This commit is contained in:
albert 2024-03-21 18:51:41 +09:00
parent 60b7f9525c
commit c32e803f2c
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
7 changed files with 29 additions and 30 deletions

View file

@ -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 ];
};
};

View file

@ -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;
# };
}

View file

@ -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" = {

View 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}";
}

View file

@ -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";
};
}

View file

@ -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;};
};
}

View file

@ -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")