options follow my.schema to avoid conflicts

This commit is contained in:
2024-04-19 23:19:21 -06:00
parent f1a1656155
commit 36f4b83c82
30 changed files with 1502 additions and 1657 deletions

View File

@@ -1,47 +0,0 @@
{ config, pkgs, lib, ... }:
with lib; {
users.users.satisfactory = {
home = "/var/lib/satisfactory";
createHome = true;
isSystemUser = true;
group = "satisfactory";
};
users.groups.satisfactory = { };
# boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
networking.enableIPv6 = false;
# nixpkgs.config.allowUnfree = true;
#
networking = {
firewall = {
allowedUDPPorts = [ 15777 15000 7777 27015 ];
allowedUDPPortRanges = [{
from = 27031;
to = 27036;
}];
allowedTCPPorts = [ 27015 27036 ];
};
};
# -beta experimental \
systemd.services.satisfactory = {
preStart = ''
${pkgs.steamcmd}/bin/steamcmd \
+force_install_dir /var/lib/satisfactory/SatisfactoryServer \
+login anonymous \
+app_update 1690800 \
validate \
+quit
'';
script = ''
${pkgs.steam-run}/bin/steam-run /var/lib/satisfactory/SatisfactoryServer/FactoryServer.sh -DisablePacketRouting
'';
serviceConfig = {
Nice = "-5";
Restart = "always";
User = "satisfactory";
WorkingDirectory = "/var/lib/satisfactory";
};
};
}

View File

@@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
{
options.my.services.network.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.network.enable {
networking = {
useDHCP = lib.mkDefault true;
enableIPv6 = false;
networkmanager.enable = true;
extraHosts = ''
192.168.1.64 workstation
192.168.1.69 server
192.168.1.100 miniserver
'';
firewall = { enable = true; };
};
};
}

View File

@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
{
options.my.services.nvidia.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
];
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
};
};
};
}

View File

@@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
let printingDrivers = [ pkgs.hplip pkgs.hplipWithPlugin ];
in {
options.my.services.printing.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.printing.enable {
services.printing = {
enable = true;
drivers = printingDrivers;
};
hardware.sane = {
enable = true;
extraBackends = printingDrivers;
};
users.users.jawz.packages = [ pkgs.gnome.simple-scan ];
};
}

View File

@@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }:
# let
# nixGaming = import (builtins.fetchTarball
# "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
# in
{
imports = [
# nixGaming.nixosModules.pipewireLowLatency
];
options.my.services.sound.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.sound.enable {
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
sound.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# lowLatency = {
# enable = true;
# quantum = 64;
# rate = 48000;
# };
};
};
}