3 Commits

Author SHA1 Message Date
Tom Alexander
3c17d56664 Separate enabling distributed build vs substituters. 2026-08-05 17:54:38 -04:00
Tom Alexander
adff9fcd29 Update nix_builder to support tar in the flake lockfile. 2026-08-04 21:39:54 -04:00
Tom Alexander
649e4033fd Update nix_builder to record the revisions of the flake inputs. 2026-07-28 10:20:18 -04:00
12 changed files with 131 additions and 46 deletions

View File

@@ -246,8 +246,31 @@ in
glew = (final.glew.override { enableEGL = false; }); glew = (final.glew.override { enableEGL = false; });
}; };
}) })
(final: prev: {
fwupd = prev.fwupd.overrideAttrs (
finalAttrs: prevAttrs: {
version = "2.1.5";
src = final.fetchFromGitHub {
owner = "fwupd";
repo = "fwupd";
tag = finalAttrs.version;
hash = "sha256-DzQ+N99ZmFRqZc2rN6PSqmoIMXUyrE8Kkn+KnT/AWPc=";
};
}
);
})
(disableTests "onetbb") # oneTBB tests hang forever on machines with a single core (like my build virtual machine) https://github.com/uxlfoundation/oneTBB/issues/1557 (disableTests "onetbb") # oneTBB tests hang forever on machines with a single core (like my build virtual machine) https://github.com/uxlfoundation/oneTBB/issues/1557
(disableTests "aws-c-common") # aws-c-common tests time out on my build virtual machine but run fine on my laptop. (disableTests "aws-c-common") # aws-c-common tests time out on my build virtual machine but run fine on my laptop.
# Works but probably sets python2's scipy to be python3:
#
# (final: prev: {
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
# (python-final: python-prev: {
# scipy = final.unoptimized.python3Packages.scipy;
# })
# ];
# })
]; ];
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,

View File

@@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1781152676, "lastModified": 1780894562,
"narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=", "narHash": "sha256-c3430xwxwhHipl3jigUGMMBfpaMylDqytW/kdmB3ZGs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1", "rev": "24fed06cac83bcc44ac8efbb57cab1a82fa0bedc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -170,11 +170,11 @@
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1784948952, "lastModified": 1785893798,
"narHash": "sha256-rT90o2vRhbTh87NRC6Y6IaklJGL4jjT0SSbtuAs1PQw=", "narHash": "sha256-69nKdvM+E/66sj9R2HEK8i0p0TOt/0MSqfXiZjcJ9nI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "77b3ba64c044c2864b4a6f06755f93465b1526af", "rev": "6386febdb81eb1e072ad7cb568019f06618008fe",
"revCount": 38, "revCount": 41,
"type": "git", "type": "git",
"url": "https://code.fizz.buzz/talexander/nix_builder.git" "url": "https://code.fizz.buzz/talexander/nix_builder.git"
}, },
@@ -185,11 +185,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1785090369, "lastModified": 1780749050,
"narHash": "sha256-m0pDuRJG7EDo9ri+4Ksu83VsI+PlxNC9lNBfydejce4=", "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "624af665418d3c65d544145b4d34ad696439570e", "rev": "a799d3e3886da994fa307f817a6bc705ae538eeb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -199,6 +199,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-google": {
"locked": {
"lastModified": 1779893571,
"narHash": "sha256-wiwMyVCtmjRjlFCe2zaumCE6LRV9GzzN0ZH25NQkbAU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "45f6cfaa4605b706c870e75bd74bdb5e97eee11e",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "45f6cfaa4605b706c870e75bd74bdb5e97eee11e",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1730741070, "lastModified": 1730741070,
@@ -248,7 +264,8 @@
"impermanence": "impermanence", "impermanence": "impermanence",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix_builder": "nix_builder", "nix_builder": "nix_builder",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-google": "nixpkgs-google"
} }
}, },
"rust-overlay": { "rust-overlay": {

View File

@@ -20,6 +20,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-google.url = "github:NixOS/nixpkgs/45f6cfaa4605b706c870e75bd74bdb5e97eee11e";
lanzaboote = { lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2"; url = "github:nix-community/lanzaboote/v0.4.2";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -38,6 +39,7 @@
{ {
self, self,
nixpkgs, nixpkgs,
nixpkgs-google,
disko, disko,
impermanence, impermanence,
lanzaboote, lanzaboote,
@@ -97,6 +99,9 @@
hostPlatform.gcc.arch = "default"; hostPlatform.gcc.arch = "default";
hostPlatform.gcc.tune = "default"; hostPlatform.gcc.tune = "default";
}; };
google = import nixpkgs-google {
system = prev.stdenv.hostPlatform.system;
};
}) })
]; ];
}; };

