misc improvements to modularity
This commit is contained in:
29 files changed
+111
-108
No files matched your search
@@ -1,4 +1,10 @@
|
||||
{ inputs, self, ... }: let
|
||||
{ inputs, self, lib, ... }: let
|
||||
featureOptionName = "features.applications.cli.color-converter.enable";
|
||||
moduleArgs = config: {
|
||||
inherit config;
|
||||
optionName = featureOptionName;
|
||||
};
|
||||
|
||||
color-converter-package = { lib, pkgs }: pkgs.python3Packages.buildPythonApplication rec {
|
||||
pname = "color-converter";
|
||||
version = "1.0.0";
|
||||
@@ -29,21 +35,17 @@
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "globalOptions" ({ lib, ... }: {
|
||||
options.features.applications.cli.color-converter.enable = lib.mkEnableOption "`color-converter`";
|
||||
})) ];
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "global" featureOptionName (lib.mkEnableOption "`color-converter`")) ];
|
||||
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.color-converter.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.cli.color-converter.enable = lib.mkDefault true;
|
||||
} {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule (moduleArgs config) {
|
||||
environment.systemPackages = [ (pkgs.callPackage color-converter-package {}) ];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.color-converter.enable) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule (moduleArgs config) {
|
||||
home.packages = [ (pkgs.callPackage color-converter-package {}) ];
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.cli.fastfetch.enable = lib.mkDefault true;
|
||||
home-manager.users.${config.info.userName}.features.applications.cli.fastfetch.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.fastfetch ];
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ in {
|
||||
config = lib.mkIf (config.features.applications.cli.nh.enable) {
|
||||
programs.nh = mkNhAttrs config;
|
||||
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
features.applications.cli.nh = lib.mkDefault config.features.applications.cli.nh;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user