refactor wallpaper

This commit is contained in:
EdenQwQ 2026-03-27 23:56:14 +08:00
parent c33286e661
commit f9ff6c6bc4
7 changed files with 68 additions and 53 deletions

58
flake.lock generated
View file

@ -626,11 +626,11 @@
]
},
"locked": {
"lastModified": 1771647911,
"narHash": "sha256-18liNHHwOmcaKCpOptE3wLW97fm5v7RTLiZBecX7km0=",
"lastModified": 1774584114,
"narHash": "sha256-uWR9fC+4NykFJVn4GN4Ini9LX+w8Llj7BnWKKp0N6bw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "436b27742c996b75e2baf8e835e3b3eae0c9fbd4",
"rev": "4b1be5c38be350ee9452a4847945ce71d950dc31",
"type": "github"
},
"original": {
@ -812,11 +812,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1771683761,
"narHash": "sha256-ZaASbpeFF3sQ8uJAheuuuDMnymqpLfrsyf3hr9B5CMM=",
"lastModified": 1774190104,
"narHash": "sha256-L/Ldq9G41Mj8WjWTuC+rePvWIx1A/tHdFpLbQmtrMSA=",
"owner": "niri-wm",
"repo": "niri",
"rev": "3b9f6ca062056348ef1a280716718d96c591246d",
"rev": "d06dd4b9e60fa07120c217aa095f3ed8caac99f2",
"type": "github"
},
"original": {
@ -1111,11 +1111,11 @@
},
"nixpkgs_14": {
"locked": {
"lastModified": 1774235121,
"narHash": "sha256-CzpSER+YKq4yD+RPom6Su9c/4FutF+sD4rEnls+4MyM=",
"lastModified": 1774595715,
"narHash": "sha256-8za7tFAK1nO2lqzLHYMPu+gmrBG9nN8UgvwOGMmOJfA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1116aed2cee959f7d054a462458513ad323b710a",
"rev": "5a48933708565662eb1309c018d6a9810016ae2a",
"type": "github"
},
"original": {
@ -1158,22 +1158,6 @@
}
},
"nixpkgs_17": {
"locked": {
"lastModified": 1770107345,
"narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_18": {
"locked": {
"lastModified": 1773821835,
"narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=",
@ -1189,7 +1173,7 @@
"type": "github"
}
},
"nixpkgs_19": {
"nixpkgs_18": {
"locked": {
"lastModified": 1761236834,
"narHash": "sha256-+pthv6hrL5VLW2UqPdISGuLiUZ6SnAXdd2DdUE+fV2Q=",
@ -1359,11 +1343,11 @@
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1774202718,
"narHash": "sha256-YueGGmJMHvGZfgQytc2Kbl9aJ31NSHG5nMpY4S1i+r4=",
"lastModified": 1774556355,
"narHash": "sha256-N131zILQ06ZNEvtgtjjFZ0N5qEI70rKKhCZsBcZoDH8=",
"owner": "noctalia-dev",
"repo": "noctalia-qs",
"rev": "807e330f5a42856f07e72197c4d4c22d7855b6c4",
"rev": "070340934ca374bc770fd500a0fd7b3210f06b1c",
"type": "github"
},
"original": {
@ -1380,11 +1364,11 @@
"noctalia-qs": "noctalia-qs"
},
"locked": {
"lastModified": 1774228269,
"narHash": "sha256-AfkJgTRKv/SGD+XTdeLHlWRNlUmA9nhdM/F/Tlde13k=",
"lastModified": 1774617741,
"narHash": "sha256-aZ1Su8zsIdls0C2uFxIBL/pD77lcAtPhuqlRlYyO5Jo=",
"owner": "noctalia-dev",
"repo": "noctalia-shell",
"rev": "3eb0fe56080777f3d74b66da08e6d9cf69361ad6",
"rev": "9b64e21bea819a3c6415874a982b4393b6244fdb",
"type": "github"
},
"original": {
@ -1396,7 +1380,7 @@
"nur": {
"inputs": {
"flake-parts": "flake-parts_5",
"nixpkgs": "nixpkgs_18"
"nixpkgs": "nixpkgs_17"
},
"locked": {
"lastModified": 1774246799,
@ -1922,7 +1906,11 @@
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": "nixpkgs_17"
"nixpkgs": [
"noctalia-shell",
"noctalia-qs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1772660329,
@ -1940,7 +1928,7 @@
},
"treefmt-nix_3": {
"inputs": {
"nixpkgs": "nixpkgs_19"
"nixpkgs": "nixpkgs_18"
},
"locked": {
"lastModified": 1762938485,

View file

@ -35,6 +35,8 @@
ALL_PROXY = "http://127.0.0.1:7890";
HTTP_PROXY = "http://127.0.0.1:7890";
HTTPS_PROXY = "http://127.0.0.1:7890";
http_PROXY = "http://127.0.0.1:7890";
https_PROXY = "http://127.0.0.1:7890";
NIXPKGS_ALLOW_UNFREE = "1";
NIXPKGS_ALLOW_INSECURE = "1";
};

View file

@ -30,7 +30,8 @@ let
// (
if path == null then
{
path = "${pkgs.wallpapers}/${name}";
path =
pkgs.wallpapers.byName.${name} or (throw "Wallpaper '${name}' not found in pkgs.wallpapers.byName");
}
else
{ inherit path; }

View file

@ -59,6 +59,11 @@ let
NetworkComparisonTest
rPackages.pls
rPackages.MASS
igraph
ggraph
tidygraph
corrr
relaimpo
(buildRPackage {
name = "eegUtils";
src = fetchFromGitHub {

View file

@ -33,7 +33,7 @@
input = {
focus-follows-mouse.enable = true;
touchpad.natural-scroll = false;
touchpad.dwt = false;
touchpad.dwt = true;
keyboard.xkb.options = "caps:escape";
};
environment = {

View file

@ -12,7 +12,7 @@
{
name = "frieren-butterflies-hydrogen.jpg";
baseImageName = "frieren-butterflies";
path = "${pkgs.wallpapers}/frieren-butterflies.jpg";
path = pkgs.wallpapers.byName."frieren-butterflies.jpg";
convertMethod = "lutgen";
effects = {
hydrogen = {
@ -45,7 +45,7 @@
{
name = "bangqiaoyan-girl-sky-hydrogen.jpg";
baseImageName = "bangqiaoyan-girl-sky";
path = "${pkgs.wallpapers}/bangqiaoyan-girl-sky.jpg";
path = pkgs.wallpapers.byName."bangqiaoyan-girl-sky.jpg";
convertMethod = "gonord";
effects.hydrogen.enable = true;
}

View file

@ -1,4 +1,8 @@
{ stdenvNoCC, fetchurl }:
{
stdenvNoCC,
fetchurl,
lib,
}:
let
wallpapers = [
{
@ -88,19 +92,34 @@ let
}
];
wallpaperSrcs = map fetchurl wallpapers;
mkWallpaper =
{
name,
url,
sha256,
}:
fetchurl {
inherit name url sha256;
};
byName = lib.listToAttrs (map (w: lib.nameValuePair w.name (mkWallpaper w)) wallpapers);
in
stdenvNoCC.mkDerivation {
name = "wallpapers";
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out
''
+ (
map (wallpaper: "ln -s ${wallpaper} $out/${wallpaper.name}") wallpaperSrcs
|> builtins.concatStringsSep "\n"
);
meta = {
description = "My wallpapers";
{
inherit byName;
inherit wallpapers;
all = stdenvNoCC.mkDerivation {
name = "wallpapers";
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out
''
+ (
lib.mapAttrsToList (name: path: "ln -s ${path} $out/${name}") byName |> lib.concatStringsSep "\n"
);
meta = {
description = "My wallpapers";
};
};
}