-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaring per-system functions as flake outputs #220
Comments
Can be done by defining Example: { lib, withSystem, ... }: {
perSystem = mkPerSystemOption {
options.lib = mkOption { type = raw; internal = true; };
config.lib.freeze = <...>;
};
flake.lib.freeze = drv:
withSystem drv.system ({ config, ... }:
config.lib.freeze drv
);
}
You could define (3?) You could expose a flake-parts module that adds your library as a module argument. That way it can use the user |
I ported
nix-freeze-tree
toflake-parts
. It exports a function for freezing a derivation as a tree of fixed-output derivations and uses a native program to do this. Because I can't assign tolib
inperSystem
, I am forced to declare these functions inflake
and useflake-utils
'eachSystem
to generate this function. Is there a better way to either:perSystem
, oreachSystem
without having to go throughflake-utils
?https://git.sr.ht/~jack/nix-freeze-tree/tree/343fd80a67db6f55cacc1961f60bbac91d96bbb6/item/flake.nix#L27-52 is what I am currently doing.
The text was updated successfully, but these errors were encountered: