migrate mkOption to mkPackageOption

This commit is contained in:
Aly Raffauf 2024-07-12 20:50:01 -04:00
parent b1946eee4c
commit c8cbab446f
3 changed files with 11 additions and 65 deletions

View file

@ -15,12 +15,7 @@ in {
chromium = { chromium = {
enable = lib.mkEnableOption "Chromium-based browser with default extensions."; enable = lib.mkEnableOption "Chromium-based browser with default extensions.";
package = lib.mkPackageOption pkgs "brave" {};
package = lib.mkOption {
description = "Package for Chromium.";
default = pkgs.brave;
type = lib.types.package;
};
}; };
emacs.enable = lib.mkEnableOption "Emacs text editor."; emacs.enable = lib.mkEnableOption "Emacs text editor.";
@ -47,7 +42,6 @@ in {
type = lib.types.bool; type = lib.types.bool;
}; };
neovim.enable = lib.mkEnableOption "Neovim text editor.";
swaylock.enable = lib.mkEnableOption "Swaylock screen locker."; swaylock.enable = lib.mkEnableOption "Swaylock screen locker.";
thunar.enable = lib.mkOption { thunar.enable = lib.mkOption {
description = "Thunar file manager."; description = "Thunar file manager.";
@ -63,60 +57,15 @@ in {
defaultApps = { defaultApps = {
enable = lib.mkEnableOption "Declaratively set default apps and file associations."; enable = lib.mkEnableOption "Declaratively set default apps and file associations.";
audioPlayer = lib.mkPackageOption pkgs "audio player" {default = ["celluloid"];};
audioPlayer = lib.mkOption { editor = lib.mkPackageOption pkgs "text editor" {default = ["vscodium"];};
description = "Default audio player package."; fileManager = lib.mkPackageOption pkgs "file manager" {default = ["cinnamon" "nemo"];};
default = cfg.defaultApps.videoPlayer; imageViewer = lib.mkPackageOption pkgs "image viewer" {default = ["gnome" "eog"];};
type = lib.types.package; pdfViewer = lib.mkPackageOption pkgs "pdf viewer" {default = ["evince"];};
}; terminal = lib.mkPackageOption pkgs "terminal emulator" {default = ["alacritty"];};
terminalEditor = lib.mkPackageOption pkgs "terminal text editor" {default = ["vim"];};
editor = lib.mkOption { videoPlayer = lib.mkPackageOption pkgs "video player" {default = ["celluloid"];};
description = "Default editor package."; webBrowser = lib.mkPackageOption pkgs "web browser" {default = ["firefox"];};
default = config.programs.vscode.package;
type = lib.types.package;
};
fileManager = lib.mkOption {
description = "Default file manager package.";
default = pkgs.cinnamon.nemo;
type = lib.types.package;
};
imageViewer = lib.mkOption {
description = "Default image viewer package.";
default = pkgs.gnome.eog;
type = lib.types.package;
};
pdfViewer = lib.mkOption {
description = "Default PDF viewer package.";
default = pkgs.evince;
type = lib.types.package;
};
terminal = lib.mkOption {
description = "Default terminal package.";
default = config.programs.alacritty.package;
type = lib.types.package;
};
terminalEditor = lib.mkOption {
description = "Default terminal editor package.";
default = config.programs.neovim.package;
type = lib.types.package;
};
videoPlayer = lib.mkOption {
description = "Default video player package.";
default = pkgs.celluloid;
type = lib.types.package;
};
webBrowser = lib.mkOption {
description = "Default web browser package.";
default = config.programs.firefox.package;
type = lib.types.package;
};
}; };
desktop = { desktop = {

View file

@ -74,7 +74,6 @@ self: {
fastfetch.enable = true; fastfetch.enable = true;
firefox.enable = true; firefox.enable = true;
keepassxc.enable = true; keepassxc.enable = true;
neovim.enable = true;
tmux.enable = true; tmux.enable = true;
vsCodium.enable = true; vsCodium.enable = true;
}; };

View file

@ -38,8 +38,6 @@
sway.enable = lib.mkEnableOption "Sway wayland session."; sway.enable = lib.mkEnableOption "Sway wayland session.";
}; };
services = { services.flatpak.enable = lib.mkEnableOption "Flatpak support with GUI.";
flatpak.enable = lib.mkEnableOption "Flatpak support with GUI.";
};
}; };
} }