add: more system modules
This commit is contained in:
parent
47eb3e0691
commit
793cc3131c
17 changed files with 291 additions and 56 deletions
17
system/profiles/base/default.nix
Normal file
17
system/profiles/base/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemProfile.base;
|
||||
in
|
||||
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemModules = {
|
||||
security.enable = true;
|
||||
nixOptions.enable = true;
|
||||
pipewire.enable = true;
|
||||
networking.enable = true;
|
||||
locale.enable = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
40
system/profiles/default.nix
Normal file
40
system/profiles/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
profileEnabler = let
|
||||
reducer = l: r: {"${r}".enable = true;} // l;
|
||||
in
|
||||
builtins.foldl' reducer {} config.activeProfiles;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./base
|
||||
./nvidia
|
||||
#./gaming
|
||||
#./laptop
|
||||
];
|
||||
|
||||
options = {
|
||||
activeProfiles = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [];
|
||||
};
|
||||
|
||||
systemProfiles = {
|
||||
base = {
|
||||
enable = lib.mkEnableOption "Enable the base profile";
|
||||
};
|
||||
gaming = {
|
||||
enable = lib.mkEnableOption "Enable the gaming profile";
|
||||
};
|
||||
laptop = {
|
||||
enable = lib.mkEnableOption "Enable the laptop profile";
|
||||
};
|
||||
nvidia = {
|
||||
enable = lib.mkEnableOption "Enable the nvidia profile";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.profiles = profileEnabler;
|
||||
}
|
||||
30
system/profiles/gaming/default.nix
Normal file
30
system/profiles/gaming/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemProfile.gaming;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nix-gaming.nixosModules.pipewireLowLatency
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.opengl.extraPackages = [ pkgs.gamescope ];
|
||||
programs = {
|
||||
steam.enable = true;
|
||||
gamescope = {
|
||||
enable = true;
|
||||
capsSysNice = true;
|
||||
};
|
||||
gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
softrealtime = "auto";
|
||||
renice = 15;
|
||||
};
|
||||
};
|
||||
};
|
||||
services.pipewire.lowLatency.enable = true;
|
||||
};
|
||||
}
|
||||
29
system/profiles/nvidia/default.nix
Normal file
29
system/profiles/nvidia/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemProfile.nvidia;
|
||||
production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
in
|
||||
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
harware.nvidia = {
|
||||
open = true;
|
||||
package = production;
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = true;
|
||||
powerManagement.enable = false;
|
||||
};
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
environment.sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
vulkan-tools
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue