Skip to content

Commit 6130708

Browse files
chore: make nix flake buildable
1 parent 98fdacb commit 6130708

7 files changed

+69
-16
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
ns_*
88
*.ron
99
.env
10+
result

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "thermite"]
2-
path = thermite
3-
url = git@github.com:AnActualEmerald/thermite

Cargo.lock

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.*"]
1313

1414
[dependencies]
1515
tracing = { default-features = false, version = "0.1.37" }
16-
libthermite = { path = "./thermite", version = "0.7.1", features = [
16+
libthermite = { git = "https://github.com/anactualemerald/thermite", branch = "main", version = "0.8.1", features = [
1717
"steam",
1818
], default-features = false }
1919
anyhow = "1.0.72"

flake.lock

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

flake.nix

+31-10
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,41 @@
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs";
6+
flake-utils.url = "github:numtide/flake-utils";
67
};
78

89
outputs = {
910
self,
1011
nixpkgs,
11-
}: let
12-
pkgs = import nixpkgs {system = "x86_64-linux";};
13-
in {
14-
formatter.x86_64-linux = pkgs.alejandra;
12+
flake-utils,
13+
}:
14+
flake-utils.lib.eachDefaultSystem (system: let
15+
pkgs = import nixpkgs {inherit system;};
16+
buildDeps = with pkgs; [pkg-config openssl rustc];
17+
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
18+
rustPackage = features:
19+
pkgs.rustPlatform.buildRustPackage {
20+
inherit (cargoToml.package) name version;
21+
src = ./.;
22+
cargoLock = {
23+
lockFile = ./Cargo.lock;
24+
outputHashes = {
25+
"libthermite-0.8.1" = "sha256-DPc6Nt8BN0Q+t+bf3p171BiIXuAAcVBbve2rR1l9QTg=";
26+
};
27+
};
28+
buildFeatures = features;
29+
nativeBuildInputs = buildDeps;
30+
};
31+
in rec {
32+
packages.papa = rustPackage "";
1533

16-
devShells.x86_64-linux.default = pkgs.mkShell {
17-
nativeBuildInputs = [pkgs.pkg-config];
18-
buildInputs = [pkgs.rustc pkgs.openssl];
19-
packages = [pkgs.just pkgs.cargo pkgs.cargo-watch];
20-
};
21-
};
34+
packages.default = packages.papa;
35+
36+
formatter = pkgs.alejandra;
37+
38+
devShells.default = pkgs.mkShell {
39+
nativeBuildInputs = buildDeps;
40+
packages = [pkgs.just pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer];
41+
};
42+
});
2243
}

thermite

-1
This file was deleted.

0 commit comments

Comments
 (0)