From 11c555d2c509c66f92d190ac2ccc052ba7f97f85 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 11 Oct 2024 12:27:50 -0400 Subject: [PATCH] containers: merge default.nix with wine.nix It turns out that I shouldn't actually need graphical container support for most containers, which might also improve build times with multiple containers. --- containers/default.nix | 46 ----------------------------- containers/wine.nix | 66 +++++++++++++++++++++++++++++++++--------- modules/containers.nix | 1 - 3 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 containers/default.nix diff --git a/containers/default.nix b/containers/default.nix deleted file mode 100644 index 246f0558..00000000 --- a/containers/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ nix-config, ... }: - -{ - imports = with nix-config.nixosModules; [ - shell - desktop - system - stylix - fonts - ]; - - home-manager.sharedModules = with nix-config.homeModules; [ - fish - git - gtk - kitty - neovim - xresources - yazi - ]; - - nixpkgs.overlays = builtins.attrValues nix-config.overlays; - - environment = { - variables = { - TERM = "xterm-kitty"; - }; - - sessionVariables = { - WAYLAND_DISPLAY = "wayland-1"; - QT_QPA_PLATFORM = "wayland"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - SDL_VIDEODRIVER = "wayland"; - CLUTTER_BACKEND = "wayland"; - MOZ_ENABLE_WAYLAND = "1"; - XDG_RUNTIME_DIR = "/run/user/1000"; - DISPLAY = ":0"; - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - SDL_IM_MODULE = "fcitx"; - GLFW_IM_MODULE = "ibus"; - }; - }; - - hardware.graphics.enable = true; -} diff --git a/containers/wine.nix b/containers/wine.nix index 74d6f000..8e5c86a3 100644 --- a/containers/wine.nix +++ b/containers/wine.nix @@ -14,6 +14,58 @@ let sakayaPort = 39493; in { + imports = with nix-config.nixosModules; [ + shell + desktop + system + stylix + fonts + ]; + + home-manager.sharedModules = with nix-config.homeModules; [ + fish + git + gtk + kitty + neovim + xresources + yazi + ]; + + nixpkgs.overlays = builtins.attrValues nix-config.overlays; + + environment = { + systemPackages = + (with pkgs; [ + wineWowPackages.waylandFull + winetricks + ]) + ++ [ sakaya ]; + + variables = { + TERM = "xterm-kitty"; + }; + + sessionVariables = { + WAYLAND_DISPLAY = "wayland-1"; + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + MOZ_ENABLE_WAYLAND = "1"; + XDG_RUNTIME_DIR = "/run/user/1000"; + DISPLAY = ":0"; + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + SDL_IM_MODULE = "fcitx"; + GLFW_IM_MODULE = "ibus"; + LC_ALL = "ja_JP.UTF-8"; + TZ = "Asia/Tokyo"; + }; + }; + + hardware.graphics.enable = true; + networking = { nat.forwardPorts = singleton { destination = "192.168.100.49:${sakayaPort}"; @@ -39,18 +91,4 @@ in wantedBy = [ "multi-user.target" ]; }; - - environment = { - systemPackages = - (with pkgs; [ - wineWowPackages.waylandFull - winetricks - ]) - ++ [ sakaya ]; - - sessionVariables = { - LC_ALL = "ja_JP.UTF-8"; - TZ = "Asia/Tokyo"; - }; - }; } diff --git a/modules/containers.nix b/modules/containers.nix index 3eab4926..4fdd49de 100644 --- a/modules/containers.nix +++ b/modules/containers.nix @@ -67,7 +67,6 @@ in { ... }: { imports = [ - ../containers ../containers/wine.nix ]; };