Files
nix-flake/modules/features/applications/cli/fastfetch.nix
T
greyweather 7f49c289d5 all application options will adapt to environment
when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
2026-08-29 13:48:20 +01:00

26 lines
947 B
Nix

{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, lib, config, ... }: {
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
config = let
mkIfElse = with lib; p: yes: no:
mkMerge [
(mkIf p yes)
(mkIf (!p) no)
];
in lib.mkIf (config.features.applications.cli.fastfetch.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
home-manager.users.grey.features.applications.cli.fastfetch.enable = lib.mkDefault true;
} {
environment.systemPackages = [ pkgs.fastfetch ];
});
};
flake.homeModules.global = { pkgs, lib, config, ... }: {
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
programs.fastfetch.enable = true;
});
};
}