42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{ 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";
|
|
};
|
|
|
|
environment.etc."gitconfig".text = ''
|
|
[user]
|
|
name = Brian Nelson
|
|
email = brian@briannelson.dev
|
|
[init]
|
|
defaultBranch = main
|
|
'';
|
|
|
|
environment.etc."yt-dlp.conf".text = ''
|
|
-o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s
|
|
--no-mtime
|
|
--restrict-filenames
|
|
--embed-thumbnails
|
|
--embed-metadata
|
|
--format "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
|
|
--merge-output-format mp4
|
|
'';
|
|
} |