containers: Move wine config to separate file

This commit is contained in:
Donovan Glover 2024-04-06 18:18:30 -04:00
parent 7def2c1b3c
commit 2e366abf7d
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 64 additions and 56 deletions

62
containers/wine.nix Normal file
View File

@ -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";
};
}

View File

@ -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";
};
};
};
};