networkd for the nuc

This commit is contained in:
Rouven Seifert 2023-01-23 23:35:44 +01:00
parent db9760072f
commit 1dfcdd7d7c
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
3 changed files with 23 additions and 9 deletions

View file

@ -1,20 +1,15 @@
# 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).
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
imports = imports =
[ [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./modules/networks
../../shared/vim.nix ../../shared/vim.nix
# ../../shared/sops.nix # ../../shared/sops.nix
]; ];
# Use the systemd-boot EFI boot loader.
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
@ -24,8 +19,6 @@
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
services.zfs.autoSnapshot.enable = true; services.zfs.autoSnapshot.enable = true;
networking.hostName = "nuc"; # Define your hostname.
networking.hostId = "795a4952";
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -48,7 +41,6 @@
user.email = "rouven@rfive.de"; user.email = "rouven@rfive.de";
}; };
}; };
# List services that you want to enable:
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;

View file

@ -0,0 +1,21 @@
{ config, ... }:
{
networking = {
hostName = "nuc"; # Define your hostname.
hostId = "795a4952";
useNetworkd = true;
};
systemd.network = {
enable = true;
networks."10-loopback" = {
matchConfig.Name = "lo";
linkConfig.RequiredForOnline = false;
};
networks."10-wired" = {
matchConfig.Name = "eno1";
networkConfig = {
DHCP = "yes";
};
};
};
}

View file

@ -37,6 +37,7 @@
wait-online.anyInterface = true; wait-online.anyInterface = true;
networks."10-loopback" = { networks."10-loopback" = {
matchConfig.Name = "lo"; matchConfig.Name = "lo";
linkConfig.RequiredForOnline = false;
}; };
networks."10-wired" = { networks."10-wired" = {
matchConfig.Name = "enp0s31f6"; matchConfig.Name = "enp0s31f6";