Skip to content

Instantly share code, notes, and snippets.

@jevy
Created February 17, 2022 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jevy/511a51622056003380ed0d53f5c08c75 to your computer and use it in GitHub Desktop.
Save jevy/511a51622056003380ed0d53f5c08c75 to your computer and use it in GitHub Desktop.
Duplicity Flake
{
description = "Duplicity Backup Script";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.backup_script =
let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
duplicity_backupsh = pkgs.fetchFromGitHub {
owner = "zertrin";
repo = "duplicity-backup.sh";
rev = "595aded06f96d91cbe44662712f6e5614ce89220";
sha256 = "1xzmz7fcr3vjcxhbjla3kvc49g3xgbs065pjd167jfqvgxj51m7l";
};
config = pkgs.writeTextFile {
name = "config";
text = builtins.readFile ./duplicity-backup.conf;
};
in
pkgs.writeShellApplication {
name = "duplicity_backup";
runtimeInputs = [ pkgs.duplicity pkgs.nawk pkgs.jq];
text = ''
${duplicity_backupsh}/duplicity-backup.sh -c ${config} -b
'';
};
defaultPackage.x86_64-linux = self.packages.x86_64-linux.backup_script;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment