From 65a91dc324f2acef687e532da38ce57d84cd1359 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 26 Nov 2022 00:37:22 +0100 Subject: [PATCH] stream: skyflakify --- flake.nix | 2 +- hosts/stream/default.nix | 50 ++++++++-------------------------------- 2 files changed, 10 insertions(+), 42 deletions(-) diff --git a/flake.nix b/flake.nix index bf89a486..230b9591 100644 --- a/flake.nix +++ b/flake.nix @@ -797,7 +797,7 @@ stream = nixosSystem' { modules = [ - self.nixosModules.microvm + self.nixosModules.cluster-options ./hosts/stream ]; }; diff --git a/hosts/stream/default.nix b/hosts/stream/default.nix index ca9ea5a1..3e039421 100644 --- a/hosts/stream/default.nix +++ b/hosts/stream/default.nix @@ -1,36 +1,16 @@ -{ zentralwerk, config, pkgs, ... }: +{ zentralwerk, config, lib, pkgs, ... }: let authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY"; - mac = { - pub = "DE:91:C7:51:D1:C5"; - serv = "C6:40:E0:21:9B:A4"; - }; in { networking.hostName = "stream"; c3d2.hq.statistics.enable = true; - c3d2.deployment = { - server = "server9"; - autoNetSetup = false; - mounts = []; + deployment = { + persistedShares = [ "/etc" "/home" "/var" ]; + storage = "big"; + mem = 2048; + networks = lib.mkForce [ "pub" "serv" ]; }; - microvm.mem = 2048; - microvm.interfaces = [ { - type = "tap"; - id = "pub-stream"; - mac = mac.pub; - } { - type = "tap"; - id = "serv-stream"; - mac = mac.serv; - } ]; - microvm.shares = map (name: { - source = "/tank/storage/stream/${name}"; - mountPoint = "/${name}"; - tag = name; - proto = "virtiofs"; - socket = "${name}.socket"; - }) [ "etc" "home" "var" ]; systemd.network = { enable = true; @@ -39,19 +19,14 @@ in # rest of the network so that I am reachable by # public-access-proxy. - links."00-serv" = { - matchConfig.MACAddress = mac.serv; - linkConfig.Name = "serv"; - }; - - networks."00-serv" = { - matchConfig.MACAddress = mac.serv; + networks."30-serv" = { networkConfig.IPv6AcceptRA = false; # try harder disabling global ipv6 networkConfig.LinkLocalAddressing = "no"; addresses = [ { addressConfig.Address = "${config.c3d2.hosts.stream.ip4}/${toString zentralwerk.lib.config.site.net.serv.subnet4Len}"; } ]; + gateway = lib.mkForce []; routes = [ { routeConfig = { Destination = "172.20.0.0/14"; @@ -61,14 +36,7 @@ in }; # On the pub network I am a normal client. - - links."00-pub" = { - matchConfig.MACAddress = mac.pub; - linkConfig.Name = "pub"; - }; - - networks."01-pub" = { - matchConfig.MACAddress = mac.pub; + networks."30-pub" = { networkConfig.DHCP = "ipv4"; networkConfig.IPv6AcceptRA = true; };