diff --git a/nix/flake.nix b/nix/flake.nix index de80009..61771de 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -57,22 +57,19 @@ # Work WSL work = nixpkgs-wsl-stable.lib.nixosSystem { - system = linuxSystem; specialArgs = { inherit self inputs; }; modules = [ nixos-wsl.nixosModules.wsl ./hosts/work/nixos/configuration.nix home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = false; - home-manager.useUserPackages = false; + nixpkgs.hostPlatform = linuxSystem; + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit self inputs; - pkgs = import nixpkgs-wsl-stable { - system = linuxSystem; - config.allowUnfree = true; - overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; - }; }; home-manager.users.pan = import ./hosts/work/nixos/home.nix; } @@ -81,28 +78,20 @@ # Home home = nixpkgs-stable.lib.nixosSystem { - system = linuxAarchSystem; specialArgs = { inherit self inputs; - # Provide both stable and unstable pkgs - pkgs = import nixpkgs-stable { - system = linuxAarchSystem; - config.allowUnfree = true; - }; }; modules = [ ./hosts/home/nixos/configuration.nix home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = false; - home-manager.useUserPackages = false; + nixpkgs.hostPlatform = linuxAarchSystem; + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit self inputs; - pkgs = import nixpkgs-stable { - system = linuxAarchSystem; - config.allowUnfree = true; - overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; - }; }; home-manager.users.martin = import ./hosts/home/nixos/home.nix; } @@ -112,31 +101,39 @@ # --- Darwin Systems (Mac) --- darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem { - system = darwinSystem; specialArgs = { inherit self inputs; }; - modules = [ ./hosts/home/darwin/configuration.nix ]; + modules = [ + ./hosts/home/darwin/configuration.nix + { + nixpkgs.hostPlatform = darwinSystem; + } + ]; }; # --- Standalone Home Manager --- homeConfigurations = { "pan@work" = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs-stable { - system = linuxSystem; - config.allowUnfree = true; - overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; - }; + pkgs = nixpkgs-stable.legacyPackages.${linuxSystem}; extraSpecialArgs = { inherit self inputs; }; - modules = [ ./hosts/work/nix/home.nix ]; + modules = [ + ./hosts/work/nix/home.nix + { + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; + } + ]; }; "martin@mac" = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs-stable { - system = darwinSystem; - config.allowUnfree = true; - overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; - }; + pkgs = nixpkgs-stable.legacyPackages.${darwinSystem}; extraSpecialArgs = { inherit self inputs; }; - modules = [ ./hosts/home/nix/home.nix ]; + modules = [ + ./hosts/home/nix/home.nix + { + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ]; + } + ]; }; }; };