Skip to content

Commit

Permalink
feat(modules): switch mkEnableOption to mkBoolOpt
Browse files Browse the repository at this point in the history
  • Loading branch information
InioX committed Oct 14, 2023
1 parent 59fe910 commit c8da653
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 44 deletions.
6 changes: 4 additions & 2 deletions modules/apps/firefox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
config,
pkgs,
lib,
zenyte-lib,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.apps.firefox;
in {
options.zenyte.apps.firefox = with types; {
enable = mkEnableOption "Whether to enable firefox.";
enable = mkBoolOpt false "Whether to enable firefox.";
extensions = mkOption {
type = nullOr (listOf package);
description = ''
Expand Down
6 changes: 4 additions & 2 deletions modules/apps/gmail/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.apps.gmail;

gmailIcon = let
Expand All @@ -31,7 +33,7 @@ with lib; let
};
in {
options.zenyte.apps.gmail = {
enable = mkEnableOption "Whether to enable gmail as a desktop entry.";
enable = mkBoolOpt false "Whether to enable gmail as a desktop entry.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/apps/prism-launcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
system,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.apps.prism-launcher;
in {
options.zenyte.apps.prism-launcher = with types; {
enable = mkEnableOption "Whether to enable Prism Launcher.";
enable = mkBoolOpt false "Whether to enable Prism Launcher.";
extensions = mkOption {
type = nullOr (listOf package);
description = ''
Expand Down
8 changes: 5 additions & 3 deletions modules/apps/vscodium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
config,
pkgs,
lib,
zenyte-lib,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.apps.vscodium;

# Modified code from https://github.com/nix-community/home-manager/issues/3507#issuecomment-1616803481
Expand All @@ -17,7 +19,7 @@ with lib; let
'';
in {
options.zenyte.apps.vscodium = with types; {
enable = mkEnableOption "Whether to enable vscodium.";
enable = mkBoolOpt false "Whether to enable vscodium.";
extensions = mkOption {
type = nullOr (listOf package);
description = ''
Expand Down Expand Up @@ -117,7 +119,7 @@ in {
" cfg = config.zenyte.$1.$2;"
" in {"
" options.zenyte.$1.$2 = {"
" enable = mkEnableOption \"Whether to enable $2.\";"
" enable = mkBoolOpt false \"Whether to enable $2.\";"
" };"
""
" config = mkIf cfg.enable {"
Expand Down
6 changes: 4 additions & 2 deletions modules/cli/bash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
username,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.cli.bash;
in {
options.zenyte.cli.bash = with types; {
enable = mkEnableOption "Whether to set bash as the default shell.";
enable = mkBoolOpt false "Whether to set bash as the default shell.";
};
config = mkIf cfg.enable {
zenyte.home.programs.bash = {
Expand Down
6 changes: 4 additions & 2 deletions modules/cli/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
username,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.cli.git;
in {
options.zenyte.cli.git = with types; {
enable = mkEnableOption "Whether to enable git.";
enable = mkBoolOpt false "Whether to enable git.";
email = mkOption {
type = str;
default = "";
Expand Down
6 changes: 4 additions & 2 deletions modules/cli/neofetch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.cli.neofetch;
in {
options.zenyte.cli.neofetch = with types; {
enable = mkEnableOption "Whether to enable neofetch.";
enable = mkBoolOpt false "Whether to enable neofetch.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/cli/starship/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.cli.starship;
in {
options.zenyte.cli.starship = with types; {
enable = mkEnableOption "Whether to enable starship.";
enable = mkBoolOpt false "Whether to enable starship.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/cli/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
username,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.cli.zsh;
in {
options.zenyte.cli.zsh = with types; {
enable = mkEnableOption "Whether to set zsh as the default shell.";
enable = mkBoolOpt false "Whether to set zsh as the default shell.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/ags/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
system,
inputs,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.ags;
in {
options.zenyte.desktop.addons.ags = {
enable = mkEnableOption "Whether to enable ags.";
enable = mkBoolOpt false "Whether to enable ags.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/alacritty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.alacritty;
in {
options.zenyte.desktop.addons.alacritty = {
enable = mkEnableOption "Whether to enable alacritty.";
enable = mkBoolOpt false "Whether to enable alacritty.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/dunst/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.dunst;
in {
options.zenyte.desktop.addons.dunst = {
enable = mkEnableOption "Whether to enable the k-vernooy dunst fork.";
enable = mkBoolOpt false "Whether to enable the k-vernooy dunst fork.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/gtk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.gtk;

schema = pkgs.gsettings-desktop-schemas;
Expand All @@ -20,7 +22,7 @@ with lib; let
'';
in {
options.zenyte.desktop.addons.gtk = {
enable = mkEnableOption "Whether to enable gtk theme.";
enable = mkBoolOpt false "Whether to enable gtk theme.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/kitty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.kitty;
in {
options.zenyte.desktop.addons.kitty = {
enable = mkEnableOption "Whether to enable kitty.";
enable = mkBoolOpt false "Whether to enable kitty.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/matugen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
templateFolder,
username,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.matugen;
in {
options.zenyte.desktop.addons.matugen = {
enable = mkEnableOption "Whether to enable matugen.";
enable = mkBoolOpt false "Whether to enable matugen.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/rofi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.rofi;
in {
options.zenyte.desktop.addons.rofi = {
enable = mkEnableOption "Whether to enable rofi.";
enable = mkBoolOpt false "Whether to enable rofi.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/sddm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.sddm;
in {
options.zenyte.desktop.addons.sddm = {
enable = mkEnableOption "Whether to enable sddm.";
enable = mkBoolOpt false "Whether to enable sddm.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/addons/waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
nixpkgs,
configFolder,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.addons.waybar;
mediaplayer-waybar = pkgs.writeShellScriptBin "mediaplayer-waybar" ''
while true; do
Expand All @@ -28,7 +30,7 @@ with lib; let
'';
in {
options.zenyte.desktop.addons.waybar = {
enable = mkEnableOption "Whether to enable waybar with experimental patches.";
enable = mkBoolOpt false "Whether to enable waybar with experimental patches.";
};

config = mkIf cfg.enable {
Expand Down
6 changes: 4 additions & 2 deletions modules/desktop/awesome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
config,
pkgs,
lib,
zenyte-lib,
inputs,
...
}:
with lib; let
with lib;
with zenyte-lib; let
cfg = config.zenyte.desktop.awesome;
in {
options.zenyte.desktop.awesome = {
enable = mkEnableOption "Whether to enable awesomewm.";
enable = mkBoolOpt false "Whether to enable awesomewm.";
};

config = mkIf cfg.enable {
Expand Down
Loading

0 comments on commit c8da653

Please sign in to comment.