diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-01-05 17:31:16 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-01-22 16:43:05 +0100 |
commit | 0b222173dba00680074ef9e98a5bad224f62967e (patch) | |
tree | fea90aec46bc766ec3cb2757c3a1b8a55debd963 | |
parent | fecf32505984f4b8feae4c54663f322dcc8bd080 (diff) |
flake.nix: Set nixpkgs.config.path
-rw-r--r-- | flake.nix | 4 | ||||
-rw-r--r-- | nixos/modules/misc/nixpkgs.nix | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix index c2306768d6fe..39553cde0ab5 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,10 @@ system.nixos.versionSuffix = ".${final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}"; system.nixos.revision = final.mkIf (self ? rev) self.rev; + + # NOTE: This assumes that `nixpkgs.config` is _not_ used when + # nixpkgs.pkgs is set OR _module.args.pkgs is set. + nixpkgs.config.path = self.outPath; } ]; }); diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 69967c8a7601..14dd1d816dbe 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -59,6 +59,8 @@ let inherit (cfg) config overlays localSystem crossSystem; }; + # NOTE: flake.nix assumes that nixpkgs.config is only used with ../../.. + # as nixpkgs.config.path should be equivalent to ../../.. finalPkgs = if opt.pkgs.isDefined then cfg.pkgs.appendOverlays cfg.overlays else defaultPkgs; in |