Skip to content

Commit

Permalink
nix-darwin/linux-builder: init
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Sep 4, 2024
1 parent 92f6680 commit f3aefff
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nix-darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
./cli.nix
./home.nix
./homebrew.nix
./nix.nix
./nix
./system.nix
];

Expand Down
6 changes: 4 additions & 2 deletions nix-darwin/nix.nix → nix-darwin/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let
cfg = config.nix-darwin.nix;
in
{
imports = [ ./linux-builder.nix ];

options.nix-darwin.nix.enable = lib.mkEnableOption "nix/nixpkgs config" // {
default = true;
};
Expand All @@ -27,10 +29,10 @@ in

settings =
let
substituters = import ../shared/substituters.nix;
substituters = import ../../shared/substituters.nix;
in
lib.mkMerge [
(import ../shared/nix-conf.nix)
(import ../../shared/nix-conf.nix)
{
trusted-users = [
"root"
Expand Down
26 changes: 26 additions & 0 deletions nix-darwin/nix/linux-builder.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
config,
lib,
...
}:

let
cfg = config.nix-darwin.nix.linux-builder;
in
{
options.nix-darwin.nix.linux-builder.enable = lib.mkEnableOption "Linux builder config" // {
default = config.nix-darwin.nix.enable;
};

config = lib.mkIf cfg.enable {
nix.linux-builder = {
enable = true;
ephemeral = true;
maxJobs = 4;
systems = [
"aarch64-linux"
"x86_64-linux"
];
};
};
}

0 comments on commit f3aefff

Please sign in to comment.