diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-07-07 19:00:27 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-08-13 21:59:20 +0000 |
commit | e073bc363070f09feb9885248d9bfc501fdc61b9 (patch) | |
tree | 55deb56af1118cffca117ca8fe570a75ea493d07 /modules/nix/default.nix | |
parent | 45572a0336bce7d2bf36429491a45ebb34a70a0f (diff) | |
download | nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar.gz nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar.bz2 nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar.lz nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar.xz nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.tar.zst nixlib-e073bc363070f09feb9885248d9bfc501fdc61b9.zip |
modules/nix: expose /run/current-system/nixlib
This has the added benefit of meaning that derivations that depend on nix.nixPath no longer have to rebuilt any time anything in nixlib changes, making rebuilds *much* faster.
Diffstat (limited to 'modules/nix/default.nix')
-rw-r--r-- | modules/nix/default.nix | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 598c27aff11f..9f5af88ff117 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -4,22 +4,23 @@ let # Most of the standard Darwin-detection methods cause infinite recursion. isDarwin = options.environment ? "darwinConfig"; - # Copy entire nixlib tree to the store. - root = lib.cleanSource ../..; - in { nix.nixPath = [ - "nixos-config=${root}/sys/${config.networking.hostName}.nix" - root.outPath + "nixos-config=/run/current-system/nixlib/sys/${config.networking.hostName}.nix" + "/run/current-system/nixlib" ]; + system.extraSystemBuilderCmds = '' + ln -s ${lib.cleanSource ../..} $out/nixlib + ''; + nixpkgs.overlays = let inherit (builtins) attrNames readDir; dir = ../../nixpkgs-overlays; names = attrNames (readDir dir); in - map (o: import "${root}/nixpkgs-overlays/${o}") names; + map (o: import "${dir}/${o}") names; services = lib.optionalAttrs isDarwin { nix-daemon.enable = true; }; |