modularize config

This commit is contained in:
DashieTM 2024-07-10 17:03:31 +02:00
parent 09c4625fbb
commit 7a4e46e04f
33 changed files with 230 additions and 168 deletions

View file

@ -1,11 +0,0 @@
{ lib, ... }: {
options.programs.boot = {
boot_params = lib.mkOption {
default = [ ];
example = [ "resume=something" ];
description = ''
Boot params
'';
};
};
}

106
nix/modules/conf.nix Normal file
View file

@ -0,0 +1,106 @@
{ lib, config, pkgs, ... }: {
options.conf = {
monitor = lib.mkOption {
default = "";
example = "eDP-1";
type = lib.types.str;
description = ''
main monitor
'';
};
scale = lib.mkOption {
default = "1.0";
example = "1.0";
type = lib.types.str;
description = ''
Scale for the monitor
'';
};
battery = lib.mkOption {
default = [ ];
example = [ ];
};
amdGpu = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Enables drivers, optimizations and kernel parameters for AMD gpus.
'';
};
boot_params = lib.mkOption {
default = [ ];
example = [ "resume=something" ];
description = ''
Boot params
'';
};
gaming = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Install gaming related programs such as steam, gamemode, and more
'';
};
device = lib.mkOption {
default = 0;
example = 0;
description = ''
GPU device number
'';
};
};
streamdeck = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Install streamdeck configuration program.
'';
};
};
kernel = lib.mkOption {
default = pkgs.linuxPackages_latest;
example = pkgs.linuxPackages_xanmod_latest;
# type = lib.types.package;
description = ''
kernel to be used
'';
};
hostname = lib.mkOption {
default = "nixos";
example = "spaceship";
type = lib.types.str;
description = ''
The name of the system
'';
};
username = lib.mkOption {
default = "dashie";
example = "pingpang";
type = lib.types.str;
description = ''
The username.
'';
};
};
config = {
conf.boot_params = lib.mkIf config.conf.amdGpu [
"amdgpu.ppfeaturemask=0xffffffff"
];
conf.kernel = lib.mkIf config.conf.gaming.enable pkgs.linuxPackages_xanmod_latest;
};
}

View file

@ -1,6 +1,6 @@
{
imports = [
./ironbar_config.nix
./hyprpaper_config.nix
./conf.nix
];
}

View file

@ -1,11 +0,0 @@
{ lib, ... }: {
options.programs.gamemode = {
device = lib.mkOption {
default = 0;
example = 0;
description = ''
GPU device number
'';
};
};
}

View file

@ -1,25 +0,0 @@
{ lib, ... }: {
options.programs.ironbar = {
monitor = lib.mkOption {
default = "";
example = "eDP-1";
type = lib.types.str;
description = ''
main monitor
'';
};
scale = lib.mkOption {
default = "1.0";
example = "1.0";
type = lib.types.str;
description = ''
Scale for the monitor
'';
};
battery = lib.mkOption {
default = [ ];
example = [ ];
};
};
}