Implement distributed builder

This commit is contained in:
Julian Mutter 2024-01-06 22:51:49 +01:00
parent b49b6263d3
commit 619d3f9a45
2 changed files with 62 additions and 13 deletions

View File

@ -18,6 +18,24 @@ in rec {
users.julian = import ./home.nix;
};
nix.buildMachines = [ {
hostName = "192.168.3.118";
system = "x86_64-linux";
protocol = "ssh";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 4;
speedFactor = 3;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}] ;
nix.distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
nix.extraOptions = ''
builders-use-substitutes = true
'';
# Bootloader
# Use this for simple nix boot menu, if no dual boot required
boot.loader.systemd-boot.enable = true;
@ -62,6 +80,17 @@ in rec {
nix.settings.auto-optimise-store = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Setup binary caches
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
@ -201,6 +230,9 @@ in rec {
services.flatpak.enable = true;
# Smart card reader
services.pcscd.enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
@ -212,8 +244,20 @@ in rec {
# $ nix search wget
environment.systemPackages = with pkgs; [
# rfid reader tests
openct
opensc
pcsclite
pcsctools
ccid
libnfc
xournalpp
path-of-building
xfce.thunar-archive-plugin
zip
p7zip
imagemagick
(pkgs.python3.withPackages python-packages)
firefox
@ -317,10 +361,11 @@ in rec {
xclip
okular # Pdf reader with many features, good for commenting documents
evince # Simple pdf reader, good for focusing on document content
pdfsam-basic # Split, merge, etc for pdfs
poppler_utils # Pdf utils including pdfimages
matlab # Using nix-matlab overlay defined in flake
sage
# sage
gimp
@ -340,6 +385,10 @@ in rec {
calibre
audible-cli
cudaPackages.cudatoolkit
openmvg
colmapWithCuda
];
nixpkgs.overlays = [

24
nix/flake.lock generated
View File

@ -23,11 +23,11 @@
]
},
"locked": {
"lastModified": 1695108154,
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=",
"lastModified": 1702195668,
"narHash": "sha256-Lxmjez0nfNBptdqV5GsXKm7Bb7swjGsrxiLxWJu0tL8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "07682fff75d41f18327a871088d20af2710d4744",
"rev": "33110fb3c7fe6a94b98b641866a5eddb64b7c23f",
"type": "github"
},
"original": {
@ -45,11 +45,11 @@
]
},
"locked": {
"lastModified": 1698505288,
"narHash": "sha256-zisMGZ/akYQUrPkLiZvyAi7kJrge34XaOyT/YQS7pzw=",
"lastModified": 1704121315,
"narHash": "sha256-gsv9E8o3iF4VamGDNRHT4H0e29BB+0pZRHfP/oAQqjo=",
"owner": "doronbehar",
"repo": "nix-matlab",
"rev": "aa979bfe814051b15bc562c2b7f10b5fc1b08451",
"rev": "2e61e11473c8b4e83b62308b36ad2118a84177cb",
"type": "gitlab"
},
"original": {
@ -60,11 +60,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1698434055,
"narHash": "sha256-Phxi5mUKSoL7A0IYUiYtkI9e8NcGaaV5PJEaJApU1Ko=",
"lastModified": 1704018918,
"narHash": "sha256-erjg/HrpC9liEfm7oLqb8GXCqsxaFwIIPqCsknW5aFY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1a3c95e3b23b3cdb26750621c08cc2f1560cb883",
"rev": "2c9c58e98243930f8cb70387934daa4bc8b00373",
"type": "github"
},
"original": {
@ -76,11 +76,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1698318101,
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
"lastModified": 1703961334,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "63678e9f3d3afecfeafa0acead6239cdb447574c",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github"
},
"original": {