mirror of
https://github.com/EdenQwQ/nixos.git
synced 2025-12-26 10:14:58 +08:00
wallpapers as package
This commit is contained in:
parent
94f67cb98c
commit
1e92d162c8
7 changed files with 94 additions and 48 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/result
|
||||
|
|
@ -17,20 +17,7 @@ let
|
|||
else
|
||||
colorScheme;
|
||||
|
||||
wallpapers = config.wallpapers;
|
||||
|
||||
getImage =
|
||||
image:
|
||||
if builtins.typeOf image == "path" then
|
||||
image
|
||||
else
|
||||
pkgs.fetchurl {
|
||||
inherit (builtins.filter (wallpaper: wallpaper.name == image) wallpapers |> builtins.head)
|
||||
name
|
||||
url
|
||||
sha256
|
||||
;
|
||||
};
|
||||
getImage = image: if builtins.typeOf image == "path" then image else "${pkgs.wallpapers}/${image}";
|
||||
|
||||
matugenToBase16 =
|
||||
colorScheme:
|
||||
|
|
|
|||
|
|
@ -11,12 +11,19 @@ let
|
|||
getWallpaper =
|
||||
wallpaper:
|
||||
let
|
||||
wallpaperPkg = pkgs.fetchurl { inherit (wallpaper) name url sha256; };
|
||||
inherit (wallpaper) name path convertMethod;
|
||||
in
|
||||
{
|
||||
inherit (wallpaper) name convertMethod;
|
||||
path = "${wallpaperPkg}";
|
||||
};
|
||||
inherit name convertMethod;
|
||||
}
|
||||
// (
|
||||
if path == null then
|
||||
{
|
||||
path = "${pkgs.wallpapers}/${name}";
|
||||
}
|
||||
else
|
||||
{ inherit path; }
|
||||
);
|
||||
|
||||
getName =
|
||||
path:
|
||||
|
|
@ -26,7 +33,8 @@ let
|
|||
wallpaper:
|
||||
let
|
||||
inherit (wallpaper) path convertMethod;
|
||||
name = getName path;
|
||||
# name = getName path;
|
||||
name = match "(.*)\\..*" wallpaper.name |> head;
|
||||
live = (toString path |> match ".*gif$") != null;
|
||||
thisWallpaper = { inherit name path live; };
|
||||
in
|
||||
|
|
|
|||
|
|
@ -2,68 +2,46 @@
|
|||
wallpapers = [
|
||||
{
|
||||
name = "mygo-watch-tv.png";
|
||||
url = "https://i.imgur.com/FSneBN2.jpg";
|
||||
sha256 = "1pznrjx6rb8qm947q63dzkrmv188h3nrcp8cdmd7hs5gs30azfww";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "frieren-butterflies.jpg";
|
||||
url = "https://i.imgur.com/H1noDhu.jpg";
|
||||
sha256 = "0vypn9sxarv2gw42hs2haasyvzqyp02s6vaqygp9xbg59m0x2l73";
|
||||
convertMethod = "lutgen";
|
||||
}
|
||||
{
|
||||
name = "frieren-fire.jpg";
|
||||
url = "https://i.imgur.com/c3CWmia.jpg";
|
||||
sha256 = "0lgqwjl6jd1y84cz368s4sq0krzg67znqxirzapqxqvfdpn9rwbw";
|
||||
convertMethod = "lutgen";
|
||||
}
|
||||
{
|
||||
name = "anon-soyo.jpg";
|
||||
url = "https://i.imgur.com/koPV5sz.png";
|
||||
sha256 = "031s3v8fp5q2dm95wra898jq9l4i49wlwf97iah6bjqi5ihaxs2x";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "mygo-train.jpg";
|
||||
url = "https://i.imgur.com/OzR8c12.jpg";
|
||||
sha256 = "0fnwasnr19wfyhxa5yq7g3315d1641602x7fg8sv1qv95dlj55w2";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "green-blue-flowers.jpg";
|
||||
url = "https://i.imgur.com/Kvjqksw.jpg";
|
||||
sha256 = "1la4g50sxc940j9vcf7440l73ycx05z63dmpfq8xn0b746hzmnkq";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "bangqiaoyan-girl-sky.jpg";
|
||||
url = "https://i.imgur.com/qJ3ta1b.jpg";
|
||||
sha256 = "1chzklk6j893fdxhp0jhjwgwyhg3p6hjrgrrr5fw8gkllx91sx5w";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "morncolour-pink-landscape.png";
|
||||
url = "https://i.imgur.com/BBzCYYQ.png";
|
||||
sha256 = "14kjc7zipbwvswjbkzqk4781as6pn31naq26nxknzhmr4z5rhzci";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "jiaocha-girl-sea.jpg";
|
||||
url = "https://i.imgur.com/LBowln5.jpeg";
|
||||
sha256 = "0agpr2z7v6q77ypgfsl6b57gac7ncrgf1fh0b5g7g0a53mzib5hm";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "muji-monochrome.jpg";
|
||||
url = "https://i.imgur.com/F2h7rsD.jpg";
|
||||
sha256 = "02q0wd2xpyjfiifmrsf6sg1ja3zlb9514g98w156f7jdpw2c9ppb";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
{
|
||||
name = "zzzzoka-gbc.jpg";
|
||||
url = "https://i.imgur.com/qE6Pr45.jpg";
|
||||
sha256 = "1li5ypdvlvdpihiplf5mjj0lvf9gbcwyjslpxgla6wz0fzrwnvgi";
|
||||
convertMethod = "gonord";
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -9,13 +9,10 @@ let
|
|||
type = str;
|
||||
description = "Name of the wallpaper";
|
||||
};
|
||||
url = mkOption {
|
||||
type = str;
|
||||
description = "URL of the wallpaper";
|
||||
};
|
||||
sha256 = mkOption {
|
||||
type = str;
|
||||
description = "SHA256 of the wallpaper";
|
||||
path = mkOption {
|
||||
type = nullOr path;
|
||||
description = "Path to the wallpaper, ${pkgs.wallpapers}/name by default";
|
||||
default = null;
|
||||
};
|
||||
convertMethod = mkOption {
|
||||
type = str;
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@
|
|||
custom-colorschemes = pkgs.callPackage ./customColorSchemes { };
|
||||
fiz = pkgs.callPackage ./fiz.nix { };
|
||||
hellwm = pkgs.callPackage ./hellwm.nix { };
|
||||
wallpapers = pkgs.callPackage ./wallpapers.nix { };
|
||||
}
|
||||
|
|
|
|||
74
pkgs/wallpapers.nix
Normal file
74
pkgs/wallpapers.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ stdenvNoCC, fetchurl }:
|
||||
let
|
||||
wallpapers = [
|
||||
{
|
||||
name = "mygo-watch-tv.png";
|
||||
url = "https://i.imgur.com/FSneBN2.jpg";
|
||||
sha256 = "1pznrjx6rb8qm947q63dzkrmv188h3nrcp8cdmd7hs5gs30azfww";
|
||||
}
|
||||
{
|
||||
name = "frieren-butterflies.jpg";
|
||||
url = "https://i.imgur.com/H1noDhu.jpg";
|
||||
sha256 = "0vypn9sxarv2gw42hs2haasyvzqyp02s6vaqygp9xbg59m0x2l73";
|
||||
}
|
||||
{
|
||||
name = "frieren-fire.jpg";
|
||||
url = "https://i.imgur.com/c3CWmia.jpg";
|
||||
sha256 = "0lgqwjl6jd1y84cz368s4sq0krzg67znqxirzapqxqvfdpn9rwbw";
|
||||
}
|
||||
{
|
||||
name = "anon-soyo.jpg";
|
||||
url = "https://i.imgur.com/koPV5sz.png";
|
||||
sha256 = "031s3v8fp5q2dm95wra898jq9l4i49wlwf97iah6bjqi5ihaxs2x";
|
||||
}
|
||||
{
|
||||
name = "mygo-train.jpg";
|
||||
url = "https://i.imgur.com/OzR8c12.jpg";
|
||||
sha256 = "0fnwasnr19wfyhxa5yq7g3315d1641602x7fg8sv1qv95dlj55w2";
|
||||
}
|
||||
{
|
||||
name = "green-blue-flowers.jpg";
|
||||
url = "https://i.imgur.com/Kvjqksw.jpg";
|
||||
sha256 = "1la4g50sxc940j9vcf7440l73ycx05z63dmpfq8xn0b746hzmnkq";
|
||||
}
|
||||
{
|
||||
name = "bangqiaoyan-girl-sky.jpg";
|
||||
url = "https://i.imgur.com/qJ3ta1b.jpg";
|
||||
sha256 = "1chzklk6j893fdxhp0jhjwgwyhg3p6hjrgrrr5fw8gkllx91sx5w";
|
||||
}
|
||||
{
|
||||
name = "morncolour-pink-landscape.png";
|
||||
url = "https://i.imgur.com/BBzCYYQ.png";
|
||||
sha256 = "14kjc7zipbwvswjbkzqk4781as6pn31naq26nxknzhmr4z5rhzci";
|
||||
}
|
||||
{
|
||||
name = "jiaocha-girl-sea.jpg";
|
||||
url = "https://i.imgur.com/LBowln5.jpeg";
|
||||
sha256 = "0agpr2z7v6q77ypgfsl6b57gac7ncrgf1fh0b5g7g0a53mzib5hm";
|
||||
}
|
||||
{
|
||||
name = "muji-monochrome.jpg";
|
||||
url = "https://i.imgur.com/F2h7rsD.jpg";
|
||||
sha256 = "02q0wd2xpyjfiifmrsf6sg1ja3zlb9514g98w156f7jdpw2c9ppb";
|
||||
}
|
||||
{
|
||||
name = "zzzzoka-gbc.jpg";
|
||||
url = "https://i.imgur.com/qE6Pr45.jpg";
|
||||
sha256 = "1li5ypdvlvdpihiplf5mjj0lvf9gbcwyjslpxgla6wz0fzrwnvgi";
|
||||
}
|
||||
];
|
||||
|
||||
wallpaperSrcs = map fetchurl wallpapers;
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "wallpapers";
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out
|
||||
''
|
||||
+ (
|
||||
map (wallpaper: "ln -s ${wallpaper} $out/${wallpaper.name}") wallpaperSrcs
|
||||
|> builtins.concatStringsSep "\n"
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue