From 664506b6cb64a98dc36dd0b097102a9d89cfaddb Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 4 Aug 2023 22:37:18 +0800 Subject: [PATCH] feat: use the same nixpkgs as much as possible --- lib/nixosSystem.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/nixosSystem.nix b/lib/nixosSystem.nix index 1d4ba987..0cdc157e 100644 --- a/lib/nixosSystem.nix +++ b/lib/nixosSystem.nix @@ -14,6 +14,15 @@ in modules = nixos-modules ++ [ + { + # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. + nix.registry.nixpkgs.flake = nixpkgs; + + # make `nix repl ''` use the same nixpkgs as the one used by this flake. + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + nix.nixPath = ["/etc/nix/inputs"]; + } + nixos-generators.nixosModules.all-formats { # formatConfigs.iso = {config, ...}: {};