diff --git a/common/configuration.nix b/common/configuration.nix index e928657..422f727 100644 --- a/common/configuration.nix +++ b/common/configuration.nix @@ -3,12 +3,29 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { inputs, config, pkgs, ... }: - +let + system = "x86_64-linux"; +in { imports = [ ../modules/default.nix ]; + nixpkgs.overlays = [ + (final: prev: { + unstable = import inputs.unstable { + inherit system; + config.allowUnfree = true; + }; + }) + (final: prev: { + update = import inputs.update { + inherit system; + config.allowUnfree = true; + }; + }) + ]; + nix.settings.experimental-features = "nix-command flakes"; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. diff --git a/flake.nix b/flake.nix index 7a7bb03..254f30b 100644 --- a/flake.nix +++ b/flake.nix @@ -23,31 +23,13 @@ let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; - unstable-overlay = final: prev: { - unstable = import unstable { + mkSystem = h: { + "${h}" = nixpkgs.lib.nixosSystem { inherit system; - config.allowUnfree = true; - }; - }; - update-overlay = final: prev: { - update = import update { - inherit system; - config.allowUnfree = true; - }; - }; - # Perhaps this could've been presented as an overlay? - # bashcfg-overlay = final: prev: { - # }; - in { - - nixosConfigurations = { - NixFrame = nixpkgs.lib.nixosSystem { - inherit system; - # specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs; }; modules = [ - { nixpkgs.overlays = [ unstable-overlay update-overlay ]; } - nixos-hardware.nixosModules.framework-13-7040-amd - ./hosts/NixFrame/configuration.nix + ./common/configuration.nix + (./. + "/hosts/${h}/configuration.nix") home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit inputs; }; @@ -57,30 +39,17 @@ } ]; }; + }; + in { - NixDawn = nixpkgs.lib.nixosSystem { - inherit system; - # specialArgs = { inherit inputs; }; - modules = [ - { nixpkgs.overlays = [ unstable-overlay update-overlay ]; } - ./hosts/NixDawn/configuration.nix - home-manager.nixosModule - { - home-manager = { - extraSpecialArgs = { inherit inputs; }; - useGlobalPkgs = true; - useUserPackages = true; - users.benson.imports = [ ./home/home.nix ]; - }; - } - ]; - }; - + nixosConfigurations = + (nixpkgs.lib.foldr (a: b: a // b) {} + (map mkSystem ["NixDawn" "NixFrame"])) // { NixGate = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ - { nixpkgs.overlays = [ unstable-overlay update-overlay ]; } + ./common/configuration.nix ./hosts/NixGate/configuration.nix ]; }; @@ -89,7 +58,7 @@ inherit system; specialArgs = { inherit inputs; }; modules = [ - { nixpkgs.overlays = [ unstable-overlay update-overlay ]; } + ./common/configuration.nix ./hosts/NixSentinel/configuration.nix ]; }; diff --git a/hosts/NixDawn/configuration.nix b/hosts/NixDawn/configuration.nix index 569e21e..5b47c16 100644 --- a/hosts/NixDawn/configuration.nix +++ b/hosts/NixDawn/configuration.nix @@ -5,7 +5,6 @@ { config, pkgs, ... }: { imports = [ - ../../common/configuration.nix ../../common/user-facing.nix ../../common/development-machine.nix ../../common/lxd-setup.nix diff --git a/hosts/NixFrame/configuration.nix b/hosts/NixFrame/configuration.nix index 51d8d32..36716c8 100644 --- a/hosts/NixFrame/configuration.nix +++ b/hosts/NixFrame/configuration.nix @@ -1,12 +1,12 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { imports = [ # ./home-git-repos.nix - ../../common/configuration.nix ../../common/development-machine.nix ../../common/laptop-things.nix ../../common/exwm.nix # Include the results of the hardware scan. + inputs.nixos-hardware.nixosModules.framework-13-7040-amd ./hardware-configuration.nix ]; diff --git a/hosts/NixGate/configuration.nix b/hosts/NixGate/configuration.nix index 42c3514..4e208ff 100644 --- a/hosts/NixGate/configuration.nix +++ b/hosts/NixGate/configuration.nix @@ -7,7 +7,6 @@ { imports = [ ../../common/moms-house - ../../common/configuration.nix # Include the results of the hardware scan. ./hardware-configuration.nix ]; diff --git a/hosts/NixSentinel/configuration.nix b/hosts/NixSentinel/configuration.nix index c788251..a87fe97 100644 --- a/hosts/NixSentinel/configuration.nix +++ b/hosts/NixSentinel/configuration.nix @@ -7,7 +7,6 @@ { imports = [ ../../common/moms-house - ../../common/configuration.nix # Include the results of the hardware scan. ./hardware-configuration.nix ];