Simplify more options

This commit is contained in:
Jimbo 2025-02-02 13:42:37 -05:00
parent fbfedfd761
commit 8c2bf296ca
8 changed files with 33 additions and 58 deletions

View file

@ -1,9 +1,6 @@
{ lib, config, ... }: { config, lib, ... }:
{ {
options.system.wireguard.client.enable = lib.mkOption { options.system.wireguard.client.enable = lib.mkEnableOption "Enable the Wireguard client";
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.system.wireguard.client.enable { config = lib.mkIf config.system.wireguard.client.enable {
networking = { networking = {

View file

@ -1,9 +1,6 @@
{ lib, config, ... }: { config, lib, ... }:
{ {
options.system.wireguard.server.enable = lib.mkOption { options.system.wireguard.server.enable = lib.mkEnableOption "Enable the Wireguard server";
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.system.wireguard.server.enable { config = lib.mkIf config.system.wireguard.server.enable {
networking = { networking = {

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
options.system.wireless.enable = lib.mkOption { options.system.wireless.enable = lib.mkEnableOption "Enable wireless stack";
type = lib.types.bool;
default = true;
};
config = lib.mkIf config.system.wireless.enable { config = lib.mkIf config.system.wireless.enable {
networking.wireless.iwd.enable = true; networking.wireless.iwd.enable = true;

View file

@ -1,17 +1,15 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
services.udev = { services.udev.packages = [
packages = [ (pkgs.writeTextFile {
(pkgs.writeTextFile { name = "10-oculus.rules";
name = "10-oculus.rules"; text = ''KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess"'';
text = ''KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess"''; destination = "/etc/udev/rules.d/10-oculus.rules";
destination = "/etc/udev/rules.d/10-oculus.rules"; })
}) (pkgs.writeTextFile {
(pkgs.writeTextFile { name = "10-pdp.rules";
name = "10-pdp.rules"; text = ''SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666"'';
text = ''SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666"''; destination = "/etc/udev/rules.d/10-pdp.rules";
destination = "/etc/udev/rules.d/10-pdp.rules"; })
}) ];
];
};
} }

View file

@ -1,9 +1,6 @@
{ lib, pkgs, config, ... }: { config, lib, pkgs, ... }:
{ {
options.system.video.nouveau.enable = lib.mkOption { options.system.video.nouveau.enable = lib.mkEnableOption "Enable the Nouveau graphics stack";
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.system.video.nouveau.enable { config = lib.mkIf config.system.video.nouveau.enable {
services.xserver.videoDrivers = [ "nouveau" ]; services.xserver.videoDrivers = [ "nouveau" ];

View file

@ -1,9 +1,6 @@
{ lib, pkgs, config, ... }: { config, lib, pkgs, ... }:
{ {
options.system.video.nvidia.enable = lib.mkOption { options.system.video.nvidia.enable = lib.mkEnableOption "Enable the Nvidia graphics stack";
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.system.video.nvidia.enable { config = lib.mkIf config.system.video.nvidia.enable {
hardware = { hardware = {

View file

@ -1,12 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
options.system.libvirtd = { options.system.libvirtd.enable = lib.mkEnableOption "Enable libvirtd services";
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable libvirtd and such";
};
};
config = lib.mkIf config.system.libvirtd.enable { config = lib.mkIf config.system.libvirtd.enable {
virtualisation = { virtualisation = {

View file

@ -1,18 +1,16 @@
{ config, pkgs, lib, ... }: { config, lib, pkgs, ... }:
{ {
config = lib.mkIf config.system.desktop.enable { xdg.portal = lib.mkIf config.system.desktop.enable {
xdg.portal = { wlr = {
wlr = { enable = lib.mkForce true;
enable = lib.mkForce true; settings.screencast = {
settings.screencast = { max_fps = 60;
max_fps = 60; chooser_type = "simple";
chooser_type = "simple"; chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
};
}; };
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
];
}; };
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
];
}; };
} }