forked from extern/nix-config
refactor(containers): Abstract common config
This makes it possible to create multiple containers without duplicating code. This may be useful for having an internet container and a no internet container.
This commit is contained in:
parent
596a9183f8
commit
f4d23d6784
@ -4,17 +4,11 @@
|
|||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
let
|
||||||
systemd.tmpfiles.rules = [
|
template = {
|
||||||
"d /run/user/1000 0700 user users -"
|
|
||||||
];
|
|
||||||
|
|
||||||
containers.wine = {
|
|
||||||
privateNetwork = true;
|
privateNetwork = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
hostAddress = "192.168.100.34";
|
|
||||||
localAddress = "192.168.100.49";
|
|
||||||
|
|
||||||
bindMounts = {
|
bindMounts = {
|
||||||
"/mnt" = {
|
"/mnt" = {
|
||||||
@ -44,6 +38,15 @@
|
|||||||
node = "/dev/dri/renderD128";
|
node = "/dev/dri/renderD128";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /run/user/1000 0700 user users -"
|
||||||
|
];
|
||||||
|
|
||||||
|
containers.wine = template // {
|
||||||
|
hostAddress = "192.168.100.34";
|
||||||
|
localAddress = "192.168.100.49";
|
||||||
|
|
||||||
config = { lib, pkgs, ... }: {
|
config = { lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
|
Loading…
Reference in New Issue
Block a user