summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/fetchWallpaper.nix
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-10-29 09:16:33 +0100
committerlassulus <git@lassul.us>2023-10-29 09:16:33 +0100
commit23d52de962f91cde3761645c57c301a294b9b7b6 (patch)
tree9308d4871e349ea5ed6b35f4037e53d6c30272f5 /krebs/3modules/fetchWallpaper.nix
parent61689ca4519e6415d7af7cd3910759c2da8115ec (diff)
remove deprecated fetchWallpaper
Diffstat (limited to 'krebs/3modules/fetchWallpaper.nix')
-rw-r--r--krebs/3modules/fetchWallpaper.nix95
1 files changed, 0 insertions, 95 deletions
diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix
deleted file mode 100644
index 0d67120fd..000000000
--- a/krebs/3modules/fetchWallpaper.nix
+++ /dev/null
@@ -1,95 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with import ../../lib/pure.nix { inherit lib; };
-
-let
- cfg = config.krebs.fetchWallpaper;
-
- out = {
- options.krebs.fetchWallpaper = api;
- config = lib.mkIf cfg.enable imp;
- };
-
- api = {
- enable = mkEnableOption "fetch wallpaper";
- url = mkOption {
- type = types.str;
- };
- timerConfig = mkOption {
- type = types.unspecified;
- default = {
- OnCalendar = "*:00,10,20,30,40,50";
- };
- };
- stateDir = mkOption {
- type = types.str;
- default = "/var/lib/wallpaper";
- };
- display = mkOption {
- type = types.str;
- default = ":${toString config.services.xserver.display}";
- };
- unitConfig = mkOption {
- type = types.attrsOf types.str;
- description = "Extra unit configuration for fetchWallpaper to define conditions and assertions for the unit";
- example = literalExample ''
- # do not start when running on umts
- { ConditionPathExists = "!/var/run/ppp0.pid"; }
- '';
- default = {};
- };
- };
-
- fetchWallpaperScript = pkgs.writers.writeDash "fetchWallpaper" ''
- set -euf
-
- mkdir -p ${cfg.stateDir}
- chmod o+rx ${cfg.stateDir}
- cd ${cfg.stateDir}
- (curl -s -o wallpaper.tmp -z wallpaper.tmp ${shell.escape cfg.url} && cp wallpaper.tmp wallpaper) || :
- feh --no-fehbg --bg-scale wallpaper
- '';
-
- imp = {
- users.users.fetchWallpaper = {
- name = "fetchWallpaper";
- uid = genid_uint31 "fetchWallpaper";
- description = "fetchWallpaper user";
- group = "fetchWallpaper";
- home = cfg.stateDir;
- createHome = true;
- isSystemUser = true;
- };
- users.groups.fetchWallpaper = {};
-
- systemd.timers.fetchWallpaper = {
- description = "fetch wallpaper timer";
- wantedBy = [ "timers.target" ];
-
- timerConfig = cfg.timerConfig;
- };
- systemd.services.fetchWallpaper = {
- description = "fetch wallpaper";
- after = [ "network.target" ];
-
- path = with pkgs; [
- curl
- feh
- ];
-
- environment = {
- URL = cfg.url;
- DISPLAY = cfg.display;
- };
- restartIfChanged = true;
-
- serviceConfig = {
- Type = "simple";
- ExecStart = fetchWallpaperScript;
- User = "fetchWallpaper";
- };
-
- unitConfig = cfg.unitConfig;
- };
- };
-in out