diff --git a/README.md b/README.md index ede82af..90e22f3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![dependency status](https://deps.rs/repo/github/viperML/nh/status.svg)](https://deps.rs/repo/github/viperML/nh) +

nh

Because the name "yet-another-nix-helper" was too long to type...
diff --git a/module.nix b/module.nix index 1bf0a4d..1bed285 100644 --- a/module.nix +++ b/module.nix @@ -17,6 +17,12 @@ self: { description = "Which NH package to use"; }; + flake = mkOption { + type = with types; nullOr path; + default = null; + description = "The path that will be used for the `FLAKE` environment variable"; + }; + clean = { enable = mkOption { type = types.bool; @@ -45,9 +51,19 @@ self: { assertion = config.nh.clean.enable -> config.nh.enable; message = "nh.clean.enable requires nh.enable"; } + + { + assertion = (config.nh.flake != null) -> !(lib.hasSuffix ".nix" config.nh.flake); + message = "nh.flake must be a directory"; + } ]; - environment.systemPackages = [config.nh.package]; + environment = { + systemPackages = [config.nh.package]; + variables = lib.optionalAttrs (config.nh.flake != null) { + FLAKE = config.nh.flake; + }; + }; systemd = lib.mkIf config.nh.clean.enable { services.nh-clean = {