Testing
This commit is contained in:
parent
60b7f9525c
commit
c32e803f2c
7 changed files with 29 additions and 30 deletions
|
@ -32,7 +32,7 @@
|
|||
|
||||
# Helper function for generating container configs
|
||||
mkContainer = {
|
||||
container,
|
||||
hostname,
|
||||
username ? "albert",
|
||||
desktop ? null,
|
||||
system ? "x86_64-linux",
|
||||
|
@ -47,10 +47,10 @@
|
|||
}: {
|
||||
autoStart = true;
|
||||
privateNetwork = false;
|
||||
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, ... }: {
|
||||
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, ... }: {
|
||||
system.stateVersion = stateVersion;
|
||||
imports = [ ../nixos/containers/${container} ];
|
||||
imports = [ ../nixos/containers ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{lib, pkgs, config, ...}: {
|
||||
# Enable networking with NetworkManager
|
||||
{lib, ... }: {
|
||||
|
||||
# Enable networking with NetworkManager
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
useDHCP = lib.mkDefault true;
|
||||
enableIPv6 = lib.mkForce false;
|
||||
# enableIPv6 = lib.mkForce false;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ ];
|
||||
|
@ -15,7 +15,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv6.conf.all.disable_ipv6" = true;
|
||||
};
|
||||
# boot.kernel.sysctl = {
|
||||
# "net.ipv6.conf.all.disable_ipv6" = true;
|
||||
# };
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ inputs, config, lib, pkgs, modulesPath, hostname, ... }: {
|
||||
{ hostname, ... }: {
|
||||
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
|
||||
# Set up the secrets file:
|
||||
sops.secrets."tailscale_key" = {
|
||||
|
@ -10,4 +10,4 @@
|
|||
];
|
||||
};
|
||||
services.tailscale.authKeyFile = "/run/secrets/tailscale_key";
|
||||
}
|
||||
}
|
||||
|
|
11
nixos/containers/default.nix
Normal file
11
nixos/containers/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ hostname, username, ... }: {
|
||||
import = [
|
||||
./${hostname}
|
||||
../users/${username}
|
||||
../common/modules/nixos.nix
|
||||
../common/modules/networking.nix
|
||||
../common/services/tailscale-autoconnect.nix
|
||||
];
|
||||
|
||||
networking.hostname = "${hostname}";
|
||||
}
|
|
@ -1,26 +1,13 @@
|
|||
{ pkgs, username, stateVersion, desktop, ... }: {
|
||||
{ hostname, username, desktop, ... }: {
|
||||
imports = [
|
||||
# ../../common/desktops/${desktop}
|
||||
../../users/${username}
|
||||
../../common/modules/nixos.nix
|
||||
../../common/modules/networking.nix
|
||||
../../common/services/tailscale-autoconnect.nix
|
||||
../../common/desktops/${desktop}
|
||||
];
|
||||
|
||||
networking.hostName = "${hostname}";
|
||||
networking.firewall.allowedTCPPorts = [ 3389 ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
xfce.enable = true;
|
||||
};
|
||||
displayManager.defaultSession = "xfce";
|
||||
};
|
||||
|
||||
services.xrdp = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
defaultWindowManager = "xfce4-session";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@ let
|
|||
libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion pkgs-unstable pkgs; };
|
||||
in {
|
||||
containers = {
|
||||
rdesktop = libx.mkContainer { container = "rdesktop"; desktop = "xfce"; unfree = true;};
|
||||
rdesktop = libx.mkContainer { hostname = "rdesktop"; desktop = "xfce"; unfree = true;};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ self, inputs, outputs, username, stateVersion, hmStateVersion, config, lib, pkgs, modulesPath, system, ... }: {
|
||||
{ inputs, config, lib, pkgs, modulesPath, system, ... }: {
|
||||
imports = [
|
||||
inputs.nixos-hardware.nixosModules.framework-13th-gen-intel
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
|
|
Loading…
Reference in a new issue