formatting

This commit is contained in:
mjallen18
2024-02-28 21:49:51 -06:00
parent bdfd5e92b7
commit 347d30094b
40 changed files with 459 additions and 503 deletions

View File

@@ -1,14 +1,13 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.share.hardware.amd;
let cfg = config.share.hardware.amd;
in {
imports = [
./options.nix
];
imports = [ ./options.nix ];
config = mkIf cfg.enable {
boot.kernelParams = [ (if cfg.corectrl.enable then "amdgpu.ppfeaturemask=0xffffffff" else "") ];
boot.kernelParams = [
(if cfg.corectrl.enable then "amdgpu.ppfeaturemask=0xffffffff" else "")
];
# Configure programs
programs.corectrl.enable = cfg.corectrl.enable;
@@ -42,7 +41,7 @@ in {
return polkit.Result.YES;
}
});
'';
'';
};
};
}

View File

@@ -1,9 +1,8 @@
{ lib, ... }:
with lib;
{
with lib; {
options.share.hardware.amd = {
enable = mkEnableOption "amd hardware config";
corectrl.enable = mkOption {
type = types.bool;
default = false;

View File

@@ -1,7 +1 @@
{ ... }:
{
imports = [
./amd
./nvidia
];
}
{ ... }: { imports = [ ./amd ./nvidia ]; }

View File

@@ -1,5 +1,4 @@
{ pkgs, lib, LT, config, utils, inputs, ... }@args:
{
{ pkgs, lib, LT, config, utils, inputs, ... }@args: {
# Set up impernance configuration for things like bluetooth
# In this configuration with /etc and /var/log being persistent, only directories outside of that need to be done here. See hardware configuration for all mountpoints.
@@ -11,10 +10,16 @@
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/etc/secureboot"
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
];
files = [
{ file = "/etc/nix/id_rsa"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
{
directory = "/var/lib/colord";
user = "colord";
group = "colord";
mode = "u=rwx,g=rx,o=";
}
];
files = [{
file = "/etc/nix/id_rsa";
parentDirectory = { mode = "u=rwx,g=,o="; };
}];
};
}
}

View File

@@ -1,18 +1,18 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.share.hardware.nvidia;
let cfg = config.share.hardware.nvidia;
in {
imports = [
./options.nix
];
imports = [ ./options.nix ];
config = mkIf cfg.enable {
hardware = {
# Nvidia
nvidia = {
package = if cfg.enableBeta then config.boot.kernelPackages.nvidiaPackages.beta else config.boot.kernelPackages.nvidiaPackages.latest;
package = if cfg.enableBeta then
config.boot.kernelPackages.nvidiaPackages.beta
else
config.boot.kernelPackages.nvidiaPackages.latest;
# Modesetting is required.
modesetting.enable = true;
@@ -36,7 +36,7 @@ in {
# accessible via `nvidia-settings`.
nvidiaSettings = cfg.nvidiaSettings;
};
# Enable OpenGL
opengl = {
enable = true;
@@ -45,14 +45,12 @@ in {
};
};
# Services configs
services.xserver = {
# Load nvidia driver for Xorg and Wayland
videoDrivers = ["nvidia"];
videoDrivers = [ "nvidia" ];
};
# Virtualisation
virtualisation.docker.enableNvidia = cfg.enableNvidiaDocker;
};

View File

@@ -1,9 +1,8 @@
{ lib, ... }:
with lib;
{
with lib; {
options.share.hardware.nvidia = {
enable = mkEnableOption "nvidia hardware config";
enableOpen = mkOption {
type = types.bool;
default = false;