diff --git a/flake.nix b/flake.nix index 27b1f21..e739ce6 100644 --- a/flake.nix +++ b/flake.nix @@ -19,25 +19,13 @@ ; }; inherit (inputs.nixpkgs) lib; - commonModules = [ - ./configs/boot.nix - ./configs/nix-config.nix - ./configs/security.nix - ./configs/users.nix - ./configs/networking.nix - ./configs/shell.nix - ./configs/programs/stylix.nix - ]; - graphicalModules = [ - ./configs/graphical.nix - ]; in inputs.nixpkgs.lib.nixosSystem { specialArgs = args; - modules = - commonModules - ++ lib.optionals (type == "graphical") graphicalModules - ++ [ ./hosts/${hostname}.nix ]; + modules = [ + ./hosts/common.nix + ./hosts/${hostname}.nix + ]; }; }; in diff --git a/hosts/common.nix b/hosts/common.nix new file mode 100644 index 0000000..40374b5 --- /dev/null +++ b/hosts/common.nix @@ -0,0 +1,16 @@ +{ lib, type, ... }: +{ + imports = + [ + ../configs/boot.nix + ../configs/nix-config.nix + ../configs/security.nix + ../configs/users.nix + ../configs/networking.nix + ../configs/shell.nix + ../configs/programs/stylix.nix + ] + ++ lib.optionals (type == "graphical") [ + ../configs/graphical.nix + ]; +}