From e5d4e2718370e99ec8c77cf89358a43f061a9044 Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Mon, 2 Dec 2024 20:49:20 -0500 Subject: [PATCH] modules/home-manager: add fastfetch 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. --- .../programs/fastfetch/module.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/home-manager/programs/fastfetch/module.nix diff --git a/modules/home-manager/programs/fastfetch/module.nix b/modules/home-manager/programs/fastfetch/module.nix new file mode 100644 index 0000000..fa2b106 --- /dev/null +++ b/modules/home-manager/programs/fastfetch/module.nix @@ -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 ]; + }; +}