From 578fe3f5a02f855c5d1ad14e2440b9359a750c40 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 11 Mar 2019 17:32:38 +0100 Subject: 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 --- nixos/modules/programs/sway.nix | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'nixos/modules/programs') 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; -- cgit v1.2.3