get "hosts.baseline-x86_64" to eval

This commit is contained in:
2025-06-28 10:17:59 +00:00
parent a2634219bc
commit 4ceab76cd1
2 changed files with 9 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
#
{ config, lib, pkgs, ... }:
let
hostCfg = config.sane.hosts.by-name."${config.networking.hostName}";
hostCfg = config.sane.hosts.by-name."${config.networking.hostName}" or null;
bindCfg = config.services.bind;
in
{
@@ -50,7 +50,7 @@ in
];
services.bind.listenOn = [
"127.0.0.1"
] ++ lib.optionals (hostCfg.wg-home.ip != null) [
] ++ lib.optionals (hostCfg != null && hostCfg.wg-home.ip != null) [
# allow wireguard clients to use us as a recursive resolver (only needed for servo)
hostCfg.wg-home.ip
];

View File

@@ -29,5 +29,12 @@ in
# TODO: service sandboxing
services.btrfs.autoScrub.enable = lib.mkIf cfg.enabled true;
services.btrfs.autoScrub.interval = "weekly";
# nixos/modules/tasks/filesystems/btrfs.nix fires this assertion, but its implementation totally handles the case of 0 btrfs filesystems.
sane.silencedAssertions = lib.mkIf cfg.enabled [''
If 'services.btrfs.autoScrub' is enabled, you need to have at least one
btrfs file system mounted via 'fileSystems' or specify a list manually
in 'services.btrfs.autoScrub.fileSystems'.
''];
}