summary refs log tree commit diff
path: root/lib/sources.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-09-17 09:59:37 +0000
committerAlyssa Ross <hi@alyssa.is>2021-09-17 10:03:00 +0000
commitf4463189169f09b4741d81fd7323197f48667063 (patch)
tree5f60fd30069ee05b97207c15c47c4940a7759c53 /lib/sources.nix
parentd4f282e39317ac50aac58d26034047f33b72b151 (diff)
downloadnixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar.gz
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar.bz2
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar.lz
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar.xz
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.tar.zst
nixpkgs-f4463189169f09b4741d81fd7323197f48667063.zip
lib.cleanSource: ignore sockets
I'm working on a project that involves running a virtual machine
monitor program, which creates a control socket in the project
directory (because it doesn't make sense to put it anywhere else).
This obviously isn't part of the source of my program, so I think
cleanSource should filter it out.
Diffstat (limited to 'lib/sources.nix')
-rw-r--r--lib/sources.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sources.nix b/lib/sources.nix
index 407829b547b..ae2df723521 100644
--- a/lib/sources.nix
+++ b/lib/sources.nix
@@ -43,7 +43,9 @@ let
     lib.hasSuffix ".o" baseName ||
     lib.hasSuffix ".so" baseName ||
     # Filter out nix-build result symlinks
-    (type == "symlink" && lib.hasPrefix "result" baseName)
+    (type == "symlink" && lib.hasPrefix "result" baseName) ||
+    # Filter out sockets and other types of files we can't have in the store.
+    (type == "unknown")
   );
 
   # Filters a source tree removing version control files and directories using cleanSourceWith