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

View file

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

View file

@ -1,11 +1,10 @@
{ hostname, username, ... }: {
import = [
imports = [
./${hostname}
../users/${username}
../common/modules/nixos.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 = [
../../common/desktops/${desktop}
];
networking.hostName = "${hostname}";
networking.firewall.allowedTCPPorts = [ 3389 ];
services.xrdp = {

View file

@ -2,7 +2,15 @@
let
libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; };
in {
# TODO: Set up Tailscale key
# 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;};
rdesktop = libx.mkContainer { hostname = "rdesktop"; desktop = "xfce"; unfree = true; };
};
}