From 51db5ee7713f39ed4335709235b4fae154acb193 Mon Sep 17 00:00:00 2001 From: Wekuz Date: Sat, 22 Nov 2025 14:11:21 +0200 Subject: [PATCH] changed config --- TODO | 1 + flake.nix | 54 +++++++++++++++++++++++++++++++++-- hosts/opti/default.nix | 2 +- hosts/opti/disko-config.nix | 47 +++++++++++++++++++++++++++++++ hosts/opti/disko.nix | 56 ------------------------------------- 5 files changed, 101 insertions(+), 59 deletions(-) create mode 100644 hosts/opti/disko-config.nix delete mode 100644 hosts/opti/disko.nix diff --git a/TODO b/TODO index 9efa0b0..db1e6ce 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,3 @@ - distributed build (https://nix.dev/tutorials/nixos/distributed-builds-setup) - setup script (https://github.com/jakeb-grant/nix-configs/blob/main/setup.sh) +- swap diff --git a/flake.nix b/flake.nix index 4eed61c..e1c00f1 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; disko = { - url = "github:nix-community/disko"; + url = "github:nix-community/disko/latest"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -14,7 +14,57 @@ nixosConfigurations = { opti = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ disko.nixosModules.disko ./hosts/opti ]; + modules = [ + ./hosts/opti + disko.nixosModules.disko + { + disko.devices = { + disk = { + main = { + type = "disk"; + device = + "/dev/disk/by-id/nvme-eui.00000000000000000c82d58020000000"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + primary = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + subvolumes = { + "/rootfs" = { mountpoint = "/"; }; + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "/home/wekuz" = { }; + "/nix" = { + mountOptions = [ "compress=zstd" "noatime" ]; + mountpoint = "/nix"; + }; + }; + + mountpoint = "/partition-root"; + }; + }; + }; + }; + }; + }; + }; + } + ]; }; }; }; diff --git a/hosts/opti/default.nix b/hosts/opti/default.nix index 29c1b30..d29cfb6 100644 --- a/hosts/opti/default.nix +++ b/hosts/opti/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: { - imports = [ ./hardware-configuration.nix ./disko.nix ./configuration.nix ]; + imports = [ ./hardware-configuration.nix ]; nix = { package = pkgs.nixFlakes; diff --git a/hosts/opti/disko-config.nix b/hosts/opti/disko-config.nix new file mode 100644 index 0000000..325edbe --- /dev/null +++ b/hosts/opti/disko-config.nix @@ -0,0 +1,47 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = + "/dev/disk/by-id/nvme-eui.00000000000000000c82d58020000000"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + primary = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + subvolumes = { + "/rootfs" = { mountpoint = "/"; }; + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "/home/wekuz" = { }; + "/nix" = { + mountOptions = [ "compress=zstd" "noatime" ]; + mountpoint = "/nix"; + }; + }; + + mountpoint = "/partition-root"; + }; + }; + }; + }; + }; + }; + }; + } diff --git a/hosts/opti/disko.nix b/hosts/opti/disko.nix deleted file mode 100644 index 3362694..0000000 --- a/hosts/opti/disko.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - disko.devices = { - disk = { - one = { - type = "disk"; - device = "/dev/disk/by-id/nvme-eui.00000000000000000c82d58020000000"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - primary = { - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "96G"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ "defaults" ]; - }; - }; - home = { - size = "100%FREE"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/home"; - }; - }; - }; - }; - }; - }; -}