diff --git a/nixos/kolyma-4/disk-configuration.nix b/nixos/kolyma-4/disk-configuration.nix new file mode 100644 index 0000000..a0951c2 --- /dev/null +++ b/nixos/kolyma-4/disk-configuration.nix @@ -0,0 +1,112 @@ +{ + disko.devices = { + disk = { + nvme0n1 = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + BOOT = { + size = "1M"; + type = "EF02"; + priority = 1; + }; + ESP = { + size = "500M"; + type = "EF00"; + priority = 2; + content = { + type = "mdraid"; + name = "boot"; + }; + }; + SWAP = { + size = "130G"; + content = { + type = "mdraid"; + name = "swap"; + }; + }; + ROOT = { + size = "100%"; + content = { + type = "mdraid"; + name = "root"; + }; + }; + }; + }; + }; + nvme1n1 = { + type = "disk"; + device = "/dev/nvme1n1"; + content = { + type = "gpt"; + partitions = { + BOOT = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "mdraid"; + name = "boot"; + }; + }; + SWAP = { + size = "130G"; + content = { + type = "mdraid"; + name = "swap"; + }; + }; + ROOT = { + size = "100%"; + content = { + type = "mdraid"; + name = "root"; + }; + }; + }; + }; + }; + }; + mdadm = { + root = { + type = "mdadm"; + level = 1; + content = { + type = "gpt"; + partitions.primary = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + boot = { + type = "mdadm"; + level = 1; + metadata = "1.0"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + swap = { + type = "mdadm"; + level = 1; + content = { + type = "swap"; + }; + }; + }; + }; +} diff --git a/nixos/kolyma-4/hardware-configuration.nix b/nixos/kolyma-4/hardware-configuration.nix index 2ac41a9..e8b9cb0 100644 --- a/nixos/kolyma-4/hardware-configuration.nix +++ b/nixos/kolyma-4/hardware-configuration.nix @@ -1,4 +1,5 @@ { + inputs, config, lib, pkgs, @@ -6,7 +7,14 @@ ... }: { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + imports = [ + # Disko partitioning + inputs.disko.nixosModules.disko + ./disk-configuration.nix + + # Not available hardware modules + (modulesPath + "/installer/scan/not-detected.nix") + ]; boot.initrd.availableKernelModules = [ "xhci_pci" @@ -28,22 +36,6 @@ ]; }; - fileSystems."/" = { - device = "/dev/disk/by-uuid/76f237de-5eb6-4241-894e-d024a29685c8"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/852A-FFFC"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; - - swapDevices = [ { device = "/dev/disk/by-uuid/82953896-b081-4cc7-ad7b-c82c12a076ef"; } ]; - network = { enable = true; diff --git a/nixos/kolyma-5/hardware-configuration.nix b/nixos/kolyma-5/hardware-configuration.nix index b4fee10..e6b413d 100644 --- a/nixos/kolyma-5/hardware-configuration.nix +++ b/nixos/kolyma-5/hardware-configuration.nix @@ -12,6 +12,7 @@ inputs.disko.nixosModules.disko ./disk-configuration.nix + # Not available hardware modules (modulesPath + "/installer/scan/not-detected.nix") ]; diff --git a/nixos/kolyma-5/services/container.nix b/nixos/kolyma-5/services/container.nix deleted file mode 100644 index aca573d..0000000 --- a/nixos/kolyma-5/services/container.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ outputs, ... }: -{ - imports = [ outputs.nixosModules.container ]; - - # Enable containerization - services.containers = { - enable = true; - instances = { }; - ports = [ ]; - }; -} diff --git a/nixos/kolyma-5/services/default.nix b/nixos/kolyma-5/services/default.nix index 9fe6407..2d2caa7 100644 --- a/nixos/kolyma-5/services/default.nix +++ b/nixos/kolyma-5/services/default.nix @@ -6,9 +6,6 @@ # Bind nameserver service for hosting personal domains ./bind.nix - # List of docker instances hosted in this machine - ./container.nix - # Web server & proxy virtual hosts via caddy ./www.nix ];