Well it's broken again...

This commit is contained in:
albert 2024-04-05 22:51:54 +09:00
parent 3cd13d1441
commit a309679516
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
4 changed files with 24 additions and 12 deletions

View file

@ -40,6 +40,7 @@
repo ? "nixpkgs",
unfree ? false,
ip ? null,
ephemeral ? false,
pkgs ? import inputs.${repo}
{ inherit system; config.allowUnfree = unfree; hostPlatform = system; },
pkgs-unstable ? import inputs.nixpkgs-unstable
@ -49,15 +50,15 @@
( import ../nixos/containers/mounts.nix )
( import ../nixos/containers/${hostname}/mounts.nix )
];
ephemeral = false;
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.2.1";
localAddress = "192.168.2.2";
restartIfChanged = true;
enableTun = true;
enableTun = false;
specialArgs = { inherit pkgs-unstable hostname username desktop theme system repo unfree stateVersion; };
config = { lib, config, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, ... }: {
# Choose whether to pull from stable or unstable
nixpkgs.pkgs = import inputs.${repo} {
inherit system;
config.allowUnfree = unfree;

View file

@ -3,6 +3,7 @@
./${hostname}
../users/${username}
../common/modules/nixos.nix
# ../common/modules/networking.nix
# Services
../common/services/promtail.nix
../common/services/telegraf.nix
@ -11,7 +12,7 @@
boot.isContainer = true;
system.stateVersion = stateVersion;
networking.hostName = hostname;
networking.hostName = "${hostname}";
# Set up the secrets file:
sops.secrets."tailscale_key" = {
@ -23,7 +24,9 @@
];
};
services.tailscale.enable = true;
services.tailscale.authKeyFile = "/run/secrets/tailscale_key";
services.tailscale.interfaceName = "userspace-networking";
services.tailscale = {
enable = true;
authKeyFile = "/run/secrets/tailscale_key";
interfaceName = "userspace-networking";
};
}

View file

@ -1,8 +1,17 @@
{ lib, self, inputs, outputs, stateVersion, hmStateVersion, ... }:
let
libx = import ../../../lib { inherit lib self inputs outputs stateVersion hmStateVersion; };
lanInterface = "enp0s13f0u4";
in {
containers = {
rdesktop = libx.mkContainer { hostname = "rdesktop"; unfree = true; desktop = "xfce"; };
};
networking = {
nat.enable = true;
nat.internalInterfaces = [ "ve-+" ];
nat.externalInterface = lanInterface;
firewall.extraCommands = ''iptables -t nat -A POSTROUTING -o ${lanInterface} -j MASQUERADE'';
};
}

View file

@ -15,7 +15,6 @@ in {
++ ifExists [ "video" ]
++ ifExists [ "docker" ]
++ ifExists [ "podman" ]
++ ifExists [ "xrdp" ]
++ ifExists [ "syncthing" ];
# mkpasswd -m sha-512
hashedPassword = "$y$j9T$wKLsIWaA4Gf63RvjedwLJ0$EHKL6BBJV0CAxEKcHHjaBqW085KJ/MGvmbyWzmcWOy6";