First commit
This commit is contained in:
68
hosts/home-nix/disk-config.nix
Normal file
68
hosts/home-nix/disk-config.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
# disko.devices = {
|
||||
# disk = {
|
||||
# main = {
|
||||
# type = "disk";
|
||||
# device = "/dev/sdb";
|
||||
# content = {
|
||||
# type = "gpt";
|
||||
# partitions = {
|
||||
# ESP = {
|
||||
# size = "512M";
|
||||
# type = "EF00";
|
||||
# content = {
|
||||
# type = "filesystem";
|
||||
# format = "vfat";
|
||||
# mountpoint = "/boot";
|
||||
# mountOptions = [ "umask=0077" ];
|
||||
# };
|
||||
# };
|
||||
# SYS = {
|
||||
# size = "100%";
|
||||
# type = "8309";
|
||||
# content = {
|
||||
# type = "luks";
|
||||
# name = "rootfs";
|
||||
# settings = {
|
||||
# allowDiscards = true;
|
||||
#
|
||||
# };
|
||||
# content = {
|
||||
# type = "btrfs";
|
||||
# extraArgs = [ "-f --nodiscard --label root" ];
|
||||
# subvolumes = {
|
||||
# "@" = {
|
||||
# mountpoint = "/";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# "@root" = {
|
||||
# mountpoint = "/root";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# "@home" = {
|
||||
# mountpoint = "/home";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# "@nix" = {
|
||||
# mountpoint = "/nix";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# "@var" = {
|
||||
# mountpoint = "/var";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# "@games" = {
|
||||
# mountpoint = "/games";
|
||||
# mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
}
|
||||
# sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --yes-wipe-all-disks --mode destroy,format,mount ./disko.nix
|
||||
149
hosts/home-nix/hardware-configuration.nix
Normal file
149
hosts/home-nix/hardware-configuration.nix
Normal file
@@ -0,0 +1,149 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ehci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."rootfs".device = "/dev/disk/by-uuid/77601e4d-358d-49ba-b6e5-f3a68f05060a";
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/9EF7-6EB2";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/games" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@games"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@home"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@nix"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/root" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@root"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var" = {
|
||||
device = "/dev/disk/by-uuid/2271e57f-0b57-4ab7-8238-b84b01974cc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@var"
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
"nodiscard"
|
||||
];
|
||||
};
|
||||
|
||||
environment.etc."crypttab".text = ''
|
||||
datafs UUID=5ca962a7-537f-46ce-ba50-9cc9cefd012b /etc/lukskey
|
||||
'';
|
||||
|
||||
fileSystems."/data" = {
|
||||
device = "/dev/disk/by-uuid/a8ea6a7b-3733-40d8-bee8-45806aaacfe1";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"defaults"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
swapDevices = [ ];
|
||||
|
||||
# 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
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
105
hosts/test-kvm/disk-config.nix
Normal file
105
hosts/test-kvm/disk-config.nix
Normal file
@@ -0,0 +1,105 @@
|
||||
{ ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
SYS = {
|
||||
size = "100%";
|
||||
type = "8309";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "rootfs";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f --nodiscard --label root" ];
|
||||
subvolumes = {
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@root" = {
|
||||
mountpoint = "/root";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@var" = {
|
||||
mountpoint = "/var";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@games" = {
|
||||
mountpoint = "/games";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"ssd"
|
||||
"compress=zstd"
|
||||
"autodefrag"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
# sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --yes-wipe-all-disks --mode destroy,format,mount ./disko.nix
|
||||
29
hosts/test-kvm/hardware-configuration.nix
Normal file
29
hosts/test-kvm/hardware-configuration.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
"virtio_pci"
|
||||
"sr_mod"
|
||||
"virtio_blk"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
Reference in New Issue
Block a user