diff options
author | Michael Weiss <dev.primeos@gmail.com> | 2019-03-11 17:32:38 +0100 |
---|---|---|
committer | Michael Weiss <dev.primeos@gmail.com> | 2019-03-13 11:37:11 +0100 |
commit | 578fe3f5a02f855c5d1ad14e2440b9359a750c40 (patch) | |
tree | 35d24fa93a009d2d2faa0c35cebdea7f589b6955 /nixos/modules/programs/sway.nix | |
parent | 45004c6f6330b1ff6f3d6c3a0ea8019f6c18a930 (diff) |
nixos/sway: Improve the module and adapt it to NixOS
This commit contains the following changes:
- nixos/sway: Remove the beta references
- sway: Drop buildDocs
- nixos/sway: Improve the documentation
- sway,nixos/sway: Adapt Sway to NixOS
- Copy the default configuration file to /etc/sway/config (Sway will
still load the identical file from the Nix store but this makes it
easier to copy the default configuration file).
- This will also remove all references to the Nix store from the
default configuration file as they will eventually be garbage
collected which is a problem if the user copies it.
- I've also decided to drop the default wallpaper (alternatively we
could copy it to a fixed location).
- nixos/sway: Drop the package option
Diffstat (limited to 'nixos/modules/programs/sway.nix')
-rw-r--r-- | nixos/modules/programs/sway.nix | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix index 3c235de0ce63..457faaa3c102 100644 --- a/nixos/modules/programs/sway.nix +++ b/nixos/modules/programs/sway.nix @@ -3,8 +3,8 @@ with lib; let - cfg = config.programs.sway-beta; - swayPackage = cfg.package; + cfg = config.programs.sway; + swayPackage = pkgs.sway; swayWrapped = pkgs.writeShellScriptBin "sway" '' set -o errexit @@ -26,19 +26,14 @@ let paths = [ swayWrapped swayPackage ]; }; in { - options.programs.sway-beta = { + options.programs.sway = { enable = mkEnableOption '' - Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 - ''; - - package = mkOption { - type = types.package; - default = pkgs.sway-beta; - defaultText = "pkgs.sway-beta"; - description = '' - The package to be used for `sway`. - ''; - }; + Sway, the i3-compatible tiling Wayland compositor. You can manually launch + Sway by executing "exec sway" on a TTY. Copy /etc/sway/config to + ~/.config/sway/config to modify the default configuration. See + https://github.com/swaywm/sway/wiki and "man 5 sway" for more information. + Please have a look at the "extraSessionCommands" example for running + programs natively under Wayland''; extraSessionCommands = mkOption { type = types.lines; @@ -80,7 +75,14 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; + environment = { + systemPackages = [ swayJoined ] ++ cfg.extraPackages; + etc = { + "sway/config".source = "${swayPackage}/etc/sway/config"; + #"sway/security.d".source = "${swayPackage}/etc/sway/security.d/"; + #"sway/config.d".source = "${swayPackage}/etc/sway/config.d/"; + }; + }; security.pam.services.swaylock = {}; hardware.opengl.enable = mkDefault true; fonts.enableDefaultFonts = mkDefault true; |