From b421d40da09d09126e5aee8511910dc22d91bdef Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 28 Mar 2024 11:51:22 +0100 Subject: [PATCH] ci(flake): run nixci in debug build by default normal flake produces release code still. Signed-off-by: Harald Hoyer --- flake.lock | 17 +++++++++++++++++ flake.nix | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 8846edbae..b4d584edb 100644 --- a/flake.lock +++ b/flake.lock @@ -44,6 +44,22 @@ "type": "github" } }, + "debugBuild": { + "locked": { + "lastModified": 1657739266, + "narHash": "sha256-vLy8GQr0noEcoA+jX24FgUVBA/poV36zDWAUChN3hIY=", + "owner": "boolean-option", + "repo": "false", + "rev": "d06b4794a134686c70a1325df88a6e6768c6b212", + "type": "github" + }, + "original": { + "owner": "boolean-option", + "repo": "false", + "rev": "d06b4794a134686c70a1325df88a6e6768c6b212", + "type": "github" + } + }, "devenv": { "inputs": { "cachix": "cachix", @@ -548,6 +564,7 @@ "root": { "inputs": { "crane": "crane", + "debugBuild": "debugBuild", "devenv": "devenv", "flake-utils": "flake-utils_4", "nixpkgs": "nixpkgs_2", diff --git a/flake.nix b/flake.nix index cfa382b22..173dc56b2 100644 --- a/flake.nix +++ b/flake.nix @@ -20,9 +20,14 @@ url = "github:ipetkov/crane"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # The premise is this is the "default" and if you want to do a debug build, + # pass it in as an arg. + # like so `nix build --override-input debugBuild github:boolean-option/true` + debugBuild.url = "github:boolean-option/false/d06b4794a134686c70a1325df88a6e6768c6b212"; }; outputs = { self, devenv, flake-utils, nixpkgs, rust-overlay, crane, ... } @ inputs: - flake-utils.lib.eachDefaultSystem + (flake-utils.lib.eachDefaultSystem (system: let features = "--all-features"; @@ -70,7 +75,10 @@ OPENSSL_NO_VENDOR = 1; NIX_OUTPATH_USED_AS_RANDOM_SEED = "aaaaaaaaaa"; cargoExtraArgs = "--locked ${features}"; - }; + } // (pkgs.lib.optionalAttrs inputs.debugBuild.value { + # do a debug build, as `dev` is the default debug profile + CARGO_PROFILE = "dev"; + }); cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); version = cargoToml.workspace.package.version; @@ -173,5 +181,12 @@ default = kitsune; kitsune = (import ./module.nix); }; + }) // { + nixci.default = { + debug = { + dir = "."; + overrideInputs.debugBuild = "github:boolean-option/true/6ecb49143ca31b140a5273f1575746ba93c3f698"; + }; + }; }; }