Compare commits
No commits in common. "937a5df23f557ac598d25fa5f3596946a68aa1c0" and "94eb79d5c6addeee464f88ffa0740da676aa3304" have entirely different histories.
937a5df23f
...
94eb79d5c6
|
@ -5,8 +5,7 @@
|
||||||
writeShellApplication,
|
writeShellApplication,
|
||||||
}: let
|
}: let
|
||||||
encryptedUSBData = import ../data/drives/encryptedUSB.nix;
|
encryptedUSBData = import ../data/drives/encryptedUSB.nix;
|
||||||
in
|
in writeShellApplication {
|
||||||
writeShellApplication {
|
|
||||||
name = "mk-enc-usb";
|
name = "mk-enc-usb";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
parted
|
parted
|
||||||
|
@ -49,4 +48,4 @@ in
|
||||||
echo "Naming Partitions"
|
echo "Naming Partitions"
|
||||||
parted "$USB_DEVICE" -- name 1 ${encryptedUSBData.encryptedPartLabel}
|
parted "$USB_DEVICE" -- name 1 ${encryptedUSBData.encryptedPartLabel}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
writeShellApplication,
|
writeShellApplication,
|
||||||
}: let
|
}: let
|
||||||
driveData = import ../data/drives/encryptedDrive.nix;
|
driveData = import ../data/drives/encryptedDrive.nix;
|
||||||
in
|
in writeShellApplication {
|
||||||
writeShellApplication {
|
|
||||||
name = "mk-encrypted-drive";
|
name = "mk-encrypted-drive";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
parted
|
parted
|
||||||
|
@ -83,4 +82,4 @@ in
|
||||||
|
|
||||||
echo "mount /dev/mapper/mk_encrypted_drive to install"
|
echo "mount /dev/mapper/mk_encrypted_drive to install"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
writeShellApplication,
|
writeShellApplication,
|
||||||
}: let
|
}: let
|
||||||
externalDriveData = import ../data/drives/raspberryExternalDrive.nix;
|
externalDriveData = import ../data/drives/raspberryExternalDrive.nix;
|
||||||
in
|
in writeShellApplication {
|
||||||
writeShellApplication {
|
|
||||||
name = "mk-raspberry-ext-drive";
|
name = "mk-raspberry-ext-drive";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
util-linux
|
util-linux
|
||||||
|
@ -65,4 +64,4 @@ in
|
||||||
echo "Closing mapper device"
|
echo "Closing mapper device"
|
||||||
cryptsetup close "mk-raspberry-ext-drive"
|
cryptsetup close "mk-raspberry-ext-drive"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,29 +21,6 @@ in {
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file."Music/music-sync-check.sh" = {
|
|
||||||
executable = true;
|
|
||||||
text = ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
cd "''${SCRIPT_DIR}"
|
|
||||||
|
|
||||||
ERROR_LOG=$(mktemp -t music-check-log-XXX)
|
|
||||||
|
|
||||||
echo "Checking StorageBox sync status"
|
|
||||||
if rclone check . Storage:Music --exclude "/*.sh" 2>$ERROR_LOG; then
|
|
||||||
echo "Up to date with StorageBox"
|
|
||||||
else
|
|
||||||
echo "An error occured attempting to check sync status:"
|
|
||||||
cat "$ERROR_LOG"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm "$ERROR_LOG"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
home.file."Music/music-sync.sh" = {
|
home.file."Music/music-sync.sh" = {
|
||||||
executable = true;
|
executable = true;
|
||||||
text = ''
|
text = ''
|
||||||
|
@ -52,7 +29,7 @@ in {
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
cd "''${SCRIPT_DIR}"
|
cd "''${SCRIPT_DIR}"
|
||||||
|
|
||||||
rclone sync -P . Storage:Music --exclude "/*.sh"
|
rclone sync -P . Storage:Music --exclude music-sync.sh,music-download.sh
|
||||||
restic-music backup $(fd -t d --max-depth=1 && fd -t f --max-depth=1)
|
restic-music backup $(fd -t d --max-depth=1 && fd -t f --max-depth=1)
|
||||||
|
|
||||||
TITLE="chaos's Music Library"
|
TITLE="chaos's Music Library"
|
||||||
|
|
|
@ -306,8 +306,7 @@ in rec {
|
||||||
then "secrets-init"
|
then "secrets-init"
|
||||||
else "secrets-init-${name}";
|
else "secrets-init-${name}";
|
||||||
scripts = genScripts cfg;
|
scripts = genScripts cfg;
|
||||||
in
|
in writeShellApplication {
|
||||||
writeShellApplication {
|
|
||||||
name = scriptName;
|
name = scriptName;
|
||||||
runtimeInputs = defaultPackages ++ cfg.packages;
|
runtimeInputs = defaultPackages ++ cfg.packages;
|
||||||
text = scripts.initScript;
|
text = scripts.initScript;
|
||||||
|
@ -320,8 +319,7 @@ in rec {
|
||||||
then "secrets-check"
|
then "secrets-check"
|
||||||
else "secrets-check-${name}";
|
else "secrets-check-${name}";
|
||||||
scripts = genScripts cfg;
|
scripts = genScripts cfg;
|
||||||
in
|
in writeShellApplication {
|
||||||
writeShellApplication {
|
|
||||||
name = scriptName;
|
name = scriptName;
|
||||||
runtimeInputs = defaultPackages ++ cfg.checkPackages;
|
runtimeInputs = defaultPackages ++ cfg.checkPackages;
|
||||||
text = scripts.checkScript;
|
text = scripts.checkScript;
|
||||||
|
@ -346,8 +344,7 @@ in rec {
|
||||||
capabilities = [${concatStringsSep "," (forEach capabilities escapeString)}]
|
capabilities = [${concatStringsSep "," (forEach capabilities escapeString)}]
|
||||||
}
|
}
|
||||||
'');
|
'');
|
||||||
in
|
in toFile "vault-policy-${name}.hcl" ''
|
||||||
toFile "vault-policy-${name}.hcl" ''
|
|
||||||
${concatStringsSep "\n" policies}
|
${concatStringsSep "\n" policies}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,8 +202,7 @@ in
|
||||||
(mergeAttrsList (forEach machinesWithContainers (machineName: let
|
(mergeAttrsList (forEach machinesWithContainers (machineName: let
|
||||||
machine = machines.${machineName};
|
machine = machines.${machineName};
|
||||||
inherit (machine) containers;
|
inherit (machine) containers;
|
||||||
in
|
in mergeAttrsList (forEach containers (containerName: {
|
||||||
mergeAttrsList (forEach containers (containerName: {
|
|
||||||
"secrets-init-${machineName}-container-${containerName}" = secretsInitScriptForContainer machineName containerName;
|
"secrets-init-${machineName}-container-${containerName}" = secretsInitScriptForContainer machineName containerName;
|
||||||
"vault-policy-${machineName}-container-${containerName}" = vaultPolicyForContainer machineName containerName;
|
"vault-policy-${machineName}-container-${containerName}" = vaultPolicyForContainer machineName containerName;
|
||||||
})))))
|
})))))
|
||||||
|
|
Loading…
Reference in a new issue