-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathupdate-all.nix
More file actions
76 lines (70 loc) · 2.13 KB
/
Copy pathupdate-all.nix
File metadata and controls
76 lines (70 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
lib,
nix-update,
writeShellApplication,
ngipkgs,
sources,
}:
(writeShellApplication {
name = "update-all";
meta.description = "updates all the NGIpkgs packages";
text =
let
skipped-packages = [
"atomic-browser" # -> atomic-server
"atomic-cli" # -> atomic-server
"firefox-meta-press" # -> meta-press
"inventaire" # -> inventaire-client
"kbin" # -> kbin-backend
"kbin-frontend" # -> kbin-backend
"openfire" # -> openfire-unwrapped
"pretalxFull" # -> pretalx
# FIX: needs custom update script
"_0wm-server"
"funkwhale"
"marginalia-search"
"peertube-plugins.livechat"
# FIX: don't update `sparql-queries` if there is no version change
"inventaire-client"
# fetcher not supported
"libervia-backend"
"libervia-desktop-kivy"
"libervia-media"
"libervia-templates"
# broken package
"libresoc-nmigen"
"libresoc-verilog"
# other issues
"kazarma"
"anastasis"
];
update-packages = lib.pipe ngipkgs [
(lib.filterAttrs (n: _: !lib.elem n skipped-packages)) # a pkg, a pkg set
(lib.flattenAttrs ".")
(lib.filterAttrs (n: _: !lib.elem n skipped-packages)) # a pkg, a pkg in a pkg set
(lib.filterAttrs (_: v: lib.isDerivation v))
];
update-commands = lib.concatMapAttrsStringSep "\n" (name: drv: ''
if ! update "${sources.nixpkgs}" "${lib.getExe nix-update}" "${name}" "$@"; then
echo "${name}" >> "$TMPDIR/failed_updates.txt"
logfile="${lib.getName drv}.log"
if [[ -f "$logfile" ]]; then
mv "$logfile" "$TMPDIR"
fi
fi
'') update-packages;
in
# bash
''
TMPDIR=$(mktemp -d)
echo -n> "$TMPDIR/failed_updates.txt"
${lib.readFile ./update.sh}
${update-commands}
if [ -s "$TMPDIR/failed_updates.txt" ]; then
echo -e "\nFailed to update the following packages:"
cat "$TMPDIR/failed_updates.txt"
else
echo "All packages updated successfully!"
fi
'';
})