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