summaryrefslogtreecommitdiff
path: root/sys/srv
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
committeradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
commit791bc419b6dac7c70951981ef6b34cdf85828470 (patch)
tree56d0962fdf829ae942feb1344763e54dbc3c89a3 /sys/srv
parente60410393cea222b16743a1a87f29c06b9b3543b (diff)
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'sys/srv')
-rw-r--r--sys/srv/compat.nix24
-rw-r--r--sys/srv/docker.nix15
-rw-r--r--sys/srv/files.nix44
-rw-r--r--sys/srv/gaming.nix50
-rw-r--r--sys/srv/kvm.nix21
-rw-r--r--sys/srv/nix-helper.nix24
-rw-r--r--sys/srv/ollama.nix37
-rw-r--r--sys/srv/srv.nix12
8 files changed, 227 insertions, 0 deletions
diff --git a/sys/srv/compat.nix b/sys/srv/compat.nix
new file mode 100644
index 0000000..5c08a9b
--- /dev/null
+++ b/sys/srv/compat.nix
@@ -0,0 +1,24 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.compat;
+in
+{
+ options.szpont.sys.srv.compat.enable = lib.mkEnableOption "enables compatibility with windows & x11";
+
+ config = lib.mkIf cfg.enable {
+ programs.xwayland = {
+ enable = true;
+ package = pkgs.xwayland-satellite;
+ };
+
+ environment.sessionVariables = {
+ NIXOS_OZONE_WL = "1";
+ ELECTRON_ENABLE_WAYLAND = "1";
+ };
+
+ environment.systemPackages = with pkgs; [
+ winetricks
+ wineWowPackages.waylandFull
+ ];
+ };
+}
diff --git a/sys/srv/docker.nix b/sys/srv/docker.nix
new file mode 100644
index 0000000..3baa689
--- /dev/null
+++ b/sys/srv/docker.nix
@@ -0,0 +1,15 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.docker;
+in
+{
+ options.szpont.sys.srv.docker.enable = lib.mkEnableOption "docker container engine";
+
+ config = lib.mkIf cfg.enable {
+ virtualisation.docker.enable = true;
+
+ environment.systemPackages = [ pkgs.docker-compose ];
+
+ users.users.adam.extraGroups = [ "docker" ];
+ };
+}
diff --git a/sys/srv/files.nix b/sys/srv/files.nix
new file mode 100644
index 0000000..bbd6ca8
--- /dev/null
+++ b/sys/srv/files.nix
@@ -0,0 +1,44 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.files;
+in
+{
+ options.szpont.sys.srv.files = {
+ thunar.enable = lib.mkEnableOption "thunar file manager";
+ utils.enable = lib.mkEnableOption "compression and trash utilities";
+ };
+
+ config = lib.mkMerge [
+ {
+ szpont.sys.srv.files.utils.enable = lib.mkDefault cfg.thunar.enable;
+ }
+
+ (lib.mkIf cfg.thunar.enable {
+ programs.thunar = {
+ enable = true;
+ plugins = with pkgs.xfce; [
+ thunar-volman
+ thunar-archive-plugin
+ thunar-vcs-plugin
+ ];
+ };
+ services.gnome.gnome-keyring.enable = true;
+ environment.systemPackages = with pkgs; [ file-roller ];
+ })
+
+ (lib.mkIf cfg.utils.enable {
+ services.gvfs.enable = true;
+
+ environment.systemPackages = with pkgs; [
+ trashy
+ gdu
+
+ unzip
+ p7zip
+ unrar
+ pxz
+ pigz
+ ];
+ })
+ ];
+}
diff --git a/sys/srv/gaming.nix b/sys/srv/gaming.nix
new file mode 100644
index 0000000..1eb5472
--- /dev/null
+++ b/sys/srv/gaming.nix
@@ -0,0 +1,50 @@
+{ config, lib, pkgs, username, ... }:
+let
+ cfg = config.szpont.sys.srv.gaming;
+in
+{
+ options.szpont.sys.srv.gaming = {
+ enable = lib.mkEnableOption "enables gaming stuff";
+ steam.enable = lib.mkEnableOption "enables steam stuff";
+ vr.enable = lib.mkEnableOption "enables vr support";
+ };
+
+ config = lib.mkMerge [
+ (lib.mkIf cfg.enable {
+ home-manager.users.${username}.szpont.hm.soft.gaming.enable = true;
+ programs.gamescope.enable = true;
+
+ programs.gamemode = {
+ enable = true;
+ enableRenice = true;
+ };
+
+ environment.systemPackages = with pkgs; [
+ heroic
+ prismlauncher
+ ];
+ })
+
+ (lib.mkIf cfg.steam.enable {
+ programs.steam = {
+ enable = true;
+ localNetworkGameTransfers.openFirewall = true;
+ dedicatedServer.openFirewall = true;
+ remotePlay.openFirewall = false;
+ extest.enable = true;
+ protontricks.enable = true;
+
+ extraCompatPackages = with pkgs; [
+ proton-ge-custom
+ ];
+ };
+ })
+
+ (lib.mkIf cfg.vr.enable {
+ programs.alvr = {
+ enable = true;
+ openFirewall = true;
+ };
+ })
+ ];
+}
diff --git a/sys/srv/kvm.nix b/sys/srv/kvm.nix
new file mode 100644
index 0000000..08c8578
--- /dev/null
+++ b/sys/srv/kvm.nix
@@ -0,0 +1,21 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.kvm;
+in
+{
+ options.szpont.sys.srv.kvm.enable = lib.mkEnableOption "KVM/QEMU virtualization with Virt-Manager";
+
+ config = lib.mkIf cfg.enable {
+ virtualisation.libvirtd = {
+ enable = true;
+ qemu.package = pkgs.qemu_kvm;
+ qemu.swtpm.enable = true;
+ };
+
+ programs.virt-manager.enable = true;
+
+ users.users.adam.extraGroups = [ "libvirtd" ];
+
+ boot.initrd.kernelModules = [ "kvm-amd" ];
+ };
+}
diff --git a/sys/srv/nix-helper.nix b/sys/srv/nix-helper.nix
new file mode 100644
index 0000000..fc81ddb
--- /dev/null
+++ b/sys/srv/nix-helper.nix
@@ -0,0 +1,24 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.nix-helper;
+in
+{
+ options.szpont.sys.srv.nix-helper.enable = lib.mkEnableOption "enables nix-helper";
+
+ config = lib.mkIf cfg.enable {
+ nix.settings = {
+ trusted-users = [ "root" "adam" ];
+ experimental-features = [ "nix-command" "flakes" ];
+ };
+
+ programs.nh = {
+ enable = true;
+ flake = "/etc/nixos";
+ };
+
+ environment.systemPackages = with pkgs; [
+ nix-output-monitor
+ nvd
+ ];
+ };
+}
diff --git a/sys/srv/ollama.nix b/sys/srv/ollama.nix
new file mode 100644
index 0000000..7cb90bf
--- /dev/null
+++ b/sys/srv/ollama.nix
@@ -0,0 +1,37 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.szpont.sys.srv.ollama;
+in
+{
+ options.szpont.sys.srv.ollama = {
+ enable = lib.mkEnableOption "Ollama AI service";
+
+ useRocm = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ description = "whether to use ollama with ROCm support.";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ fileSystems."/models" = {
+ device = "/home/ollama";
+ fsType = "none";
+ options = [ "bind" ];
+ };
+
+ services.ollama = {
+ enable = true;
+ package = if cfg.useRocm then pkgs.ollama-rocm else pkgs.ollama;
+
+ user = "ollama";
+ models = "/models";
+
+ syncModels = true;
+ loadModels = [
+ "deepseek-r1:14b"
+ "qwen3:14b"
+ ];
+ };
+ };
+}
diff --git a/sys/srv/srv.nix b/sys/srv/srv.nix
new file mode 100644
index 0000000..19e959e
--- /dev/null
+++ b/sys/srv/srv.nix
@@ -0,0 +1,12 @@
+{ ... }:
+{
+ imports = [
+ ./compat.nix
+ ./docker.nix
+ ./files.nix
+ ./gaming.nix
+ ./kvm.nix
+ ./nix-helper.nix
+ ./ollama.nix
+ ];
+}