Skip to content

Commit 4a610a8

Browse files
authored
Initialize flake.nix (#14)
Closes #13 Closes #16 Adds all necessary infrastructure code for development, testing and building allegra packages. Allows allegra packages and checks to be built by MacOS machines, assuming they have `nix-darwin` installed to forward tasks on to a `linux-builder`. Ignores tests that require sudo privilages or users to provide a disk image. Ref #18 #19
2 parents 4bd62c0 + 1336bfe commit 4a610a8

18 files changed

+991
-212
lines changed

.github/workflows/flake.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Nix Flake Checks
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
concurrency:
7+
group: ${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
permissions: read-all
11+
12+
jobs:
13+
# Contains checks for not only nix flake errors but also the rust derivations
14+
# built by the flake, e.g. cargo fmt, cargo deny check, cargo audit, etc.
15+
#
16+
# This can be extended, and these checks and their tools are available locally.
17+
nix-flake-check:
18+
name: Nix Flake Check
19+
runs-on: ubuntu-latest
20+
permissions:
21+
id-token: "write"
22+
contents: "read"
23+
steps:
24+
- name: Free Disk Space (Ubuntu)
25+
uses: jlumbroso/free-disk-space@main
26+
with:
27+
tool-cache: true
28+
- uses: actions/checkout@v4
29+
- uses: DeterminateSystems/nix-installer-action@main
30+
- uses: DeterminateSystems/magic-nix-cache-action@main
31+
- uses: DeterminateSystems/flake-checker-action@main
32+
- run: nix flake check --keep-going -L
33+
34+
nix-flake-devShell-check:
35+
name: Nix devShell Check
36+
runs-on: ubuntu-latest
37+
permissions:
38+
id-token: "write"
39+
contents: "read"
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: DeterminateSystems/nix-installer-action@main
43+
- uses: DeterminateSystems/magic-nix-cache-action@main
44+
- run: nix develop
45+
46+
nix-flake-fmt-check:
47+
name: Nix Format Check
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: DeterminateSystems/nix-installer-action@main
52+
- uses: DeterminateSystems/magic-nix-cache-action@main
53+
- run: nix fmt --accept-flake-config -- --check .

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ logs
66
.images
77
.GLUSTER-SETUP.md
88
.INSTANCE-LAUNCH.md
9+
result*

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "allegra"
33
version = "0.1.0"
44
edition = "2021"
5+
publish = false
56

67
[profile.release]
78
opt-level = 3

deny.toml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[bans]
2+
multiple-versions = 'allow'
3+
4+
[licenses]
5+
private = { ignore = true }
6+
allow = [
7+
"Apache-2.0",
8+
"BSD-3-Clause",
9+
"CC0-1.0",
10+
"ISC",
11+
"MIT",
12+
"OpenSSL",
13+
"Unicode-DFS-2016",
14+
"Unlicense",
15+
"0BSD",
16+
]
17+
18+
# Copied from https://github.com/EmbarkStudios/cargo-deny/blob/6344cc566621410a0865632b4ef0e82a20408676/deny.toml#L63
19+
[[licenses.clarify]]
20+
crate = "ring"
21+
# SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses
22+
# https://spdx.org/licenses/OpenSSL.html
23+
# ISC - Both BoringSSL and ring use this for their new files
24+
# MIT - "Files in third_party/ have their own licenses, as described therein. The MIT
25+
# license, for third_party/fiat, which, unlike other third_party directories, is
26+
# compiled into non-test libraries, is included below."
27+
# OpenSSL - Obviously
28+
expression = "ISC AND MIT AND OpenSSL"
29+
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
30+
31+
[advisories]
32+
version = 2
33+
ignore = [
34+
{ id = "RUSTSEC-2021-0141", reason = "may be valid, more research is necessary." },
35+
{ id = "RUSTSEC-2021-0127", reason = "may be valid, more research is necessary." },
36+
]

flake.lock

+174
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)