mirror of
https://github.com/tuxdotrs/tnvim.git
synced 2025-07-06 21:36:34 +05:30
add disko
This commit is contained in:
@ -5,6 +5,8 @@
|
|||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503
|
inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
(./disko.nix {device = "/dev/nvme0n1";})
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../common
|
../common
|
||||||
../../modules/nixos/desktop
|
../../modules/nixos/desktop
|
||||||
|
48
hosts/canopus/disko.nix
Normal file
48
hosts/canopus/disko.nix
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{device ? throw "Set this to the disk device, e.g. /dev/nvme0n1", ...}: {
|
||||||
|
disko.devices.disk.primary = {
|
||||||
|
inherit device;
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt"; # GPT partitioning scheme
|
||||||
|
partitions = {
|
||||||
|
# EFI Partition
|
||||||
|
ESP = {
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = ["defaults" "umask=0077"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# Btrfs Root Partition
|
||||||
|
root = {
|
||||||
|
size = "100%"; # Use remaining space
|
||||||
|
type = "8300"; # Linux filesystem type
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountOptions = ["compress=zstd"]; # Compression for better performance
|
||||||
|
mountpoint = "/"; # Root subvolume
|
||||||
|
};
|
||||||
|
"/persistent" = {
|
||||||
|
mountOptions = ["compress=zstd"]; # Compression for persistent data
|
||||||
|
mountpoint = "/persistent"; # Persistent subvolume
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
"noacl"
|
||||||
|
]; # Optimize for Nix store
|
||||||
|
mountpoint = "/nix"; # Nix subvolume
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -8,26 +8,11 @@
|
|||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/b76b1267-0c4e-425b-aec5-968aece6e55d";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/2A0B-D264";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0022" "dmask=0022" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/disk/by-uuid/f3c7073e-2e51-490f-8668-09faeed74043"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
Reference in New Issue
Block a user