summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/core/nix/default.nix1
-rw-r--r--modules/core/nix/distributed-builds.nix26
-rw-r--r--modules/core/nix/extended.nix38
-rw-r--r--modules/options/nix.nix18
4 files changed, 48 insertions, 35 deletions
diff --git a/modules/core/nix/default.nix b/modules/core/nix/default.nix
index f1919f0..2280f97 100644
--- a/modules/core/nix/default.nix
+++ b/modules/core/nix/default.nix
@@ -6,6 +6,7 @@
}:
{
imports = [
+ ./distributed-builds.nix
./extended.nix
./nh.nix
];
diff --git a/modules/core/nix/distributed-builds.nix b/modules/core/nix/distributed-builds.nix
new file mode 100644
index 0000000..2960bfd
--- /dev/null
+++ b/modules/core/nix/distributed-builds.nix
@@ -0,0 +1,26 @@
+{ config, lib, ... }:
+{
+ config.nix = lib.mkIf config.modules.nix.distributedBuilds {
+ distributedBuilds = true;
+
+ buildMachines =
+ map
+ (system: {
+ inherit system;
+
+ hostName = "eu.nixbuild.net";
+ maxJobs = 100;
+
+ supportedFeatures = [
+ "benchmark"
+ "big-parallel"
+ ];
+ })
+ [
+ "x86_64-linux"
+ "i686-linux"
+ "aarch64-linux"
+ "armv7l-linux"
+ ];
+ };
+}
diff --git a/modules/core/nix/extended.nix b/modules/core/nix/extended.nix
index 18b4176..6ce2695 100644
--- a/modules/core/nix/extended.nix
+++ b/modules/core/nix/extended.nix
@@ -9,38 +9,14 @@
programs.nix-index-database.comma.enable = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
- nix = {
- # distributedBuilds = true;
+ nix.settings = {
+ extra-platforms = config.boot.binfmt.emulatedSystems;
- buildMachines =
- map
- (system: {
- inherit system;
-
- hostName = "eu.nixbuild.net";
- maxJobs = 100;
-
- supportedFeatures = [
- "benchmark"
- "big-parallel"
- ];
- })
- [
- "x86_64-linux"
- "i686-linux"
- "aarch64-linux"
- "armv7l-linux"
- ];
-
- settings = {
- extra-platforms = config.boot.binfmt.emulatedSystems;
-
- extra-sandbox-paths = [
- config.programs.ccache.cacheDir
- "/run/binfmt"
- "${pkgs.qemu}"
- ];
- };
+ extra-sandbox-paths = [
+ config.programs.ccache.cacheDir
+ "/run/binfmt"
+ "${pkgs.qemu}"
+ ];
};
};
}
diff --git a/modules/options/nix.nix b/modules/options/nix.nix
index 63301bc..62836ae 100644
--- a/modules/options/nix.nix
+++ b/modules/options/nix.nix
@@ -1,7 +1,17 @@
{ lib, ... }:
{
- options.modules.nix.extend = lib.options.mkOption {
- default = false;
- type = lib.types.bool;
- };
+ options.modules.nix =
+ with lib.options;
+ with lib.types;
+ {
+ extend = mkOption {
+ default = false;
+ type = types.bool;
+ };
+
+ distributedBuilds = mkOption {
+ default = false;
+ type = types.bool;
+ };
+ };
}