create shared niri config, refactor generic feature modules
This commit is contained in:
23 files changed
+353
-410
No files matched your search
@@ -63,39 +63,41 @@
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
};
|
||||
optionName = "features.applications.gui.fluxer.enable";
|
||||
optionNameCanary = "features.applications.gui.fluxer-canary.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "Fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "Fluxer Canary";
|
||||
};
|
||||
})) ];
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "Fluxer")
|
||||
(inputs.helpers.mkStandardFeature.flakeModule "graphics" optionNameCanary "Fluxer Canary")
|
||||
];
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.fluxer.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
}) // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.fluxer-canary.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
});
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
})
|
||||
(inputs.helpers.mkStandardFeature.nixosModule { inherit config; optionName = optionNameCanary; } {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
} // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
};
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
})
|
||||
(inputs.helpers.mkStandardFeature.homeModule { inherit config; optionName = optionNameCanary; } {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user