added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 236b8c2a6b
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,58 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) ints bool enum package;
cfg = config.modules.usrEnv.brightness;
in {
options.modules.usrEnv.brightness = {
enable = mkOption {
type = bool;
default = false;
description = ''
Enable brightness management with systemd.
'';
};
package = mkOption {
type = package;
default = pkgs.writeShellApplication {
name = "set-system-brightness";
runtimeInputs = with pkgs; [brightnessctl];
text = "brightnessctl set ${cfg.value}";
};
};
value = mkOption {
type = ints.between 0 100;
default = 85; # try to save some battery on laptops
description = ''
The screen brightness that will be set once the graphical target is reached.
'';
};
service = {
type = mkOption {
type = enum ["oneshot" "simple"];
default = "oneshot";
description = ''
The type of the service to be used for setting brightness on graphical session start.
'';
};
target = mkOption {
type = enum ["graphical-session.target" "multi-user.target"];
default = "graphical-session.target";
description = ''
The target that the systemd-brightnessd service will be bound to.
This effectively sets the `after` attribute in the serviceConfig
'';
};
};
};
}

View file

@ -0,0 +1,9 @@
{
imports = [
./programs
./services
./brightness.nix
./desktop.nix
];
}

View file

@ -0,0 +1,85 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkOption types;
cfg = config.modules.usrEnv;
sys = config.modules.system;
in {
options.modules.usrEnv = {
desktop = mkOption {
type = types.enum ["none" "Hyprland" "sway" "awesomewm" "i3"];
default = "none";
description = ''
The desktop environment to be used.
'';
};
desktops = {
hyprland.enable = mkOption {
type = types.bool;
default = cfg.desktop == "Hyprland";
description = ''
Whether to enable Hyprland wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop` is set to "Hyprland".
'';
};
sway.enable = mkOption {
type = types.bool;
default = cfg.desktop == "sway";
description = ''
Whether to enable Sway wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop` is set to "sway".
'';
};
awesomwm.enable = mkOption {
type = types.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 = types.bool;
default = cfg.desktop == "i3";
description = ''
Whether to enable i3 window manager
Will be enabled automatically when `modules.usrEnv.desktop` is set to "i3".
'';
};
};
useHomeManager = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable the usage of home-manager for user home management. Maps the list
of users to their home directories inside the `homes/` directory in the repository
root.
Username via `modules.system.mainUser` must be set if this option is enabled.
'';
};
};
config = {
assertions = [
{
assertion = cfg.useHomeManager -> sys.mainUser != null;
message = "modules.system.mainUser must be set while modules.usrEnv.useHomeManager is enabled";
}
];
};
}

View file

@ -0,0 +1,8 @@
{
imports = [
./gaming.nix
./launchers.nix
./lockers.nix
./media.nix
];
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (config) modules;
sys = modules.system;
prg = sys.programs;
in {
options.modules.usrEnv.programs.gaming = {
enable = mkEnableOption "userspace gaming programs" // {default = prg.gaming.enable;};
emulation.enable = mkEnableOption "programs required to emulate other platforms" // {default = prg.gaming.enable;};
minecraft.enable = mkEnableOption "Minecraft launcher & JDKs" // {default = prg.gaming.enable;};
chess.enable = mkEnableOption "Chess programs and engines" // {default = prg.gaming.enable;};
mangohud.enable = mkEnableOption "MangoHud overlay" // {default = prg.gaming.enable;};
};
}

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,27 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.types) package;
inherit (lib.options) mkEnableOption mkOption;
cfg = config.modules.usrEnv.programs.screenlock;
pkg =
if cfg.gtklock.enable
then pkgs.gtklock
else pkgs.swaylock-effects;
in {
options.modules.usrEnv.programs.screenlock = {
gtklock.enable = mkEnableOption "gtklock screenlocker";
swaylock.enable = mkEnableOption "swaylock screenlocker";
package = mkOption {
type = package;
default = pkg;
readOnly = true;
description = "The screenlocker package";
};
};
}

View file

@ -0,0 +1,63 @@
{
inputs',
config,
pkgs,
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types literalExpression;
in {
options.modules.usrEnv.programs.media = {
addDefaultPackages = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable the default list of media-related packages ranging from audio taggers
to video editors.
'';
};
extraPackages = mkOption {
type = with types; 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 = with types; 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 spefici pos.
# from nyxpkgs
inputs'.nyxpkgs.packages.mpv-history # save a history of played files with timestamps
];
};
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./media.nix
];
}

View file

@ -0,0 +1,7 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.modules.usrEnv.services.media = {
mpd.enable = mkEnableOption "mpd service";
};
}