system/home/modules/window_manager/xmonad.nix

89 lines
2 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2022-10-12 01:41:32 +03:00
let
cfg = config.local.xmonad;
themeCfg = config.local.theme;
projectType = with lib; types.submodule {
options = {
name = mkOption {
type = types.str;
};
startHook = mkOption {
type = types.lines;
};
};
};
mkXmonadProject = { name, startHook }:
''
Project {
projectName = "${name}",
2024-02-19 00:19:37 +03:00
projectStartHook = ${startHook}
}
'';
2024-02-19 00:19:37 +03:00
xmonadProjects = lib.concatStringsSep " , " (map mkXmonadProject cfg.projects);
in
2022-10-12 01:41:32 +03:00
{
options.local.xmonad = with lib;
{
projects = mkOption {
type = types.listOf projectType;
default = [ ];
};
};
2022-10-12 01:41:32 +03:00
config = {
home.packages = with pkgs; [
xclip # access x clipboard from a console
dmenu # menu for x window system
nitrogen # wallpaper manager
];
2022-10-12 01:41:32 +03:00
xsession = {
2022-10-12 01:41:32 +03:00
enable = true;
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
haskellPackages = pkgs.unstable.haskellPackages;
extraPackages = (hp: [
hp.dbus
hp.monad-logger
]);
config = pkgs.substituteAll {
src = ./xmonad_config.hs;
2024-02-19 00:19:37 +03:00
projects = "\n " + xmonadProjects;
inherit (themeCfg.bar) background mainText inactiveText;
inherit (themeCfg.window) activeBorder inactiveBorder;
inherit (themeCfg.highlights) critical warning success;
inherit (themeCfg.syntax) mark1 mark2 mark3;
kdbBrightnessScriptPath = "${./scripts/kdb_brightness.sh}";
};
};
2022-10-12 01:41:32 +03:00
initExtra = ''
${pkgs.nitrogen}/bin/nitrogen --restore &
'';
};
2022-10-17 17:43:12 +03:00
services.flameshot = {
enable = true;
2022-10-17 17:43:12 +03:00
# See: https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini
settings = {
General = {
disabledTrayIcon = true;
savePathFixed = true;
showDesktopNotification = false;
showSidePanelButton = true;
};
2022-10-17 17:43:12 +03:00
};
};
};
2022-10-12 01:41:32 +03:00
}