aboutsummaryrefslogtreecommitdiff
path: root/modules/build/koboroot.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/build/koboroot.nix')
-rw-r--r--modules/build/koboroot.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/build/koboroot.nix b/modules/build/koboroot.nix
new file mode 100644
index 0000000..9bea19d
--- /dev/null
+++ b/modules/build/koboroot.nix
@@ -0,0 +1,31 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.build.koboroot;
+in {
+ options.build = {
+ koboroot = {
+ unpacked-payload = mkOption {
+ type = types.path;
+ internal = true;
+ readOnly = true;
+ default = config.koboroot.finalPackage;
+ };
+ payload = mkOption {
+ type = types.path;
+ internal = true;
+ readOnly = true;
+ default = pkgs.runCommandLocal "koboroot-payload" {} ''
+ mkdir $out
+ tar czvf $out/KoboRoot.tgz --directory="${cfg.unpacked-payload}" . --mode=u+w
+ '';
+ };
+ deploy = mkOption {
+ internal = true;
+ readOnly = true;
+ type = types.package;
+ default = pkgs.kobo-deploy cfg.payload;
+ };
+ };
+ };
+}