Compare commits

...

5 Commits

Author SHA1 Message Date
chn
8ef28b9de5 hardware.legion: init 2024-01-14 14:55:39 +08:00
chn
c8e0c74535 hardware: fix nvidia modesetting 2024-01-14 12:42:30 +08:00
chn
d5a3a6b05a fix afdko 2024-01-14 12:42:19 +08:00
chn
00901f5cb5 packages.workstation: remove quantum-espresso 2024-01-14 12:21:27 +08:00
chn
c83505da53 pc: switch to znver4 2024-01-13 22:29:51 +08:00
6 changed files with 45 additions and 26 deletions

12
flake.lock generated
View File

@@ -1235,11 +1235,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1705033419,
"narHash": "sha256-+0+qKqx0m1DcsES2ZiDtu/4PQSfrTEt9r3EUEX/9E74=",
"lastModified": 1705206924,
"narHash": "sha256-ZB0W++4WdnZDu1DsRE4p0Tx/ny9eoiHqc52xs2x4/jE=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "3e3ec807be81dca69ba2a0a7c23116a13d59d95f",
"rev": "c0897b655164d1e3cad4994115c5d243cb5c7b9a",
"type": "github"
},
"original": {
@@ -1251,11 +1251,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1705033395,
"narHash": "sha256-hgtpa0kL+yR68MMFvFgLiYU9L/itTOSSaAU+2itJeFM=",
"lastModified": 1705206885,
"narHash": "sha256-mAtILKaHAhYSgbyIo86cThNvbPeGgaVp3mZzaSjYtl0=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "4573af2db4b9c2f5aa681599f6a20ce42ced30fb",
"rev": "222b2e7737a93cbcdec2dad622502bf18cc99dd3",
"type": "github"
},
"original": {

View File

@@ -96,29 +96,31 @@
};
grub =
{
windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
# TODO: install windows
# windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
nix =
{
marches =
[
"alderlake"
# CX16
"znver2" "znver3" "znver4"
# FXSR SAHF XSAVE
"sandybridge"
# CX16 SAHF FXSR
# FXSR PREFETCHW RDRND SAHF
"silvermont"
# RDSEED MWAITX SHA CLZERO CX16 SSE4A ABM CLFLUSHOPT WBNOINVD
"znver2" "znver3"
# CX16 SAHF FXSR HLE RDSEED
# FXSR HLE LZCNT PREFETCHW RDRND SAHF XSAVE
"broadwell"
"znver4"
# AVX-VNNI CLDEMOTE GFNI-SSE HRESET KL LZCNT MOVDIR64B MOVDIRI PCONFIG PREFETCHW PTWRITE RDRND
# SERIALIZE SGX WAITPKG WIDEKL XSAVE XSAVEOPT
"alderlake"
# TODO: adjust skylake
"skylake"
];
keepOutputs = true;
};
nixpkgs =
{ march = "alderlake"; cuda = { enable = true; capabilities = [ "8.6" ]; forwardCompat = false; }; };
{ march = "znver4"; cuda = { enable = true; capabilities = [ "8.9" ]; forwardCompat = false; }; };
kernel.patches = [ "cjktty" "lantian" ];
impermanence.enable = true;
networking.hostname = "pc";
@@ -126,14 +128,13 @@
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" "nvidia" ];
cpus = [ "amd" ];
gpus = [ "amd" "nvidia" ];
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
sound.enable = true;
prime = { enable = true; mode = "offload"; busId = { intel = "PCI:0:2:0"; nvidia = "PCI:1:0:0"; }; };
gamemode.drmDevice = 1;
legion.enable = true;
};
packages.packageSet = "workstation";
virtualization =
@@ -203,11 +204,7 @@
wireguardIp = "192.168.83.3";
};
};
bugs =
[
"suspend-hibernate-no-platform" "hibernate-iwlwifi" "suspend-lid-no-wakeup" "xmunet"
"suspend-hibernate-waydroid" "power"
];
bugs = [ "xmunet" "suspend-hibernate-waydroid" ];
};
vps6 =
{

View File

@@ -1,5 +1,6 @@
inputs:
{
imports = inputs.localLib.mkModules [ ./legion.nix ];
options.nixos.hardware = let inherit (inputs.lib) mkOption types; in
{
bluetooth.enable = mkOption { type = types.bool; default = false; };
@@ -114,7 +115,11 @@ inputs:
concatLists (map (gpu: packages.${gpu}) hardware.gpus);
driSupport32Bit = true;
};
nvidia.nvidiaSettings = builtins.elem "nvidia" hardware.gpus;
nvidia = mkIf (builtins.elem "nvidia" hardware.gpus)
{
modesetting.enable = true;
nvidiaSettings = true;
};
};
}
)

View File

@@ -0,0 +1,16 @@
inputs:
{
options.nixos.hardware.legion = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.hardware) legion;
in mkIf legion.enable
{
environment.systemPackages = [ inputs.pkgs.lenovo-legion ];
boot.extraModulePackages = [ inputs.config.boot.kernelPackages.lenovo-legion-module ];
};
}

View File

@@ -33,7 +33,7 @@ inputs:
# text editor
appflowy notion-app-enhanced joplin-desktop standardnotes logseq
# math, physics and chemistry
mathematica octaveFull root ovito paraview localPackages.vesta qchem.quantum-espresso
mathematica octaveFull root ovito paraview localPackages.vesta # qchem.quantum-espresso
localPackages.vasp localPackages.vaspkit jmol localPackages.v_sim
# encryption and password management
john crunch hashcat

View File

@@ -141,6 +141,7 @@ inputs:
skylake = "MSKYLAKE";
znver2 = "MZEN2";
znver3 = "MZEN3";
znver4 = "MZEN4";
};
in { GENERIC_CPU = inputs.lib.kernel.no; ${kernelConfig.${nixpkgs.march}} = inputs.lib.kernel.yes; };
}];