aboutsummaryrefslogtreecommitdiff
path: root/modules/private/system/dilion.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-06-24 22:24:15 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-06-24 22:24:15 +0200
commit200690c9aecec1f38c1a62a65916df2950e1afe7 (patch)
tree6aa365dd4c7164016837ac1e728d7bb25a7ce2be /modules/private/system/dilion.nix
parent6689bca19502aa8823dfc0fd3948e8e0a7cb9976 (diff)
downloadNix-200690c9aecec1f38c1a62a65916df2950e1afe7.tar.gz
Nix-200690c9aecec1f38c1a62a65916df2950e1afe7.tar.zst
Nix-200690c9aecec1f38c1a62a65916df2950e1afe7.zip
First attempt at making declarative VMs
In order to make buildbot more secure, the builds need to happen inside VMs so that they can be thrown out on demand when not needed. This commit implements this facility on dilion, and also defines declaratively some previous VMs which used to run on the machine.
Diffstat (limited to 'modules/private/system/dilion.nix')
-rw-r--r--modules/private/system/dilion.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/modules/private/system/dilion.nix b/modules/private/system/dilion.nix
index be8269e..a59d607 100644
--- a/modules/private/system/dilion.nix
+++ b/modules/private/system/dilion.nix
@@ -76,12 +76,24 @@
76 }; 76 };
77 77
78 myServices.ssh.modules = [ config.myServices.ssh.predefinedModules.regular ]; 78 myServices.ssh.modules = [ config.myServices.ssh.predefinedModules.regular ];
79 imports = builtins.attrValues (import ../..); 79 imports = builtins.attrValues (import ../..) ++ [ ./dilion/vms.nix ];
80 80
81 system.nssModules = [ pkgs.libvirt ]; 81 system.nssModules = [ pkgs.libvirt ];
82 system.nssDatabases.hosts = lib.mkForce [ "files" "libvirt_guest" "mymachines" "dns" "myhostname" ]; 82 system.nssDatabases.hosts = lib.mkForce [ "files" "libvirt_guest" "mymachines" "dns" "myhostname" ];
83 programs.zsh.enable = true; 83 programs.zsh.enable = true;
84 84
85 users.users.libvirt = {
86 hashedPassword = "!";
87 shell = pkgs.bashInteractive;
88 isSystemUser = true;
89 group = "libvirtd";
90 packages = [ pkgs.netcat-openbsd ];
91 openssh.authorizedKeys.keyFiles = [
92 "${privateFiles}/buildbot_ssh_key.pub"
93 ];
94 openssh.authorizedKeys.keys = [ config.myEnv.sshd.rootKeys.ismael_flony ];
95 };
96
85 users.users.backup = { 97 users.users.backup = {
86 hashedPassword = "!"; 98 hashedPassword = "!";
87 isSystemUser = true; 99 isSystemUser = true;
@@ -118,7 +130,7 @@
118 after = [ "network.target" ]; 130 after = [ "network.target" ];
119 131
120 serviceConfig = { 132 serviceConfig = {
121 ExecStart = "${pkgs.socat}/bin/socat TCP-LISTEN:8022,fork TCP:nixops-99a7e1ba-54dc-11ea-a965-10bf487fe63b-caldance:22"; 133 ExecStart = "${pkgs.socat}/bin/socat TCP-LISTEN:8022,fork TCP:caldance:22";
122 }; 134 };
123 }; 135 };
124 136
@@ -170,7 +182,7 @@
170 recommendedGzipSettings = true; 182 recommendedGzipSettings = true;
171 recommendedProxySettings = true; 183 recommendedProxySettings = true;
172 upstreams = { 184 upstreams = {
173 caldance.servers."nixops-99a7e1ba-54dc-11ea-a965-10bf487fe63b-caldance:3031" = {}; 185 caldance.servers."caldance:3031" = {};
174 }; 186 };
175 virtualHosts = { 187 virtualHosts = {
176 "dev.immae.eu" = { 188 "dev.immae.eu" = {