packages.desktop: auto add wallpaper

This commit is contained in:
2024-09-02 12:34:50 +08:00
parent 5d7dcd28de
commit 8180bb4792
3 changed files with 20 additions and 8 deletions

View File

@@ -204,5 +204,15 @@
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
src = let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{
nixos-wallpaper = pkgs.fetchgit
{
url = "https://git.chn.moe/chn/nixos-wallpaper.git";
rev = "1ad78b20b21c9f4f7ba5f4c897f74276763317eb";
sha256 = "0faahbzsr44bjmwr6508wi5hg59dfb57fzh5x6jh7zwmv4pzhqlb";
fetchLFS = true;
};
};
};
}

View File

@@ -95,13 +95,21 @@ inputs:
[{
config.programs =
{
plasma =
plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
plasmarc.Wallpapers.usersWallpapers.value =
let
inherit (inputs.topInputs.self.src) nixos-wallpaper;
isPicture = f: builtins.elem (inputs.lib.last (inputs.lib.splitString "." f))
[ "png" "jpg" "jpeg" "webp" ];
in builtins.concatStringsSep "," (builtins.map (f: "${nixos-wallpaper}/${f.name}")
(builtins.filter (f: (isPicture f.name) && (f.value == "regular"))
(inputs.localLib.attrsToList (builtins.readDir nixos-wallpaper))));
};
powerdevil =
let config =

View File

@@ -2,13 +2,7 @@ inputs:
{
config.home-manager.users.chn.config.programs.plasma.configFile =
let
nixos-wallpaper = inputs.pkgs.fetchgit
{
url = "https://git.chn.moe/chn/nixos-wallpaper.git";
rev = "1ad78b20b21c9f4f7ba5f4c897f74276763317eb";
sha256 = "0faahbzsr44bjmwr6508wi5hg59dfb57fzh5x6jh7zwmv4pzhqlb";
fetchLFS = true;
};
inherit (inputs.topInputs.self.src) nixos-wallpaper;
wallpaper =
{
pc = "${nixos-wallpaper}/pixiv-117612023.png";