Add steam container bridge network

This commit is contained in:
muon 2024-07-28 18:22:59 +00:00
parent a4b72da4b4
commit 53508e59c5
4 changed files with 43 additions and 11 deletions

18
flake.lock generated
View file

@ -204,11 +204,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721534365, "lastModified": 1721852138,
"narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", "narHash": "sha256-JH8N5uoqoVA6erV4O40VtKKHsnfmhvMGbxMNDLtim5o=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "635563f245309ef5320f80c7ebcb89b2398d2949", "rev": "304a011325b7ac7b8c9950333cd215a7aa146b0e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -276,11 +276,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1721379653, "lastModified": 1721562059,
"narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -329,11 +329,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1721478802, "lastModified": 1721816671,
"narHash": "sha256-+WMQs0fMAmpWPsKNgIFQoKLtvS4qtTj+mC++cD1May4=", "narHash": "sha256-gk+ktb6smoyYmjM5Je2EYxyVLDrFNmRHDzf3iUoElJU=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "6f36b27afd7b7ac8664bb62b7b27728540972c82", "rev": "c974c17cd089dcbfb16fbde028dd00bcc05e3f73",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -22,7 +22,7 @@ in {
mods.theme.scheme = "woodland"; mods.theme.scheme = "woodland";
mods.theme.wallpaper = ./wallpaper.png; mods.theme.wallpaper = ./wallpaper.png;
mods.containers.steam.enable = false; mods.containers.steam.enable = true;
mods.server.media.enable = true; mods.server.media.enable = true;
mods.server.astral.enable = true; mods.server.astral.enable = true;
mods.server.astral.autoStart = false; mods.server.astral.autoStart = false;

View file

@ -22,6 +22,27 @@
externalInterface = "enp0s31f6"; externalInterface = "enp0s31f6";
}; };
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
# networking = {
# bridges.br0.interfaces = [ "enp0s31f6" ]; # Adjust interface accordingly
# # Get bridge-ip with DHCP
# # useDHCP = false;
# # interfaces."br0".useDHCP = true;
# # Set bridge-ip static
# # interfaces."br0".ipv4.addresses = [{
# # address = "192.168.1.171";
# # prefixLength = 24;
# # }];
# # interfaces."enp0s31f6".ipv4.addresses = [{
# # address = "192.168.1.107";
# # prefixLength = 24;
# # }];
# defaultGateway = "192.168.1.1";
# nameservers = [ "192.168.1.1" ];
# };
# networking.firewall.allowedTCPPorts = [ 4713 6000 ]; # networking.firewall.allowedTCPPorts = [ 4713 6000 ];
# hardware.pulseaudio = { # hardware.pulseaudio = {

View file

@ -20,6 +20,8 @@ in {
privateNetwork = true; privateNetwork = true;
hostAddress = "192.168.100.10"; hostAddress = "192.168.100.10";
localAddress = "192.168.100.11"; localAddress = "192.168.100.11";
# hostBridge = "br0"; # Specify the bridge name
# localAddress = "192.168.1.105/24";
bindMounts = { bindMounts = {
"/home/steam/.steam/steam/steamapps/common/SMITE" = { "/home/steam/.steam/steam/steamapps/common/SMITE" = {
@ -48,7 +50,6 @@ in {
"steam-run" "steam-run"
]; ];
programs.steam = { programs.steam = {
enable = true; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
@ -64,6 +65,8 @@ in {
glxinfo glxinfo
wget wget
bottles bottles
ungoogled-chromium
zellij
openbox openbox
steam-xinit steam-xinit
@ -109,6 +112,14 @@ in {
initialPassword = "changeme"; initialPassword = "changeme";
}; };
networking = {
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = lib.mkForce false;
};
services.resolved.enable = true;
system.stateVersion = "23.11"; system.stateVersion = "23.11";
}; };
}; };