push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager."2bwm";
in
{
###### interface
options = {
services.xserver.windowManager."2bwm".enable = mkEnableOption "2bwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "2bwm";
start = ''
${pkgs._2bwm}/bin/2bwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs._2bwm ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.afterstep;
in
{
###### interface
options = {
services.xserver.windowManager.afterstep.enable = mkEnableOption "afterstep";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "afterstep";
start = ''
${pkgs.afterstep}/bin/afterstep &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.afterstep ];
};
}

View File

@@ -0,0 +1,63 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.awesome;
awesome = cfg.package;
getLuaPath = lib: dir: "${lib}/${dir}/lua/${awesome.lua.luaversion}";
makeSearchPath = lib.concatMapStrings (
path: " --search " + (getLuaPath path "share") + " --search " + (getLuaPath path "lib")
);
in
{
###### interface
options = {
services.xserver.windowManager.awesome = {
enable = mkEnableOption "Awesome window manager";
luaModules = mkOption {
default = [ ];
type = types.listOf types.package;
description = "List of lua packages available for being used in the Awesome configuration.";
example = literalExpression "[ pkgs.luaPackages.vicious ]";
};
package = mkPackageOption pkgs "awesome" { };
noArgb = mkOption {
default = false;
type = types.bool;
description = "Disable client transparency support, which can be greatly detrimental to performance in some setups";
};
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "awesome";
start = ''
${awesome}/bin/awesome ${lib.optionalString cfg.noArgb "--no-argb"} ${makeSearchPath cfg.luaModules} &
waitPID=$!
'';
};
environment.systemPackages = [ awesome ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.berry;
in
{
###### interface
options = {
services.xserver.windowManager.berry.enable = mkEnableOption "berry";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "berry";
start = ''
${pkgs.berry}/bin/berry &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.berry ];
};
}

View File

@@ -0,0 +1,78 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.bspwm;
in
{
options = {
services.xserver.windowManager.bspwm = {
enable = mkEnableOption "bspwm";
package = mkPackageOption pkgs "bspwm" { };
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
default = null;
description = ''
Path to the bspwm configuration file.
If null, $HOME/.config/bspwm/bspwmrc will be used.
'';
};
sxhkd = {
package = mkPackageOption pkgs "sxhkd" { };
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
default = null;
description = ''
Path to the sxhkd configuration file.
If null, $HOME/.config/sxhkd/sxhkdrc will be used.
'';
};
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "bspwm";
start = ''
export _JAVA_AWT_WM_NONREPARENTING=1
SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${
optionalString (cfg.sxhkd.configFile != null) "-c ${escapeShellArg cfg.sxhkd.configFile}"
} &
${cfg.package}/bin/bspwm ${
optionalString (cfg.configFile != null) "-c ${escapeShellArg cfg.configFile}"
} &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
imports = [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"bspwm"
"startThroughSession"
] "bspwm package does not provide bspwm-session anymore.")
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"bspwm"
"sessionScript"
] "bspwm package does not provide bspwm-session anymore.")
];
}

View File

