Last active
June 7, 2019 14:12
-
-
Save vastus/d9588d81f5ca210a3afdab04c04db913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.services.xserver.windowManager.dwm; | |
dwm = | |
if cfg.configFile | |
then (pkgs.dwm.overrideAttrs (old: { postPatch = "cp ${cfg.configFile} config.h"; })) | |
else pkgs.dwm; | |
in | |
{ | |
###### interface | |
options = { | |
services.xserver.windowManager.dwm.enable = mkEnableOption "dwm"; | |
# TODO: what constructor to use? | |
services.xserver.windowManager.dwm.configFile = "mkConfigFileOption?"; | |
# TODO: consider allowing an inline config as well | |
}; | |
###### implementation | |
config = mkIf cfg.enable { | |
services.xserver.windowManager.session = singleton | |
{ name = "dwm"; | |
start = | |
'' | |
dwm & | |
waitPID=$! | |
''; | |
}; | |
environment.systemPackages = [ dwm ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment