Ease writeShellApplication calls

Provide proper runtimeInputs instead of using nix variables all the
time.
This commit is contained in:
Daniel Siepmann 2022-05-31 18:54:47 +02:00
parent cd63d01702
commit 21573b25f5
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 28 additions and 6 deletions

View file

@ -8,8 +8,14 @@
writeShellApplication {
name = "custom-backup";
runtimeInputs = [
borgbackup
rsync
git
];
text = ''
${borgbackup}/bin/borg create \
borg create \
-v \
--progress \
--stats \
@ -17,11 +23,11 @@ writeShellApplication {
/media/daniels/Backup/borg::"$(date +%F-%R)" \
~/
${rsync}/bin/rsync -az ~/.config/nixpkgs /media/daniels/Backup/
rsync -az ~/.config/nixpkgs /media/daniels/Backup/
sudo ${rsync}/bin/rsync -az /etc/.git /media/daniels/Backup/etc/
sudo chown daniels:daniels -R /media/daniels/Backup/etc/
cd /media/daniels/Backup/etc/
${git}/bin/git reset --hard master
git reset --hard master
'';
}

View file

@ -2,7 +2,9 @@
writeShellApplication,
dmenu,
dunst,
bc
bc,
firefox,
i3
}:
let
@ -58,6 +60,7 @@ let
name = "dmenu-custom-scripts-system";
runtimeInputs = [
i3
dmenu
dunst
];
@ -70,6 +73,7 @@ let
runtimeInputs = [
dmenu
firefox
];
text = ''

View file

@ -1,8 +1,15 @@
{ writeShellApplication }:
{
writeShellApplication,
git
}:
writeShellApplication {
name = "custom-push-etckeeper";
runtimeInputs = [
git
];
text = ''
mkdir /tmp/etckeeper
cd /tmp/etckeeper

View file

@ -10,7 +10,12 @@ let
in writeShellApplication {
name = "sqlformat";
runtimeInputs = [
python
];
text = ''
${python}/bin/python3 -m sqlparse --keywords upper --identifiers lower --reindent_aligned --indent_width 4 <(cat -)
python3 -m sqlparse --keywords upper --identifiers lower --reindent_aligned --indent_width 4 <(cat -)
'';
}