summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/build.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-01 14:48:51 +0200
committerlassulus <lass@aidsballs.de>2015-10-01 14:48:51 +0200
commit4bacf702b0112a82eb2a4a21ee41c6f11337e8dc (patch)
treedc2f0e90f9336ba224384c81376ea0c2af2634c0 /krebs/3modules/build.nix
parenta34de6743a44760d21589d4e1a154ccc5c621420 (diff)
parent3384dd0a5578cc3a26dd076669dd264f5ae9f008 (diff)
Merge branch 'tv'
Diffstat (limited to 'krebs/3modules/build.nix')
-rw-r--r--krebs/3modules/build.nix72
1 files changed, 72 insertions, 0 deletions
diff --git a/krebs/3modules/build.nix b/krebs/3modules/build.nix
new file mode 100644
index 000000000..57495ea69
--- /dev/null
+++ b/krebs/3modules/build.nix
@@ -0,0 +1,72 @@
+{ config, lib, ... }:
+
+with import ../4lib { inherit lib; };
+
+let
+ target = config.krebs.build // { user.name = "root"; };
+
+ out = {
+ # TODO deprecate krebs.build.host
+ options.krebs.build.host = mkOption {
+ type = types.host;
+ };
+
+ # TODO make krebs.build.profile shell safe
+ options.krebs.build.profile = mkOption {
+ type = types.str;
+ default = "/nix/var/nix/profiles/system";
+ };
+
+ # TODO make krebs.build.target.host :: host
+ options.krebs.build.target = mkOption {
+ type = with types; nullOr str;
+ default = null;
+ };
+
+ # TODO deprecate krebs.build.user
+ options.krebs.build.user = mkOption {
+ type = types.user;
+ };
+
+ options.krebs.build.source.dir = mkOption {
+ type = types.attrsOf (types.submodule ({ config, ... }: {
+ options = {
+ host = mkOption {
+ type = types.host;
+ };
+ path = mkOption {
+ type = types.str;
+ };
+ target-path = mkOption {
+ type = types.str;
+ default = "/root/${config._module.args.name}";
+ };
+ url = mkOption {
+ type = types.str;
+ default = "file://${config.host.name}${config.path}";
+ };
+ };
+ }));
+ default = {};
+ };
+
+ options.krebs.build.source.git = mkOption {
+ type = with types; attrsOf (submodule ({ config, ... }: {
+ options = {
+ url = mkOption {
+ type = types.str; # TODO must be shell safe
+ };
+ rev = mkOption {
+ type = types.str;
+ };
+ target-path = mkOption {
+ type = types.str;
+ default = "/root/${config._module.args.name}";
+ };
+ };
+ }));
+ default = {};
+ };
+ };
+
+in out