tangled
alpha
login
or
join now
tsiry-sandratraina.com
/
fireup
8
fork
atom
Prepare, configure, and manage Firecracker microVMs in seconds!
virtualization
linux
microvm
firecracker
8
fork
atom
overview
issues
pulls
pipelines
setup nix flakes
tsiry-sandratraina.com
7 months ago
701a3bdf
fa7f7801
1/1
fmt.yml
success
11s
+268
2 changed files
expand all
collapse all
unified
split
flake.lock
flake.nix
+116
flake.lock
···
1
1
+
{
2
2
+
"nodes": {
3
3
+
"advisory-db": {
4
4
+
"flake": false,
5
5
+
"locked": {
6
6
+
"lastModified": 1753275806,
7
7
+
"narHash": "sha256-E+Cu/AFVGwoQo4KPgcWmFS9zU7fJgXoK0o25EP3j48g=",
8
8
+
"owner": "rustsec",
9
9
+
"repo": "advisory-db",
10
10
+
"rev": "c62e71ad8c5256ffa3cafbb1a8c687db60869e98",
11
11
+
"type": "github"
12
12
+
},
13
13
+
"original": {
14
14
+
"owner": "rustsec",
15
15
+
"repo": "advisory-db",
16
16
+
"type": "github"
17
17
+
}
18
18
+
},
19
19
+
"crane": {
20
20
+
"locked": {
21
21
+
"lastModified": 1753316655,
22
22
+
"narHash": "sha256-tzWa2kmTEN69OEMhxFy+J2oWSvZP5QhEgXp3TROOzl0=",
23
23
+
"owner": "ipetkov",
24
24
+
"repo": "crane",
25
25
+
"rev": "f35a3372d070c9e9ccb63ba7ce347f0634ddf3d2",
26
26
+
"type": "github"
27
27
+
},
28
28
+
"original": {
29
29
+
"owner": "ipetkov",
30
30
+
"repo": "crane",
31
31
+
"type": "github"
32
32
+
}
33
33
+
},
34
34
+
"fenix": {
35
35
+
"inputs": {
36
36
+
"nixpkgs": [
37
37
+
"nixpkgs"
38
38
+
],
39
39
+
"rust-analyzer-src": []
40
40
+
},
41
41
+
"locked": {
42
42
+
"lastModified": 1754030776,
43
43
+
"narHash": "sha256-EA7Qh5OUc3tgYrLHfG7zU6wxltvWsJ0+sFxOcVsbjOY=",
44
44
+
"owner": "nix-community",
45
45
+
"repo": "fenix",
46
46
+
"rev": "451f184de2958f8e725acba046ec10670dd771a1",
47
47
+
"type": "github"
48
48
+
},
49
49
+
"original": {
50
50
+
"owner": "nix-community",
51
51
+
"repo": "fenix",
52
52
+
"type": "github"
53
53
+
}
54
54
+
},
55
55
+
"flake-utils": {
56
56
+
"inputs": {
57
57
+
"systems": "systems"
58
58
+
},
59
59
+
"locked": {
60
60
+
"lastModified": 1731533236,
61
61
+
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
62
62
+
"owner": "numtide",
63
63
+
"repo": "flake-utils",
64
64
+
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
65
65
+
"type": "github"
66
66
+
},
67
67
+
"original": {
68
68
+
"owner": "numtide",
69
69
+
"repo": "flake-utils",
70
70
+
"type": "github"
71
71
+
}
72
72
+
},
73
73
+
"nixpkgs": {
74
74
+
"locked": {
75
75
+
"lastModified": 1753939845,
76
76
+
"narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=",
77
77
+
"owner": "NixOS",
78
78
+
"repo": "nixpkgs",
79
79
+
"rev": "94def634a20494ee057c76998843c015909d6311",
80
80
+
"type": "github"
81
81
+
},
82
82
+
"original": {
83
83
+
"owner": "NixOS",
84
84
+
"ref": "nixos-unstable",
85
85
+
"repo": "nixpkgs",
86
86
+
"type": "github"
87
87
+
}
88
88
+
},
89
89
+
"root": {
90
90
+
"inputs": {
91
91
+
"advisory-db": "advisory-db",
92
92
+
"crane": "crane",
93
93
+
"fenix": "fenix",
94
94
+
"flake-utils": "flake-utils",
95
95
+
"nixpkgs": "nixpkgs"
96
96
+
}
97
97
+
},
98
98
+
"systems": {
99
99
+
"locked": {
100
100
+
"lastModified": 1681028828,
101
101
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
102
102
+
"owner": "nix-systems",
103
103
+
"repo": "default",
104
104
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
105
105
+
"type": "github"
106
106
+
},
107
107
+
"original": {
108
108
+
"owner": "nix-systems",
109
109
+
"repo": "default",
110
110
+
"type": "github"
111
111
+
}
112
112
+
}
113
113
+
},
114
114
+
"root": "root",
115
115
+
"version": 7
116
116
+
}
+152
flake.nix
···
1
1
+
{
2
2
+
description = "FireUp - a command line tool for getting started with Firecracker MicroVMs quickly";
3
3
+
4
4
+
inputs = {
5
5
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
6
+
7
7
+
crane = {
8
8
+
url = "github:ipetkov/crane";
9
9
+
inputs.nixpkgs.follows = "nixpkgs";
10
10
+
};
11
11
+
12
12
+
fenix = {
13
13
+
url = "github:nix-community/fenix";
14
14
+
inputs.nixpkgs.follows = "nixpkgs";
15
15
+
inputs.rust-analyzer-src.follows = "";
16
16
+
};
17
17
+
18
18
+
flake-utils.url = "github:numtide/flake-utils";
19
19
+
20
20
+
advisory-db = {
21
21
+
url = "github:rustsec/advisory-db";
22
22
+
flake = false;
23
23
+
};
24
24
+
};
25
25
+
26
26
+
outputs = { self, nixpkgs, crane, fenix, flake-utils, advisory-db, ... }:
27
27
+
flake-utils.lib.eachDefaultSystem (system:
28
28
+
let
29
29
+
pkgs = import nixpkgs {
30
30
+
inherit system;
31
31
+
};
32
32
+
33
33
+
inherit (pkgs) lib;
34
34
+
35
35
+
craneLib = crane.mkLib pkgs;
36
36
+
src = craneLib.cleanCargoSource (craneLib.path ./.);
37
37
+
38
38
+
# Common arguments can be set here to avoid repeating them later
39
39
+
commonArgs = {
40
40
+
inherit src;
41
41
+
42
42
+
pname = "fireup";
43
43
+
version = "0.2.0";
44
44
+
cargoExtraArgs = "--package=fireup";
45
45
+
46
46
+
buildInputs = [
47
47
+
# Add additional build inputs here
48
48
+
pkgs.openssl.dev
49
49
+
pkgs.pkg-config
50
50
+
pkgs.gnumake
51
51
+
pkgs.perl
52
52
+
] ++ lib.optionals pkgs.stdenv.isDarwin [
53
53
+
# Additional darwin specific inputs can be set here
54
54
+
pkgs.libiconv
55
55
+
pkgs.darwin.Security
56
56
+
];
57
57
+
58
58
+
# Additional environment variables can be set directly
59
59
+
# MY_CUSTOM_VAR = "some value";
60
60
+
};
61
61
+
62
62
+
craneLibLLvmTools = craneLib.overrideToolchain
63
63
+
(fenix.packages.${system}.complete.withComponents [
64
64
+
"cargo"
65
65
+
"llvm-tools"
66
66
+
"rustc"
67
67
+
"rustfmt"
68
68
+
]);
69
69
+
70
70
+
# Build *just* the cargo dependencies, so we can reuse
71
71
+
# all of that work (e.g. via cachix) when running in CI
72
72
+
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
73
73
+
74
74
+
# Build the actual crate itself, reusing the dependency
75
75
+
# artifacts from above.
76
76
+
fireup = craneLib.buildPackage (commonArgs // {
77
77
+
inherit cargoArtifacts;
78
78
+
});
79
79
+
80
80
+
in
81
81
+
{
82
82
+
checks = {
83
83
+
# Build the crate as part of `nix flake check` for convenience
84
84
+
inherit fireup;
85
85
+
86
86
+
# Run clippy (and deny all warnings) on the crate source,
87
87
+
# again, resuing the dependency artifacts from above.
88
88
+
#
89
89
+
# Note that this is done as a separate derivation so that
90
90
+
# we can block the CI if there are issues here, but not
91
91
+
# prevent downstream consumers from building our crate by itself.
92
92
+
fireup-clippy = craneLib.cargoClippy (commonArgs // {
93
93
+
inherit cargoArtifacts;
94
94
+
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
95
95
+
});
96
96
+
97
97
+
fireup-doc = craneLib.cargoDoc (commonArgs // {
98
98
+
inherit cargoArtifacts;
99
99
+
});
100
100
+
101
101
+
# Check formatting
102
102
+
fireup-fmt = craneLib.cargoFmt {
103
103
+
inherit src;
104
104
+
};
105
105
+
106
106
+
# Audit dependencies
107
107
+
fireup-audit = craneLib.cargoAudit {
108
108
+
inherit src advisory-db;
109
109
+
};
110
110
+
111
111
+
# Run tests with cargo-nextest
112
112
+
# Consider setting `doCheck = false` on `fireup` if you do not want
113
113
+
# the tests to run twice
114
114
+
fireup-nextest = craneLib.cargoNextest (commonArgs // {
115
115
+
inherit cargoArtifacts;
116
116
+
partitions = 1;
117
117
+
partitionType = "count";
118
118
+
});
119
119
+
} // lib.optionalAttrs (system == "x86_64-linux") {
120
120
+
# NB: cargo-tarpaulin only supports x86_64 systems
121
121
+
# Check code coverage (note: this will not upload coverage anywhere)
122
122
+
fireup-coverage = craneLib.cargoTarpaulin (commonArgs // {
123
123
+
inherit cargoArtifacts;
124
124
+
});
125
125
+
};
126
126
+
127
127
+
packages = {
128
128
+
default = fireup;
129
129
+
fireup-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // {
130
130
+
inherit cargoArtifacts;
131
131
+
});
132
132
+
};
133
133
+
134
134
+
apps.default = flake-utils.lib.mkApp {
135
135
+
drv = fireup;
136
136
+
};
137
137
+
138
138
+
devShells.default = pkgs.mkShell {
139
139
+
inputsFrom = builtins.attrValues self.checks.${system};
140
140
+
141
141
+
# Additional dev-shell environment variables can be set directly
142
142
+
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
143
143
+
144
144
+
# Extra inputs can be added here
145
145
+
nativeBuildInputs = with pkgs; [
146
146
+
cargo
147
147
+
rustc
148
148
+
rustfmt
149
149
+
];
150
150
+
};
151
151
+
});
152
152
+
}