universal nixos

This commit is contained in:
Ariel Sosnovsky committed 2024-02-06 21:41:14 -05:00
1 parent 66d1b07c79
commit 2013b0cf2d
2 files changed
+21 -12

No files matched your search

+13 -8
View File
@@ -1,14 +1,19 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
hostName,
stateVersion = "23.05",
dbConnectionStr,
K3SToken
}:
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
"./k3s.nix"
(import "./k3s.nix" {
hostName = hostName;
dbConnectionStr = dbConnectionStr;
K3SToken = K3SToken;
})
"./users.nix"
"./settings.nix"
];
@@ -16,6 +21,6 @@
# Bootloader.
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
networking.hostName = "changeme"; # Define your hostname.
system.stateVersion = "23.05";
networking.hostName = hostName;
system.stateVersion = stateVersion;
}
+8 -4
View File
@@ -1,7 +1,11 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
hostName,
dbConnectionStr,
K3SToken
}:
{ config, pkgs, ... }:
{
@@ -21,9 +25,9 @@
services.k3s.role = "server";
services.k3s.extraFlags = toString [
"--tls-san"
"192.168.0.26"
"--datastore-endpoint" "postgres://postgres:3wtvrd5KdQYUXE@192.168.0.28:5432/k3sdb?sslmode=disable"
"--token" "Upi+DZa++9DiAc1po4LkPKPx6Ed1IRrg1VRsglGjp2ERhOssDXaKCWLY8Enk3GIOGyWHHlHKz1dIofXpgkRV2w=="
hostName
"--datastore-endpoint" dbConnectionStr
"--token" K3SToken
];
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
networking.firewall.allowedUDPPorts = [ 80 443 ];