mbp
This commit is contained in:
36
modules/nixos/wallpaper/options.nix
Normal file
36
modules/nixos/wallpaper/options.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib.${namespace}) mkOpt;
|
||||
|
||||
# Default fallback wallpaper (included in the system)
|
||||
defaultWallpaper = pkgs.runCommand "default-wallpaper" { } ''
|
||||
mkdir -p $out
|
||||
cp ${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nix-wallpaper-nineish-dark-gray.png $out/default.jpg
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.${namespace}.wallpaper = {
|
||||
enable = mkEnableOption "shared wallpaper management (download, symlink, and boot integration)";
|
||||
|
||||
source = mkOpt (types.enum [
|
||||
"bing"
|
||||
"nasa"
|
||||
]) "bing" "Source for the wallpaper (bing or nasa)";
|
||||
|
||||
path = mkOpt types.path "/var/lib/wallpapers/current.jpg" "Path to the active wallpaper file";
|
||||
|
||||
dir = mkOpt types.path "/var/lib/wallpapers" "Directory where wallpapers are stored";
|
||||
|
||||
defaultWallpaper = mkOpt types.path "${defaultWallpaper}/default.jpg" "Default fallback wallpaper";
|
||||
|
||||
reloadCommand =
|
||||
mkOpt (types.nullOr types.str) null
|
||||
"Optional shell command run after downloading a new wallpaper to notify the desktop environment. If null, no reload command is run.";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user