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);
oizysPkg = forAllSystems (pkgs:
rec {
oizysPkg = forAllSystems (
pkgs: rec {
oizys = pkgs.callPackage ../oizys {};
default = oizys;
}

View file

@ -1,5 +1,5 @@
final: prev: let
inherit (final) hasSuffix mkEnableOption mkIf;
inherit (final) hasSuffix mkEnableOption mkIf mkOption types;
runes = import ../modules/runes;
in rec {
enabled = {enable = true;};
@ -33,4 +33,12 @@ in rec {
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
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,
...
}: let
inherit (lib) mkOption mkIf types;
cfg = config.oizys.cli;
in {
options.oizys.cli.enable = mkOption {
default = true;
description = "Whether to enable cli.";
type = types.bool;
};
config = mkIf cfg.enable {
inherit (lib) mkDefaultOizysModule;
in
mkDefaultOizysModule config "cli" {
programs.direnv.enable = true;
environment.sessionVariables = {
DIRENV_LOG_FORMAT = "direnv: %s";
@ -35,5 +28,4 @@ in {
btop
inputs.tsm.packages.${pkgs.system}.tsm
];
};
}