diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/files.nix | 2 | ||||
| -rw-r--r-- | modules/main.nix | 28 |
2 files changed, 28 insertions, 2 deletions
diff --git a/modules/files.nix b/modules/files.nix index 14b5319..c5256a0 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -30,7 +30,7 @@ with builtins // lib; }; text = mkOption { type = types.lines; - default = null; + default = ""; }; }; diff --git a/modules/main.nix b/modules/main.nix index 974f599..cd5262a 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -36,9 +36,35 @@ with builtins // lib; RSYNC="rsync -a --copy-links -v" $RSYNC "${config.koreader.basePackage}/" "$out/" - $RSYNC "${config._files}/" "$out/${config.koreaderPath}/" + $RSYNC "${config._files}/" "$out/${config.koreader.koreaderPath}/" ''; }; + finalPackageTar = mkOption { + type = types.path; + readOnly = true; + default = pkgs.runCommandLocal "tar" { nativeBuildInputs = [ pkgs.tar ]; } '' + cd "${config.koreader.finalPackage}" + tar cvf "$out" . + ''; + }; + deploy = mkOption { + type = types.package; + readOnly = true; + default = pkgs.writeShellApplication { + name = "deploy"; + runtimeInputs = [ pkgs.tar ]; + text = '' + DESTINATION="''${1-}" + + if [ -z "$DESTINATION" ]; then + echo "Must include a destination" + exit 1 + fi + + tar xvf "${config.koreader.finalPackageTar}" --directory "$DESTINATION" + ''; + }; + }; }; }; |
