dotfiles/common/desktop_environment/i3/default.nix
RingOfStorms (Joshua Bell) e3689e5b26 working on i3
2025-09-19 18:02:18 -05:00

88 lines
1.8 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
ccfg = import ../../config.nix;
cfg_path = [
ccfg.custom_config_key
"desktopEnvironment"
"i3"
];
cfg = lib.attrsets.getAttrFromPath cfg_path config;
in
with lib;
{
options =
{ }
// lib.attrsets.setAttrByPath cfg_path {
enable = lib.mkEnableOption "i3 (X11) desktop environment";
terminalCommand = mkOption {
type = lib.types.str;
default = "foot";
description = "The terminal command to use.";
};
extraOptions = mkOption {
type = lib.types.attrs;
default = { };
description = "Extra options for i3 configuration.";
};
};
config = lib.mkIf cfg.enable {
home-manager = {
sharedModules = [ ./home_manager ];
};
services.greetd = {
enable = true;
vt = 2;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --cmd '${pkgs.dbus}/bin/dbus-run-session ${pkgs.xorg.xinit}/bin/xinit ${pkgs.i3}/bin/i3'}";
user = "greeter";
};
};
};
# X server
services.xserver.enable = true;
services.xserver.displayManager = {
# kept undefined to allow user selection; greetd is enabled above
};
# Environment variables for X11
environment.sessionVariables = {
XDG_SESSION_TYPE = "x11";
XDG_CURRENT_DESKTOP = "i3";
XDG_SESSION_DESKTOP = "i3";
};
environment.systemPackages = with pkgs; [
i3
i3status
i3lock
i3-gaps
polybar
maim
xclip
xterm
# Enable backlight/brightness control, audio, etc., similar to sway defaults
polybar
maim
xclip
i3
i3status
i3lock
i3-gaps
pavucontrol
btop
nemo
feh
rofi
];
};
}