diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 6f24b71..427f239 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -39,6 +39,7 @@ ./roles/bsnes ./roles/ssh ./roles/python + ./roles/docker ]; nix.settings.experimental-features = [ diff --git a/nix/configuration/roles/docker/default.nix b/nix/configuration/roles/docker/default.nix new file mode 100644 index 0000000..f53af03 --- /dev/null +++ b/nix/configuration/roles/docker/default.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + virtualisation.docker.enable = true; + virtualisation.docker.rootless = { + enable = true; + setSocketVariable = true; + }; + + environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + directories = [ + { + directory = "/var/lib/docker"; + user = "root"; + group = "root"; + mode = "0740"; + } + ]; + users.talexander = { + directories = [ + { + directory = ".local/share/docker"; + user = "talexander"; + group = "talexander"; + mode = "0740"; + } + ]; + }; + }; + +}