From 2e366abf7d98ffe4f6c34616e6262e6a851c55d6 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 6 Apr 2024 18:18:30 -0400 Subject: [PATCH] containers: Move wine config to separate file --- containers/wine.nix | 62 ++++++++++++++++++++++++++++++++++++++++++ modules/containers.nix | 58 ++------------------------------------- 2 files changed, 64 insertions(+), 56 deletions(-) create mode 100644 containers/wine.nix diff --git a/containers/wine.nix b/containers/wine.nix new file mode 100644 index 00000000..b96fe2fd --- /dev/null +++ b/containers/wine.nix @@ -0,0 +1,62 @@ +{ nix-config, config, lib, pkgs, ... }: + +let + inherit (nix-config.inputs) sakaya; + inherit (config.modules.system) username; +in +{ + networking.nat.forwardPorts = [ + { + destination = "192.168.100.49:39493"; + sourcePort = 39493; + } + { + destination = "192.168.100.49:5029"; + sourcePort = 5029; + } + ]; + + networking.firewall.allowedTCPPorts = [ + 39493 + 5029 + ]; + + systemd.services.sakaya = { + enable = true; + description = "sakaya server"; + + unitConfig = { + Type = "simple"; + }; + + path = with pkgs; [ + su + ]; + + serviceConfig = { + ExecStart = "/usr/bin/env su ${username} --command=${sakaya.packages.${pkgs.system}.sakaya}/bin/sakaya"; + }; + + wantedBy = [ "multi-user.target" ]; + }; + + environment.systemPackages = with pkgs; [ + wineWowPackages.waylandFull + winetricks + sakaya.packages.${system}.sakaya + rar + unrar + iamb + srb2 + ]; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "rar" + "unrar" + ]; + + environment.sessionVariables = { + LC_ALL = "ja_JP.UTF-8"; + TZ = "Asia/Tokyo"; + }; +} diff --git a/modules/containers.nix b/modules/containers.nix index 512768cb..99408d0c 100644 --- a/modules/containers.nix +++ b/modules/containers.nix @@ -1,4 +1,4 @@ -{ config, nix-config, sakaya, lib, ... }: +{ config, nix-config, lib, ... }: let inherit (lib) mkIf; @@ -58,62 +58,8 @@ in config = { lib, pkgs, ... }: { imports = [ ../containers/shared.nix + ../containers/wine.nix ]; - - networking.nat.forwardPorts = [ - { - destination = "192.168.100.49:39493"; - sourcePort = 39493; - } - { - destination = "192.168.100.49:5029"; - sourcePort = 5029; - } - ]; - - networking.firewall.allowedTCPPorts = [ - 39493 - 5029 - ]; - - systemd.services.sakaya = { - enable = true; - description = "sakaya server"; - - unitConfig = { - Type = "simple"; - }; - - path = with pkgs; [ - su - ]; - - serviceConfig = { - ExecStart = "/usr/bin/env su ${username} --command=${sakaya.packages.${pkgs.system}.sakaya}/bin/sakaya"; - }; - - wantedBy = [ "multi-user.target" ]; - }; - - environment.systemPackages = with pkgs; [ - wineWowPackages.waylandFull - winetricks - sakaya.packages.${system}.sakaya - rar - unrar - iamb - srb2 - ]; - - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "rar" - "unrar" - ]; - - environment.sessionVariables = { - LC_ALL = "ja_JP.UTF-8"; - TZ = "Asia/Tokyo"; - }; }; }; };