commit 236a68ab5e47937968760ea2ff67df37234f4f80
parent 110bd2126dda065edaf9c6ea4c77cdb452d6be3c
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Thu, 21 Aug 2025 08:52:31 +0200
parent 110bd2126dda065edaf9c6ea4c77cdb452d6be3c
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Thu, 21 Aug 2025 08:52:31 +0200
flake: give modules access to to flakes outputs
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/flake.nix b/flake.nix @@ -18,8 +18,18 @@ maintainersAttrset = import ./maintainers.nix; - homeManagerModules = lib.collectModules { path = ./homeManagerModules; }; - nixosModules = lib.collectModules { path = ./nixosModules; }; + modulesScope = { + tgcMaintainers = maintainersAttrset; + tgcFlake = inputs.self; + }; + homeManagerModules = lib.collectModules { + path = ./homeManagerModules; + scope = modulesScope; + }; + nixosModules = lib.collectModules { + path = ./nixosModules; + scope = modulesScope; + }; modulesTemplate = modules: modules
diff --git a/homeManagerModules/services/gomuks-web/default.nix b/homeManagerModules/services/gomuks-web/default.nix @@ -1,3 +1,4 @@ +{ tgcFlake, ... }: { config, pkgs, @@ -14,7 +15,7 @@ in options.tgc.services.gomuks-web = { enable = lib.mkEnableOption "A Matrix client written in Go."; - package = lib.mkPackageOption pkgs.tgc "gomuks-web" { }; + package = lib.mkPackageOption tgcFlake.packages.${pkgs.system} "gomuks-web" { }; listenAddress = lib.mkOption { type = types.str; default = "localhost:29325";
diff --git a/homeManagerModules/services/shaderbg/default.nix b/homeManagerModules/services/shaderbg/default.nix @@ -1,3 +1,4 @@ +{ tgcFlake, ... }: { config, pkgs, @@ -14,7 +15,7 @@ in options.tgc.services.shaderbg = { enable = lib.mkEnableOption ""; - package = lib.mkPackageOption pkgs.tgc "shaderbg" { }; + package = lib.mkPackageOption tgcFlake.packages.${pkgs.system} "shaderbg" { }; systemd.enable = lib.mkOption { type = types.bool; default = true;
diff --git a/lib/collectModules.nix b/lib/collectModules.nix @@ -5,6 +5,7 @@ collectModules = { path, + scope ? { }, fileName ? "default.nix", }: ( @@ -31,7 +32,7 @@ ]; filePath = path + "/${lib.concatStringsSep "/" pathList}"; in - lib.nameValuePair name (import filePath) + lib.nameValuePair name (import filePath scope) )) builtins.listToAttrs ]