diff --git a/osConfigs/hosts/laptop.nix b/osConfigs/hosts/laptop.nix index e1c7d19..2f1f193 100644 --- a/osConfigs/hosts/laptop.nix +++ b/osConfigs/hosts/laptop.nix @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2025/09/06 00:56:57 by tomoron #+# #+# # -# Updated: 2026/06/13 23:02:10 by tomoron ### ########.fr # +# Updated: 2026/06/13 23:20:55 by tomoron ### ########.fr # # # # **************************************************************************** # @@ -168,41 +168,4 @@ programs.corectrl.enable = true; - - nix.buildMachines = [ - { - hostName = "tmoron.fr"; - sshUser = "builder"; - # 'ssh-ng' is faster if both machines are NixOS but falls flat if the - # machine Nix will attempt a connection to is not NixOS. In such a case - # you must use 'ssh' instead. - protocol = "ssh-ng"; - - # This can be an absolute path to a private key or it can be managed - # with something like Agenix, or SOPS. - sshKey = "/root/.ssh/id_ed25519"; - - # Systems for which builds will be offloaded. - system = "x86_64-linux"; - - # Default is 1 but may keep the builder idle in between builds - maxJobs = 1; - # How fast is the builder compared to your local machine - speedFactor = 2; - - supportedFeatures = ["big-parallel" "kvm" "nixos-test"]; - } - ]; - - nix.distributedBuilds = true; - - - - programs.ssh.extraConfig = '' - Host tmoron.fr - HostName tmoron.fr - Port 1880 - ''; - - } diff --git a/osConfigs/hosts/server.nix b/osConfigs/hosts/server.nix index 2de0513..589cc88 100644 --- a/osConfigs/hosts/server.nix +++ b/osConfigs/hosts/server.nix @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2025/09/06 00:57:09 by tomoron #+# #+# # -# Updated: 2026/06/13 22:52:09 by tomoron ### ########.fr # +# Updated: 2026/06/13 23:21:39 by tomoron ### ########.fr # # # # **************************************************************************** # @@ -155,6 +155,8 @@ in }; users.groups.builder = {}; + config.mods.remote-build.enable = false; + systemd.services.dockermcmgr-server = { @@ -167,4 +169,5 @@ in Group= "users"; }; }; + } diff --git a/osConfigs/modules/remote_build.nix b/osConfigs/modules/remote_build.nix new file mode 100644 index 0000000..79aa48f --- /dev/null +++ b/osConfigs/modules/remote_build.nix @@ -0,0 +1,46 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# remote_build.nix :+: :+: :+: # +# +:+ +:+ +:+ # +# By: tomoron +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2025/09/05 23:47:09 by tomoron #+# #+# # +# Updated: 2026/06/13 23:27:26 by tomoron ### ########.fr # +# # +# **************************************************************************** # + +{config, lib, ... }: + +{ + options.mods.remote-build.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "setup remote nix builder"; + }; + + config = lib.mkIf config.mods.remote-build.enable { + nix.buildMachines = [ + { + hostName = "tmoron.fr"; + sshUser = "builder"; + protocol = "ssh-ng"; + + sshKey = "/root/.ssh/id_ed25519"; + + system = "x86_64-linux"; + + maxJobs = 1; + speedFactor = 2; + + supportedFeatures = ["big-parallel" "kvm" "nixos-test"]; + } + ]; + nix.distributedBuilds = true; + programs.ssh.extraConfig = '' + Host tmoron.fr + HostName tmoron.fr + Port 1880 + ''; + }; +}