diff --git a/users/simon/modules/sway.nix b/users/simon/modules/sway.nix index b476ed6..c6821f8 100644 --- a/users/simon/modules/sway.nix +++ b/users/simon/modules/sway.nix @@ -3,7 +3,33 @@ let common = import ./common.nix; solarized = common.colorschemes.solarized; - wallpaper = "${config.xdg.configHome}/sway/wallpaper"; # Symlink to the current wallpaper + wallpaper = pkgs.stdenv.mkDerivation { + name = "wallpaper"; + + src = pkgs.fetchurl { + url = "https://i.pximg.net/img-original/img/2013/10/22/04/25/37/39266182_p0.jpg"; + sha256 = "053gc9jd4cbkkwgcirrhpzbn933dfh83l30p1sz55m5d8zx1lk65"; + curlOpts = "--referer https://pixiv.net"; + }; + + nativeBuildInputs = [ + pkgs.unstable.waifu2x-converter-cpp + ]; + + # -o $out does not work (why?) + buildPhase = '' + waifu2x-converter-cpp -i $src -o wallpaper.png + ''; + + installPhase = '' + cp wallpaper.png $out + ''; + + dontUnpack = true; + dontConfigure = true; + dontFixup = true; + }; + cfg = config.wayland.windowManager.sway.config; thinsp = " "; in