{ config, lib, pkgs, ... }: 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; }; bgColour = my.mkOpt' types.str "#808F85" "Background colour for the wallpaper"; wallpapers = my.mkOpt' types.path ../../data/wallpapers/flors "Path to a folder containing wallpapers"; }; config = mkIf cfg.enable { # - Packages --------------------------------- environment.systemPackages = with pkgs; [ pamixer i3lock-blur brightnessctl playerctl feh ] ++ optionals cfg.laptop laptopPkgs; # - Audio ------------------------------------ sound.enable = true; hardware = { pulseaudio = { enable = true; support32Bit = true; package = pkgs.pulseaudioFull; }; }; # - Compositor ------------------------------- services.picom.enable = true; # - Modules ---------------------------------- samfelag.modules = { app.alacritty.enable = true; desktop.rofi.enable = true; desktop.polybar.enable = true; app.firefox.enable = true; desktop.i3 = { enable = true; laptop = cfg.laptop; launcher = "${pkgs.rofi}/bin/rofi rofi -show run"; terminal = "${pkgs.alacritty}/bin/alacritty"; locker = "${pkgs.i3lock-blur}/bin/i3lock-color -c 808F85 && sleep 1"; extraStartup = [ { command = "systemctl --user restart polybar"; always = true; notification = false; } { command = "feh --bg-center -B \"${cfg.bgColour}\" -z --no-fehbg ${cfg.wallpapers}"; always = true; notification = false; } ]; }; }; }; }