refactor: extract 'nvidia' module
This commit is contained in:
@@ -38,6 +38,7 @@ in
|
|||||||
(import ../../modules/secrets { inherit lib inputs config; })
|
(import ../../modules/secrets { inherit lib inputs config; })
|
||||||
../../modules/docker
|
../../modules/docker
|
||||||
../../modules/syncthing
|
../../modules/syncthing
|
||||||
|
../../modules/nvidia
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${username} = import ../../home/hosts/andromache {
|
home-manager.users.${username} = import ../../home/hosts/andromache {
|
||||||
@@ -79,18 +80,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
cpu.intel.updateMicrocode = true;
|
|
||||||
graphics.enable = true;
|
|
||||||
nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = true;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = true;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|
||||||
@@ -99,19 +89,15 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
xserver = {
|
locate = {
|
||||||
videoDrivers = [ "nvidia" ];
|
enable = true;
|
||||||
|
package = pkgs.plocate;
|
||||||
};
|
};
|
||||||
|
|
||||||
openssh = {
|
openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
harden = true;
|
harden = true;
|
||||||
};
|
};
|
||||||
locate = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.plocate;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
my.syncthing.enable = true;
|
my.syncthing.enable = true;
|
||||||
|
|
||||||
|
|||||||
22
modules/nvidia/default.nix
Normal file
22
modules/nvidia/default.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixpkgs.allowedUnfree = [
|
||||||
|
"nvidia-x11"
|
||||||
|
"nvidia-persistenced"
|
||||||
|
"nvidia-settings"
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.graphics.enable = true;
|
||||||
|
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
powerManagement.enable = true;
|
||||||
|
powerManagement.finegrained = false;
|
||||||
|
open = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user