From 08f666214e49028ccd465ae279468b412e6c388d Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Sun, 14 Dec 2025 15:16:23 -0600 Subject: [PATCH] use builtin utils --- hosts/i001/hardware-mounts.nix | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/hosts/i001/hardware-mounts.nix b/hosts/i001/hardware-mounts.nix index 391542c0..99362765 100644 --- a/hosts/i001/hardware-mounts.nix +++ b/hosts/i001/hardware-mounts.nix @@ -1,4 +1,8 @@ -{ lib, pkgs, ... }: +{ + utils, + pkgs, + ... +}: let BOOT = "/dev/disk/by-uuid/ABDB-2A38"; PRIMARY_UUID = "08610781-26d3-456f-9026-35dd4a40846f"; @@ -6,31 +10,7 @@ let USB_KEY = "/dev/disk/by-uuid/9985-EBD1"; - inherit (lib) - hasPrefix - removePrefix - removeSuffix - replaceStrings - stringToCharacters - ; - inherit (lib.strings) normalizePath escapeC; - # FROM https://github.com/NixOS/nixpkgs/blob/5384341652dc01f8b01a3d227ae29e2dfbe630ba/nixos/lib/utils.nix#L101C1-L120C9 - escapeSystemdPath = - s: - let - replacePrefix = - p: r: s: - (if (hasPrefix p s) then r + (removePrefix p s) else s); - trim = s: removeSuffix "/" (removePrefix "/" s); - normalizedPath = normalizePath s; - in - replaceStrings [ "/" ] [ "-" ] ( - replacePrefix "." (escapeC [ "." ] ".") ( - escapeC (stringToCharacters " !\"#$%&'()*+,;<=>=@[\\]^`{|}~-") ( - if normalizedPath == "/" then normalizedPath else trim normalizedPath - ) - ) - ); + inherit (utils) escapeSystemdPath; in { # BOOT