@@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.clfswm;
in
{
options = {
services.xserver.windowManager.clfswm = {
enable = mkEnableOption "clfswm";
package = mkPackageOption pkgs [ "sbclPackages" "clfswm" ] { };
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "clfswm";
start = ''
${cfg.package}/bin/clfswm &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.cwm;
in
{
options = {
services.xserver.windowManager.cwm.enable = mkEnableOption "cwm";
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "cwm";
start = ''
cwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.cwm ];
};
}

View File

@@ -0,0 +1,87 @@
{ config, lib, ... }:
let
inherit (lib) mkOption types;
cfg = config.services.xserver.windowManager;
in
{
imports = [
./2bwm.nix
./afterstep.nix
./berry.nix
./bspwm.nix
./cwm.nix
./clfswm.nix
./dk.nix
./dwm.nix
./e16.nix
./evilwm.nix
./exwm.nix
./fluxbox.nix
./fvwm2.nix
./fvwm3.nix
./hackedbox.nix
./herbstluftwm.nix
./hypr.nix
./i3.nix
./jwm.nix
./leftwm.nix
./lwm.nix
./metacity.nix
./mlvwm.nix
./mwm.nix
./openbox.nix
./pekwm.nix
./notion.nix
./ragnarwm.nix
./ratpoison.nix
./sawfish.nix
./smallwm.nix
./stumpwm.nix
./spectrwm.nix
./tinywm.nix
./twm.nix
./windowmaker.nix
./wmderland.nix
./wmii.nix
./xmonad.nix
./qtile.nix
./none.nix
];
options = {
services.xserver.windowManager = {
session = mkOption {
internal = true;
default = [ ];
example = [
{
name = "wmii";
start = "...";
}
];
description = ''
Internal option used to add some common line to window manager
scripts before forwarding the value to the
`displayManager`.
'';
apply = map (
d:
d
// {
manage = "window";
}
);
};
};
};
config = {
services.xserver.displayManager.session = cfg.session;
};
}

View File

@@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.xserver.windowManager.dk;
in
{
options = {
services.xserver.windowManager.dk = {
enable = lib.mkEnableOption "dk";
package = lib.mkPackageOption pkgs "dk" { };
};
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
name = "dk";
start = ''
export _JAVA_AWT_WM_NONREPARENTING=1
${cfg.package}/bin/dk &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,63 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.dwm;
in
{
###### interface
options = {
services.xserver.windowManager.dwm = {
enable = mkEnableOption "dwm";
extraSessionCommands = mkOption {
default = "";
type = types.lines;
description = ''
Shell commands executed just before dwm is started.
'';
};
package = mkPackageOption pkgs "dwm" {
example = ''
pkgs.dwm.overrideAttrs (oldAttrs: rec {
patches = [
(super.fetchpatch {
url = "https://dwm.suckless.org/patches/steam/dwm-steam-6.2.diff";
sha256 = "sha256-f3lffBjz7+0Khyn9c9orzReoLTqBb/9gVGshYARGdVc=";
})
];
})
'';
};
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "dwm";
start = ''
${cfg.extraSessionCommands}
export _JAVA_AWT_WM_NONREPARENTING=1
dwm &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.e16;
in
{
###### interface
options = {
services.xserver.windowManager.e16.enable = mkEnableOption "e16";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "E16";
start = ''
${pkgs.e16}/bin/e16 &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.e16 ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.evilwm;
in
{
###### interface
options = {
services.xserver.windowManager.evilwm.enable = mkEnableOption "evilwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "evilwm";
start = ''
${pkgs.evilwm}/bin/evilwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.evilwm ];
};
}

View File

@@ -0,0 +1,74 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.exwm;
loadScript = pkgs.writeText "emacs-exwm-load" ''
${cfg.loadScript}
'';
packages = epkgs: cfg.extraPackages epkgs ++ [ epkgs.exwm ];
exwm-emacs = cfg.package.pkgs.withPackages packages;
in
{
imports = [
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "exwm" "enableDefaultConfig" ]
"The upstream EXWM project no longer provides a default configuration, instead copy (parts of) exwm-config.el to your local config."
)
];
options = {
services.xserver.windowManager.exwm = {
enable = mkEnableOption "exwm";
loadScript = mkOption {
default = "(require 'exwm)";
type = types.lines;
example = ''
(require 'exwm)
(exwm-enable)
'';
description = ''
Emacs lisp code to be run after loading the user's init
file.
'';
};
package = mkPackageOption pkgs "Emacs" {
default = "emacs";
example = [ "emacs-gtk" ];
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = epkgs: [ ];
defaultText = literalExpression "epkgs: []";
example = literalExpression ''
epkgs: [
epkgs.emms
epkgs.magit
epkgs.proofgeneral
]
'';
description = ''
Extra packages available to Emacs. The value must be a
function which receives the attrset defined in
{var}`emacs.pkgs` as the sole argument.
'';
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "exwm";
start = ''
${exwm-emacs}/bin/emacs -l ${loadScript}
'';
};
environment.systemPackages = [ exwm-emacs ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.fluxbox;
in
{
###### interface
options = {
services.xserver.windowManager.fluxbox.enable = mkEnableOption "fluxbox";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "fluxbox";
start = ''
${pkgs.fluxbox}/bin/startfluxbox &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.fluxbox ];
};
}

View File

@@ -0,0 +1,51 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.fvwm2;
fvwm2 = pkgs.fvwm2.override { enableGestures = cfg.gestures; };
in
{
imports = [
(mkRenamedOptionModule
[ "services" "xserver" "windowManager" "fvwm" ]
[ "services" "xserver" "windowManager" "fvwm2" ]
)
];
###### interface
options = {
services.xserver.windowManager.fvwm2 = {
enable = mkEnableOption "Fvwm2 window manager";
gestures = mkOption {
default = false;
type = types.bool;
description = "Whether or not to enable libstroke for gesture support";
};
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "fvwm2";
start = ''
${fvwm2}/bin/fvwm &
waitPID=$!
'';
};
environment.systemPackages = [ fvwm2 ];
};
}

View File

@@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.fvwm3;
inherit (pkgs) fvwm3;
in
{
###### interface
options = {
services.xserver.windowManager.fvwm3 = {
enable = mkEnableOption "Fvwm3 window manager";
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "fvwm3";
start = ''
${fvwm3}/bin/fvwm3 &
waitPID=$!
'';
};
environment.systemPackages = [ fvwm3 ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.hackedbox;
in
{
###### interface
options = {
services.xserver.windowManager.hackedbox.enable = mkEnableOption "hackedbox";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "hackedbox";
start = ''
${pkgs.hackedbox}/bin/hackedbox &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.hackedbox ];
};
}

View File

@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.herbstluftwm;
in
{
options = {
services.xserver.windowManager.herbstluftwm = {
enable = mkEnableOption "herbstluftwm";
package = mkPackageOption pkgs "herbstluftwm" { };
configFile = mkOption {
default = null;
type = with types; nullOr path;
description = ''
Path to the herbstluftwm configuration file. If left at the
default value, $XDG_CONFIG_HOME/herbstluftwm/autostart will
be used.
'';
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "herbstluftwm";
start =
let
configFileClause = optionalString (cfg.configFile != null) ''-c "${cfg.configFile}"'';
in
''
${cfg.package}/bin/herbstluftwm ${configFileClause} &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.hypr;
in
{
###### interface
options = {
services.xserver.windowManager.hypr.enable = mkEnableOption "hypr";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "hypr";
start = ''
${pkgs.hypr}/bin/Hypr &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.hypr ];
};
}

View File

@@ -0,0 +1,98 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.i3;
updateSessionEnvironmentScript = ''
systemctl --user import-environment PATH DISPLAY XAUTHORITY DESKTOP_SESSION XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID DBUS_SESSION_BUS_ADDRESS || true
dbus-update-activation-environment --systemd --all || true
'';
in
{
options.services.xserver.windowManager.i3 = {
enable = mkEnableOption "i3 window manager";
configFile = mkOption {
default = null;
type = with types; nullOr path;
description = ''
Path to the i3 configuration file.
If left at the default value, $HOME/.i3/config will be used.
'';
};
updateSessionEnvironment = mkOption {
default = true;
type = types.bool;
description = ''
Whether to run dbus-update-activation-environment and systemctl import-environment before session start.
Required for xdg portals to function properly.
'';
};
extraSessionCommands = mkOption {
default = "";
type = types.lines;
description = ''
Shell commands executed just before i3 is started.
'';
};
package = mkPackageOption pkgs "i3" { };
extraPackages = mkOption {
type = with types; listOf package;
default = with pkgs; [
dmenu
i3status
];
defaultText = literalExpression ''
with pkgs; [
dmenu
i3status
]
'';
description = ''
Extra packages to be installed system wide.
'';
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = [
{
name = "i3";
start = ''
${cfg.extraSessionCommands}
${lib.optionalString cfg.updateSessionEnvironment updateSessionEnvironmentScript}
${cfg.package}/bin/i3 ${optionalString (cfg.configFile != null) "-c /etc/i3/config"} &
waitPID=$!
'';
}
];
programs.i3lock.enable = mkDefault true;
environment.systemPackages = [ cfg.package ] ++ cfg.extraPackages;
environment.etc."i3/config" = mkIf (cfg.configFile != null) {
source = cfg.configFile;
};
};
imports = [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"i3-gaps"
"enable"
] "i3-gaps was merged into i3. Use services.xserver.windowManager.i3.enable instead.")
];
}

View File

@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.icewm;
in
{
###### interface
options = {
services.xserver.windowManager.icewm.enable = mkEnableOption "icewm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "icewm";
start = ''
${pkgs.icewm}/bin/icewm-session &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.icewm ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.jwm;
in
{
###### interface
options = {
services.xserver.windowManager.jwm.enable = mkEnableOption "jwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "jwm";
start = ''
${pkgs.jwm}/bin/jwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.jwm ];
};
}

View File

@@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkEnableOption
mkIf
mkPackageOption
singleton
;
cfg = config.services.xserver.windowManager.katriawm;
in
{
###### interface
options = {
services.xserver.windowManager.katriawm = {
enable = mkEnableOption "katriawm";
package = mkPackageOption pkgs "katriawm" { };
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "katriawm";
start = ''
${cfg.package}/bin/katriawm &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.leftwm;
in
{
###### interface
options = {
services.xserver.windowManager.leftwm.enable = mkEnableOption "leftwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "leftwm";
start = ''
${pkgs.leftwm}/bin/leftwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.leftwm ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.lwm;
in
{
###### interface
options = {
services.xserver.windowManager.lwm.enable = mkEnableOption "lwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "lwm";
start = ''
${pkgs.lwm}/bin/lwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.lwm ];
};
}

View File

@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.xserver.windowManager.metacity;
inherit (pkgs) metacity;
in
{
options = {
services.xserver.windowManager.metacity.enable = lib.mkEnableOption "metacity";
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
name = "metacity";
start = ''
${metacity}/bin/metacity &
waitPID=$!
'';
};
environment.systemPackages = [ metacity ];
};
}

View File

@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.mlvwm;
in
{
options.services.xserver.windowManager.mlvwm = {
enable = mkEnableOption "Macintosh-like Virtual Window Manager";
configFile = mkOption {
default = null;
type = with types; nullOr path;
description = ''
Path to the mlvwm configuration file.
If left at the default value, $HOME/.mlvwmrc will be used.
'';
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = [
{
name = "mlvwm";
start = ''
${pkgs.mlvwm}/bin/mlvwm ${optionalString (cfg.configFile != null) "-f /etc/mlvwm/mlvwmrc"} &
waitPID=$!
'';
}
];
environment.etc."mlvwm/mlvwmrc" = mkIf (cfg.configFile != null) {
source = cfg.configFile;
};
environment.systemPackages = [ pkgs.mlvwm ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.mwm;
in
{
###### interface
options = {
services.xserver.windowManager.mwm.enable = mkEnableOption "mwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "mwm";
start = ''
${pkgs.motif}/bin/mwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.motif ];
};
}

View File

@@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.nimdow;
in
{
options = {
services.xserver.windowManager.nimdow.enable = mkEnableOption "nimdow";
services.xserver.windowManager.nimdow.package = mkPackageOption pkgs "nimdow" { };
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "nimdow";
start = ''
${cfg.package}/bin/nimdow &
waitPID=$!
'';
};
environment.systemPackages = [
cfg.package
pkgs.st
];
};
}

View File

@@ -0,0 +1,14 @@
{
services = {
xserver = {
windowManager = {
session = [
{
name = "none";
start = "";
}
];
};
};
};
}

View File

@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.notion;
in
{
options = {
services.xserver.windowManager.notion.enable = mkEnableOption "notion";
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [
{
name = "notion";
start = ''
${pkgs.notion}/bin/notion &
waitPID=$!
'';
}
];
};
environment.systemPackages = [ pkgs.notion ];
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.openbox;
in
{
options = {
services.xserver.windowManager.openbox.enable = mkEnableOption "openbox";
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [
{
name = "openbox";
start = "
${pkgs.openbox}/bin/openbox-session
";
}
];
};
environment.systemPackages = [ pkgs.openbox ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.pekwm;
in
{
###### interface
options = {
services.xserver.windowManager.pekwm.enable = mkEnableOption "pekwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "pekwm";
start = ''
${pkgs.pekwm}/bin/pekwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.pekwm ];
};
}

View File

@@ -0,0 +1,79 @@
{
config,
pkgs,
lib,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.qtile;
in
{
imports = [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"qtile"
"backend"
] "The qtile package now provides separate display sessions for both X11 and Wayland.")
];
options.services.xserver.windowManager.qtile = {
enable = mkEnableOption "qtile";
package = mkPackageOption pkgs [ "python3" "pkgs" "qtile" ] { };
configFile = mkOption {
type = with types; nullOr path;
default = null;
example = literalExpression "./your_config.py";
description = ''
Path to the qtile configuration file.
If null, $XDG_CONFIG_HOME/qtile/config.py will be used.
'';
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = _: [ ];
defaultText = literalExpression ''
python3Packages: with python3Packages; [];
'';
description = ''
Extra Python packages available to Qtile.
An example would be to include `python3Packages.qtile-extras`
for additional unofficial widgets.
'';
example = literalExpression ''
python3Packages: with python3Packages; [
qtile-extras
];
'';
};
finalPackage = mkOption {
type = types.package;
visible = false;
readOnly = true;
description = "The resulting Qtile package, bundled with extra packages";
};
};
config = mkIf cfg.enable {
services = {
xserver.windowManager.qtile.finalPackage = cfg.package.override {
extraPackages = cfg.extraPackages cfg.package.pythonModule.pkgs;
};
displayManager.sessionPackages = [ cfg.finalPackage ];
};
environment = {
etc."xdg/qtile/config.py" = mkIf (cfg.configFile != null) { source = cfg.configFile; };
systemPackages = [ cfg.finalPackage ];
};
};
}

View File

@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.ragnarwm;
in
{
###### interface
options = {
services.xserver.windowManager.ragnarwm = {
enable = mkEnableOption "ragnarwm";
package = mkPackageOption pkgs "ragnarwm" { };
};
};
###### implementation
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
};
meta.maintainers = with lib.maintainers; [ sigmanificient ];
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.ratpoison;
in
{
###### interface
options = {
services.xserver.windowManager.ratpoison.enable = mkEnableOption "ratpoison";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "ratpoison";
start = ''
${pkgs.ratpoison}/bin/ratpoison &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.ratpoison ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.sawfish;
in
{
###### interface
options = {
services.xserver.windowManager.sawfish.enable = mkEnableOption "sawfish";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "sawfish";
start = ''
${pkgs.sawfish}/bin/sawfish &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.sawfish ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.smallwm;
in
{
###### interface
options = {
services.xserver.windowManager.smallwm.enable = mkEnableOption "smallwm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "smallwm";
start = ''
${pkgs.smallwm}/bin/smallwm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.smallwm ];
};
}

View File

@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.spectrwm;
in
{
options = {
services.xserver.windowManager.spectrwm.enable = mkEnableOption "spectrwm";
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [
{
name = "spectrwm";
start = ''
${pkgs.spectrwm}/bin/spectrwm &
waitPID=$!
'';
}
];
};
environment.systemPackages = [ pkgs.spectrwm ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.stumpwm;
in
{
options = {
services.xserver.windowManager.stumpwm.enable = mkEnableOption "stumpwm";
services.xserver.windowManager.stumpwm.package = mkPackageOption pkgs "stumpwm" { };
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "stumpwm";
start = ''
${cfg.package}/bin/stumpwm &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.tinywm;
in
{
###### interface
options = {
services.xserver.windowManager.tinywm.enable = mkEnableOption "tinywm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "tinywm";
start = ''
${pkgs.tinywm}/bin/tinywm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.tinywm ];
};
}

View File

@@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.twm;
in
{
###### interface
options = {
services.xserver.windowManager.twm.enable = mkEnableOption "twm";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "twm";
start = ''
${pkgs.xorg.twm}/bin/twm &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.xorg.twm ];
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.services.xserver.windowManager.windowlab;
in
{
options = {
services.xserver.windowManager.windowlab.enable = lib.mkEnableOption "windowlab";
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager = {
session = [
{
name = "windowlab";
start = "${pkgs.windowlab}/bin/windowlab";
}
];
};
environment.systemPackages = [ pkgs.windowlab ];
};
}

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.windowmaker;
in
{
###### interface
options = {
services.xserver.windowManager.windowmaker.enable = mkEnableOption "windowmaker";
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "windowmaker";
start = ''
${pkgs.windowmaker}/bin/wmaker &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.windowmaker ];
};
}

View File

@@ -0,0 +1,68 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.wmderland;
in
{
options.services.xserver.windowManager.wmderland = {
enable = mkEnableOption "wmderland";
extraSessionCommands = mkOption {
default = "";
type = types.lines;
description = ''
Shell commands executed just before wmderland is started.
'';
};
extraPackages = mkOption {
type = with types; listOf package;
default = with pkgs; [
rofi
dunst
light
hsetroot
feh
rxvt-unicode
];
defaultText = literalExpression ''
with pkgs; [
rofi
dunst
light
hsetroot
feh
rxvt-unicode
]
'';
description = ''
Extra packages to be installed system wide.
'';
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "wmderland";
start = ''
${cfg.extraSessionCommands}
${pkgs.wmderland}/bin/wmderland &
waitPID=$!
'';
};
environment.systemPackages = [
pkgs.wmderland
pkgs.wmderlandc
]
++ cfg.extraPackages;
};
}

View File

@@ -0,0 +1,46 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.wmii;
wmii = pkgs.wmii_hg;
in
{
options = {
services.xserver.windowManager.wmii.enable = mkEnableOption "wmii";
};
config = mkIf cfg.enable {
services.xserver.windowManager.session =
singleton
# stop wmii by
# $wmiir xwrite /ctl quit
# this will cause wmii exiting with exit code 0
# (or "mod+a quit", which is bound to do the same thing in wmiirc
# by default)
#
# why this loop?
# wmii crashes once a month here. That doesn't matter that much
# wmii can recover very well. However without loop the X session
# terminates and then your workspace setup is lost and all
# applications running on X will terminate.
# Another use case is kill -9 wmii; after rotating screen.
# Note: we don't like kill for that purpose. But it works (->
# subject "wmii and xrandr" on mailinglist)
{
name = "wmii";
start = ''
while :; do
${wmii}/bin/wmii && break
done
'';
};
environment.systemPackages = [ wmii ];
};
}

View File

@@ -0,0 +1,234 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
inherit (lib)
mkOption
mkIf
optionals
literalExpression
optionalString
;
cfg = config.services.xserver.windowManager.xmonad;
ghcWithPackages = cfg.haskellPackages.ghcWithPackages;
packages =
self:
cfg.extraPackages self
++ optionals cfg.enableContribAndExtras [
self.xmonad-contrib
self.xmonad-extras
];
xmonad-vanilla = pkgs.xmonad-with-packages.override {
inherit ghcWithPackages packages;
};
xmonad-config =
let
xmonadAndPackages = self: [ self.xmonad ] ++ packages self;
xmonadEnv = ghcWithPackages xmonadAndPackages;
configured = pkgs.writers.writeHaskellBin "xmonad" {
ghc = cfg.haskellPackages.ghc;
libraries = xmonadAndPackages cfg.haskellPackages;
inherit (cfg) ghcArgs;
} cfg.config;
in
pkgs.runCommand "xmonad"
{
preferLocalBuild = true;
nativeBuildInputs = [ pkgs.makeWrapper ];
}
(
''
install -D ${xmonadEnv}/share/man/man1/xmonad.1.gz $out/share/man/man1/xmonad.1.gz
makeWrapper ${configured}/bin/xmonad $out/bin/xmonad \
''
+ optionalString cfg.enableConfiguredRecompile ''
--set XMONAD_GHC "${xmonadEnv}/bin/ghc" \
''
+ ''
--set XMONAD_XMESSAGE "${pkgs.xorg.xmessage}/bin/xmessage"
''
);
xmonad = if (cfg.config != null) then xmonad-config else xmonad-vanilla;
in
{
meta.maintainers = with maintainers; [
lassulus
xaverdh
ivanbrennan
slotThe
];
options = {
services.xserver.windowManager.xmonad = {
enable = mkEnableOption "xmonad";
haskellPackages = mkOption {
default = pkgs.haskellPackages;
defaultText = literalExpression "pkgs.haskellPackages";
example = literalExpression "pkgs.haskell.packages.ghc910";
type = types.attrs;
description = ''
haskellPackages used to build Xmonad and other packages.
This can be used to change the GHC version used to build
Xmonad and the packages listed in
{var}`extraPackages`.
'';
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = self: [ ];
defaultText = literalExpression "self: []";
example = literalExpression ''
haskellPackages: [
haskellPackages.xmonad-contrib
haskellPackages.monad-logger
]
'';
description = ''
Extra packages available to ghc when rebuilding Xmonad. The
value must be a function which receives the attrset defined
in {var}`haskellPackages` as the sole argument.
'';
};
enableContribAndExtras = mkOption {
default = false;
type = lib.types.bool;
description = "Enable xmonad-{contrib,extras} in Xmonad.";
};
config = mkOption {
default = null;
type = with lib.types; nullOr (either path str);
description = ''
Configuration from which XMonad gets compiled. If no value is
specified, a vanilla xmonad binary is put in PATH, which will
attempt to recompile and exec your xmonad config from $HOME/.xmonad.
This setup is then analogous to other (non-NixOS) linux distributions.
If you do set this option, you likely want to use "launch" as your
entry point for xmonad (as in the example), to avoid xmonad's
recompilation logic on startup. Doing so will render the default
"mod+q" restart key binding dysfunctional though, because that attempts
to call your binary with the "--restart" command line option, unless
you implement that yourself. You way mant to bind "mod+q" to
`(restart "xmonad" True)` instead, which will just restart
xmonad from PATH. This allows e.g. switching to the new xmonad binary
after rebuilding your system with nixos-rebuild.
For the same reason, ghc is not added to the environment when this
option is set, unless {option}`enableConfiguredRecompile` is
set to `true`.
If you actually want to run xmonad with a config specified here, but
also be able to recompile and restart it from a copy of that source in
$HOME/.xmonad on the fly, set {option}`enableConfiguredRecompile`
to `true` and implement something like "compileRestart"
from the example.
This should allow you to switch at will between the local xmonad and
the one NixOS puts in your PATH.
'';
example = ''
import XMonad
import XMonad.Util.EZConfig (additionalKeys)
import Control.Monad (when)
import Text.Printf (printf)
import System.Posix.Process (executeFile)
import System.Info (arch,os)
import System.Environment (getArgs)
import System.FilePath ((</>))
compiledConfig = printf "xmonad-%s-%s" arch os
myConfig = defaultConfig
{ modMask = mod4Mask -- Use Super instead of Alt
, terminal = "urxvt" }
`additionalKeys`
[ ( (mod4Mask,xK_r), compileRestart True)
, ( (mod4Mask,xK_q), restart "xmonad" True ) ]
compileRestart resume = do
dirs <- asks directories
whenX (recompile dirs True) $ do
when resume writeStateToFile
catchIO
( do
args <- getArgs
executeFile (cacheDir dirs </> compiledConfig) False args Nothing
)
main = getDirectories >>= launch myConfig
--------------------------------------------
{- For versions before 0.17.0 use this instead -}
--------------------------------------------
-- compileRestart resume =
-- whenX (recompile True) $
-- when resume writeStateToFile
-- *> catchIO
-- ( do
-- dir <- getXMonadDataDir
-- args <- getArgs
-- executeFile (dir </> compiledConfig) False args Nothing
-- )
--
-- main = launch myConfig
--------------------------------------------
'';
};
enableConfiguredRecompile = mkOption {
default = false;
type = lib.types.bool;
description = ''
Enable recompilation even if {option}`config` is set to a
non-null value. This adds the necessary Haskell dependencies (GHC with
packages) to the xmonad binary's environment.
'';
};
xmonadCliArgs = mkOption {
default = [ ];
type = with lib.types; listOf str;
description = ''
Command line arguments passed to the xmonad binary.
'';
};
ghcArgs = mkOption {
default = [ ];
type = with lib.types; listOf str;
description = ''
Command line arguments passed to the compiler (ghc)
invocation when xmonad.config is set.
'';
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [
{
name = "xmonad";
start = ''
systemd-cat -t xmonad -- ${xmonad}/bin/xmonad ${lib.escapeShellArgs cfg.xmonadCliArgs} &
waitPID=$!
'';
}
];
};
environment.systemPackages = [ xmonad ];
};
}