From 15d87cb81c61d10a641449529ab94e1a2552492c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Xaver=20H=C3=B6rl?= Date: Mon, 7 Sep 2020 19:25:45 +0200 Subject: [PATCH 1/2] nixos/xmonad: allow passing command line arguments --- nixos/modules/services/x11/window-managers/xmonad.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix index 070758720fe..c834b479a46 100644 --- a/nixos/modules/services/x11/window-managers/xmonad.nix +++ b/nixos/modules/services/x11/window-managers/xmonad.nix @@ -76,6 +76,15 @@ in } ''; }; + + xmonadCliArgs = mkOption { + default = []; + type = with lib.types; listOf str; + description = '' + Command line arguments passed to the xmonad binary. + ''; + }; + }; }; config = mkIf cfg.enable { @@ -85,7 +94,7 @@ in start = let xmonadCommand = if (cfg.config != null) then xmonadBin else "${xmonad}/bin/xmonad"; in '' - systemd-cat -t xmonad ${xmonadCommand} & + systemd-cat -t xmonad -- ${xmonadCommand} ${lib.escapeShellArgs cfg.xmonadCliArgs} & waitPID=$! ''; }]; From 10ecd1f45bf9f7bde9d58995e96dfa77641c6965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Xaver=20H=C3=B6rl?= Date: Mon, 7 Sep 2020 20:16:25 +0200 Subject: [PATCH 2/2] nixos/xmonad: allow passing compile time options to ghc invocation --- nixos/modules/services/x11/window-managers/xmonad.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix index c834b479a46..dba25da8260 100644 --- a/nixos/modules/services/x11/window-managers/xmonad.nix +++ b/nixos/modules/services/x11/window-managers/xmonad.nix @@ -16,6 +16,7 @@ let cfg.extraPackages cfg.haskellPackages ++ optionals cfg.enableContribAndExtras (with cfg.haskellPackages; [ xmonad-contrib xmonad-extras ]); + inherit (cfg) ghcArgs; } cfg.config; in @@ -85,6 +86,15 @@ in ''; }; + 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 {