This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

init fetchWallpaper

+83 -7
-1
2configs/default.nix
··· 19 19 self.inputs.stockholm.nixosModules.exim 20 20 self.inputs.stockholm.nixosModules.exim-retiolum 21 21 self.inputs.stockholm.nixosModules.tinc 22 - self.inputs.stockholm.nixosModules.fetchWallpaper 23 22 self.inputs.stockholm.nixosModules.iptables 24 23 self.inputs.stockholm.nixosModules.power-action 25 24 self.inputs.stockholm.nixosModules.setuid
+2 -6
2configs/fetchWallpaper.nix
··· 1 - { config, pkgs, ... }: 2 - 3 - let 4 - 5 - in { 6 - krebs.fetchWallpaper = { 1 + { 2 + lass.fetchWallpaper = { 7 3 enable = true; 8 4 url = "http://wallpaper.r/realwallpaper-krebs-stars-berlin.png"; 9 5 };
+1
3modules/default.nix
··· 9 9 ./nichtparasoup.nix 10 10 ./screenlock.nix 11 11 ./usershadow.nix 12 + ./fetchWallpaper.nix 12 13 ]; 13 14 }
+80
3modules/fetchWallpaper.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + let 4 + cfg = config.lass.fetchWallpaper; 5 + 6 + fetchWallpaperScript = pkgs.writers.writeDash "fetchWallpaper" '' 7 + set -euf 8 + 9 + mkdir -p ${cfg.stateDir} 10 + chmod o+rx ${cfg.stateDir} 11 + cd ${cfg.stateDir} 12 + (curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg cfg.url} && cp wallpaper.tmp wallpaper) || : 13 + feh --no-fehbg --bg-scale wallpaper 14 + ''; 15 + 16 + in { 17 + options.lass.fetchWallpaper = { 18 + enable = lib.mkEnableOption "fetch wallpaper"; 19 + url = lib.mkOption { 20 + type = lib.types.str; 21 + }; 22 + timerConfig = lib.mkOption { 23 + type = lib.types.unspecified; 24 + default = { 25 + OnCalendar = "*:00,10,20,30,40,50"; 26 + }; 27 + }; 28 + stateDir = lib.mkOption { 29 + type = lib.types.str; 30 + default = "/var/lib/wallpaper"; 31 + }; 32 + display = lib.mkOption { 33 + type = lib.types.str; 34 + default = ":${toString config.services.xserver.display}"; 35 + }; 36 + unitConfig = lib.mkOption { 37 + type = lib.types.attrsOf lib.types.str; 38 + description = "Extra unit configuration for fetchWallpaper to define conditions and assertions for the unit"; 39 + example = lib.literalExample '' 40 + # do not start when running on umts 41 + { ConditionPathExists = "!/var/run/ppp0.pid"; } 42 + ''; 43 + default = {}; 44 + }; 45 + }; 46 + 47 + config = { 48 + systemd.timers.fetchWallpaper = { 49 + description = "fetch wallpaper timer"; 50 + wantedBy = [ "timers.target" ]; 51 + 52 + timerConfig = cfg.timerConfig; 53 + }; 54 + systemd.services.fetchWallpaper = { 55 + description = "fetch wallpaper"; 56 + after = [ "network.target" ]; 57 + 58 + path = with pkgs; [ 59 + curl 60 + feh 61 + ]; 62 + 63 + environment = { 64 + URL = cfg.url; 65 + DISPLAY = cfg.display; 66 + }; 67 + restartIfChanged = true; 68 + 69 + serviceConfig = { 70 + Type = "simple"; 71 + ExecStart = fetchWallpaperScript; 72 + User = "fetchWallpaper"; 73 + StateDirectory = true; 74 + StateDirectoryMode = "0755"; 75 + }; 76 + 77 + unitConfig = cfg.unitConfig; 78 + }; 79 + }; 80 + }