diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-25 18:10:34 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-08-29 17:47:16 +0200 |
commit | 40a140bd20c2637242341f1c5bc338d97337b16f (patch) | |
tree | b0ef239fa598b9e7c24945c452b48301b786164f /default.nix | |
parent | 71d4cf42f1971d18c4142a6bbc8fd05f484ca090 (diff) | |
download | garage-40a140bd20c2637242341f1c5bc338d97337b16f.tar.gz garage-40a140bd20c2637242341f1c5bc338d97337b16f.zip |
Run clippy in nix, leveraging nix caching ability
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/default.nix b/default.nix index 5634f0af..4d7558c5 100644 --- a/default.nix +++ b/default.nix @@ -6,11 +6,16 @@ with import ./nix/common.nix; let + pkgs = import pkgsSrc { }; compile = import ./nix/compile.nix; build_debug_and_release = (target: { debug = (compile { inherit target; release = false; }).workspace.garage { compileMode = "build"; }; release = (compile { inherit target; release = true; }).workspace.garage { compileMode = "build"; }; }); + test = (rustPkgs: pkgs.symlinkJoin { + name ="garage-tests"; + paths = builtins.map (key: rustPkgs.workspace.${key} { compileMode = "test"; }) (builtins.attrNames rustPkgs.workspace); + }); in { pkgs = { @@ -20,13 +25,9 @@ in { arm = build_debug_and_release "armv6l-unknown-linux-musleabihf"; }; test = { - amd64 = let - pkgs = import pkgsSrc { }; - rustPkgs = compile { target = "x86_64-unknown-linux-musl"; }; - in - pkgs.symlinkJoin { - name ="garage-tests"; - paths = builtins.map (key: rustPkgs.workspace.${key} { compileMode = "test"; }) (builtins.attrNames rustPkgs.workspace); - }; + amd64 = test (compile { target = "x86_64-unknown-linux-musl"; }); + }; + clippy = { + amd64 = (compile { compiler = "clippy"; }).workspace.garage { compileMode = "build"; } ; }; } |