diff options
| author | Seth Flynn <[email protected]> | 2025-02-25 22:29:26 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-25 22:29:26 -0500 |
| commit | 0f630c8671acd1b0c3a441e83fd49e3d84783439 (patch) | |
| tree | 5cf7c7a154a427f6b87b39c0274629db673846e8 | |
| parent | c5ce8d67f80a9b4690ca9ddcb2d2e976d0f45fe5 (diff) | |
nixos/nix: get NIX_PATH from system derivation
| -rw-r--r-- | modules/nixos/defaults/nix.nix | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/nixos/defaults/nix.nix b/modules/nixos/defaults/nix.nix index e55faf4..fba0efc 100644 --- a/modules/nixos/defaults/nix.nix +++ b/modules/nixos/defaults/nix.nix @@ -1,12 +1,32 @@ -{ lib, ... }: +{ + lib, + pkgs, + inputs, + ... +}: + +let + flakeInputs = pkgs.linkFarm "flake-inputs" ( + lib.mapAttrs (lib.const (flake: flake.outPath)) inputs + ); +in + { nix = { channel.enable = lib.mkDefault false; + + nixPath = lib.mkForce ( + lib.mapAttrsToList (name: lib.const "${name}=/run/current-system/inputs/${name}") inputs + ); + settings.trusted-users = [ - "root" "@wheel" ]; }; nixpkgs.config.allowAliases = false; + + system.extraSystemBuilderCmds = '' + ln -s ${flakeInputs} $out/inputs + ''; } |
