Add desk-arch (#1)

Reviewed-on: #1
Co-authored-by: Tristan <tristan@vault81.mozmail.com>
Co-committed-by: Tristan <tristan@vault81.mozmail.com>
This commit is contained in:
Tristan D. 2023-11-02 23:22:08 +01:00 committed by tristan
parent 2bdb43c14a
commit 7b70408842
3 changed files with 264 additions and 0 deletions

View file

@ -123,6 +123,7 @@
}; };
diskoConfigurations = { diskoConfigurations = {
nixos-pulse = import ./systems/nixos-pulse/disko.nix; nixos-pulse = import ./systems/nixos-pulse/disko.nix;
nixos-desk = import ./systems/nixos-desk/disko.nix;
}; };
homeConfigurations = { homeConfigurations = {
"tester@tristan-desk-arch" = home-manager.lib.homeManagerConfiguration { "tester@tristan-desk-arch" = home-manager.lib.homeManagerConfiguration {
@ -174,6 +175,20 @@
] ]
++ osModules; ++ osModules;
}; };
nixos-desk = nixpkgs.lib.nixosSystem {
modules =
[
./systems/nixos-desk
{
_module.args = args;
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
]
++ osModules;
};
}; };
}; };
} }

View file

@ -0,0 +1,65 @@
{ config
, lib
, pkgs
, modulesPath
, system
, inputs
, ...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
../../os-mods/common
../../os-mods/desktop
../../os-mods/network
../../os-mods/virt
../../users
./disko.nix
];
system.stateVersion = "23.05";
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot = {
enable = true;
configurationLimit = 32;
};
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules = [ "amdgpu" "nvme" "xhci_pci" "uas" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ ];
systemd.enable = true;
};
kernelModules = [ "kvm-amd" "amdgpu" ];
extraModulePackages = [ ];
};
services.btrfs.autoScrub.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
networking = {
hostName = "nixos-desk";
useDHCP = lib.mkDefault true;
};
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
hardware = {
opengl = {
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
];
};
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
zramSwap.enable = true;
}

View file

@ -0,0 +1,184 @@
{
disko.devices = {
disk = {
cryptboot_1 = {
type = "disk";
device = "/dev/disk/by-path/pci-0000:08:00.0-nvme-1";
content = {
type = "gpt";
partitions = {
luks = {
# size = "831.5G";
end = "-100G";
label = "Linux LUKS";
type = "8309";
content = {
type = "luks";
name = "cryptboot_1";
extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key";
additionalKeyFiles = [ ];
# content is empty here as the btrfs partition will be created via extraArgs of the cryptroot_1 partition def
};
};
luksSwap = {
# TODO Create
size = "32G";
content = {
type = "luks";
name = "cryptswap_0";
extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key";
additionalKeyFiles = [ ];
content = {
type = "swap";
};
};
};
};
};
};
cryptboot_0 = {
type = "disk";
device = "/dev/disk/by-path/pci-0000:03:00.0-nvme-1";
content = {
type = "gpt";
partitions = {
luks = {
# size = "831.5G";
end = "-100G";
label = "Linux LUKS";
type = "8309";
content = {
type = "luks";
name = "cryptboot_0";
extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key";
additionalKeyFiles = [ ];
content = {
# this partiton needs to be in the last parent part alphabetically to ensure the referenced dev already exists
type = "btrfs";
extraArgs = [
"-L cryptboot_btrfs"
"-f"
"-m raid1"
"-d raid1"
"/dev/mapper/cryptboot_0"
];
subvolumes = {
"/" = {
mountpoint = "/media/@btrfsroot";
mountOptions = [
"rw"
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
};
"/_active" = { };
"/_active/rootvol" = { };
"/_active/pkgvol" = { };
"/_active/nix_rootvol" = {
mountpoint = "/";
mountOptions = [
"rw"
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
};
"/_active/homevol" = {
mountpoint = "/home";
mountOptions = [
"rw"
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
};
"/_active/nixvol" = {
mountpoint = "/nix";
mountOptions = [
"rw"
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
};
};
};
};
};
ESP = {
label = "EFI system partition";
name = "ESP";
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"rw"
"relatime"
"fmask=0022"
"dmask=0022"
"codepage=437"
"iocharset=ascii"
"shortname=mixed"
"utf8"
"errors=remount-ro"
];
};
};
};
};
};
sandisk = {
type = "disk";
device = "/dev/disk/by-path/pci-0000:06:00.0-ata-4";
content = {
type = "gpt";
partitions = {
luks = {
# ~size = "3.4T";
end = "-250G";
label = "Linux filesystem";
type = "8300";
content = {
type = "btrfs";
extraArgs = [ ];
subvolumes = {
"/" = {
mountpoint = "/media/SanDisk";
mountOptions = [
"rw"
"autodefrag"
"compress=zstd"
"discard=async"
"relatime"
"space_cache=v2"
"ssd"
];
};
};
};
};
};
};
};
};
};
}