From 637433e101fa6c21096c8df3df4fd5fe4f5df438 Mon Sep 17 00:00:00 2001 From: sin serhao Date: Tue, 13 Jan 2026 22:33:20 +0100 Subject: [PATCH] disk --- flake.nix | 21 +++++++++++++++++++ hosts/sin/luks-btrfs-raid.nix | 39 +++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 2263888..592abda 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,26 @@ ); in { + nixosConfigurations = { + sin = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + modules = [ + disko.nixosModules.disko + agenix.nixosModules.default + ./hosts/sin/configuration.nix + ./hosts/sin/hardware-configuration.nix + ] + ++ [ + # modules + ./modules/gitea/sin + ]; + + specialArgs = { + inherit inputs; + }; + }; + }; colmenaHive = colmena.lib.makeHive { meta = { nixpkgs = import nixpkgs { @@ -118,6 +138,7 @@ ]; deployment.targetHost = "192.168.1.14"; + deployment.allowLocalDeployment = true; }; }; devShells = forEachSupportedSystem ( diff --git a/hosts/sin/luks-btrfs-raid.nix b/hosts/sin/luks-btrfs-raid.nix index 1dccbbb..4addbba 100644 --- a/hosts/sin/luks-btrfs-raid.nix +++ b/hosts/sin/luks-btrfs-raid.nix @@ -50,18 +50,39 @@ }; }; - data1 = { + # data1 = { + # type = "disk"; + # device = "/dev/sda"; + # content = { + # type = "gpt"; + # partitions = { + # crypt_p1 = { + # size = "100%"; + # content = { + # type = "luks"; + # name = "p_data1"; # device-mapper name when decrypted + # # Remove settings.keyFile if you want to use interactive password entry + # settings = { + # allowDiscards = true; + # keyFile = "/dev/disk/by-uuid/2021-07-11-12-33-27-00"; + # keyFileSize = 4096; + # }; + # }; + # }; + # }; + # }; + # }; + data = { type = "disk"; - device = "/dev/sda"; + device = "/dev/sdc"; content = { type = "gpt"; partitions = { - crypt_p1 = { + crypt_p = { size = "100%"; content = { type = "luks"; - name = "p_data1"; # device-mapper name when decrypted - # Remove settings.keyFile if you want to use interactive password entry + name = "p_data"; settings = { allowDiscards = true; keyFile = "/dev/disk/by-uuid/2021-07-11-12-33-27-00"; @@ -72,17 +93,17 @@ }; }; }; - data2 = { + data1 = { type = "disk"; device = "/dev/sdb"; content = { type = "gpt"; partitions = { - crypt_p2 = { + crypt_p = { size = "100%"; content = { type = "luks"; - name = "p_data2"; + name = "p_data1"; # Remove settings.keyFile if you want to use interactive password entry settings = { allowDiscards = true; @@ -93,7 +114,7 @@ type = "btrfs"; extraArgs = [ "-d raid0" - "/dev/mapper/p_data1" # Use decrypted mapped device, same name as defined in disk1 + "/dev/mapper/p_data3" # Use decrypted mapped device, same name as defined in disk1 ]; subvolumes = { "/" = {