Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #122995 from primeos/sway-install-default-wallpaper

authored by Patrick Hilhorst and committed by GitHub 5a14b59c cb4c8d3e

+31 -6
+2
nixos/modules/programs/sway.nix
··· 123 ]; 124 environment = { 125 systemPackages = [ swayPackage ] ++ cfg.extraPackages; 126 etc = { 127 "sway/config".source = mkOptionDefault "${swayPackage}/etc/sway/config"; 128 "sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" ''
··· 123 ]; 124 environment = { 125 systemPackages = [ swayPackage ] ++ cfg.extraPackages; 126 + # Needed for the default wallpaper: 127 + pathsToLink = [ "/share/backgrounds/sway" ]; 128 etc = { 129 "sway/config".source = mkOptionDefault "${swayPackage}/etc/sway/config"; 130 "sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" ''
+8 -6
pkgs/applications/window-managers/sway/default.nix
··· 22 }; 23 24 patches = [ 25 - ./sway-config-no-nix-store-references.patch 26 ./load-configuration-from-etc.patch 27 28 (substituteAll { 29 src = ./fix-paths.patch; 30 inherit swaybg; 31 }) 32 ]; 33 - 34 - postPatch = lib.optionalString isNixOS '' 35 - echo -e '\ninclude /etc/sway/config.d/*' >> config.in 36 - ''; 37 38 nativeBuildInputs = [ 39 meson ninja pkg-config wayland-scanner scdoc ··· 47 ]; 48 49 mesonFlags = [ 50 - "-Ddefault-wallpaper=false" 51 "-Dsd-bus-provider=libsystemd" 52 ] 53 ++ lib.optional (!enableXWayland) "-Dxwayland=disabled"
··· 22 }; 23 24 patches = [ 25 ./load-configuration-from-etc.patch 26 27 (substituteAll { 28 src = ./fix-paths.patch; 29 inherit swaybg; 30 }) 31 + ] ++ lib.optionals (!isNixOS) [ 32 + # References to /nix/store/... will get GC'ed which causes problems when 33 + # copying the default configuration: 34 + ./sway-config-no-nix-store-references.patch 35 + ] ++ lib.optionals isNixOS [ 36 + # Use /run/current-system/sw/share and /etc instead of /nix/store 37 + # references: 38 + ./sway-config-nixos-paths.patch 39 ]; 40 41 nativeBuildInputs = [ 42 meson ninja pkg-config wayland-scanner scdoc ··· 50 ]; 51 52 mesonFlags = [ 53 "-Dsd-bus-provider=libsystemd" 54 ] 55 ++ lib.optional (!enableXWayland) "-Dxwayland=disabled"
+21
pkgs/applications/window-managers/sway/sway-config-nixos-paths.patch
···
··· 1 + diff --git a/config.in b/config.in 2 + index 08703bef..f3872730 100644 3 + --- a/config.in 4 + +++ b/config.in 5 + @@ -22,8 +22,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec -- 6 + 7 + ### Output configuration 8 + # 9 + -# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) 10 + -output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill 11 + +# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) 12 + +output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill 13 + # 14 + # Example configuration: 15 + # 16 + @@ -214,4 +214,4 @@ bar { 17 + } 18 + } 19 + 20 + -include @sysconfdir@/sway/config.d/* 21 + +include /etc/sway/config.d/*