1
0
Fork 0
mirror of https://github.com/NixOS/nixos-artwork synced 2024-10-18 14:32:43 -04:00
nixos-artwork/gnome/default.nix

36 lines
874 B
Nix
Raw Normal View History

{ pkgs }:
rec {
mkBackgroundProperties = { backgroundName, backgroundFile }:
pkgs.substituteAll {
name = "${backgroundName}.xml";
src = ./share/gnome-background-properties/template.xml.in;
inherit backgroundName backgroundFile;
};
mkBackgroundOverride = { name, background }:
pkgs.writeTextFile {
inherit name;
destination = "/share/gsettings-schemas/${name}/org.gnome.desktop.background.nixos.gschema.override";
text = ''
[org.gnome.desktop.background]
picture-uri='file://${background}'
'';
};
mkBackground = { backgroundName, backgroundFile }: rec {
properties = mkBackgroundProperties {
inherit backgroundName backgroundFile;
};
gsettings = mkBackgroundOverride {
name = "nixos-${backgroundName}-background";
background = properties;
};
};
}