Refactor user management functions to use inputs

Removed the `lib.nix` file and refactored various modules to utilize `inputs.self.lib` for user package and attribute management. This change enhances consistency and maintainability across the configuration files.
This commit is contained in:
Danilo Reyes
2026-01-16 10:55:15 -06:00
parent b89d193445
commit 495f6e2e25
31 changed files with 67 additions and 122 deletions

View File

@@ -9,17 +9,14 @@
options.my.shell.multimedia.enable = lib.mkEnableOption "multimedia CLI tools and codecs";
config = lib.mkIf config.my.shell.multimedia.enable {
sops.secrets."gallery-dl/secrets" = let
userLib = import ../lib.nix { inherit lib; };
# Use first user for secret ownership
user = userLib.getFirstUser config.my.toggleUsers.shell;
user = inputs.self.lib.getFirstUser config.my.toggleUsers.shell;
in {
sopsFile = ../../secrets/gallery.yaml;
owner = user;
mode = "0400";
};
home-manager.users = let
userLib = import ../lib.nix { inherit lib; };
in userLib.mkHomeManagerUsers config.my.toggleUsers.shell (user: {
home-manager.users = inputs.self.lib.mkHomeManagerUsers lib config.my.toggleUsers.shell (user: {
programs = {
yt-dlp = {
enable = true;
@@ -46,7 +43,6 @@
};
});
users.users = let
userLib = import ../lib.nix { inherit lib; };
packages = builtins.attrValues {
inherit (pkgs)
ffmpeg # not ffmpreg, the coolest video conversion tool!
@@ -54,6 +50,6 @@
ffpb # make ffmpeg encoding... a bit fun
;
};
in userLib.mkUserPackages config.my.toggleUsers.shell packages;
in inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
};
}