diff options
Diffstat (limited to 'os/srv')
| -rw-r--r-- | os/srv/autoclicker.nix | 12 | ||||
| -rw-r--r-- | os/srv/compat.nix | 24 | ||||
| -rw-r--r-- | os/srv/docker.nix | 14 | ||||
| -rw-r--r-- | os/srv/files.nix | 46 | ||||
| -rw-r--r-- | os/srv/gaming.nix | 50 | ||||
| -rw-r--r-- | os/srv/kvm.nix | 18 | ||||
| -rw-r--r-- | os/srv/nix-helper.nix | 23 | ||||
| -rw-r--r-- | os/srv/ollama.nix | 28 | ||||
| -rw-r--r-- | os/srv/srv.nix | 13 |
9 files changed, 228 insertions, 0 deletions
diff --git a/os/srv/autoclicker.nix b/os/srv/autoclicker.nix new file mode 100644 index 0000000..84cba2e --- /dev/null +++ b/os/srv/autoclicker.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.autoclicker; +in +{ + options.sys.srv.autoclicker.enable = lib.mkEnableOption "enables wl-autoclicker"; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + wl-autoclicker + ]; + }; +} diff --git a/os/srv/compat.nix b/os/srv/compat.nix new file mode 100644 index 0000000..ab9560f --- /dev/null +++ b/os/srv/compat.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.compat; +in +{ + options.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"; + WINE_RT_PRIO = "1"; + }; + + environment.systemPackages = with pkgs; [ + winetricks + wineWowPackages.waylandFull + ]; + }; +} diff --git a/os/srv/docker.nix b/os/srv/docker.nix new file mode 100644 index 0000000..0ed1541 --- /dev/null +++ b/os/srv/docker.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.docker; +in +{ + options.sys.srv.docker.enable = lib.mkEnableOption "enables the docker container engine"; + config = lib.mkIf cfg.enable { + virtualisation.docker.enable = true; + + environment.systemPackages = [ pkgs.docker-compose ]; + + users.users.${username}.extraGroups = [ "docker" ]; + }; +} diff --git a/os/srv/files.nix b/os/srv/files.nix new file mode 100644 index 0000000..9b5759e --- /dev/null +++ b/os/srv/files.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.files; +in +{ + options.sys.srv.files = { + thunar.enable = lib.mkEnableOption "enables the thunar file manager"; + utils.enable = lib.mkEnableOption "enables compression and trash utilities"; + }; + config = lib.mkMerge [ + { + 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 = { + tumbler.enable = true; + 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/os/srv/gaming.nix b/os/srv/gaming.nix new file mode 100644 index 0000000..ee7f608 --- /dev/null +++ b/os/srv/gaming.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.gaming; +in +{ + options.sys.srv.gaming = { + enable = lib.mkEnableOption "enables gaming utilities"; + steam.enable = lib.mkEnableOption "enables steam utilities"; + vr.enable = lib.mkEnableOption "enables vr support"; + }; + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + programs.gamescope.enable = true; + + programs.gamemode = { + enable = true; + enableRenice = true; + }; + + environment.systemPackages = with pkgs; [ + heroic + prismlauncher + ]; + + home-manager.users.${username}.hm.soft.mangohud.enable = true; + }) + + (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/os/srv/kvm.nix b/os/srv/kvm.nix new file mode 100644 index 0000000..2cf8c26 --- /dev/null +++ b/os/srv/kvm.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.kvm; +in +{ + options.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; + + boot.initrd.kernelModules = lib.optional (config.sys.core.drivers.amd.enable or false) "kvm-amd"; + }; +} diff --git a/os/srv/nix-helper.nix b/os/srv/nix-helper.nix new file mode 100644 index 0000000..6a64201 --- /dev/null +++ b/os/srv/nix-helper.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.nix-helper; +in +{ + options.sys.srv.nix-helper.enable = lib.mkEnableOption "enables nix-helper"; + config = lib.mkIf cfg.enable { + nix.settings = { + trusted-users = [ "root" "${username}" ]; + experimental-features = [ "nix-command" "flakes" ]; + }; + + programs.nh = { + enable = true; + flake = "/etc/nixos"; + }; + + environment.systemPackages = with pkgs; [ + nix-output-monitor + nvd + ]; + }; +} diff --git a/os/srv/ollama.nix b/os/srv/ollama.nix new file mode 100644 index 0000000..11babd6 --- /dev/null +++ b/os/srv/ollama.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.ollama; +in +{ + options.sys.srv.ollama.enable = lib.mkEnableOption "Ollama AI service"; + config = lib.mkIf cfg.enable { + fileSystems."/models" = { + device = "/home/ollama"; + fsType = "none"; + options = [ "bind" ]; + }; + + services.ollama = { + enable = true; + package = pkgs.ollama-rocm; + + user = "ollama"; + models = "/models"; + + syncModels = true; + loadModels = [ + "deepseek-r1:14b" + "qwen3:14b" + ]; + }; + }; +} diff --git a/os/srv/srv.nix b/os/srv/srv.nix new file mode 100644 index 0000000..2da7d50 --- /dev/null +++ b/os/srv/srv.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ./autoclicker + ./compat.nix + ./docker.nix + ./files.nix + ./gaming.nix + ./kvm.nix + ./nix-helper.nix + ./ollama.nix + ]; +} |
