Desktop environment refactor
This commit is contained in:
@@ -3,71 +3,11 @@
|
||||
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;
|
||||
};
|
||||
# Define generic desktop options to be used by the environments
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user