Skip to content

Commit

Permalink
chore: make nix flake buildable
Browse files Browse the repository at this point in the history
  • Loading branch information
AnActualEmerald committed Apr 21, 2024
1 parent 98fdacb commit 6130708
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
ns_*
*.ron
.env
result
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "thermite"]
path = thermite
url = [email protected]:AnActualEmerald/thermite
3 changes: 2 additions & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.*"]

[dependencies]
tracing = { default-features = false, version = "0.1.37" }
libthermite = { path = "./thermite", version = "0.7.1", features = [
libthermite = { git = "https://github.com/anactualemerald/thermite", branch = "main", version = "0.8.1", features = [
"steam",
], default-features = false }
anyhow = "1.0.72"
Expand Down
34 changes: 34 additions & 0 deletions flake.lock

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

41 changes: 31 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,41 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
}: let
pkgs = import nixpkgs {system = "x86_64-linux";};
in {
formatter.x86_64-linux = pkgs.alejandra;
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
buildDeps = with pkgs; [pkg-config openssl rustc];
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
rustPackage = features:
pkgs.rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"libthermite-0.8.1" = "sha256-DPc6Nt8BN0Q+t+bf3p171BiIXuAAcVBbve2rR1l9QTg=";
};
};
buildFeatures = features;
nativeBuildInputs = buildDeps;
};
in rec {
packages.papa = rustPackage "";

devShells.x86_64-linux.default = pkgs.mkShell {
nativeBuildInputs = [pkgs.pkg-config];
buildInputs = [pkgs.rustc pkgs.openssl];
packages = [pkgs.just pkgs.cargo pkgs.cargo-watch];
};
};
packages.default = packages.papa;

formatter = pkgs.alejandra;

devShells.default = pkgs.mkShell {
nativeBuildInputs = buildDeps;
packages = [pkgs.just pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer];
};
});
}
1 change: 0 additions & 1 deletion thermite
Submodule thermite deleted from 8e6fc6

0 comments on commit 6130708

Please sign in to comment.