View File

@@ -4,13 +4,15 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable = false; enable_build = false;
enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
}; };
me.distributed_build.machines.hydra = { me.distributed_build.machines.hydra = {
enable = true; enable_build = false;
enable_substituter = true;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };

View File

@@ -4,10 +4,19 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable = true; enable_build = false;
enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
}; };
me.distributed_build.machines.hydra = {
enable_build = false;
enable_substituter = true;
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
};
}; };
} }

View File

@@ -4,13 +4,15 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable = false; enable_build = false;
enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
}; };
me.distributed_build.machines.hydra = { me.distributed_build.machines.hydra = {
enable = true; enable_build = false;
enable_substituter = true;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };

View File

@@ -4,13 +4,15 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable = false; enable_build = false;
enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
}; };
me.distributed_build.machines.hydra = { me.distributed_build.machines.hydra = {
enable = true; enable_build = false;
enable_substituter = true;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };

View File

@@ -3,8 +3,16 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = {
enable_build = false;
enable_substituter = false;
additional_config = {
speedFactor = 2;
};
};
me.distributed_build.machines.hydra = { me.distributed_build.machines.hydra = {
enable = true; enable_build = false;
enable_substituter = true;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };

View File

@@ -4,10 +4,19 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable = true; enable_build = false;
enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
}; };
me.distributed_build.machines.hydra = {
enable_build = false;
enable_substituter = true;
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
};
}; };
} }

View File

@@ -10,7 +10,14 @@
let let
make_machine_config = name: { make_machine_config = name: {
enable = lib.mkOption { enable_build = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to use the ${name} machine during distributed builds.";
};
enable_substituter = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
example = true; example = true;
@@ -59,11 +66,30 @@ let
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root"; hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
}; };
}; };
build_machine_list = (
map (
hostname:
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable_build (
lib.mkMerge [
{
hostName = hostname;
sshUser = "nixworker";
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
maxJobs = 1;
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
protocol = "ssh-ng";
}
static_host_configs."${hostname}"
config.me.distributed_build.machines."${hostname}".additional_config
]
))
) (builtins.attrNames all_nixos_configs)
);
substituters_list = ( substituters_list = (
map ( map (
hostname: hostname:
(lib.mkIf ( (lib.mkIf (
config.me.distributed_build.machines."${hostname}".enable config.me.distributed_build.machines."${hostname}".enable_substituter
&& config.me.distributed_build.machines."${hostname}".substituter_url != null && config.me.distributed_build.machines."${hostname}".substituter_url != null
) (config.me.distributed_build.machines."${hostname}".substituter_url)) ) (config.me.distributed_build.machines."${hostname}".substituter_url))
) (builtins.attrNames all_nixos_configs) ) (builtins.attrNames all_nixos_configs)
@@ -112,25 +138,7 @@ in
]; ];
} }
{ {
nix.buildMachines = ( nix.buildMachines = build_machine_list;
map (
hostname:
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable (
lib.mkMerge [
{
hostName = hostname;
sshUser = "nixworker";
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
maxJobs = 1;
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
protocol = "ssh-ng";
}
static_host_configs."${hostname}"
config.me.distributed_build.machines."${hostname}".additional_config
]
))
) (builtins.attrNames all_nixos_configs)
);
} }
(lib.mkIf has_any_substituters { (lib.mkIf has_any_substituters {
nix.settings.substitute = lib.mkForce true; nix.settings.substitute = lib.mkForce true;

View File

@@ -18,7 +18,7 @@
}; };
config = lib.mkIf config.me.gcloud.enable { config = lib.mkIf config.me.gcloud.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs.google; [
(google-cloud-sdk.withExtraComponents [ google-cloud-sdk.components.gke-gcloud-auth-plugin ]) (google-cloud-sdk.withExtraComponents [ google-cloud-sdk.components.gke-gcloud-auth-plugin ])
]; ];

View File

@@ -25,8 +25,8 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
tex = ( tex = (
pkgs.texliveSmall.withPackages ( pkgs.texlive.combine {
ps: with ps; [ inherit (pkgs.texlive)
scheme-basic scheme-basic
dvisvgm dvisvgm
dvipng # for preview and export as html in org-mode dvipng # for preview and export as html in org-mode
@@ -44,8 +44,8 @@
upquote # emacs org-mode pdf export upquote # emacs org-mode pdf export
lineno # emacs org-mode pdf export lineno # emacs org-mode pdf export
beamer # emacs org-mode presentation pdf export beamer # emacs org-mode presentation pdf export
] ;
) }
); );
}) })
]; ];