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
This commit is contained in:
parent
45004c6f63
commit
578fe3f5a0
@ -3,8 +3,8 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.sway-beta;
|
cfg = config.programs.sway;
|
||||||
swayPackage = cfg.package;
|
swayPackage = pkgs.sway;
|
||||||
|
|
||||||
swayWrapped = pkgs.writeShellScriptBin "sway" ''
|
swayWrapped = pkgs.writeShellScriptBin "sway" ''
|
||||||
set -o errexit
|
set -o errexit
|
||||||
@ -26,19 +26,14 @@ let
|
|||||||
paths = [ swayWrapped swayPackage ];
|
paths = [ swayWrapped swayPackage ];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.programs.sway-beta = {
|
options.programs.sway = {
|
||||||
enable = mkEnableOption ''
|
enable = mkEnableOption ''
|
||||||
Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0
|
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
|
||||||
package = mkOption {
|
https://github.com/swaywm/sway/wiki and "man 5 sway" for more information.
|
||||||
type = types.package;
|
Please have a look at the "extraSessionCommands" example for running
|
||||||
default = pkgs.sway-beta;
|
programs natively under Wayland'';
|
||||||
defaultText = "pkgs.sway-beta";
|
|
||||||
description = ''
|
|
||||||
The package to be used for `sway`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraSessionCommands = mkOption {
|
extraSessionCommands = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
@ -80,7 +75,14 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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 = {};
|
security.pam.services.swaylock = {};
|
||||||
hardware.opengl.enable = mkDefault true;
|
hardware.opengl.enable = mkDefault true;
|
||||||
fonts.enableDefaultFonts = mkDefault true;
|
fonts.enableDefaultFonts = mkDefault true;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
, wayland, libxkbcommon, pcre, json_c, dbus, libevdev
|
, wayland, libxkbcommon, pcre, json_c, dbus, libevdev
|
||||||
, pango, cairo, libinput, libcap, pam, gdk_pixbuf
|
, pango, cairo, libinput, libcap, pam, gdk_pixbuf
|
||||||
, wlroots, wayland-protocols
|
, wlroots, wayland-protocols
|
||||||
, buildDocs ? true
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -26,11 +25,10 @@ stdenv.mkDerivation rec {
|
|||||||
url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch";
|
url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch";
|
||||||
sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp";
|
sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp";
|
||||||
})
|
})
|
||||||
|
./sway-config-no-nix-store-references.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [ pkgconfig meson ninja scdoc ];
|
||||||
pkgconfig meson ninja
|
|
||||||
] ++ stdenv.lib.optional buildDocs scdoc;
|
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
wayland libxkbcommon pcre json_c dbus libevdev
|
wayland libxkbcommon pcre json_c dbus libevdev
|
||||||
@ -41,11 +39,12 @@ stdenv.mkDerivation rec {
|
|||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"-Dxwayland=enabled" "-Dgdk-pixbuf=enabled" "-Dtray=enabled"
|
"-Ddefault-wallpaper=false" "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled"
|
||||||
] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled";
|
"-Dtray=enabled" "-Dman-pages=enabled"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "i3-compatible window manager for Wayland";
|
description = "i3-compatible tiling Wayland compositor";
|
||||||
homepage = https://swaywm.org;
|
homepage = https://swaywm.org;
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
diff --git a/config.in b/config.in
|
||||||
|
--- a/config.in
|
||||||
|
+++ b/config.in
|
||||||
|
@@ -21,8 +21,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec
|
||||||
|
|
||||||
|
### Output configuration
|
||||||
|
#
|
||||||
|
-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||||
|
-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||||
|
+# Default wallpaper
|
||||||
|
+#output * bg ~/.config/sway/backgrounds/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||||
|
#
|
||||||
|
# Example configuration:
|
||||||
|
#
|
||||||
|
@@ -213,5 +213,3 @@ bar {
|
||||||
|
inactive_workspace #32323200 #32323200 #5c5c5c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-
|
||||||
|
-include @sysconfdir@/sway/config.d/*
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user