From aaa78b5079eba36577c356a448b6aca5ece20c97 Mon Sep 17 00:00:00 2001 From: muon Date: Thu, 2 Jan 2025 12:57:39 +0000 Subject: [PATCH] Fix match --- utils.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/utils.nix b/utils.nix index aceff3d..e532287 100644 --- a/utils.nix +++ b/utils.nix @@ -1,12 +1,15 @@ { builtins, inputs, system, pkgs, ... }: { mkHost = host: inputs.nixpkgs.lib.nixosSystem { - specialArgs = let name = builtins.match "muho" (builtins.toString host); - in if name == "muho" then { - inherit inputs system pkgs; - } else { - inherit inputs system; - }; + specialArgs = with builtins; + let + hasInfix = infix: content: match ".*${infix}.*" "${content}" != null; + muho = hasInfix "/muho/" (toString host); + in if muho then { + inherit inputs system pkgs; + } else { + inherit inputs system; + }; modules = [ host