update
This commit is contained in:
parent
e912d142fc
commit
a02ec11858
3 changed files with 16 additions and 18 deletions
|
@ -34,8 +34,6 @@ def healthcheck_stop [
|
|||
}
|
||||
|
||||
def main [
|
||||
--rclone: string # path to rclone binary
|
||||
--restic: string # path to restic binary
|
||||
--cache-dir: string # path to cache dir
|
||||
] {
|
||||
let rid = (random uuid)
|
||||
|
@ -48,9 +46,6 @@ def main [
|
|||
|
||||
healthcheck_start $healthcheck_url
|
||||
|
||||
alias rclone = ^$rclone
|
||||
alias restic = ^$restic --cache-dir $cache_dir --option "b2.connections=128"
|
||||
|
||||
if ($env | get -i BACKUP_PATHS | is-empty) {
|
||||
print "BACKUP_PATHS not set."
|
||||
healthcheck_fail $healthcheck_url "BACKUP_PATHS not set."
|
||||
|
|
8
flake.lock
generated
8
flake.lock
generated
|
@ -20,16 +20,16 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1730327045,
|
||||
"narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
|
||||
"lastModified": 1742937945,
|
||||
"narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
|
||||
"rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-24.05",
|
||||
"ref": "nixos-24.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
|
|
21
flake.nix
21
flake.nix
|
@ -3,7 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs-stable = {
|
||||
url = "nixpkgs/nixos-24.05";
|
||||
url = "nixpkgs/nixos-24.11";
|
||||
};
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
|
@ -25,9 +25,9 @@
|
|||
packages = {
|
||||
restic = let
|
||||
pname = "restic";
|
||||
version = "0.17.3";
|
||||
hash = "sha256-PTy/YcojJGrYQhdp98e3rEMqHIWDMR5jiSC6BdzBT/M=";
|
||||
vendorHash = "sha256-tU2msDHktlU0SvvxLQCU64p8DpL8B0QiliVCuHlLTHQ=";
|
||||
version = "0.18.0";
|
||||
hash = "sha256-odyKcpNAhk1dlVBhjrtmgKjWTOCMtooYOJ5p0J9OUFY=";
|
||||
vendorHash = "sha256-cxOwVf1qZXJbDZC/7cGnKPNpwJnAk3OunKVZpwtI8pI=";
|
||||
in
|
||||
pkgs.buildGoModule {
|
||||
inherit pname version vendorHash;
|
||||
|
@ -90,7 +90,13 @@
|
|||
name = "entrypoint";
|
||||
destination = "/bin/entrypoint";
|
||||
text = pkgs.lib.concatStringsSep "\n" [
|
||||
"#!${pkgs.nushell}/bin/nu"
|
||||
''
|
||||
#!${pkgs.nushell}/bin/nu
|
||||
|
||||
alias figurine = ^${pkgs.lib.getExe pkgs.figurine}
|
||||
alias rclone = ^${pkgs.lib.getExe pkgs.rclone}
|
||||
alias restic = ^${pkgs.lib.getExe pkgs.restic} --cache-dir ''$cache_dir --option "b2.connections=128"
|
||||
''
|
||||
(builtins.readFile ./entrypoint.nu)
|
||||
];
|
||||
executable = true;
|
||||
|
@ -105,10 +111,6 @@
|
|||
config = {
|
||||
Cmd = [
|
||||
"${self.packages.${system}.entrypoint}/bin/entrypoint"
|
||||
"--rclone"
|
||||
"${pkgs.rclone}/bin/rclone"
|
||||
"--restic"
|
||||
"${self.packages.${pkgs.system}.restic}/bin/restic"
|
||||
"--cache-dir"
|
||||
"/cache"
|
||||
];
|
||||
|
@ -347,6 +349,7 @@
|
|||
oneFileSystem ++ excludes ++ paths
|
||||
);
|
||||
in ''
|
||||
${pkgs.lib.getExe pkgs.figlet} -f ${pkgs.figlet}/share/figlet/banner3-D.flf ${lib.strings.concatStringsSep " " paths}
|
||||
${backup.preCommand}
|
||||
${package}/bin/restic backup ${arguments}
|
||||
${backup.postCommand}
|
||||
|
|
Loading…
Add table
Reference in a new issue