fix avahi and dhcp, mark swan as physical

This commit is contained in:
Noah Masur 2023-07-18 02:00:38 +00:00
parent 22ab2acf66
commit 8eb7ef0be7
5 changed files with 19 additions and 26 deletions

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: {
boot.loader = lib.mkIf config.physical {
boot.loader = lib.mkIf (config.physical && !config.server) {
grub = {
enable = true;

View File

@ -2,12 +2,7 @@
config = lib.mkIf config.physical {
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp5s0.useDHCP = true;
networking.interfaces.wlp4s0.useDHCP = true;
networking.useDHCP = true;
networking.firewall.allowPing = lib.mkIf config.server true;

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: {
{ config, lib, ... }: {
config = lib.mkIf (pkgs.stdenv.isLinux && config.server) {
config = lib.mkIf config.server {
# Servers need a bootloader or they won't start
boot.loader.systemd-boot.enable = true;

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: {
config = lib.mkIf config.physical {
config = lib.mkIf (config.physical && !config.server) {
# Prevent wake from keyboard
powerManagement.powerDownCommands = ''

View File

@ -1,13 +1,11 @@
{ config, pkgs, lib, ... }: {
{ config, lib, ... }: {
options = { zfs.enable = lib.mkEnableOption "ZFS file system."; };
config =
lib.mkIf (pkgs.stdenv.isLinux && config.server && config.zfs.enable) {
config = lib.mkIf (config.server && config.zfs.enable) {
# Only use compatible Linux kernel, since ZFS can be behind
boot.kernelPackages =
config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelParams = [ "nohibernate" ];
boot.supportedFilesystems = [ "zfs" ];
services.prometheus.exporters.zfs.enable =