Skip to content

Instantly share code, notes, and snippets.

@vastus
Last active June 7, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vastus/d9588d81f5ca210a3afdab04c04db913 to your computer and use it in GitHub Desktop.
Save vastus/d9588d81f5ca210a3afdab04c04db913 to your computer and use it in GitHub Desktop.
{ 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