diff --git a/users/geekiot/host/proxy.nix b/users/geekiot/host/proxy.nix index 54be79c..6359425 100644 --- a/users/geekiot/host/proxy.nix +++ b/users/geekiot/host/proxy.nix @@ -15,7 +15,6 @@ let type = config.sops.secrets."sing_box/type".path; in { - # Sops sops.secrets = { "sing_box/flow" = { }; "sing_box/packet_encoding" = { }; @@ -33,7 +32,6 @@ in httpProxy = "http://127.0.0.1:12634"; }; - # Sing-box services.sing-box = { enable = true; package = pkgs.old.sing-box; diff --git a/users/geekiot/scripts/default.nix b/users/geekiot/scripts/default.nix index 57e0017..02376c4 100644 --- a/users/geekiot/scripts/default.nix +++ b/users/geekiot/scripts/default.nix @@ -1,40 +1,42 @@ pkgs: { - updateSystem = + rebuidWithSopsSubmodule = configPath: secretsPath: - pkgs.writeShellScriptBin "updateSystem" '' + pkgs.writeShellScriptBin "rebuidWithSopsSubmodule" '' #!/bin/bash export my_wd=$PWD cd ${configPath} - if [ ! -d "${secretsPath}" ]; then - echo "!!! Error !!! NixConfigSecrets directory not found in ${configPath}" + if [ ! -d ./${secretsPath} ]; then + echo "Error: ${secretsPath} directory not found in ${configPath}" + echo "System not updated!" cd $my_wd unset my_wd exit 1 fi - if [ -z "$(find NixConfigSecrets -maxdepth 1 -name '*.yaml' -print -quit)" ]; then - echo "!!! Error !!! No .yaml files found in NixConfigSecrets directory" + if [ -z "$(find ./${secretsPath} -maxdepth 1 -name '*.yaml' -print -quit)" ]; then + echo "Error: No .yaml files found in ${secretsPath} directory" + echo "System not updated!" cd $my_wd unset my_wd exit 1 fi - mkdir secrets - cp -r NixConfigSecrets/*.yaml secrets/ - git add secrets/*.yaml + mkdir ./secrets + cp ./${secretsPath}/*.yaml ./secrets/ + git add ./secrets/*.yaml if sudo nixos-rebuild switch --flake . "$@"; then - echo "Success: System successfully updated with new configuration" + echo "Success: System successfully updated with new configuration!" else - echo "!!! Failure !!! Failed to apply NixOS configuration" - echo "System version remains unchanged" + echo "Error: Failed to rebuild NixOS configuration" + echo "System not updated!" fi - git reset secrets/*.yaml - rm secrets/*.yaml - rm -d secrets + git reset ./secrets/*.yaml + rm ./secrets/*.yaml + rm -d ./secrets cd $my_wd unset my_wd '';