From 803e1d4b4f06cd1a64b52474effc805f4396beca Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 8 Sep 2025 19:44:59 +0000 Subject: [PATCH] Merge in working separate nocix config to main nixos-anywhere config This involves renaming the disks because when I rebooted the VM the disk names changed. I also made the root disk just 50G and put the rest in /var, as well as formatting and mounting the big rust disk. --- nixos-anywhere/nocix/configuration.nix | 18 ++++++ nixos-anywhere/nocix/disk-config.nix | 85 ++++++++++++++++++-------- 2 files changed, 77 insertions(+), 26 deletions(-) diff --git a/nixos-anywhere/nocix/configuration.nix b/nixos-anywhere/nocix/configuration.nix index a7fd7b7..df11acb 100644 --- a/nixos-anywhere/nocix/configuration.nix +++ b/nixos-anywhere/nocix/configuration.nix @@ -17,20 +17,38 @@ efiInstallAsRemovable = true; }; environment.systemPackages = map lib.lowPrio [ + pkgs.curl pkgs.dig + pkgs.gitMinimal ]; networking = { defaultGateway = { address = "107.150.59.201"; interface = "enp2s0"; }; + defaultGateway6 = { + address = "2604:4300:a:27e::1"; + interface = "enp2s0"; + }; interfaces.enp2s0 = { ipv4.addresses = [{ address = "107.150.59.202"; prefixLength = 29; }]; + ipv6.addresses = [{ + address = "2604:4300:a:27e::2"; + prefixLength = 64; + }]; }; nameservers = ["192.187.107.16"]; search = ["nocix.net"]; }; + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = + [ + # change this to your ssh key + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHL1SpT3KR8XeXtH19muncYVrKxWzWdWtJYNTwoJGTm3 eliribble@Elis-Mac-mini.local" + ] ++ (args.extraPublicKeys or []); # this is used for unit-testing this module and can be removed if not needed + system.stateVersion = "25.05"; } diff --git a/nixos-anywhere/nocix/disk-config.nix b/nixos-anywhere/nocix/disk-config.nix index f5d3b94..ded0765 100644 --- a/nixos-anywhere/nocix/disk-config.nix +++ b/nixos-anywhere/nocix/disk-config.nix @@ -2,33 +2,55 @@ { lib, ... }: { disko.devices = { - disk.disk1 = { - device = lib.mkDefault "/dev/sda"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; + disk = { + sda = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + MBR = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + boot = { + size = "500M"; + type = "EF00"; # for grub MBR + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + root = { + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; }; }; - root = { - name = "root"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; + }; + }; + sdb = { + device = "/dev/sdb"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + bigdisk = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/mnt/bigdisk"; + mountOptions = [ + "defaults" + ]; + }; }; }; }; @@ -39,7 +61,7 @@ type = "lvm_vg"; lvs = { root = { - size = "100%FREE"; + size = "50G"; content = { type = "filesystem"; format = "ext4"; @@ -49,6 +71,17 @@ ]; }; }; + var = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/var"; + mountOptions = [ + "defaults" + ]; + }; + }; }; }; };