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
26 lines
947 B
Nix
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;
|
|
});
|
|
};
|
|
} |