make another function to propagate

This commit is contained in:
Daylin Morgan 2024-03-21 15:48:48 -05:00
parent 49b9b107a4
commit 60a6311a0d
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 15 additions and 15 deletions

View file

@ -33,8 +33,8 @@ in rec {
}; };
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts); oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
oizysPkg = forAllSystems (pkgs: oizysPkg = forAllSystems (
rec { pkgs: rec {
oizys = pkgs.callPackage ../oizys {}; oizys = pkgs.callPackage ../oizys {};
default = oizys; default = oizys;
} }

View file

@ -1,5 +1,5 @@
final: prev: let final: prev: let
inherit (final) hasSuffix mkEnableOption mkIf; inherit (final) hasSuffix mkEnableOption mkIf mkOption types;
runes = import ../modules/runes; runes = import ../modules/runes;
in rec { in rec {
enabled = {enable = true;}; enabled = {enable = true;};
@ -33,4 +33,12 @@ in rec {
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support"; options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
config = mkIf config.oizys.${attr}.enable content; config = mkIf config.oizys.${attr}.enable content;
}; };
mkDefaultOizysModule = config: attr: content: {
options.oizys.${attr}.enable = mkOption {
default = true;
description = "enable ${attr} support";
type = types.bool;
};
config = mkIf config.oizys.${attr}.enable content;
};
} }

View file

@ -5,16 +5,9 @@
config, config,
... ...
}: let }: let
inherit (lib) mkOption mkIf types; inherit (lib) mkDefaultOizysModule;
cfg = config.oizys.cli; in
in { mkDefaultOizysModule config "cli" {
options.oizys.cli.enable = mkOption {
default = true;
description = "Whether to enable cli.";
type = types.bool;
};
config = mkIf cfg.enable {
programs.direnv.enable = true; programs.direnv.enable = true;
environment.sessionVariables = { environment.sessionVariables = {
DIRENV_LOG_FORMAT = "direnv: %s"; DIRENV_LOG_FORMAT = "direnv: %s";
@ -35,5 +28,4 @@ in {
btop btop
inputs.tsm.packages.${pkgs.system}.tsm inputs.tsm.packages.${pkgs.system}.tsm
]; ];
}; }
}