summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-02-01 22:49:44 -0500
committerSeth Flynn <[email protected]>2025-02-01 22:49:44 -0500
commit066a793213fffde787a0796f8d24603b886245af (patch)
tree3392fbe1fd83d8112fff5e286b904ba41b5b977e /modules
parent4929c4e4fa8c1d6211fd6e75c3eac0d9eab88759 (diff)
shared/nix: drop input chicanery
Diffstat (limited to 'modules')
-rw-r--r--modules/nixos/defaults/nix.nix14
-rw-r--r--modules/shared/defaults/nix.nix12
2 files changed, 6 insertions, 20 deletions
diff --git a/modules/nixos/defaults/nix.nix b/modules/nixos/defaults/nix.nix
index 064b0d9..e55faf4 100644
--- a/modules/nixos/defaults/nix.nix
+++ b/modules/nixos/defaults/nix.nix
@@ -1,4 +1,4 @@
-{ lib, inputs, ... }:
+{ lib, ... }:
{
nix = {
channel.enable = lib.mkDefault false;
@@ -9,16 +9,4 @@
};
nixpkgs.config.allowAliases = false;
-
- # Link inputs for use in `$NIX_PATH`
- systemd.tmpfiles.settings = {
- nix-inputs = lib.mapAttrs' (
- name: input:
- lib.nameValuePair "/etc/nix/inputs/${name}" {
- L = {
- argument = input.outPath;
- };
- }
- ) inputs;
- };
}
diff --git a/modules/shared/defaults/nix.nix b/modules/shared/defaults/nix.nix
index 8ecdfe1..c4cc2c3 100644
--- a/modules/shared/defaults/nix.nix
+++ b/modules/shared/defaults/nix.nix
@@ -14,10 +14,6 @@ let
|| lib.versionAtLeast config.nix.package.version "2.90.0"; # but not in lix yet
hasAlwaysAllowSubstitutes = lib.versionAtLeast config.nix.package.version "2.19.0";
-
- # Use systemd-tmpfiles on Linux
- nixPathFromInput =
- name: input: "${name}=${if isLinux then "/etc/nix/inputs/${name}" else input.outPath}";
in
{
config = lib.mkMerge [
@@ -37,14 +33,16 @@ in
options = lib.mkDefault "--delete-older-than 2d";
};
+ registry = lib.mapAttrs (lib.const (flake: {
+ inherit flake;
+ })) inputs;
+
# See comment below
- nixPath = lib.mapAttrsToList nixPathFromInput inputs;
+ nixPath = lib.mapAttrsToList (name: lib.const "${name}=flake:${name}") inputs;
};
nixpkgs = {
config.allowUnfree = lib.mkDefault true;
- # The `flake:` syntax in `$NIX_PATH` seems to do some weird copying on Nix 2.24
- flake.setNixPath = false;
};
}