diff options
Diffstat (limited to 'custom/run-opossum@bragi.nix')
-rw-r--r-- | custom/run-opossum@bragi.nix | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/custom/run-opossum@bragi.nix b/custom/run-opossum@bragi.nix deleted file mode 100644 index 34452ef7..00000000 --- a/custom/run-opossum@bragi.nix +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | { stdenv | ||
2 | , zsh | ||
3 | , findutils | ||
4 | , coreutils | ||
5 | , makeWrapper | ||
6 | , wombat | ||
7 | , opossum | ||
8 | }: | ||
9 | |||
10 | let | ||
11 | version = "0.0.0"; | ||
12 | in stdenv.mkDerivation { | ||
13 | name = "run-opossum-${version}"; | ||
14 | buildInputs = [ makeWrapper ]; | ||
15 | src = builtins.toFile name '' | ||
16 | #!${zsh}/bin/zsh | ||
17 | |||
18 | oversized() { | ||
19 | l=$(du -BG -s -t 75 $BEUTEL | wc -l) | ||
20 | [[ $l -ge 1 ]] | ||
21 | } | ||
22 | |||
23 | echo "Started $(date)" > $LOGFILE | ||
24 | opossum &>> $LOGFILE | ||
25 | |||
26 | wombat search "(not (seen or hidden)) and (not forced)" | \ | ||
27 | xargs -r -n 1 -d '\n' -- wombat force \ | ||
28 | &>> $LOGFILE | ||
29 | |||
30 | find $BEUTEL -type f -iname '*.tgz.bak' -delete | ||
31 | |||
32 | if oversized; then | ||
33 | wombat search "(seen or hidden) and forced" | \ | ||
34 | while (read file && oversized); do | ||
35 | wombat reset $file | ||
36 | find $BEUTEL -type f -iname '*.tgz.bak' -delete | ||
37 | done | ||
38 | |||
39 | wombat search "seen or hidden" | \ | ||
40 | while (read file && oversized); do | ||
41 | wombat delete $file | ||
42 | size=$(du -BG $BEUTEL) | ||
43 | done | ||
44 | fi | ||
45 | |||
46 | echo "Ended $(date)" >> $LOGFILE | ||
47 | ''; | ||
48 | phases = [ "buildPhase" | ||
49 | "installPhase" | ||
50 | ]; | ||
51 | buildPhase = '' | ||
52 | cp -prd --no-preserve=timestamps $src run-opossum | ||
53 | ''; | ||
54 | installPhase = '' | ||
55 | mkdir -p $out/bin | ||
56 | cp run-opossum.sh $out/bin | ||
57 | chmod +x $out/bin/run-opossum | ||
58 | wrapProgram $out/bin/run-opossum \ | ||
59 | --prefix PATH : ${wombat}/bin \ | ||
60 | --prefix PATH : ${opossum}/bin \ | ||
61 | --prefix PATH : ${findutils}/bin \ | ||
62 | --prefix PATH : ${coreutils}/bin \ | ||
63 | --set BEUTEL $HOME/.beutel \ | ||
64 | --set LOGFILE $HOME/.last_opossum.log | ||
65 | ''; | ||
66 | } | ||