1
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
Aires bedfbf991b Fix assertion check for Nvidia GPUs 2024-07-01 15:51:13 -04:00
Aires c96a7820bd Finalize Dimaga's config 2024-07-01 15:51:05 -04:00
3 changed files with 19 additions and 19 deletions

View file

@ -28,17 +28,17 @@ in
apps = { apps = {
development.enable = true; development.enable = true;
media.enable = true; #media.enable = true;
office.enable = true; #office.enable = true;
recording.enable = true; #recording.enable = true;
social.enable = true; #social.enable = true;
writing.enable = true; #writing.enable = true;
}; };
# Enable Secure Boot support. # Enable Secure Boot support.
bootloader = { bootloader = {
enable = true; enable = true;
secureboot.enable = true; #secureboot.enable = true;
tpm2.enable = true; tpm2.enable = true;
}; };
@ -49,11 +49,11 @@ in
gpu = { gpu = {
intel.enable = true; intel.enable = true;
nvidia = { nvidia = {
enable = false; enable = true;
hybrid = { hybrid = {
enable = false; enable = true;
busIDs.nvidia = ""; busIDs.nvidia = "PCI:3:0:0";
busIDs.intel = ""; busIDs.intel = "PCI:0:2:0";
}; };
}; };
}; };

View file

@ -7,8 +7,8 @@
}: }:
let let
primaryDisk = "/dev/disk/by-id/"; luksPartition = "/dev/disk/by-uuid/dfb4fc8f-e82b-43a1-91c1-a77acb6337cb";
luksDevice = ""; luksDevice = "9fdc521b-a037-4070-af47-f54da03675e4";
standardMountOpts = [ standardMountOpts = [
"compress=zstd" "compress=zstd"
"noatime" "noatime"
@ -37,27 +37,27 @@ in
fileSystems = { fileSystems = {
"/" = { "/" = {
device = primaryDisk; device = luksPartition;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ] ++ standardMountOpts; options = [ "subvol=@" ] ++ standardMountOpts;
}; };
"/home" = { "/home" = {
device = primaryDisk; device = luksPartition;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@home" ] ++ standardMountOpts; options = [ "subvol=@home" ] ++ standardMountOpts;
}; };
"/nix" = { "/nix" = {
device = primaryDisk; device = luksPartition;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@nix" ] ++ standardMountOpts; options = [ "subvol=@nix" ] ++ standardMountOpts;
}; };
"/swap" = { "/swap" = {
device = primaryDisk; device = luksPartition;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@swap" ]; options = [ "subvol=@swap" ];
}; };
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/AFCB-D880"; device = "/dev/disk/by-uuid/FC20-D155";
fsType = "vfat"; fsType = "vfat";
}; };
}; };

View file

@ -45,11 +45,11 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ assertions = [
{ {
assertion = (cfg.busIDs.nvidia == ""); assertion = (cfg.hybrid.busIDs.nvidia != "");
message = "You need to define a bus ID for your Nvidia GPU. To learn how to find the bus ID, see https://nixos.wiki/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29."; message = "You need to define a bus ID for your Nvidia GPU. To learn how to find the bus ID, see https://nixos.wiki/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
} }
{ {
assertion = (cfg.busIDs.intel == "" && cfg.busIDs.amd == ""); assertion = (cfg.hybrid.busIDs.intel != "" || cfg.hybrid.busIDs.amd != "");
message = "You need to define a bus ID for your non-Nvidia GPU. To learn how to find your bus ID, see https://nixos.wiki/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29."; message = "You need to define a bus ID for your non-Nvidia GPU. To learn how to find your bus ID, see https://nixos.wiki/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
} }
]; ];