From 7a7769e8161c03fac8125f2c7c515f37ecdb0f1d Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Mon, 16 Dec 2024 12:55:17 +0100 Subject: [PATCH] flake: filter src Signed-off-by: Paul Meyer --- flake.nix | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index a9a7108..9758a85 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,23 @@ uplosi = pkgs.buildGoModule { pname = "uplosi"; version = "devel"; - src = ./.; + + src = + let + inherit (pkgs.lib) fileset path hasSuffix; + root = ./.; + in + fileset.toSource { + inherit root; + fileset = fileset.unions [ + (fileset.fileFilter (file: hasSuffix ".go" file.name) root) + (path.append root "go.mod") + (path.append root "go.sum") + (path.append root "config/validation.rego") + (path.append root "measured-boot/internal/testdata/uki.efi") + ]; + }; + # this needs to be updated together with go.mod / go.sum vendorHash = "sha256-2lJmPNLpI1ksFb0EtcjPjyTy7eX1DKeX0F80k9FtGno="; @@ -45,16 +61,6 @@ --fish <($out/bin/uplosi completion fish) \ --zsh <($out/bin/uplosi completion zsh) ''; - - meta = with pkgs.lib; { - description = "Upload OS images to cloud provider"; - homepage = "https://github.com/edgelesssys/uplosi"; - maintainers = with maintainers; [ - katexochen - malt3 - ]; - license = licenses.asl20; - }; }; treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;