Skip to content

Commit

Permalink
ci: switch to nix flakes for more reproducible builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Jan 22, 2025
1 parent f53b677 commit b735ab5
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ jobs:

cleanbuild-linux-nix:
name: Run clean build on Linux
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell --pure --run "cargo build"
nix_path: nixpkgs=channel:nixos-24.11
- run: nix develop --command cargo build

check-status:
name: Check status
Expand Down
100 changes: 100 additions & 0 deletions flake.lock

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

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
description = "Development environment flake";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, fenix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
buildInputs = with pkgs; [
libgit2
libz
];

in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
git
clang
gcc
protobuf
gnumake
mold
(fenix.packages.${system}.fromToolchainFile {
dir = ./.;
sha256 = "sha256-9GnMWM2pjzawUuVU7EbnPMn79rMknaA4EaxipyTgqig=";
})
cargo-nextest
cargo-llvm-cov
taplo
curl
];

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
};
});
}
31 changes: 0 additions & 31 deletions shell.nix

This file was deleted.

0 comments on commit b735ab5

Please sign in to comment.