mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
fix(lint): nixfmt the whole tree
This commit is contained in:
parent
643b136863
commit
bf219a30c2
69 changed files with 2605 additions and 1726 deletions
|
|
@ -1,17 +1,33 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.hardware.nvidia;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.aviallon.hardware.nvidia.nouveau = {
|
||||
config = mkOption {
|
||||
description = "nouveau boot config";
|
||||
type = with types; attrsOf (nullOr (oneOf [ int str bool ]));
|
||||
example = { NvBoost = 1; };
|
||||
default = {};
|
||||
type =
|
||||
with types;
|
||||
attrsOf (
|
||||
nullOr (oneOf [
|
||||
int
|
||||
str
|
||||
bool
|
||||
])
|
||||
);
|
||||
example = {
|
||||
NvBoost = 1;
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf (cfg.enable && cfg.variant == "nouveau") {
|
||||
boot.initrd.kernelModules = [ "nouveau" ];
|
||||
|
||||
|
|
@ -19,15 +35,14 @@ in {
|
|||
"nouveau.pstate" = 1;
|
||||
"nouveau.runpm" = 1;
|
||||
"nouveau.modeset" = 1;
|
||||
"nouveau.config" = let
|
||||
toValue = v:
|
||||
if isBool v
|
||||
then toString (if v then 1 else 0)
|
||||
else toString v;
|
||||
filteredConfig = filterAttrs (n: v: ! isNull v) cfg.nouveau.config;
|
||||
configList = mapAttrsToList (n: v: "${n}=${toValue v}") filteredConfig;
|
||||
configString = concatStringsSep "," configList;
|
||||
in trace "Nouveau config: ${configString}" configString;
|
||||
"nouveau.config" =
|
||||
let
|
||||
toValue = v: if isBool v then toString (if v then 1 else 0) else toString v;
|
||||
filteredConfig = filterAttrs (n: v: !isNull v) cfg.nouveau.config;
|
||||
configList = mapAttrsToList (n: v: "${n}=${toValue v}") filteredConfig;
|
||||
configString = concatStringsSep "," configList;
|
||||
in
|
||||
trace "Nouveau config: ${configString}" configString;
|
||||
};
|
||||
|
||||
aviallon.hardware.mesa.enable = mkDefault true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue