summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2026-01-07 22:48:33 +1100
committerKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2026-01-07 22:48:33 +1100
commit59857b18115a1430a33a07e47e0bec24bae2f4b5 (patch)
treeb8a4897d819a53d7953abc8619094d55f8830045
parent8c95bb353556ceb51e5a135da08753e005c8baa7 (diff)
networkd
-rw-r--r--labsrv01/alt-arrow-vt.nix29
-rw-r--r--labsrv01/configuration.nix48
-rw-r--r--labsrv01/network.nix45
3 files changed, 76 insertions, 46 deletions
diff --git a/labsrv01/alt-arrow-vt.nix b/labsrv01/alt-arrow-vt.nix
new file mode 100644
index 0000000..d0dbb90
--- /dev/null
+++ b/labsrv01/alt-arrow-vt.nix
@@ -0,0 +1,29 @@
+{
+ pkgs,
+ ...
+}:
+{
+ # Disable Alt+Left/Right virtual terminal switching
+ console.keyMap = "us";
+
+ # Create systemd service to disable only Alt+Arrow VT switching
+ systemd.services.disable-alt-arrow-vt = {
+ description = "Disable Alt+Arrow VT switching";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "systemd-vconsole-setup.service" ];
+ script = ''
+ # Define string sequences for Alt+Arrow that generate proper terminal escape sequences
+ cat << 'EOF' | ${pkgs.kbd}/bin/loadkeys
+ string F200 = "\033[1;3D"
+ string F201 = "\033[1;3C"
+ alt keycode 105 = F200
+ alt keycode 106 = F201
+ EOF
+ '';
+ serviceConfig = {
+ Type = "oneshot";
+ RemainAfterExit = true;
+ };
+ };
+
+}
diff --git a/labsrv01/configuration.nix b/labsrv01/configuration.nix
index dbb679f..e2a542e 100644
--- a/labsrv01/configuration.nix
+++ b/labsrv01/configuration.nix
@@ -10,6 +10,8 @@
imports = [
./disk-config.nix
./secureboot.nix
+ ./alt-arrow-vt.nix
+ ./network.nix
];
hardware.facter.reportPath = ./facter.json;
@@ -75,25 +77,6 @@
};
};
- # Enable systemd-resolved for DNS
- services.resolved = {
- enable = true;
- llmnr = "true";
- extraConfig = ''
- MulticastDNS=yes
- '';
- };
- networking.hostName = "labsrv01";
- networking.nameservers = [ "127.0.0.53" ];
- networking.networkmanager = {
- enable = true;
- dns = "systemd-resolved";
- # Enable mDNS on NetworkManager connections
- connectionConfig = {
- "connection.mdns" = "2"; # 2 = yes (resolve & register)
- };
- };
-
services.openssh = {
enable = true;
hostKeys = [
@@ -110,33 +93,6 @@
services.fwupd.enable = true;
- environment.systemPackages = with pkgs; [
- sbctl
- ];
-
# Enable zsh system-wide
programs.zsh.enable = true;
-
- # Disable Alt+Left/Right virtual terminal switching
- console.keyMap = "us";
-
- # Create systemd service to disable only Alt+Arrow VT switching
- systemd.services.disable-alt-arrow-vt = {
- description = "Disable Alt+Arrow VT switching";
- wantedBy = [ "multi-user.target" ];
- after = [ "systemd-vconsole-setup.service" ];
- script = ''
- # Define string sequences for Alt+Arrow that generate proper terminal escape sequences
- cat << 'EOF' | ${pkgs.kbd}/bin/loadkeys
- string F200 = "\033[1;3D"
- string F201 = "\033[1;3C"
- alt keycode 105 = F200
- alt keycode 106 = F201
- EOF
- '';
- serviceConfig = {
- Type = "oneshot";
- RemainAfterExit = true;
- };
- };
}
diff --git a/labsrv01/network.nix b/labsrv01/network.nix
new file mode 100644
index 0000000..27ee2d2
--- /dev/null
+++ b/labsrv01/network.nix
@@ -0,0 +1,45 @@
+{
+ lib,
+ ...
+}:
+{
+ networking.hostName = "labsrv01";
+
+ # Enable systemd-resolved for DNS
+ networking.nameservers = [ "127.0.0.53" ];
+ services.resolved = {
+ enable = true;
+ llmnr = "true";
+ extraConfig = ''
+ MulticastDNS=yes
+ '';
+ };
+
+ networking.useNetworkd = true;
+ systemd.network = {
+ enable = true;
+ networks."10-enp2s0" = {
+ matchConfig.Name = "enp2s0";
+ networkConfig = {
+ DHCP = "yes";
+ MulticastDNS = "yes";
+ };
+ };
+ networks."10-wlp3s0" = {
+ matchConfig.Name = "wlp3s0";
+ linkConfig.Unmanaged = "yes";
+ };
+ };
+
+ # Keeping this networkmanager conf handy for wifi purposes on other machines
+ # but this machine will use networkd.
+ # networking.networkmanager = lib.mkIf useNetworkManager {
+ # enable = true;
+ # dns = "systemd-resolved";
+ # # Enable mDNS on NetworkManager connections
+ # connectionConfig = {
+ # "connection.mdns" = "2"; # 2 = yes (resolve & register)
+ # };
+ # };
+
+}