diff options
| author | root@dishwasher | 2022-06-26 21:17:20 +0200 |
|---|---|---|
| committer | root@dishwasher | 2022-06-26 21:17:20 +0200 |
| commit | 35e93ce43b12e3be922e37b27f74d5d4b86929f4 (patch) | |
| tree | 14050d1e3f233c53f2ec2e46f9fde1d1a116d163 /hosts | |
| parent | 56ab27d66128ff3891708a5ddde4ecd2a5e3ded5 (diff) | |
nextcloud: init
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/dishwasher/configuration.nix | 1 | ||||
| -rw-r--r-- | hosts/dishwasher/default.nix | 1 | ||||
| -rw-r--r-- | hosts/dishwasher/hardware-configuration.nix | 6 | ||||
| -rw-r--r-- | hosts/dishwasher/mcvm-network.nix | 51 |
4 files changed, 59 insertions, 0 deletions
diff --git a/hosts/dishwasher/configuration.nix b/hosts/dishwasher/configuration.nix index 258c3a5..ea1b070 100644 --- a/hosts/dishwasher/configuration.nix +++ b/hosts/dishwasher/configuration.nix @@ -61,6 +61,7 @@ # List services that you want to enable: # Enable the OpenSSH daemon. + programs.mosh.enable = true; services.openssh = { enable = true; permitRootLogin = "prohibit-password"; diff --git a/hosts/dishwasher/default.nix b/hosts/dishwasher/default.nix index c50e6cf..b6c6651 100644 --- a/hosts/dishwasher/default.nix +++ b/hosts/dishwasher/default.nix @@ -4,5 +4,6 @@ ./hardware-configuration.nix ./secrets.nix ./oxalab.nix + ./mcvm-network.nix ]; } diff --git a/hosts/dishwasher/hardware-configuration.nix b/hosts/dishwasher/hardware-configuration.nix index 68182c8..ebbd0ff 100644 --- a/hosts/dishwasher/hardware-configuration.nix +++ b/hosts/dishwasher/hardware-configuration.nix @@ -31,6 +31,12 @@ options = [ "subvol=var-log" "compress=zstd" "noatime" ]; }; + fileSystems."/var/microvms" = + { device = "/dev/disk/by-uuid/2971597a-b364-405d-8bb2-287556e819e1"; + fsType = "btrfs"; + options = [ "subvol=microvms" "compress=zstd" "noatime" ]; + }; + fileSystems."/nix" = { device = "/dev/disk/by-uuid/2971597a-b364-405d-8bb2-287556e819e1"; fsType = "btrfs"; diff --git a/hosts/dishwasher/mcvm-network.nix b/hosts/dishwasher/mcvm-network.nix new file mode 100644 index 0000000..518cab8 --- /dev/null +++ b/hosts/dishwasher/mcvm-network.nix @@ -0,0 +1,51 @@ +{ config, pkgs, ... }: { + systemd.network = { + netdevs."microvm-bridge".netdevConfig = { + Kind = "bridge"; + Name = "microvm-bridge"; + }; + + networks."0-microvm-bridge" = { + matchConfig.Name = "microvm-bridge"; + networkConfig = { + DHCPServer = false; + IPv6SendRA = true; + }; + addresses = [ { + addressConfig.Address = "10.99.99.1/24"; + } { + addressConfig.Address = "fd12:3456:789a::1/64"; + } ]; + ipv6Prefixes = [ { + ipv6PrefixConfig.Prefix = "fd12:3456:789a::/64"; + } ]; + # networkConfig = { + # Address = "10.99.99.1/24"; + # IPForward = "ipv4"; + # }; + # routes = [{ + # routeConfig = { + # GatewayOnLink = true; + # };}]; + # IPForward = "ipv4"; + # DHCPServer = true; + # IPv6SendRA = true; + # addresses = [{ + # addressConfig.Address = "10.99.99.1/24"; + # }]; + }; + + networks."1-microvm-bridge" = { + matchConfig.Name = "vm-*"; + networkConfig.Bridge = "microvm-bridge"; + }; + }; + + networking.nat = { + enable = true; + enableIPv6 = true; + externalInterface = "enp1s0"; + internalInterfaces = [ "microvm-bridge" ]; + }; + +} |
