Task: moved hardware options into the niksos.hardware suboptions.
This commit is contained in:
parent
0924f9c267
commit
678c3cb4f7
15 changed files with 99 additions and 82 deletions
|
|
@ -5,8 +5,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (osConfig.niksos) desktop bluetooth;
|
||||
inherit (osConfig.niksos) desktop hardware;
|
||||
inherit (desktop) games;
|
||||
inherit (hardware) bluetooth;
|
||||
in {
|
||||
# Also look at system/programs/games.nix (some programs have to be overlayed or have systemwide modules that have to be installed.)
|
||||
home.packages = lib.mkIf games ([
|
||||
|
|
|
|||
|
|
@ -4,25 +4,27 @@
|
|||
osConfig,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
inherit (lib) optionals;
|
||||
inherit (osConfig.niksos.hardware) bluetooth portable;
|
||||
in {
|
||||
home.packages =
|
||||
[
|
||||
pkgs.ripgrep
|
||||
pkgs.p7zip
|
||||
pkgs.dua
|
||||
pkgs.ffmpeg
|
||||
|
||||
pkgs.usbutils
|
||||
pkgs.pciutils
|
||||
pkgs.inetutils
|
||||
pkgs.aria2
|
||||
pkgs.dua
|
||||
pkgs.file
|
||||
pkgs.ffmpeg
|
||||
pkgs.gurk-rs
|
||||
pkgs.playerctl
|
||||
]
|
||||
++ lib.optionals osConfig.niksos.bluetooth [
|
||||
++ optionals bluetooth [
|
||||
pkgs.ear2ctl
|
||||
]
|
||||
++ lib.optionals osConfig.niksos.portable.enable [
|
||||
++ optionals portable.enable [
|
||||
inputs.somcli.defaultPackage.${pkgs.system}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
}: let
|
||||
inherit (lib) getExe;
|
||||
inherit (config.lib.stylix.colors) base0D;
|
||||
inherit (osConfig.niksos) desktop portable bluetooth;
|
||||
inherit (osConfig.niksos) desktop hardware;
|
||||
inherit (hardware) portable bluetooth;
|
||||
inherit (desktop) games;
|
||||
|
||||
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ in {
|
|||
"${uwsm} finalize"
|
||||
"${hyprlock}" # Lock screen
|
||||
]
|
||||
++ lib.optional osConfig.niksos.portable.enable "powermode sync";
|
||||
++ lib.optional osConfig.niksos.hardware.portable.enable "powermode sync";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ in {
|
|||
hide_cursor = false;
|
||||
no_fade_in = true;
|
||||
};
|
||||
auth."fingerprint:enabled" = true;
|
||||
auth."fingerprint:enabled" = osConfig.niksos.hardware.fingerprint;
|
||||
|
||||
label = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@
|
|||
|
||||
niksos = {
|
||||
server = true;
|
||||
graphics.nvidia = false; #FIXME: Compile error
|
||||
graphics.intel = true;
|
||||
hardware.graphics = {
|
||||
nvidia = false; #FIXME: Compile error
|
||||
intel = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.immich = {
|
||||
|
|
|
|||
|
|
@ -23,18 +23,21 @@
|
|||
|
||||
# programs.evolution.enable = true; # FIXME: move to appropiate place.
|
||||
niksos = {
|
||||
joycond = false; #NOTE: enable when game night lol
|
||||
fingerprint = true;
|
||||
bluetooth = true;
|
||||
portable = {
|
||||
enable = true;
|
||||
hyprland = {
|
||||
powerSaver = ''
|
||||
hyprctl keyword monitor eDP-1,2880x1920@60,0x0,1.5,vrr,1
|
||||
'';
|
||||
performance = ''
|
||||
hyprctl keyword monitor eDP-1,2880x1920@120,0x0,1.5,vrr,1
|
||||
'';
|
||||
hardware = {
|
||||
joycond = false; #NOTE: enable when game night lol
|
||||
fingerprint = true;
|
||||
bluetooth = true;
|
||||
|
||||
portable = {
|
||||
enable = true;
|
||||
hyprland = {
|
||||
powerSaver = ''
|
||||
hyprctl keyword monitor eDP-1,2880x1920@60,0x0,1.5,vrr,1
|
||||
'';
|
||||
performance = ''
|
||||
hyprctl keyword monitor eDP-1,2880x1920@120,0x0,1.5,vrr,1
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
services.fwupd.enable = false;
|
||||
|
||||
niksos = {
|
||||
bluetooth = false;
|
||||
desktop = {
|
||||
enable = false;
|
||||
hyprland = false;
|
||||
|
|
@ -17,20 +16,24 @@
|
|||
apps = false;
|
||||
games = false;
|
||||
};
|
||||
fingerprint = false;
|
||||
graphics = {
|
||||
enable = false;
|
||||
intel = false;
|
||||
nvidia = false;
|
||||
};
|
||||
neovim = false;
|
||||
portable = {
|
||||
enable = false;
|
||||
hyprland = {
|
||||
powerSaver = "";
|
||||
performance = "";
|
||||
hardware = {
|
||||
fingerprint = false;
|
||||
bluetooth = false;
|
||||
joycond = false;
|
||||
graphics = {
|
||||
enable = false;
|
||||
intel = false;
|
||||
nvidia = false;
|
||||
};
|
||||
portable = {
|
||||
enable = false;
|
||||
hyprland = {
|
||||
powerSaver = "";
|
||||
performance = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
neovim = false;
|
||||
server = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options.niksos.bluetooth = lib.mkEnableOption "bluetooth related stuff.";
|
||||
|
||||
config = lib.mkIf config.niksos.bluetooth {
|
||||
config = lib.mkIf config.niksos.hardware.bluetooth {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
input.General.ClassicBondedOnly = false;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
{lib, ...}: let
|
||||
mkEO = lib.mkEnableOption;
|
||||
in {
|
||||
config.hardware.enableRedistributableFirmware = true;
|
||||
|
||||
imports = [
|
||||
./bluetooth.nix
|
||||
|
|
@ -9,4 +11,32 @@
|
|||
./joycond.nix
|
||||
./power.nix
|
||||
];
|
||||
|
||||
options.niksos.hardware = {
|
||||
bluetooth = mkEO "bluetooth related stuff.";
|
||||
fingerprint = mkEO "fingerprint support.";
|
||||
|
||||
graphics = {
|
||||
enable = mkEO "core graphics";
|
||||
intel = mkEO "additional intel drivers";
|
||||
nvidia = mkEO "additoinal nvidia drivers";
|
||||
};
|
||||
|
||||
joycond = mkEO "support for nintendo switch controllers.";
|
||||
|
||||
portable = {
|
||||
enable = mkEO "battery optimisers";
|
||||
hyprland = let
|
||||
gen = mode:
|
||||
lib.mkOption {
|
||||
default = "";
|
||||
description = "Shell commands to run when switching to ${mode} mode.";
|
||||
type = lib.types.lines;
|
||||
};
|
||||
in {
|
||||
powerSaver = gen "power-saver";
|
||||
performance = gen "performance";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.niksos) fingerprint desktop;
|
||||
inherit (config.niksos) hardware desktop;
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
uwsm = lib.getExe pkgs.uwsm;
|
||||
foot = lib.getExe pkgs.foot;
|
||||
in {
|
||||
options.niksos.fingerprint = mkEnableOption "fingerprint support.";
|
||||
config = mkIf fingerprint {
|
||||
config = mkIf hardware.fingerprint {
|
||||
services = {
|
||||
fprintd.enable = true;
|
||||
logind.extraConfig = mkIf desktop.hyprland ''
|
||||
|
|
|
|||
|
|
@ -5,20 +5,14 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) optionals mkEnableOption mkDefault;
|
||||
inherit (config.niksos) graphics;
|
||||
inherit (graphics) enable;
|
||||
inherit (config.niksos.hardware) graphics;
|
||||
inherit (graphics) enable nvidia intel;
|
||||
|
||||
nvidia = graphics.enable && graphics.nvidia;
|
||||
intel = graphics.enable && graphics.intel;
|
||||
Nvidia = enable && nvidia;
|
||||
Intel = enable && intel;
|
||||
in {
|
||||
options.niksos.graphics = {
|
||||
enable = mkEnableOption "core graphics";
|
||||
intel = mkEnableOption "additional intel drivers";
|
||||
nvidia = mkEnableOption "additoinal nvidia drivers";
|
||||
};
|
||||
|
||||
config = {
|
||||
niksos.graphics.enable = mkDefault true;
|
||||
niksos.hardware.graphics.enable = mkDefault true;
|
||||
|
||||
hardware.graphics = {
|
||||
inherit enable;
|
||||
|
|
@ -29,10 +23,10 @@ in {
|
|||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
]
|
||||
++ optionals intel [
|
||||
++ optionals Intel [
|
||||
pkgs.intel-media-driver
|
||||
]
|
||||
++ optionals nvidia [
|
||||
++ optionals Nvidia [
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
extraPackages32 = with pkgs.pkgsi686Linux;
|
||||
|
|
@ -41,18 +35,18 @@ in {
|
|||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
]
|
||||
++ optionals intel [
|
||||
++ optionals Intel [
|
||||
pkgs.pkgsi686Linux.intel-media-driver
|
||||
]
|
||||
++ optionals nvidia [
|
||||
++ optionals Nvidia [
|
||||
pkgs.pkgsi686Linux.nvidia-vaapi-driver
|
||||
];
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = nvidia;
|
||||
modesetting.enable = Nvidia;
|
||||
open = false;
|
||||
};
|
||||
services.xserver.videoDrivers = optionals nvidia ["nvidia"];
|
||||
services.xserver.videoDrivers = optionals Nvidia ["nvidia"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: {
|
||||
options.niksos.joycond = lib.mkEnableOption "support for nintendo switch controllers.";
|
||||
|
||||
config.services = lib.mkIf config.niksos.joycond {
|
||||
config.services = lib.mkIf config.niksos.hardware.joycond {
|
||||
usbmuxd.enable = true;
|
||||
joycond.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,22 +5,8 @@
|
|||
...
|
||||
}: let
|
||||
inherit (config) niksos;
|
||||
cfg = niksos.portable;
|
||||
cfg = niksos.hardware.portable;
|
||||
in {
|
||||
options.niksos.portable = {
|
||||
enable = lib.mkEnableOption "battery optimisers";
|
||||
hyprland = let
|
||||
gen = mode:
|
||||
lib.mkOption {
|
||||
default = "";
|
||||
description = "Shell commands to run when switching to ${mode} mode.";
|
||||
type = lib.types.lines;
|
||||
};
|
||||
in {
|
||||
powerSaver = gen "power-saver";
|
||||
performance = gen "performance";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services = lib.mkIf cfg.enable {
|
||||
logind = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{config, ...}: {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = !config.niksos.portable.enable;
|
||||
openFirewall = !config.niksos.hardware.portable.enable;
|
||||
settings.UseDns = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue