changed cupsadmin

This commit is contained in:
2026-11-07 08:07:54 -05:00
parent f36234ea8c
commit b4ce55c151

View File

@@ -1,19 +1,24 @@
{ inputs, ... }: { inputs, pkgs, ... }:
let
cupsadminPkg = pkgs.fetchurl {
url = "https://github.com/kfattic/cupsadmin/releases/download/v1.4.1/cupsadmin-1.4.1.pkg";
hash = "sha256-DyIyDYSjAlcU7ivyfldMapIZw5nczEBXfnLicnK6k7Y=";
};
in
{ {
system.activationScripts.postActivation.text = '' system.activationScripts.postActivation.text = ''
stamp=/usr/local/share/cupsadmin.stamp want="${cupsadminPkg}"
want="${inputs.cupsadmin}" stamp=/usr/local/share/cupsadmin-pkg.stamp
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
echo "building cupsadmin..." echo "installing cupsadmin..."
tmp=$(mktmp -d) if /usr/sbin/installer -pkg "$want" -target /; then
cp -R "$want"/. "$tmp" mkdir -p /usr/local/share
chmod -R u+w "$tmp" echo "$want" > "$stamp"
( cd "$tmp" && /user/bin/swift build -c release ) \ else
&& install -m 755 "$tmp/.build/release/cupsadmin" /usr/local/bin/cupsadmin \ echo "cupsadmin install failed, skipping"
&& mkdir -p /usr/local/share && echo #$want" > "$stamp" \ fi
|| echo "cupsadmin build failed, skipping"
rm -rf "$tmp"
fi fi
''; '';