This commit is contained in:
albert 2024-03-21 20:27:53 +09:00
parent c32e803f2c
commit f56c07e288
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
5 changed files with 26 additions and 22 deletions

View file

@ -30,7 +30,6 @@
modules = [ ../home-manager/${type}.nix ]; modules = [ ../home-manager/${type}.nix ];
}; };
# Helper function for generating container configs
mkContainer = { mkContainer = {
hostname, hostname,
username ? "albert", username ? "albert",
@ -40,17 +39,21 @@
type ? "default", type ? "default",
repo ? "nixpkgs", repo ? "nixpkgs",
unfree ? false, unfree ? false,
pkgs ? import inputs.${repo} tskey ? null,
{ inherit system; config.allowUnfree = unfree; hostPlatform = system; }, pkgs ? import inputs.${repo}
{ inherit system; config.allowUnfree = unfree; hostPlatform = system; },
pkgs-unstable ? import inputs.nixpkgs-unstable pkgs-unstable ? import inputs.nixpkgs-unstable
{inherit system; config.allowUnfree = unfree; hostPlatform = system; } { inherit system; config.allowUnfree = unfree; hostPlatform = system; }
}: { }: {
autoStart = true; autoStart = true;
privateNetwork = false; privateNetwork = true;
specialArgs = { inherit pkgs pkgs-unstable hostname username desktop theme system repo unfree stateVersion; }; hostBridge = "br0";
config = { lib, config, pkgs, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, ... }: { specialArgs = { inherit pkgs pkgs-unstable hostname username desktop theme system repo unfree stateVersion tskey; };
config = { lib, config, pkgs, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, tskey, ... }: {
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
imports = [ ../nixos/containers ]; imports = [
../nixos/containers
];
}; };
}; };

View file

@ -7,16 +7,11 @@
}; };
useDHCP = lib.mkDefault true; useDHCP = lib.mkDefault true;
# enableIPv6 = lib.mkForce false; enableIPv6 = lib.mkForce false;
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ ]; allowedTCPPorts = [ ];
allowedUDPPorts = [ ]; allowedUDPPorts = [ ];
}; };
}; };
# boot.kernel.sysctl = {
# "net.ipv6.conf.all.disable_ipv6" = true;
# };
} }

View file

@ -1,11 +1,10 @@
{ hostname, username, ... }: { { hostname, username, ... }: {
import = [ imports = [
./${hostname} ./${hostname}
../users/${username} ../users/${username}
../common/modules/nixos.nix ../common/modules/nixos.nix
../common/modules/networking.nix ../common/modules/networking.nix
../common/services/tailscale-autoconnect.nix
]; ];
networking.hostname = "${hostname}"; networking.hostName = "${hostname}";
} }

View file

@ -1,9 +1,8 @@
{ hostname, username, desktop, ... }: { { hostname, username, desktop, tailscalekey, ... }: {
imports = [ imports = [
../../common/desktops/${desktop} ../../common/desktops/${desktop}
]; ];
networking.hostName = "${hostname}";
networking.firewall.allowedTCPPorts = [ 3389 ]; networking.firewall.allowedTCPPorts = [ 3389 ];
services.xrdp = { services.xrdp = {

View file

@ -2,7 +2,15 @@
let let
libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; }; libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; };
in { in {
containers = { # TODO: Set up Tailscale key
rdesktop = libx.mkContainer { hostname = "rdesktop"; desktop = "xfce"; unfree = true;};
# Set up the bridge network:
networking = {
bridges.br0.interfaces = [ "enp0s13f0u4" ]; # nmcli con show | grep Wired\ connection\ 2
interfaces.br0.useDHCP = true;
}; };
}
containers = {
rdesktop = libx.mkContainer { hostname = "rdesktop"; desktop = "xfce"; unfree = true; };
};
}