Skip to content

Commit

Permalink
ci(flake): run nixci in debug build by default
Browse files Browse the repository at this point in the history
normal flake produces release code still.

Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh committed Mar 28, 2024
1 parent e97def3 commit e7d6910
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -173,5 +181,12 @@
default = kitsune;
kitsune = (import ./module.nix);
};
}) // {
nixci.default = {
debug = {
dir = ".";
overrideInputs.debugBuild = "github:boolean-option/true/6ecb49143ca31b140a5273f1575746ba93c3f698";
};
};
};
}
2 changes: 2 additions & 0 deletions test-overlay/flake.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
inputs = {
kitsune-overlay.url = "./..";
kitsune-overlay.inputs.debugBuild.follows = "debugBuild";
nixpkgs.follows = "kitsune-overlay/nixpkgs";
flake-utils.follows = "kitsune-overlay/flake-utils";
debugBuild.url = "github:boolean-option/true/6ecb49143ca31b140a5273f1575746ba93c3f698";
};
outputs = { self, flake-utils, nixpkgs, kitsune-overlay, ... } @ inputs:
flake-utils.lib.eachDefaultSystem
Expand Down

0 comments on commit e7d6910

Please sign in to comment.