diff --git a/flake.nix b/flake.nix index 52a3659..da09d7b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,8 @@ description = "My system configuration"; nixConfig = { + allowUnfree = true; + extra-substituters = [ "https://nix-community.cachix.org" # "https://cache.garnix.io" @@ -42,67 +44,24 @@ outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-fixed, home-manager, ... }@inputs: let system = "x86_64-linux"; + config = { allowUnfree = true; }; + mkHost = hostname: nixpkgs-stable.lib.nixosSystem { + specialArgs = { + inherit + inputs + system + ; + pkgs-unstable = import nixpkgs { inherit system config; }; + pkgs-fixed = import nixpkgs-fixed { inherit system config; }; + }; + modules = [ ./host/${hostname}/configuration.nix ]; + }; in { nixosConfigurations = { - Rias = nixpkgs-stable.lib.nixosSystem { - specialArgs = { - pkgs-unstable = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-fixed = import nixpkgs-fixed { - inherit system; - config.allowUnfree = true; - }; - inherit inputs system; - }; - modules = [ ./host/Rias/configuration.nix ]; - }; - - Senko = nixpkgs-stable.lib.nixosSystem { - specialArgs = { - pkgs-unstable = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-fixed = import nixpkgs-fixed { - inherit system; - config.allowUnfree = true; - }; - inherit inputs system; - }; - modules = [ ./host/Senko/configuration.nix ]; - }; - - Eclipse = nixpkgs-stable.lib.nixosSystem { - specialArgs = { - pkgs-unstable = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-fixed = import nixpkgs-fixed { - inherit system; - config.allowUnfree = true; - }; - inherit inputs system; - }; - modules = [ ./host/Eclipse/configuration.nix ]; - }; - - Impreza = nixpkgs-stable.lib.nixosSystem { - specialArgs = { - pkgs-unstable = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-fixed = import nixpkgs-fixed { - inherit system; - config.allowUnfree = true; - }; - inherit inputs system; - }; - modules = [ ./host/Impreza/configuration.nix ]; - }; + Rias = mkHost "Rias"; + Senko = mkHost "Senko"; + Eclipse = mkHost "Eclipse"; + Impreza = mkHost "Impreza"; }; devShells."${system}".default = let