From 2b09b74ba617346a0c9c932543e658837ef9e5d2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 Apr 2024 18:50:02 +0200 Subject: nix: pin nixpkgs to flake input globally and per-user --- flake.nix | 3 +++ pin.nix | 11 +++++++++++ system/settings/configuration/nix.nix | 3 +++ system/settings/darwin.nix | 3 +++ user/settings/nix.nix | 2 +- user/settings/pin.nix | 11 ----------- 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 pin.nix delete mode 100644 user/settings/pin.nix diff --git a/flake.nix b/flake.nix index b89941a7..9115ef97 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,7 @@ { nixosConfigurations.prefect = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { inherit inputs; }; modules = [ ./system/prefect.nix ] ++ (with nixos-hardware.nixosModules; [ @@ -54,10 +55,12 @@ }; nixosConfigurations.nanopi = nixpkgs.lib.nixosSystem { system = utils.lib.system.aarch64-linux; + specialArgs = { inherit inputs; }; modules = [ ./nanopi.nix ]; }; darwinConfigurations.mba = darwin.lib.darwinSystem { system = utils.lib.system.aarch64-darwin; + specialArgs = { inherit inputs; }; modules = [ ./system/mba.nix ]; }; homeConfigurations."alan@mba" = mkHomeConfiguration { diff --git a/pin.nix b/pin.nix new file mode 100644 index 00000000..ab7c8b3e --- /dev/null +++ b/pin.nix @@ -0,0 +1,11 @@ +{ inputs, ... }: +let + inherit (inputs) nixpkgs; +in +{ + nix = { + registry = { + nixpkgs.flake = nixpkgs; + }; + }; +} diff --git a/system/settings/configuration/nix.nix b/system/settings/configuration/nix.nix index 6328f32e..4142fa34 100644 --- a/system/settings/configuration/nix.nix +++ b/system/settings/configuration/nix.nix @@ -2,6 +2,9 @@ , pkgs , ... }: { + imports = [ + ../../../pin.nix + ]; nix = { settings = { cores = 0; diff --git a/system/settings/darwin.nix b/system/settings/darwin.nix index 806fdeb9..460d47bd 100644 --- a/system/settings/darwin.nix +++ b/system/settings/darwin.nix @@ -3,6 +3,9 @@ , lib , ... }: { + imports = [ + ../../pin.nix + ]; services.nix-daemon = { enable = true; enableSocketListener = true; diff --git a/user/settings/nix.nix b/user/settings/nix.nix index b15f5c5d..ec69d51f 100644 --- a/user/settings/nix.nix +++ b/user/settings/nix.nix @@ -3,7 +3,7 @@ , ... }: { imports = [ - ./pin.nix + ../../pin.nix ]; nixpkgs.config = import ../config.nix; home.packages = with pkgs; [ diff --git a/user/settings/pin.nix b/user/settings/pin.nix deleted file mode 100644 index ab7c8b3e..00000000 --- a/user/settings/pin.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ inputs, ... }: -let - inherit (inputs) nixpkgs; -in -{ - nix = { - registry = { - nixpkgs.flake = nixpkgs; - }; - }; -} -- cgit 1.4.1