22 lines
516 B
Nix
22 lines
516 B
Nix
{ lib, config, ... }:
|
|
|
|
let
|
|
# Path to your source folder of wallpapers
|
|
wallpaperSrc = ./Wallpapers;
|
|
|
|
# Read all file names in that directory
|
|
names = lib.attrNames (builtins.readDir wallpaperSrc);
|
|
|
|
# For each name, produce an attrset mapping
|
|
wallpaperFiles = map (name: {
|
|
# quoted string keys are valid attribute names
|
|
"Pictures/wallpapers/${name}" = {
|
|
source = "${wallpaperSrc}/${name}";
|
|
};
|
|
}) names;
|
|
in
|
|
{
|
|
# Merge them all under home.file
|
|
home.file = lib.mkMerge wallpaperFiles;
|
|
}
|