From c211298f7e3a143187cd9887ee3256beb2604aea Mon Sep 17 00:00:00 2001 From: Benedikt Rips Date: Sat, 3 Jan 2026 22:09:33 +0100 Subject: [PATCH] tree-wide: use `lib.hm.assertions.assertPlatform` --- modules/programs/niriswitcher.nix | 5 +---- modules/systemd.nix | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/programs/niriswitcher.nix b/modules/programs/niriswitcher.nix index 1b0c6e4c2..b1b8443e0 100644 --- a/modules/programs/niriswitcher.nix +++ b/modules/programs/niriswitcher.nix @@ -66,10 +66,7 @@ in config = lib.mkIf cfg.enable { assertions = [ - { - assertion = pkgs.stdenv.hostPlatform.isLinux; - message = "niriswitcher is only available on Linux."; - } + (lib.hm.assertions.assertPlatform "programs.niriswitcher" pkgs lib.platforms.linux) ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; diff --git a/modules/systemd.nix b/modules/systemd.nix index 64a65ba52..3c2ea5569 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -430,10 +430,7 @@ in # Do not install any user services if username is root. config = mkIf (cfg.enable && config.home.username != "root") { assertions = [ - { - assertion = pkgs.stdenv.isLinux; - message = "This module is only available on Linux."; - } + (lib.hm.assertions.assertPlatform "systemd" pkgs lib.platforms.linux) ]; xdg.configFile = mkMerge [