refactor(sys): systemModules -> ooknet

This commit is contained in:
ooks-io 2024-05-26 17:41:49 +12:00
parent 63c39a89ed
commit 104df464f9
52 changed files with 69 additions and 69 deletions

View file

@ -2,7 +2,7 @@
let
inherit (lib) mkIf;
host = config.systemModules.host;
host = config.ooknet.host;
in
{

View file

@ -3,7 +3,7 @@
let
inherit (lib) mkMerge mkEnableOption mkIf versionAtLeast versionOlder;
inherit (builtins) elem;
cpu = config.systemModules.host.hardware.cpu;
cpu = config.ooknet.host.hardware.cpu;
cfg = cpu.amd;
kernelVersion = config.boot.kernelPackages.kernel.version;
kernelVersionAtLeast = versionAtLeast kernelVersion;
@ -11,7 +11,7 @@ let
in
{
options.systemModules.host.hardware.cpu.amd.pstate.enable = mkEnableOption "Enable amd pstate module";
options.ooknet.host.hardware.cpu.amd.pstate.enable = mkEnableOption "Enable amd pstate module";
config = mkIf (elem cpu.type ["amd"]) {
environment.systemPackages = [pkgs.amdctl];

View file

@ -10,7 +10,7 @@ in
./intel.nix
];
options.systemModules.host.hardware.cpu.type = mkOption {
options.ooknet.host.hardware.cpu.type = mkOption {
type = with types; nullOr (enum ["intel" "amd"]);
default = null;
description = "Type of cpu system module to use";

View file

@ -3,13 +3,13 @@
let
inherit (lib) mkIf;
inherit (builtins) elem;
hardware = config.systemModules.host.hardware.cpu;
cpu = config.ooknet.host.hardware.cpu;
in
{
# TODO: put kvm/gvt behind virtualization module flag
config = mkIf (elem hardware.type ["intel"]) {
config = mkIf (elem cpu.type ["intel"]) {
boot = {
kernelModules = ["kvm-intel"];
kernelParams = ["i915.fastboot=1" "enable_gvt=1"];

View file

@ -5,7 +5,7 @@ let
inherit (lib.generators) toLua;
inherit (lib.lists) elem optionals;
# inherit (builtins) elem;
features = config.systemModules.host.hardware.features;
features = config.ooknet.host.hardware.features;
hasBT = (elem "bluetooth" features);
in

View file

@ -1,7 +1,7 @@
{ lib, config, ... }:
let
features = config.systemModules.host.hardware.features;
features = config.ooknet.host.hardware.features;
inherit (lib) mkIf;
inherit (builtins) elem;
in

View file

@ -2,15 +2,15 @@
{ lib, config, pkgs, ... }:
let
features = config.systemModules.host.hardware.features;
cfg = config.systemModules.host.hardware.battery;
features = config.ooknet.host.hardware.features;
cfg = config.ooknet.host.hardware.battery;
inherit (lib) mkIf mkDefault mkOption types;
inherit (builtins) elem;
MHz = x: x * 1000;
in
{
options.systemModules.host.hardware.battery = {
options.ooknet.host.hardware.battery = {
powersave = {
minFreq = mkOption {
type = types.int;

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, self, ... }:
let
features = config.systemModules.host.hardware.features;
features = config.ooknet.host.hardware.features;
inherit (lib) mkIf;
inherit (builtins) elem;
in

View file

@ -14,7 +14,7 @@ in
./video.nix
];
options.systemModules.host.hardware.features = mkOption {
options.ooknet.host.hardware.features = mkOption {
type = with types; listOf (enum ["audio" "video" "bluetooth" "backlight" "battery" "ssd"]);
default = [];
description = "What extra hardware feature system modules to use";

View file

@ -1,7 +1,7 @@
{ lib, config, ... }:
let
features = config.systemModules.host.hardware.features;
features = config.ooknet.host.hardware.features;
inherit (lib) mkIf;
inherit (builtins) elem;
in

View file

@ -4,7 +4,7 @@ let
inherit (lib) mkIf;
inherit (builtins) elem;
isx86Linux = pkgs: with pkgs.stdenv; hostPlatform.isLinux && hostPlatform.isx86;
features = config.systemModules.host.hardware.features;
features = config.ooknet.host.hardware.features;
in
{

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
gpu = config.systemModules.host.hardware.gpu;
gpu = config.ooknet.host.hardware.gpu;
inherit (lib) mkIf mkDefault;
inherit (builtins) elem;
in

View file

@ -11,7 +11,7 @@ in
./nvidia.nix
];
options.systemModules.host.hardware.gpu.type = mkOption {
options.ooknet.host.hardware.gpu.type = mkOption {
type = with types; nullOr (enum ["intel" "amd" "nvidia"]);
default = null;
description = "Type of gpu system module to use";

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
gpu = config.systemModules.host.hardware.gpu;
gpu = config.ooknet.host.hardware.gpu;
inherit (lib) mkIf;
inherit (builtins) elem;

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
gpu = config.systemModules.host.hardware.gpu;
gpu = config.ooknet.host.hardware.gpu;
inherit (lib) mkIf mkDefault;
inherit (builtins) elem;
production = config.boot.kernelPackages.nvidiaPackages.production;