Closed lilyball closed 2 weeks ago
I hacked this together myself, and I can confirm that environment.etc."nix/input".source = pkgs.runCommandNoCC
works to build a directory. There may be an issue activating the result for anyone who already has the existing /etc/nix/inputs
as a directory though (this is true for nix-darwin, I don't know if nixos's environment.etc activation is any smarter, though my belief is nix-darwin just copied it from nixos).
Yeah, good point. Will implement it this weekend
I think it's fixed by https://github.com/gytis-ivaskevicius/flake-utils-plus/issues/105?
nix.generateNixPathFromInputs
only adds inputs toNIX_PATH
if they have apackages
orlegacyPackages
output. This is a rather curious restriction, as the existence of such a package set does not prove that the flake source can be imported directly. It also means that flakes that can be imported, such as nix-darwin, don't end up inNIX_PATH
as they don't have a package set.Instead of testing for the package set, it should check if the flake has a
default.nix
file. Unfortunately I don't think Nix lets you test if a file exists, so this might require using an activation script instead ofconfig.environment.etc
. Though perhaps settingenvironment.etc."nix/input".source
to a derivation whoseoutPath
is a directory of symlinks might work? That way the derivation build script can test the inputs for adefault.nix
.