phase 2: promote services/, tests/, patches/, lib/, scripts/
This commit is contained in:
78
lib/overlays.nix
Normal file
78
lib/overlays.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
final: prev: {
|
||||
ensureZfsMounts = prev.writeShellApplication {
|
||||
name = "zfsEnsureMounted";
|
||||
runtimeInputs = with prev; [
|
||||
zfs
|
||||
gawk
|
||||
coreutils
|
||||
];
|
||||
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
if [[ "$#" -eq "0" ]]; then
|
||||
echo "no arguments passed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MOUNTED=$(zfs list -o mountpoint,mounted -H | awk '$NF == "yes" {NF--; print}')
|
||||
|
||||
MISSING=""
|
||||
for target in "$@"; do
|
||||
if ! grep -Fxq "$target" <<< "$MOUNTED"; then
|
||||
MISSING="$MISSING $target"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "$MISSING" ]]; then
|
||||
echo "FAILURE, missing:$MISSING" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
reflac = prev.writeShellApplication {
|
||||
name = "reflac";
|
||||
runtimeInputs = with prev; [ flac ];
|
||||
excludeShellChecks = [ "2086" ];
|
||||
|
||||
text = builtins.readFile (
|
||||
prev.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/chungy/reflac/refs/heads/master/reflac";
|
||||
sha256 = "61c6cc8be3d276c6714e68b55e5de0e6491f50bbf195233073dbce14a1e278a7";
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
jellyfin-exporter = prev.buildGoModule rec {
|
||||
pname = "jellyfin-exporter";
|
||||
version = "unstable-2025-03-27";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "rebelcore";
|
||||
repo = "jellyfin_exporter";
|
||||
rev = "8e3970cb1bdf3cb21fac099c13072bb7c1b20cf9";
|
||||
hash = "sha256-wDnhepYj1MyLRZlwKfmwf4xiEEL3mgQY6V+7TnBd0MY=";
|
||||
};
|
||||
vendorHash = "sha256-e08u10e/wNapNZSsD/fGVN9ybMHe3sW0yDIOqI8ZcYs=";
|
||||
# upstream tests require a running Jellyfin instance
|
||||
doCheck = false;
|
||||
meta.mainProgram = "jellyfin_exporter";
|
||||
};
|
||||
|
||||
igpu-exporter = prev.buildGoModule rec {
|
||||
pname = "igpu-exporter";
|
||||
version = "unstable-2025-03-27";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "mike1808";
|
||||
repo = "igpu-exporter";
|
||||
rev = "db2dace1a895c2b950f6d3ba1a2e46729251d124";
|
||||
hash = "sha256-xWTiu26UzTZIK/6jeda+x6VePUgoWTS0AekejFdgFWs=";
|
||||
};
|
||||
vendorHash = "sha256-oeCSKwDKVwvYQ1fjXXTwQSXNl/upDE3WAAk680vqh3U=";
|
||||
subPackages = [ "cmd" ];
|
||||
postInstall = ''
|
||||
mv $out/bin/cmd $out/bin/igpu-exporter
|
||||
'';
|
||||
meta.mainProgram = "igpu-exporter";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user