From 2b25db0fb6e409dd3967753bc5f78ed84b53eca5 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 22 Mar 2024 18:21:09 -0400 Subject: [PATCH] fix(nix): allow deleting store paths with a dot in them --- common/default.nix | 8 ++++++++ common/overlays/nix/patch | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 common/overlays/nix/patch diff --git a/common/default.nix b/common/default.nix index 54e71c7..9d47862 100644 --- a/common/default.nix +++ b/common/default.nix @@ -30,6 +30,14 @@ boot.tmp.cleanOnBoot = true; nix = { + # Allow deleting store files with '.' in the name + package = pkgs.nixUnstable.overrideAttrs (oldAttrs: { + patches = + (oldAttrs.patches or []) + ++ [ + ./overlays/nix/patch + ]; + }); # Edit nix.conf settings = { # Store diff --git a/common/overlays/nix/patch b/common/overlays/nix/patch new file mode 100644 index 0000000..4b4bc05 --- /dev/null +++ b/common/overlays/nix/patch @@ -0,0 +1,12 @@ +diff --git a/src/libstore/path.cc b/src/libstore/path.cc +index e642abcd5..0e584ef33 100644 +--- a/src/libstore/path.cc ++++ b/src/libstore/path.cc +@@ -12,7 +12,7 @@ static void checkName(std::string_view path, std::string_view name) + if (!((c >= '0' && c <= '9') + || (c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') +- || c == '+' || c == '-' || c == '.' || c == '_' || c == '?' || c == '=')) ++ || c == '+' || c == '-' || c == '.' || c == '_' || c == '?' || c == '=' || c == '!')) + throw BadStorePath("store path '%s' contains illegal character '%s'", path, c); + }