1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-31 04:04:32 +00:00

Apply suggestions from code review

Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Pim Snel 2025-03-28 16:38:56 +01:00 committed by GitHub
parent 2fde3bcb82
commit 7ae4d6f7c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,12 +25,7 @@ in {
enable = lib.mkEnableOption "Smug session manager";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.smug;
defaultText = lib.literalExpression "pkgs.smug";
description = "Package providing {command}`smug`.";
};
package = lib.mkPackageOption pkgs "smug" { nullable = true; };
projects = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule [{
@ -118,10 +113,8 @@ in {
stop = mkOptionCommands
"Commands to execute after the tmux-session is destroyed.";
};
}
]);
default = { };
description = "List of project configurations.";
@ -147,7 +140,7 @@ in {
});
in lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file = { } // (mkProjects cleanedProjects);
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file = mkProjects cleanedProjects;
};
}