feat: Use disko config for mirai

This commit is contained in:
uttarayan21
2025-01-02 18:02:49 +05:30
parent e05a4c5815
commit 315422692d
6 changed files with 169 additions and 43 deletions

22
flake.lock generated
View File

@@ -349,6 +349,27 @@
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1734088167,
"narHash": "sha256-snPBgTqwn3FPZVdFC5yt7Bnk3squim1vZOZ8CObWykk=",
"owner": "nix-community",
"repo": "disko",
"rev": "65a441502c9382d41ada1adbc9bd31d6c9b00fe2",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "latest",
"repo": "disko",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
@@ -2049,6 +2070,7 @@
"csshacks": "csshacks",
"d2": "d2",
"deploy-rs": "deploy-rs",
"disko": "disko",
"flake-utils": "flake-utils_3",
"guihua": "guihua",
"home-manager": "home-manager",

View File

@@ -4,6 +4,10 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";

View File

@@ -18,6 +18,7 @@ builtins.listToAttrs (builtins.map (device: {
modules = [
nur.modules.nixos.default
inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko
{nixpkgs.overlays = overlays;}
./${device.name}/configuration.nix
home-manager.nixosModules.home-manager

View File

@@ -0,0 +1,98 @@
{lib, ...}: {
disko.devices = {
disk = {
one = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
two = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
# esp = {
# size = "1G";
# type = "EF00";
# content = {
# type = "mdraid";
# name = "boot";
# };
# };
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
# mdadm = {
# esp = {
# type = "mdadm";
# level = 1;
# metadata = "1.0";
# content = {
# type = "filesystem";
# format = "vfat";
# mountpoint = "/boot";
# };
# };
# };
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "128G";
lvm_type = "mirror";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
home = {
size = "512G";
lvm_type = "raid0";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
};
};
};
};
}

View File

@@ -10,6 +10,7 @@
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
./disk-config.nix
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci"];
@@ -17,21 +18,21 @@
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/8f805d1b-a469-4db8-9ee1-b98ea220714a";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D840-A590";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
fileSystems."/media" = {
device = "/dev/disk/by-uuid/cad22fc7-08d2-4650-8d5e-a101e3fd1bd1";
fsType = "ext4";
};
# fileSystems."/" = {
# device = "/dev/disk/by-uuid/8f805d1b-a469-4db8-9ee1-b98ea220714a";
# fsType = "ext4";
# };
#
# fileSystems."/boot" = {
# device = "/dev/disk/by-uuid/D840-A590";
# fsType = "vfat";
# options = ["fmask=0022" "dmask=0022"];
# };
#
# fileSystems."/media" = {
# device = "/dev/disk/by-uuid/cad22fc7-08d2-4650-8d5e-a101e3fd1bd1";
# fsType = "ext4";
# };
swapDevices = [];

View File

@@ -2032,7 +2032,7 @@
"[13]",
"[14]"
],
"bogo": 7585.25,
"bogo": 7585.36,
"cache": 1024,
"units": 16,
"physical_id": 0,
@@ -2194,7 +2194,7 @@
"unix_device_number": {
"type": 98,
"major": 259,
"minor": 1,
"minor": 3,
"range": 0
},
"unix_device_names": [
@@ -2983,7 +2983,7 @@
{
"type": "mem",
"base": 0,
"range": 66491928576,
"range": 66491920384,
"enabled": true,
"access": "read_write",
"prefetch": "unknown"
@@ -3112,6 +3112,29 @@
"network_interface": [
{
"index": 74,
"attached_to": 0,
"class_list": [
"network_interface"
],
"base_class": {
"hex": "0107",
"name": "Network Interface",
"value": 263
},
"sub_class": {
"hex": "0000",
"name": "Loopback",
"value": 0
},
"model": "Loopback network interface",
"sysfs_id": "/class/net/lo",
"unix_device_name": "lo",
"unix_device_names": [
"lo"
]
},
{
"index": 75,
"attached_to": 44,
"class_list": [
"network_interface"
@@ -3151,29 +3174,6 @@
"driver_modules": [
"igb"
]
},
{
"index": 75,
"attached_to": 0,
"class_list": [
"network_interface"
],
"base_class": {
"hex": "0107",
"name": "Network Interface",
"value": 263
},
"sub_class": {
"hex": "0000",
"name": "Loopback",
"value": 0
},
"model": "Loopback network interface",
"sysfs_id": "/class/net/lo",
"unix_device_name": "lo",
"unix_device_names": [
"lo"
]
}
],
"pci": [
@@ -3232,7 +3232,7 @@
"resources": [
{
"type": "irq",
"base": 126,
"base": 121,
"triggered": 0,
"enabled": true
},
@@ -3250,7 +3250,7 @@
"command": 7,
"header_type": 0,
"secondary_bus": 0,
"irq": 126,
"irq": 121,
"prog_if": 0
},
"driver": "snd_rpl_pci_acp6x",