Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@ jobs:
- name: Check Nix formatting
run: nix run nixpkgs#alejandra -- --check .

- name: Build default package
run: nix build

- name: Test in flake devShell
run: nix develop --command cargo test --all-targets --all-features
35 changes: 32 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
description = "Rust development shell template";
description = "JSON CLI for a running QueryMT ACP WebSocket server";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = inputs:
outputs = inputs @ {self, ...}:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = inputs.nixpkgs.lib.systems.flakeExposed;

Expand All @@ -18,7 +18,36 @@
};

rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

qmtacp = pkgs.rustPlatform.buildRustPackage {
pname = "qmtacp";
version = cargoToml.package.version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
auditable = false;
doCheck = false;
};
in {
packages = {
qmtacp = qmtacp;
default = qmtacp;
};

apps = {
qmtacp = {
type = "app";
program = "${self.packages.${system}.qmtacp}/bin/qmtacp";
};
default = {
type = "app";
program = "${self.packages.${system}.qmtacp}/bin/qmtacp";
};
};

devShells.default = pkgs.mkShell {
packages = [
rustToolchain
Expand All @@ -27,7 +56,7 @@
];

shellHook = ''
export PS1="(dev:rust) $PS1"
export PS1="(dev:qmtacp) $PS1"
'';
};
};
Expand Down
Loading