diff --git a/README.md b/README.md index 2cbb8a7..90902b1 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,3 @@ ## License The code is released into the public domain. - -Other conditions apply to the following files: - -- `pkgs/sway-background-image/background.jpg`: [Photo](https://unsplash.com/photos/wQLAGv4_OYs) by [Lucas Kapla](https://unsplash.com/@aznbokchoy), [Unsplash License](https://unsplash.com/license) diff --git a/pkgs/default.nix b/pkgs/default.nix index 48f2bce..30f350a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -7,5 +7,5 @@ _: super: git-multi-shortlog = super.callPackage ./git-multi-shortlog.nix { }; homer = super.callPackage ./homer { }; neomutt-export-patches = super.callPackage ./neomutt-export-patches.nix { }; - sway-background-image = super.callPackage ./sway-background-image { }; + sway-background-image = super.callPackage ./sway-background-image.nix { }; } diff --git a/pkgs/sway-background-image.nix b/pkgs/sway-background-image.nix new file mode 100644 index 0000000..9e0e9d9 --- /dev/null +++ b/pkgs/sway-background-image.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, imagemagick }: + +stdenv.mkDerivation rec { + pname = "sway-background-image"; + version = "0.1"; + + src = fetchurl { + url = "https://images.unsplash.com/photo-1541701494587-cb58502866ab"; + hash = "sha256-qFD7FFqY2l2Fsev/YPu1/f7f29BntxsO1ezJj2BlMs8="; + }; + + dontUnpack = true; + + nativeBuildInputs = [ imagemagick ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/share + # significantly reduces image size, 4.8MiB -> 1.7MiB + convert -quality 90 -resize 4096x $src $out/share/background.jpg + runHook postInstall + ''; +} diff --git a/pkgs/sway-background-image/background.jpg b/pkgs/sway-background-image/background.jpg deleted file mode 100644 index 0eda98e..0000000 Binary files a/pkgs/sway-background-image/background.jpg and /dev/null differ diff --git a/pkgs/sway-background-image/default.nix b/pkgs/sway-background-image/default.nix deleted file mode 100644 index 5651835..0000000 --- a/pkgs/sway-background-image/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ stdenv }: - -stdenv.mkDerivation rec { - pname = "sway-background-image"; - version = "0.1"; - dontUnpack = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share - cp -v ${./background.jpg} $out/share/background.jpg - runHook postInstall - ''; -}