diff --git a/flake.nix b/flake.nix index 652055f..747da57 100755 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,8 @@ inputs = { nix-impermanence.url = "github:nix-community/impermanence"; }; -outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstable, nixos-hardware, nix-impermanence, ... }: { +outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstable, nixos-hardware, nix-impermanence, ... } @inputs: { + devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell { name = "Environment for toast's nixos configurations"; # The agenix cli is not needed to activate a configuration, so instead of installing it @@ -46,6 +47,7 @@ outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstabl nixosConfigurations = { Archie = nixpkgs-unstable.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { systemPkgs = inputs.nixpkgs-unstable; }; /* I used to set up nixpkgs in the flake, but doing that made defining overlays in modules impossible (or at least I could @@ -67,6 +69,7 @@ outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstabl SurfaceGo = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { systemPkgs = inputs.nixpkgs; }; modules = [ # Needed for nix-index { nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; } @@ -82,6 +85,7 @@ outputs = {nixpkgs, nixpkgs-unstable, agenix, home-manager, home-manager-unstabl Everest = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { systemPkgs = inputs.nixpkgs; }; modules = [ # Needed for nix-index { nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; } diff --git a/roles/common/programs/nix.nix b/roles/common/programs/nix.nix index ea40ccd..baa1cc9 100755 --- a/roles/common/programs/nix.nix +++ b/roles/common/programs/nix.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, systemPkgs, ... }: { nix = { @@ -10,6 +10,9 @@ experimental-features = nix-command flakes from = { id = "agenix"; type = "indirect"; }; to = { owner = "ryantm"; repo = "agenix"; type = "github"; }; }; + # Write the system's nixpkgs into the registry to avoid mixing nixpkgs versions + # https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html + system.flake = systemPkgs; }; }; }