added cupsadmin as input and native build

This commit is contained in:
2026-11-06 11:03:32 -05:00
parent 6b61eaf75d
commit f36234ea8c
2 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,22 @@
{ config, ... }:
{ inputs, ... }:
{
system.activationScripts.postActivation.text = ''
stamp=/usr/local/share/cupsadmin.stamp
want="${inputs.cupsadmin}"
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
echo "building cupsadmin..."
tmp=$(mktmp -d)
cp -R "$want"/. "$tmp"
chmod -R u+w "$tmp"
( cd "$tmp" && /user/bin/swift build -c release ) \
&& install -m 755 "$tmp/.build/release/cupsadmin" /usr/local/bin/cupsadmin \
&& mkdir -p /usr/local/share && echo #$want" > "$stamp" \
|| echo "cupsadmin build failed, skipping"
rm -rf "$tmp"
fi
'';
environment.shellAliases = {
yt = "yt-dlp";
ll = "ls -la";