diff --git a/snowfall-lib/checks/default.nix b/snowfall-lib/checks/default.nix index 8a5efde..1c203f5 100644 --- a/snowfall-lib/checks/default.nix +++ b/snowfall-lib/checks/default.nix @@ -48,6 +48,8 @@ in }; in { + # We are building flake outputs based on file paths. Nix doesn't allow this + # so we have to explicitly discard the string's path context to use it as an attribute name. name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory check); drv = callPackageWith extra-inputs check { }; }; diff --git a/snowfall-lib/module/default.nix b/snowfall-lib/module/default.nix index 97f892a..27f38f3 100644 --- a/snowfall-lib/module/default.nix +++ b/snowfall-lib/module/default.nix @@ -41,6 +41,8 @@ in create-module-metadata = module: { name = let + # We are building flake outputs based on file paths. Nix doesn't allow this + # so we have to explicitly discard the string's path context for string manipulation. path-name = builtins.replaceStrings [ (builtins.toString src) "/default.nix" ] [ "" "" ] ( builtins.unsafeDiscardStringContext module ); diff --git a/snowfall-lib/overlay/default.nix b/snowfall-lib/overlay/default.nix index 8d01cc6..4736399 100644 --- a/snowfall-lib/overlay/default.nix +++ b/snowfall-lib/overlay/default.nix @@ -111,6 +111,8 @@ in create-overlay = ( overlays: file: let + # We are building flake outputs based on file paths. Nix doesn't allow this + # so we have to explicitly discard the string's path context to use it as an attribute name. name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory file); overlay = final: prev: @@ -159,6 +161,8 @@ in create-package-overlay = package-overlays: file: let + # We are building flake outputs based on file paths. Nix doesn't allow this + # so we have to explicitly discard the string's path context to use it as an attribute name. name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory file); overlay = final: prev: diff --git a/snowfall-lib/shell/default.nix b/snowfall-lib/shell/default.nix index 77352a7..fae6832 100644 --- a/snowfall-lib/shell/default.nix +++ b/snowfall-lib/shell/default.nix @@ -48,6 +48,8 @@ in }; in { + # We are building flake outputs based on file paths. Nix doesn't allow this + # so we have to explicitly discard the string's path context to use it as an attribute name. name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory shell); drv = callPackageWith extra-inputs shell { }; };