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 { writeShellApplication {
name = "custom-backup"; name = "custom-backup";
runtimeInputs = [
borgbackup
rsync
git
];
text = '' text = ''
${borgbackup}/bin/borg create \ borg create \
-v \ -v \
--progress \ --progress \
--stats \ --stats \
@ -17,11 +23,11 @@ writeShellApplication {
/media/daniels/Backup/borg::"$(date +%F-%R)" \ /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 ${rsync}/bin/rsync -az /etc/.git /media/daniels/Backup/etc/
sudo chown daniels:daniels -R /media/daniels/Backup/etc/ sudo chown daniels:daniels -R /media/daniels/Backup/etc/
cd /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, writeShellApplication,
dmenu, dmenu,
dunst, dunst,
bc bc,
firefox,
i3
}: }:
let let
@ -58,6 +60,7 @@ let
name = "dmenu-custom-scripts-system"; name = "dmenu-custom-scripts-system";
runtimeInputs = [ runtimeInputs = [
i3
dmenu dmenu
dunst dunst
]; ];
@ -70,6 +73,7 @@ let
runtimeInputs = [ runtimeInputs = [
dmenu dmenu
firefox
]; ];
text = '' text = ''

View file

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

View file

@ -10,7 +10,12 @@ let
in writeShellApplication { in writeShellApplication {
name = "sqlformat"; name = "sqlformat";
runtimeInputs = [
python
];
text = '' 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 -)
''; '';
} }