fix: prepare for installing /w nixos-anywhere

This commit is contained in:
Jay Looney 2025-09-12 17:14:06 -05:00
parent b025dbac46
commit 3ae9e4aae3
4 changed files with 92 additions and 84 deletions

View file

@ -6,7 +6,8 @@
../../modules/nixos/desktop.nix ../../modules/nixos/desktop.nix
../../modules/nixos/gaming.nix ../../modules/nixos/gaming.nix
inputs.nixos-hardware.nixosModules.asus-rog-strix-x570e inputs.nixos-hardware.nixosModules.asus-rog-strix-x570e
./hardware.nix #./hardware.nix
./configuration.nix ./configuration.nix
./nvidia.nix
]; ];
} }

View file

@ -7,70 +7,76 @@
# `sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount /tmp/disk-config.nix` # `sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount /tmp/disk-config.nix`
disko.devices = { disko.devices = {
disk = { disk = {
main-disk = { main = {
type = "disk"; type = "disk";
device = "/dev/disk/by-path/pci-0000:08:00.0-ata-2"; device = "/dev/disk/by-path/pci-0000:08:00.0-ata-2";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
size = "512M"; size = "512M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "umask=0077" ]; mountOptions = [ "umask=0077" ];
}; };
}; };
luks = { luks = {
size = "100%"; # Full Disk Encryption size = "100%"; # Full Disk Encryption
content = { content = {
type = "luks"; type = "luks";
name = "crypted"; name = "crypted";
# disable settings.keyFile if you want to use interactive password entry # disable settings.keyFile if you want to use interactive password entry
# passwordFile = "/tmp/secret.key"; # Interactive # passwordFile = "/tmp/secret.key"; # Interactive
settings = { extraOpenArgs = [
allowDiscards = true; "--allow-discards"
#keyFile = "/tmp/secret.key"; "--perf-no_read_workqueue"
}; "--perf-no_write_workqueue"
#additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; ];
content = { settings = {
type = "btrfs"; allowDiscards = true;
extraArgs = [ "-f" ]; # What? crypttabExtraOpts = [ "fido2-device=auto" "token-timeout=10" ];
subvolumes = { #keyFile = "/tmp/secret.key";
"/root" = { };
mountpoint = "/"; #additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
mountOptions = [ content = {
"compress=zstd" type = "btrfs";
"noatime" extraArgs = [ "-L" "nixos" "-f" ]; # What?
]; subvolumes = {
}; "/root" = {
"/home" = { mountpoint = "/";
mountpoint = "/home"; mountOptions = [
mountOptions = [ "compress=zstd"
"compress=zstd" "noatime"
"noatime" ];
]; };
}; "/home" = {
"/nix" = { mountpoint = "/home";
mountpoint = "/nix"; mountOptions = [
mountOptions = [ "compress=zstd"
"compress=zstd" "noatime"
"noatime" ];
]; };
}; "/nix" = {
"/swap" = { mountpoint = "/nix";
mountpoint = "/.swapvol"; mountOptions = [
swap.swapfile.size = "16G"; "compress=zstd"
}; "noatime"
}; ];
}; };
}; "/swap" = {
}; mountpoint = "/.swapvol";
}; swap.swapfile.size = "32G";
};
};
};
};
};
};
}; };
}; };
}; };
}; };
} }

View file

@ -58,27 +58,4 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# GPU Things
# NOTE: The following command can be helpful when diagnosing GPU issues:
# `nix shell nixpkgs#vulkan-tools -c vulkaninfo --summary`
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
# NOTE: This acceptLicense thing was necessary for nvidia packages to begin
# working, and it seems undocumented in the usual places.
# I found it on a forum thread, and then inside the nixpkgs repo.
# https://discourse.nixos.org/t/nvidia-settings-and-nvidia-offload-not-found/37187/23
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/nvidia-x11/generic.nix#L65
nixpkgs.config.nvidia.acceptLicense = true;
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.latest;
modesetting.enable = true;
open = true;
nvidiaSettings = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
};
} }

24
hosts/titanium/nvidia.nix Normal file
View file

@ -0,0 +1,24 @@
{ config, ... }: {
# GPU Things
# NOTE: The following command can be helpful when diagnosing GPU issues:
# `nix shell nixpkgs#vulkan-tools -c vulkaninfo --summary`
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
# NOTE: This acceptLicense thing was necessary for nvidia packages to begin
# working, and it seems undocumented in the usual places.
# I found it on a forum thread, and then inside the nixpkgs repo.
# https://discourse.nixos.org/t/nvidia-settings-and-nvidia-offload-not-found/37187/23
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/nvidia-x11/generic.nix#L65
nixpkgs.config.nvidia.acceptLicense = true;
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.latest;
modesetting.enable = true;
open = true;
nvidiaSettings = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
};
}