Files
samfelag/modules/desktop/desktop.nix
2024-12-03 15:22:53 +01:00

74 lines
1.7 KiB
Nix

{ config, lib, pkgs, inputs, ... }:
with lib;
let
cfg = config.samfelag.modules.desktop;
laptopPkgs = with pkgs; [
];
in
{
options.samfelag.modules.desktop = {
enable = mkEnableOption "desktop environment";
laptop = mkOption {
description = "Enable features for a laptop (trackpad, battery, etc...)";
type = types.bool;
default = false;
};
wallpaper = my.mkOpt' types.path ../../data/wallpaper/flors "Path to wallpaper(s)";
};
config = mkIf cfg.enable {
# - Packages ---------------------------------
environment.systemPackages = with pkgs; [
pamixer
i3lock-blur
brightnessctl
playerctl
feh
] ++ optionals cfg.laptop laptopPkgs;
# - Audio ------------------------------------
services = {
pipewire = {
enable = true;
};
};
# - Compositor -------------------------------
services.picom.enable = true;
# - Modules ----------------------------------
samfelag.modules = {
app.alacritty.enable = true;
app.firefox.enable = true;
desktop.rofi.enable = true;
desktop.polybar.enable = true;
desktop.i3 = {
laptop = cfg.laptop;
extraStartup = [
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
{ command = "feh --bg-fill -B \"#${config.colorScheme.palette.base00}\" -z --no-fehbg ${cfg.wallpaper}"; always = true; notification = false; }
];
extraKeybindings = {
"${cfg.i3.mod}+space" = "exec $HOME/.config/rofi/menus/launcher/launcher.sh";
"${cfg.i3.mod}+End" = "exec $HOME/.config/rofi/menus/powermenu/powermenu.sh";
};
};
};
};
}