commit 68e616f40c82f677de3e2861dba800fa87eeebe2
parent d3b75e45b97b751793f44f1c4ee41ee7a95dd1a6
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 22 Aug 2022 16:27:55 +0200
systems/modules: move profile.avahi to services
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
4 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/systems/modules/desktop/base.nix b/systems/modules/desktop/base.nix
@@ -22,6 +22,7 @@ in
};
};
config = mkIf cfg.enable {
+ modules.services.avahi.enable = true;
# Enable netbootxyz if systemd-boot is enabled
boot = {
loader.systemd-boot.netbootxyz.enable = config.core.boot.systemd-boot;
diff --git a/systems/modules/profiles/avahi.nix b/systems/modules/profiles/avahi.nix
@@ -11,17 +11,7 @@ in
};
};
config = mkIf cfg.enable {
- services = {
- avahi = {
- enable = true;
- ipv4 = true;
- ipv6 = true;
- nssmdns = true;
- publish = {
- enable = true;
- userServices = true;
- };
- };
- };
+ warnings = [ "The option 'profiles.ahavi' is deprecated, use 'modules.services.avahi' instead." ];
+ modules.services.avahi.enable = true;
};
}
diff --git a/systems/modules/services/avahi.nix b/systems/modules/services/avahi.nix
@@ -0,0 +1,27 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+ cfg = config.modules.services.avahi;
+in
+{
+ options = {
+ modules.services.avahi = {
+ enable = mkEnableOption "Enable avahi profile";
+ };
+ };
+ config = mkIf cfg.enable {
+ services = {
+ avahi = {
+ enable = true;
+ ipv4 = true;
+ ipv6 = true;
+ nssmdns = true;
+ publish = {
+ enable = true;
+ userServices = true;
+ };
+ };
+ };
+ };
+}
diff --git a/systems/modules/services/default.nix b/systems/modules/services/default.nix
@@ -1,5 +1,6 @@
{
imports = [
+ ./avahi.nix
./barrier.nix
./govanityurl.nix
./nix-binary-cache.nix