From 5d1fded15c9503b40bca4db11d0e9b7c232c7828 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 20 Mar 2024 22:59:42 +0900 Subject: [PATCH] Going to bed. --- flake.nix | 2 ++ lib/default.nix | 5 +++-- nixos/common/modules/networking.nix | 4 ++-- nixos/containers/rdesktop/default.nix | 19 +++++++++++++------ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 736ec56a..eadaf29e 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,8 @@ "albert@backups-rpi4" = libx.mkHome { hostname = "backups-rpi4"; system = "aarch64-linux"; type = "small"; }; "albert@piaware-rpi4" = libx.mkHome { hostname = "piaware-rpi4"; system = "aarch64-linux"; type = "small"; }; "albert@quitman-rpi4" = libx.mkHome { hostname = "quitman-rpi4"; system = "aarch64-linux"; type = "small"; }; + # Containers + "albert@nixos-rdesktop" = libx.mkHome { hostname = "nixos-rdesktop"; }; }; deploy.nodes = { osaka-linode-01 = libx.deploy { hostname = "osaka-linode-01"; }; diff --git a/lib/default.nix b/lib/default.nix index 6bceb966..53e03f27 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -47,8 +47,9 @@ }: { autoStart = true; privateNetwork = false; - specialArgs = { inherit pkgs pkgs-unstable container username desktop theme system repo unfree; }; - config = { lib, config, pkgs, pkgs-unstable, container, username, desktop, theme, system, repo, ... }: { + specialArgs = { inherit pkgs pkgs-unstable container username desktop theme system repo unfree stateVersion; }; + config = { lib, config, pkgs, pkgs-unstable, container, username, desktop, theme, system, repo, stateVersion, ... }: { + system.stateVersion = stateVersion; imports = [ ../nixos/containers/${container} ]; }; }; diff --git a/nixos/common/modules/networking.nix b/nixos/common/modules/networking.nix index 0d4137dc..1b975c2a 100644 --- a/nixos/common/modules/networking.nix +++ b/nixos/common/modules/networking.nix @@ -7,11 +7,11 @@ }; useDHCP = lib.mkDefault true; - enableIPv6 = false; + enableIPv6 = lib.mkForce false; firewall = { enable = true; allowedTCPPorts = [ ]; allowedUDPPorts = [ ]; }; }; -} \ No newline at end of file +} diff --git a/nixos/containers/rdesktop/default.nix b/nixos/containers/rdesktop/default.nix index 4ddfcd46..0c78fceb 100644 --- a/nixos/containers/rdesktop/default.nix +++ b/nixos/containers/rdesktop/default.nix @@ -1,18 +1,25 @@ { pkgs, username, stateVersion, desktop, ... }: { imports = [ - ../../common/desktops/${desktop} + # ../../common/desktops/${desktop} ../../users/${username} + ../../common/modules/nixos.nix + ../../common/modules/networking.nix ]; - networking.firewall = { + networking.firewall.allowedTCPPorts = [ 3389 ]; + + services.xserver = { enable = true; - allowedTCPPorts = [ 3390 ]; - }; + desktopManager = { + xterm.enable = false; + xfce.enable = true; + }; + displayManager.defaultSession = "xfce"; + }; services.xrdp = { enable = true; openFirewall = true; - port = 3390; - defaultWindowManager = "${pkgs.xfce.xfce4-session}/bin/xfce4-session"; + defaultWindowManager = "xfce4-session"; }; }