alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
fetchWallpaper: update user & script
author
lassulus
date
2 years ago
(Dec 5, 2023, 8:42 PM CET)
commit
9e83d9e1
9e83d9e1d698e4262bc0060b6f67b07fe34ec9ac
parent
a243d557
a243d557ea0b21ea5340aacbdb20bec992371c83
+10
-11
1 changed file
Expand all
Collapse all
Unified
Split
3modules
fetchWallpaper.nix
+10
-11
3modules/fetchWallpaper.nix
View file
Reviewed
···
4
4
cfg = config.lass.fetchWallpaper;
5
5
6
6
fetchWallpaperScript = pkgs.writers.writeDash "fetchWallpaper" ''
7
7
-
set -euf
7
7
+
set -eufx
8
8
9
9
-
mkdir -p ${cfg.stateDir}
10
10
-
chmod o+rx ${cfg.stateDir}
11
11
-
cd ${cfg.stateDir}
12
12
-
(curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg cfg.url} && cp wallpaper.tmp wallpaper) || :
9
9
+
curl -v -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg cfg.url} && cp wallpaper.tmp wallpaper
13
10
feh --no-fehbg --bg-scale wallpaper
14
11
'';
15
12
···
24
21
default = {
25
22
OnCalendar = "*:00,10,20,30,40,50";
26
23
};
27
27
-
};
28
28
-
stateDir = lib.mkOption {
29
29
-
type = lib.types.str;
30
30
-
default = "/var/lib/wallpaper";
31
24
};
32
25
display = lib.mkOption {
33
26
type = lib.types.str;
···
69
62
serviceConfig = {
70
63
Type = "simple";
71
64
ExecStart = fetchWallpaperScript;
72
72
-
User = "fetchWallpaper";
73
73
-
StateDirectory = true;
65
65
+
StateDirectory = "wallpaper";
74
66
StateDirectoryMode = "0755";
67
67
+
WorkingDirectory = "/var/lib/wallpaper";
75
68
};
76
69
77
70
unitConfig = cfg.unitConfig;
78
71
};
72
72
+
73
73
+
users.users.wallpaper = {
74
74
+
isSystemUser = true;
75
75
+
group = "wallpaper";
76
76
+
};
77
77
+
users.groups.wallpaper = {};
79
78
};
80
79
}