Refactor Systems

This commit is contained in:
Johannes Jöns 2023-03-14 13:50:59 +01:00
parent 4d7de09ec4
commit 9c32ed314c
8 changed files with 101 additions and 70 deletions

View file

@ -0,0 +1,19 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.hardware.bluetooth;
in
{
options.custom.hardware.bluetooth = with types; {
enable = mkBoolOpt false "Whether or not to enable bluetooth";
};
config = mkIf cfg.enable {
hardware.bluetooth.enable = true;
hardware.bluetooth.hsphfpd.enable = !config.services.pipewire.wireplumber.enable;
hardware.bluetooth.powerOnBoot = true;
};
}

View file

@ -0,0 +1,19 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.hardware.rgb;
in
{
options.custom.hardware.rgb = with types; {
enable = mkBoolOpt false "Whether or not to enable openrgb";
motherboard = mkOpt str "intel" "Which motherboard to use"; # Move to common CPU module at some point
};
config = mkIf cfg.enable {
services.hardware.openrgb.enable = true;
services.hardware.openrgb.motherboard = cfg.motherboard;
};
}

View file

@ -0,0 +1,21 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.programs.steam;
in
{
options.custom.programs.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable Steam.";
};
config = mkIf cfg.enable {
hardware.steam-hardware.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
}

View file

@ -6,21 +6,6 @@ with lib;
imports = [ ./hardware.nix ]; imports = [ ./hardware.nix ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
custom.system.boot.uboot.enable = true;
custom.system.xdg.enable = true;
custom.system.fonts.enable = true;
custom.system.locale.enable = true;
custom.system.locale.layout = "us";
custom.system.ssh.enable = true;
custom.nix.enable = true;
custom.hardware.audio.enable = true;
custom.hardware.printing.enable = true;
custom.desktop.plasma.enable = true;
custom.user.jopejoe1.enable =true;
custom.user.root.enable =true;
networking.hostName = "yokai"; networking.hostName = "yokai";
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -32,4 +17,20 @@ with lib;
xwayland.enable = true; xwayland.enable = true;
}; };
# System
custom.system.boot.uboot.enable = true;
custom.system.xdg.enable = true;
custom.system.fonts.enable = true;
custom.system.locale.enable = true;
custom.system.locale.layout = "us";
custom.system.ssh.enable = true;
custom.nix.enable = true;
custom.hardware.audio.enable = true;
custom.hardware.printing.enable = true;
custom.desktop.plasma.enable = true;
custom.hardware.bluetooth.enable = true;
# User
custom.user.jopejoe1.enable = true;
custom.user.root.enable = true;
} }

View file

@ -5,17 +5,6 @@
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
hardware.nvidia.prime = {
offload.enable = false;
sync.enable = true;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
boot = { boot = {
kernelPackages = pkgs.linuxPackages_zen; kernelPackages = pkgs.linuxPackages_zen;
@ -49,6 +38,4 @@
# high-resolution display # high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true; hardware.video.hidpi.enable = lib.mkDefault true;
hardware.bluetooth.enable = true;
} }

View file

@ -29,7 +29,6 @@
#boot.kernelParams = [ "module_blacklist=i915" ]; #boot.kernelParams = [ "module_blacklist=i915" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
git
prismlauncher prismlauncher
libsForQt5.discover libsForQt5.discover
knossos knossos
@ -40,16 +39,9 @@
carla carla
]; ];
services.hardware.openrgb.enable = true;
services.hardware.openrgb.motherboard = "intel";
hardware.nvidia.modesetting.enable = true; hardware.nvidia.modesetting.enable = true;
hardware.steam-hardware.enable = true;
services.flatpak.enable = true; services.flatpak.enable = true;
hardware.bluetooth.enable = true;
hardware.bluetooth.hsphfpd.enable = false; # Conflicts with wireplumber
hardware.bluetooth.powerOnBoot = true;
programs = { programs = {
dconf.enable = true; dconf.enable = true;
@ -57,16 +49,11 @@
sysdig.enable = true; sysdig.enable = true;
xwayland.enable = true; xwayland.enable = true;
kdeconnect.enable = true; kdeconnect.enable = true;
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
}; };
# Migrated Stuff # Migrated Stuff
custom.user.jopejoe1.enable =true; custom.user.jopejoe1.enable = true;
custom.user.root.enable =true; custom.user.root.enable = true;
custom.system.locale.enable = true; custom.system.locale.enable = true;
custom.system.locale.layout = "de"; custom.system.locale.layout = "de";
custom.nix.enable = true; custom.nix.enable = true;
@ -78,6 +65,12 @@
custom.hardware.printing.enable = true; custom.hardware.printing.enable = true;
custom.system.ssh.enable = true; custom.system.ssh.enable = true;
custom.hardware.rgb.enable = true;
custom.hardware.rgb.motherboard = "intel";
custom.hardware.bluetooth.enable = true;
custom.programs.steam.enable = true;
# Currently broken # Currently broken
#custom.system.dns.enable = true; #custom.system.dns.enable = true;
} }

View file

@ -6,6 +6,18 @@ with lib;
imports = [ ./hardware.nix ]; imports = [ ./hardware.nix ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.hostName = "oni";
time.timeZone = "Europe/Berlin";
hardware.opengl.enable = true;
programs = {
dconf.enable = true;
droidcam.enable = true;
sysdig.enable = true;
xwayland.enable = true;
};
# System
custom.system.boot.uefi.enable = true; custom.system.boot.uefi.enable = true;
custom.system.xdg.enable = true; custom.system.xdg.enable = true;
@ -18,19 +30,11 @@ with lib;
custom.hardware.printing.enable = true; custom.hardware.printing.enable = true;
custom.desktop.plasma.enable = true; custom.desktop.plasma.enable = true;
custom.system.ssh.enable = true;
custom.hardware.bluetooth.enable = true;
custom.programs.steam.enable = true;
# Users
custom.user.jopejoe1.enable =true; custom.user.jopejoe1.enable =true;
custom.user.root.enable =true; custom.user.root.enable =true;
networking.hostName = "oni";
time.timeZone = "Europe/Berlin";
hardware.opengl.enable = true;
programs = {
dconf.enable = true;
droidcam.enable = true;
sysdig.enable = true;
xwayland.enable = true;
};
} }

View file

@ -7,22 +7,11 @@ in
imports = with nixos-hardware.nixosModules; [ imports = with nixos-hardware.nixosModules; [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
common-cpu-amd common-cpu-amd
#common-gpu-nvidia common-gpu-amd
common-pc common-pc
#common-pc-ssd #common-pc-ssd
]; ];
hardware.nvidia.prime = {
offload.enable = false;
sync.enable = false;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
boot = { boot = {
kernelPackages = pkgs.linuxPackages_zen; kernelPackages = pkgs.linuxPackages_zen;
@ -60,6 +49,4 @@ in
# high-resolution display # high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true; hardware.video.hidpi.enable = lib.mkDefault true;
hardware.bluetooth.enable = true;
} }