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, ... }: { { config, pkgs, lib, ... }: {
boot.loader = lib.mkIf config.physical { boot.loader = lib.mkIf (config.physical && !config.server) {
grub = { grub = {
enable = true; enable = true;

View File

@ -2,12 +2,7 @@
config = lib.mkIf config.physical { config = lib.mkIf config.physical {
# The global useDHCP flag is deprecated, therefore explicitly set to false here. networking.useDHCP = true;
# 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.firewall.allowPing = lib.mkIf config.server 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 # Servers need a bootloader or they won't start
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

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

View File

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