beginning of big refactoring

This commit is contained in:
Vali 2024-07-20 13:18:01 +02:00
commit e09e7277eb
68 changed files with 358 additions and 2818 deletions

View file

@ -0,0 +1,77 @@
{
inputs,
config,
pkgs,
lib,
...
}: let
cfg = config.modules.usrEnv;
inherit (lib.options) mkOption;
inherit (lib.types) bool enum package;
in {
options.modules.usrEnv = {
desktop = mkOption {
type = enum ["none" "Hyprland" "sway" "awesomewm" "i3"];
default = "none";
description = ''
The desktop environment to be used.
'';
};
desktops = {
hyprland = {
enable = mkOption {
type = bool;
default = cfg.desktop == "Hyprland";
description = ''
Whether to enable Hyprland wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "Hyprland".
'';
};
package = mkOption {
type = package;
default = inputs.hyprland.packages.${pkgs.system}.hyprland;
description = ''
The Hyprland package to be used.
'';
};
};
awesomwm.enable = mkOption {
type = bool;
default = cfg.desktop == "awesomewm";
description = ''
Whether to enable Awesome window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "awesomewm".
'';
};
i3 = {
enable = mkOption {
type = bool;
default = cfg.desktop == "i3";
description = ''
Whether to enable i3 window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "i3".
'';
};
package = mkOption {
type = package;
default = pkgs.i3;
description = ''
The i3 package to be used.
'';
};
};
};
};
}

View file

@ -0,0 +1,9 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.modules.usrEnv.programs.launchers = {
anyrun.enable = mkEnableOption "anyrun application launcher";
rofi.enable = mkEnableOption "rofi application launcher";
tofi.enable = mkEnableOption "tofi application launcher";
};
}

View file

@ -0,0 +1,60 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) bool listOf package;
in {
options.modules.usrEnv.programs.media = {
addDefaultPackages = mkOption {
type = bool;
default = true;
description = ''
Whether to enable the default list of media-related packages ranging from audio taggers
to video editors.
'';
};
extraPackages = mkOption {
type = listOf package;
default = [];
description = ''
Additional packages that will be appended to media related packages.
'';
};
ncmpcpp.enable = mkEnableOption "ncmpcpp TUI music player";
beets.enable =
mkEnableOption ''
beets media library system.
Will be enabled automatically if {option}`config.modules.usrEnv.services.mpd.enabled`
is set to true
''
// {default = config.modules.usrEnv.services.media.mpd.enable;};
mpv = {
enable = mkEnableOption "mpv media player";
scripts = mkOption {
type = listOf package;
description = "A list of MPV scripts that will be enabled";
example = literalExpression ''[ pkgs.mpvScripts.cutter ]'';
default = with pkgs.mpvScripts; [
# from nixpkgs
cutter # cut and automatically concat videos
mpris # MPRIS plugin
thumbnail # OSC seekbar thumbnails
thumbfast # on-the-fly thumbnailer
sponsorblock # skip sponsored segments
uosc # proximity UI
quality-menu # ytdl-format quality menu
seekTo # seek to specific pos.
];
};
};
};
}