From cc657c26ddfdc94d24759d76137dd8b6be79d115 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 17 Jul 2024 09:32:40 +0200 Subject: [PATCH] Use `.gitignore` in nix build excludes This avoid building with wrong pre-built data locally as well as in CI. Signed-off-by: Sascha Grunert --- nix/derivation-bpf.nix | 3 ++- nix/derivation.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/derivation-bpf.nix b/nix/derivation-bpf.nix index b02091a07f..e9389f5513 100644 --- a/nix/derivation-bpf.nix +++ b/nix/derivation-bpf.nix @@ -1,7 +1,8 @@ { pkgs, buildGoModule, arch ? "x86" }: with pkgs; buildGo122Module rec { name = "security-profiles-operator"; - src = ./..; + # Use Pure to avoid exuding the .git directory + src = nix-gitignore.gitignoreSourcePure [ ../.gitignore ] ./..; vendorHash = null; doCheck = false; outputs = [ "out" ]; diff --git a/nix/derivation.nix b/nix/derivation.nix index 19e047a938..ebe59f93ab 100644 --- a/nix/derivation.nix +++ b/nix/derivation.nix @@ -1,7 +1,8 @@ { pkgs, buildGoModule }: with pkgs; buildGo122Module rec { name = "security-profiles-operator"; - src = ./..; + # Use Pure to avoid exuding the .git directory + src = nix-gitignore.gitignoreSourcePure [ ../.gitignore ] ./..; vendorHash = null; doCheck = false; outputs = [ "out" ];