From ac3c056e03c761037df9fa097adade7715f095cf Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 25 Jan 2025 18:57:48 +0000 Subject: [PATCH] various cloudnix modifications --- flake.lock | 8 +++---- hosts/cloudnix/default.nix | 17 +++++++++++++-- hosts/common/disks/btrfs/legacy.nix | 34 ++++++++++++++--------------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 267706f..8bf7750 100644 --- a/flake.lock +++ b/flake.lock @@ -539,11 +539,11 @@ }, "nix-secrets": { "locked": { - "lastModified": 1737813653, - "narHash": "sha256-2ZZAuL6fZiwh2Nh1vx4EgFuNueJ3LCBKomsgByOV1k4=", + "lastModified": 1737831370, + "narHash": "sha256-SknkmBjTklrzrXaVALsIIOtu1r8TP35NEfhST6zJyH4=", "ref": "refs/heads/master", - "rev": "8d063046441c3c408197a7226e43b4e7ccdf68f1", - "revCount": 254, + "rev": "148154f0b8bdaf085ea16562822f55c810b55bac", + "revCount": 255, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, diff --git a/hosts/cloudnix/default.nix b/hosts/cloudnix/default.nix index b396bdd..1fe6c4e 100644 --- a/hosts/cloudnix/default.nix +++ b/hosts/cloudnix/default.nix @@ -7,6 +7,7 @@ }: let user = "admin"; merlinIp = configVars.networking.addresses.merlin.ip; + cloudnixIp = configVars.networking.addresses.cloudnix.ip; btrfsMountDevice = "/dev/sda2"; in { imports = [ @@ -35,9 +36,10 @@ in { boot = { loader = { + efi.canTouchEfiVariables = false; grub = { enable = true; - devices = ["/dev/sda1"]; + devices = ["/dev/sda"]; }; }; }; @@ -57,7 +59,7 @@ in { pushUpdates = false; configDir = "/etc/nixos"; onCalendar = "*-*-* 06:00:00"; - user = "sam"; + user = "admin"; }; networking = { @@ -66,5 +68,16 @@ in { firewall.enable = true; }; + systemd.network.networks."10-wan" = { + networkConfig.DHCP = "no"; + address = [ + "${cloudnixIp}/32" + ]; + routes = [ + { routeConfig = { Destination = "172.31.1.1"; }; } + { routeConfig = { Gateway = "172.31.1.1"; GatewayOnLink = true; }; } + ]; + }; + services.libinput.enable = true; } diff --git a/hosts/common/disks/btrfs/legacy.nix b/hosts/common/disks/btrfs/legacy.nix index 6de397a..5155479 100644 --- a/hosts/common/disks/btrfs/legacy.nix +++ b/hosts/common/disks/btrfs/legacy.nix @@ -2,30 +2,28 @@ disko.devices = { disk = { main = { - device = "/dev/sda"; type = "disk"; + device = "/dev/sda"; content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "ESP"; - start = "1M"; - end = "512M"; - bootable = true; + type = "gpt"; + partitions = { + BOOT = { + size = "1M"; + type = "EF02"; + priority = 1; + }; + ESP = { + size = "512M"; + type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = ["umask=0077"]; }; - } - { - name = "root"; - start = "513M"; - end = "100%"; - part-type = "primary"; - bootable = true; + }; + root = { + size = "100%"; content = { type = "btrfs"; extraArgs = ["-f"]; @@ -50,8 +48,8 @@ }; }; }; - } - ]; + }; + }; }; }; };