Merge pull request #97381 from xaverdh/xmonad-configurable
nixos/xmonad: give users some build and runtime control
This commit is contained in:
commit
dd966067ae
|
@ -16,6 +16,7 @@ let
|
||||||
cfg.extraPackages cfg.haskellPackages ++
|
cfg.extraPackages cfg.haskellPackages ++
|
||||||
optionals cfg.enableContribAndExtras
|
optionals cfg.enableContribAndExtras
|
||||||
(with cfg.haskellPackages; [ xmonad-contrib xmonad-extras ]);
|
(with cfg.haskellPackages; [ xmonad-contrib xmonad-extras ]);
|
||||||
|
inherit (cfg) ghcArgs;
|
||||||
} cfg.config;
|
} cfg.config;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -76,6 +77,24 @@ in
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
@ -85,7 +104,7 @@ in
|
||||||
start = let
|
start = let
|
||||||
xmonadCommand = if (cfg.config != null) then xmonadBin else "${xmonad}/bin/xmonad";
|
xmonadCommand = if (cfg.config != null) then xmonadBin else "${xmonad}/bin/xmonad";
|
||||||
in ''
|
in ''
|
||||||
systemd-cat -t xmonad ${xmonadCommand} &
|
systemd-cat -t xmonad -- ${xmonadCommand} ${lib.escapeShellArgs cfg.xmonadCliArgs} &
|
||||||
waitPID=$!
|
waitPID=$!
|
||||||
'';
|
'';
|
||||||
}];
|
}];
|
||||||
|
|
Loading…
Reference in New Issue