Skip to content

Commit

Permalink
chore: NIX_PATH and registry.json is now set by default for flake sys…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
konradmalik committed Jun 4, 2024
1 parent d0aebe9 commit 6465fe4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions hosts/common/global/nix/linux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ let
# Map registries to channels
# very useful when using legacy commands (they use NIX_PATH and this is what we are building here)
# also make sure that no imperative channels are in use: nix-channel --list should be empty
# this happens by default in flake-based nixos systems, but here we have a generic linux
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
in
{
Expand Down
12 changes: 0 additions & 12 deletions hosts/common/global/nix/shared.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
customArgs,
...
}:
let
# Add each flake input as a registry
# To make nix3 commands consistent with the flake
# this becomes registry.nixpkgs.flake = inputs.nixpkgs etc. for all inputs
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
# Map registries to channels
# very useful when using legacy commands (they use NIX_PATH and this is what we are building here)
# also make sure that no imperative channels are in use: nix-channel --list should be empty
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
in
{
nixpkgs = {
overlays = [
Expand All @@ -36,7 +26,6 @@ in
};
nix =
{
inherit registry;
package = pkgs.nixVersions.latest;
settings = {
auto-optimise-store = lib.mkDefault true;
Expand Down Expand Up @@ -66,7 +55,6 @@ in
# but it will work for nixos config and for nix-darwin config
# this check is needed because of generic linux entry in homeConfigurations
// lib.optionalAttrs (builtins.hasAttr "nixPath" config.nix) {
inherit nixPath;
# should be >= max-jobs
nrBuildUsers = 16;
};
Expand Down

0 comments on commit 6465fe4

Please sign in to comment.