Created
February 17, 2022 13:44
-
-
Save jevy/511a51622056003380ed0d53f5c08c75 to your computer and use it in GitHub Desktop.
Duplicity Flake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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