aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/services/avahi/default.nix9
-rw-r--r--modules/system/boot/default.nix1
-rw-r--r--modules/system/btrfs/default.nix15
3 files changed, 21 insertions, 4 deletions
diff --git a/modules/services/avahi/default.nix b/modules/services/avahi/default.nix
index 8275f02..3a6eb58 100644
--- a/modules/services/avahi/default.nix
+++ b/modules/services/avahi/default.nix
@@ -4,6 +4,12 @@ in
{
options.my.services.avahi = with lib; {
enable = mkEnableOption "avahi service";
+ withReflector = mkEnableOption "enable reflector";
+ interfaces = mkOption {
+ type = types.nullOr (types.listOf types.str);
+ default = null;
+ description = "List of network interfaces that should be used by the {command}`avahi-daemon`.";
+ };
};
config = lib.mkIf cfg.enable {
@@ -11,5 +17,8 @@ in
# Important to resolve .local domains of printers, otherwise you get an error
# like "Impossible to connect to XXX.local: Name or service not known"
services.avahi.nssmdns = true;
+
+ services.avahi.reflector = cfg.withReflector;
+ services.avahi.interfaces = cfg.interfaces;
};
}
diff --git a/modules/system/boot/default.nix b/modules/system/boot/default.nix
index cac1cec..5a5ac25 100644
--- a/modules/system/boot/default.nix
+++ b/modules/system/boot/default.nix
@@ -24,7 +24,6 @@ in
tmpOnTmpfs = true;
initrd = {
- luks.devices."system".allowDiscards = true;
network = lib.mkIf cfg.initrd.network.enable {
enable = true;
postCommands = ''
diff --git a/modules/system/btrfs/default.nix b/modules/system/btrfs/default.nix
index d569c78..3446b2c 100644
--- a/modules/system/btrfs/default.nix
+++ b/modules/system/btrfs/default.nix
@@ -1,5 +1,14 @@
-{ ... }:
-
+{ lib, config, ... }:
+let
+ cfg = config.my.systems.btrfs;
+in
{
- services.btrfs.autoScrub.enable = true;
+ options.my.systems.btrfs = with lib; {
+ enable = mkEnableOption "btrfs configuration";
+ };
+
+ config = lib.mkIf cfg.enable
+ {
+ services.btrfs.autoScrub.enable = !config.virtualisation.libvirtd.enable;
+ };
}