From f426085c433d9686c96cae62af7ff276f6f4bcd0 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Mon, 30 Sep 2024 17:57:30 +0200 Subject: [PATCH] evil?? --- README.md | 22 ++++++++++++++++++++++ dropfile.script.nix | 12 ++++++++++++ pushfile.script.nix | 10 ++++++++++ 3 files changed, 44 insertions(+) create mode 100644 README.md create mode 100644 dropfile.script.nix create mode 100644 pushfile.script.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..92a059f --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Setup + +on formatted drive: + +```sh +nixos-generate-config --root /mnt +vim /mnt/etc/nixos/hardware-configuration.nix +``` +insert +```nix +boot.loader.grub.device = "/dev/ d i s k "; +networking.hostName = "TudbuT-Nix m a c h i n e";' +``` +quit and: +```sh +nix-shell -p git +rm configuration.nix +cd /mnt/etc/nixos +git clone https://git.tudbut.de/tudbut/nix-setup +exit +nixos-install +``` diff --git a/dropfile.script.nix b/dropfile.script.nix new file mode 100644 index 0000000..0d89875 --- /dev/null +++ b/dropfile.script.nix @@ -0,0 +1,12 @@ +with import {}; + +pkgs.writeShellScriptBin "dropfile" '' + #!/bin/bash + echo dropping files: + for f in $@ ; do + echo "https://data.tudbut.de/$(basename $f)" + done + sleep 2 + + echo "rm $(for f in $@ ; do basename "$f" ; done)" | sftp -P 23 root@tudbut.de:/var/www/html/ +'' diff --git a/pushfile.script.nix b/pushfile.script.nix new file mode 100644 index 0000000..f06b096 --- /dev/null +++ b/pushfile.script.nix @@ -0,0 +1,10 @@ +with import {}; + +pkgs.writeShellScriptBin "pushfile" '' + #!/bin/bash + echo pushing files to data.tudbut.de: + scp -P 23 $@ root@tudbut.de:/var/www/html + for f in $@ ; do + echo "https://data.tudbut.de/$(basename $f)" + done +''