Created
February 22, 2017 21:05
-
-
Save anonymous/cfebacf292cb03fb7fb90d9e08900742 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.wayland.windowManager.sway; | |
in | |
{ | |
### Interface | |
options = { | |
services.wayland.windowManager.sway = { | |
enable = mkEnableOption "Sway window manager"; | |
configFile = mkOption { | |
default = null; | |
type = with types; nullOr path; | |
description = | |
'' | |
Location of the Sway configuration file. | |
''; | |
}; | |
}; | |
}; | |
### Implementation | |
config = mkIf cfg.enable { | |
services.wayland.windowManager.session = [{ | |
name = "sway"; | |
start = | |
'' | |
${pkgs.sway}/bin/sway ${optionalString (cfg.configFile != null) | |
"-c \"${cfg.configFile}\"" | |
} & waitPID=$! | |
''; | |
}]; | |
environment.systemPackages = [ pkgs.sway ]; | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment