From 36849733ba437c7ff007657e8fbb86c0d0fe2d97 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 12 Dec 2023 11:33:50 +0300 Subject: [PATCH] add `flakeDir` option to automatically set the FLAKE variable --- module.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/module.nix b/module.nix index 1bf0a4d..1afa3e3 100644 --- a/module.nix +++ b/module.nix @@ -17,6 +17,12 @@ self: { description = "Which NH package to use"; }; + flakeDir = mkOption { + type = types.str; + default = ""; + description = "The directory that will be used for the `FLAKE` environment variable"; + }; + clean = { enable = mkOption { type = types.bool; @@ -47,7 +53,12 @@ self: { } ]; - environment.systemPackages = [config.nh.package]; + environment = { + systemPackages = [config.nh.package]; + variables = { + FLAKE = config.nh.flakeDir; + }; + }; systemd = lib.mkIf config.nh.clean.enable { services.nh-clean = {