add nicer + tmuxbash

This commit is contained in:
2024-02-05 09:19:16 +02:00
committed by Motiejus Jakštys
parent e5736c67b9
commit eeaed5f3ab
5 changed files with 52 additions and 27 deletions

28
pkgs/nicer.nix Normal file
View File

@@ -0,0 +1,28 @@
{
coreutils,
writeShellApplication,
}:
writeShellApplication {
name = "nicer";
text = ''
f=$(${coreutils}/bin/mktemp)
trap '${coreutils}/bin/rm -f "$f"' EXIT
${coreutils}/bin/env > "$f"
systemd-run \
--user \
--same-dir \
--slice nicer \
--nice=19 \
--property CPUSchedulingPolicy=idle \
--property IOSchedulingClass=idle \
--property IOSchedulingPriority=7 \
--pty \
--pipe \
--wait \
--collect \
--quiet \
--property EnvironmentFile="$f" \
--service-type=exec \
-- "$@"
'';
}

13
pkgs/tmuxbash.nix Normal file
View File

@@ -0,0 +1,13 @@
{
tmux,
bash,
writeShellApplication,
...
}:
writeShellApplication {
name = "tmuxbash";
text = ''
${tmux}/bin/tmux
${bash}/bin/bash
'';
}