Skip to content

Commit

Permalink
modules/home-manager: add fastfetch
Browse files Browse the repository at this point in the history
I'm trying a slightly different module defining approach that doesn't need to rewrite the path. I have not used it elsewhere so that I can take the time to ruminate on it. Once I decide, I'll make a treewide change or simply refactor this to match the others.
  • Loading branch information
Frontear committed Dec 3, 2024
1 parent 85b5bb7 commit e5d4e27
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/home-manager/programs/fastfetch/module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}:
let
path = lib.splitString "." <| "my.programs.fastfetch";
cfg = lib.getAttrFromPath path config;
in {
options = lib.setAttrByPath path {
enable = lib.mkDefaultEnableOption "fastfetch";
package = lib.mkPackageOption pkgs "fastfetch" {};
};

config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
};
}

0 comments on commit e5d4e27

Please sign in to comment.