added docker option
This commit is contained in:
17
flake.nix
17
flake.nix
@@ -16,9 +16,9 @@
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
lib = pkgs.lib;
|
||||
|
||||
# These will get applied to both the configured user and the root user (if enabled)
|
||||
userOptions = config: {
|
||||
openssh.authorizedKeys.keyFiles = lib.optionals config.ssh [ ./personal_keys ];
|
||||
extraGroups = lib.optionals config.root [ "wheel" ];
|
||||
shell = lib.mkIf config.enableShell pkgs.zsh;
|
||||
};
|
||||
|
||||
@@ -65,11 +65,10 @@
|
||||
users.users.${config.user} = {
|
||||
isNormalUser = true;
|
||||
description = "John Lancaster";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"docker"
|
||||
];
|
||||
extraGroups = []
|
||||
++ lib.optionals config.root [ "wheel" ]
|
||||
++ lib.optionals config.docker [ "docker" ]
|
||||
++ lib.optionals config.services.networkmanager.enable [ "networkmanager" ];
|
||||
} // userOptions config;
|
||||
|
||||
users.users.root = lib.mkIf config.root (userOptions config);
|
||||
@@ -82,6 +81,12 @@
|
||||
|
||||
programs.zsh.enable = lib.mkIf config.enableShell true;
|
||||
|
||||
virtualisation.docker = lib.mkIf config.docker {
|
||||
enable = true;
|
||||
enableOnBoot = true;
|
||||
package = pkgs.docker;
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
|
||||
@@ -53,4 +53,10 @@
|
||||
default = [];
|
||||
description = "Additional Home Manager modules to import";
|
||||
};
|
||||
|
||||
options.docker = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable docker stuff";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user