summaryrefslogtreecommitdiff
path: root/pkgs/static/wallpapers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/static/wallpapers')
-rw-r--r--pkgs/static/wallpapers/default.nix22
-rw-r--r--pkgs/static/wallpapers/sources.json12
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/static/wallpapers/default.nix b/pkgs/static/wallpapers/default.nix
new file mode 100644
index 0000000..4abeb38
--- /dev/null
+++ b/pkgs/static/wallpapers/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, imagemagick, lib }:
+
+let
+ fetchWallpaper =
+ { name, url, sha256, resolution ? "1920x1080", offset ? "0x0" }:
+ stdenv.mkDerivation {
+ inherit name;
+ src = fetchurl {
+ inherit url sha256;
+ };
+ buildInputs = [ imagemagick ];
+ phases = [ "unpackPhase" ];
+ unpackPhase = ''
+ convert "$src" -resize "${resolution}^" \
+ -crop "${resolution}+${offset}" \
+ "$out"
+ '';
+ };
+ sources = lib.importJSON ./sources.json;
+in {
+ fetcher = fetchWallpaper;
+} // builtins.mapAttrs (_: fetchWallpaper) sources
diff --git a/pkgs/static/wallpapers/sources.json b/pkgs/static/wallpapers/sources.json
new file mode 100644
index 0000000..a3c104a
--- /dev/null
+++ b/pkgs/static/wallpapers/sources.json
@@ -0,0 +1,12 @@
+{
+ "artic-1942-51": {
+ "name": "Nighthawks_by_Edward_Hopper_1942.jpg",
+ "url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Nighthawks_by_Edward_Hopper_1942.jpg",
+ "sha256": "Rzp2AoAvjoB5t2elzSv+Eg6978tzviPyCbxLq2oIU6E="
+ },
+ "nga-1973-68-1": {
+ "name": "La_vallée_de_Riaux_près_de_l'Estaque,_par_Paul_Cézanne,_NGA.jpg",
+ "url": "https://upload.wikimedia.org/wikipedia/commons/8/89/La_vall%C3%A9e_de_Riaux_pr%C3%A8s_de_l%27Estaque%2C_par_Paul_C%C3%A9zanne%2C_NGA.jpg",
+ "sha256": "F3FPz0dmyxMk9BzV9DabGkECLbYBAIH96a5KOivvrak="
+ }
+}