nixos/modules/desktop/dms/background.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2025-02-20 22:50:06 +01:00
{
2025-12-12 04:02:55 +01:00
config,
2025-02-20 22:50:06 +01:00
lib,
2025-12-12 04:02:55 +01:00
pkgs,
2025-02-20 22:50:06 +01:00
...
}: let
background = pkgs.stdenvNoCC.mkDerivation {
pname = "desktop-background";
2025-03-12 08:00:05 +01:00
version = "0.2";
2025-02-20 22:50:06 +01:00
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
2025-03-12 08:00:05 +01:00
./backgrounds/geometry.svg
./backgrounds/unknown.svg
2025-02-20 22:50:06 +01:00
];
};
nativeBuildInputs = [pkgs.inkscape];
buildPhase = ''
2025-03-12 08:00:05 +01:00
inkscape -w 3840 -h 2160 backgrounds/geometry.svg -o geometry.png
inkscape -w 3840 -h 2160 backgrounds/unknown.svg -o unknown.png
2025-02-20 22:50:06 +01:00
'';
installPhase = ''
mkdir -p $out/share/backgrounds
cp *.svg *.png $out/share/backgrounds
'';
};
unknownPng = background + "/share/backgrounds/unknown.png";
geometryPng = background + "/share/backgrounds/geometry.png";
2025-03-12 08:00:05 +01:00
pngs = [
unknownPng
geometryPng
2025-03-12 08:00:05 +01:00
];
2025-02-20 22:50:06 +01:00
in {
2025-12-12 04:02:55 +01:00
config = lib.mkIf config.fireproof.desktop.enable {
fireproof.home-manager = {
# Use hyprpaper as we can't currently set wallpapers through DMS
services.hyprpaper = {
enable = true;
settings = {
preload = pngs;
wallpaper = [",${builtins.head pngs}"];
};
2025-02-20 22:50:06 +01:00
};
2026-01-19 17:44:37 +01:00
programs.dank-material-shell.settings = {
2025-12-12 04:02:55 +01:00
# Disables wallpaper management in DMS to avoid conflicts with Hyprpaper
screenPreferences.wallpaper = [];
};
2026-01-19 17:44:37 +01:00
programs.dank-material-shell.session = {
2025-12-12 04:02:55 +01:00
# Attempt to set a default wallpaper on first run
wallpaperPath = unknownPng;
};
};
2025-02-20 22:50:06 +01:00
};
}