From 6022549e95c8244e883607282872027b8e5ba8c1 Mon Sep 17 00:00:00 2001 From: Athan Clark Date: Wed, 22 Sep 2021 12:12:05 -0400 Subject: [PATCH 1/4] fixing #127 --- snowman/template/nix/base.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snowman/template/nix/base.nix b/snowman/template/nix/base.nix index 473d0cca..5fc92a3d 100644 --- a/snowman/template/nix/base.nix +++ b/snowman/template/nix/base.nix @@ -87,9 +87,9 @@ let pkgs.haskell.packages.${compilerjs}.callCabal2nix "snowman" (filterSource (path: _: - baseNameOf path == "src" - || l.hasSuffix ".hs" path - || l.hasSuffix ".cabal" path + let pathWithoutCWD = replaceStrings [((getEnv "PWD") + "/")] [""] path; in + l.hasPrefix "src" pathP + || l.hasSuffix ".cabal" path ) ../. ) -- GitLab From a0ffd285544da034824b47a6e79d0754f0f1ec9e Mon Sep 17 00:00:00 2001 From: Athan Clark Date: Wed, 22 Sep 2021 12:20:24 -0400 Subject: [PATCH 2/4] fixing typo --- snowman/template/nix/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snowman/template/nix/base.nix b/snowman/template/nix/base.nix index 5fc92a3d..4e344203 100644 --- a/snowman/template/nix/base.nix +++ b/snowman/template/nix/base.nix @@ -88,7 +88,7 @@ let (filterSource (path: _: let pathWithoutCWD = replaceStrings [((getEnv "PWD") + "/")] [""] path; in - l.hasPrefix "src" pathP + l.hasPrefix "src" pathWithoutCWD || l.hasSuffix ".cabal" path ) ../. -- GitLab From 85ab14a5e05976ebb8b6917fd5964d57a2a151f6 Mon Sep 17 00:00:00 2001 From: Athan Clark Date: Wed, 22 Sep 2021 12:40:54 -0400 Subject: [PATCH 3/4] supporting being built from top-level --- snowman/template/nix/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/snowman/template/nix/base.nix b/snowman/template/nix/base.nix index 4e344203..90f05ad2 100644 --- a/snowman/template/nix/base.nix +++ b/snowman/template/nix/base.nix @@ -89,6 +89,7 @@ let (path: _: let pathWithoutCWD = replaceStrings [((getEnv "PWD") + "/")] [""] path; in l.hasPrefix "src" pathWithoutCWD + || l.hasPrefix "snowman/template/src" pathWithoutCWD || l.hasSuffix ".cabal" path ) ../. -- GitLab From 90038c394de77a1036b4353dac6a15a1992945fb Mon Sep 17 00:00:00 2001 From: Athan Clark Date: Sat, 25 Sep 2021 11:48:38 -0400 Subject: [PATCH 4/4] filtering out unwanted files rather than whitelisting --- snowman/template/nix/base.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/snowman/template/nix/base.nix b/snowman/template/nix/base.nix index 90f05ad2..22bc7070 100644 --- a/snowman/template/nix/base.nix +++ b/snowman/template/nix/base.nix @@ -87,10 +87,7 @@ let pkgs.haskell.packages.${compilerjs}.callCabal2nix "snowman" (filterSource (path: _: - let pathWithoutCWD = replaceStrings [((getEnv "PWD") + "/")] [""] path; in - l.hasPrefix "src" pathWithoutCWD - || l.hasPrefix "snowman/template/src" pathWithoutCWD - || l.hasSuffix ".cabal" path + !(l.hasSuffix ".git" path || l.hasSuffix "result" path) ) ../. ) -- GitLab