feat: Set NH_FLAKE environment variable
This commit is contained in:
parent
10b166b4d0
commit
45ea5be379
1 changed files with 11 additions and 2 deletions
|
|
@ -1,14 +1,23 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.programs.nh;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
programs.nh = {
|
config.programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clean.enable = true;
|
clean.enable = true;
|
||||||
clean.extraArgs = "--keep-since 4d --keep 3";
|
clean.extraArgs = "--keep-since 4d --keep 3";
|
||||||
flake = "/home/alex/src/nixos-config";
|
flake = "/home/alex/src/nixos-config";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc.automatic = lib.mkForce false;
|
config.nix.gc.automatic = lib.mkIf cfg.enable (lib.mkForce false);
|
||||||
|
config.environment = lib.mkIf cfg.enable {
|
||||||
|
variables = lib.mkIf (cfg.flake != null) {
|
||||||
|
NH_FLAKE = cfg.flake;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue