pkgs: sway-background-image: fetch image directly from source
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
59c4b89fd1
commit
c7a75452e7
5 changed files with 24 additions and 19 deletions
|
@ -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)
|
||||
|
|
|
@ -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 { };
|
||||
}
|
||||
|
|
23
pkgs/sway-background-image.nix
Normal file
23
pkgs/sway-background-image.nix
Normal file
|
@ -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
|
||||
'';
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 4.1 MiB |
|
@ -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
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue