From 505e35edcda7545d207a4289c7c720bdd32ec83b Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 22 Jun 2023 12:19:02 -0400 Subject: [PATCH] containers: Use more detailed common config All containers can inherit a lot of the same settings since the main feature is separating applications from the host and each other. --- containers/common/wayland.nix | 47 ++++++++++++++++++++++++++++------- containers/gui.nix | 22 ---------------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/containers/common/wayland.nix b/containers/common/wayland.nix index 5e78ad0b..3a074ccd 100644 --- a/containers/common/wayland.nix +++ b/containers/common/wayland.nix @@ -1,13 +1,40 @@ +{ pkgs, ... }: + { - environment.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"; + environment = { + defaultPackages = [ ]; + 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"; + }; + }; + + environment.systemPackages = with pkgs; [ + kitty + ]; + + users = { + mutableUsers = false; + allowNoPasswordLogin = true; + + users = { + user = { + isNormalUser = true; + home = "/home/user"; + }; + }; + }; + + home-manager.users.user = { + home.stateVersion = "22.11"; }; services.xserver.enable = true; @@ -16,4 +43,6 @@ enable = true; driSupport32Bit = true; }; + + system.stateVersion = "22.11"; } diff --git a/containers/gui.nix b/containers/gui.nix index 4d4f3113..41550311 100644 --- a/containers/gui.nix +++ b/containers/gui.nix @@ -38,30 +38,8 @@ anki # Spaced repetition sqlitebrowser # SQL kanjidraw # Kanji draw - kitty # TODO: import common module libreoffice ]; - - users = { - mutableUsers = false; - allowNoPasswordLogin = true; - - users.user = { - isNormalUser = true; - home = "/home/user"; - }; - }; - - home-manager.users.user = { pkgs, ... }: { - home.stateVersion = "22.11"; - }; - - environment = { - variables = { TERM = "xterm-kitty"; }; - defaultPackages = [ ]; - }; - - system.stateVersion = "22.11"; }; }; }