mission-control -> just

This commit is contained in:
Sridhar Ratnakumar 2023-07-23 10:10:10 -04:00
parent a511ca0e76
commit d72071c973
4 changed files with 16 additions and 63 deletions

View file

@ -24,4 +24,4 @@ nix develop -c cargo run
nix build nix build
``` ```
There are also [mission-control](https://github.com/Platonic-Systems/mission-control) shell commands provided in the devShell. We also provide a [`justfile`](https://just.systems/) for Makefile'esque commands.

32
flake.lock generated
View file

@ -18,36 +18,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-root": {
"locked": {
"lastModified": 1680964220,
"narHash": "sha256-dIdTYcf+KW9a4pKHsEbddvLVSfR1yiAJynzg2x0nfWg=",
"owner": "srid",
"repo": "flake-root",
"rev": "f1c0b93d05bdbea6c011136ba1a135c80c5b326c",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"mission-control": {
"locked": {
"lastModified": 1689802645,
"narHash": "sha256-USdf0MXZlllulmqhcqcLFQTt5FK1Lx3lQ7gxyZkz7Pk=",
"owner": "Platonic-Systems",
"repo": "mission-control",
"rev": "b48d201323df0ed2d4f05283139eaa6580ee7c39",
"type": "github"
},
"original": {
"owner": "Platonic-Systems",
"repo": "mission-control",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1690031011, "lastModified": 1690031011,
@ -101,8 +71,6 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-root": "flake-root",
"mission-control": "mission-control",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"systems": "systems", "systems": "systems",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"

View file

@ -6,8 +6,6 @@
# Dev tools # Dev tools
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
mission-control.url = "github:Platonic-Systems/mission-control";
flake-root.url = "github:srid/flake-root";
}; };
outputs = inputs: outputs = inputs:
@ -15,8 +13,6 @@
systems = import inputs.systems; systems = import inputs.systems;
imports = [ imports = [
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
inputs.mission-control.flakeModule
inputs.flake-root.flakeModule
]; ];
perSystem = { config, self', pkgs, lib, system, ... }: perSystem = { config, self', pkgs, lib, system, ... }:
@ -39,8 +35,6 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
inputsFrom = [ inputsFrom = [
config.treefmt.build.devShell config.treefmt.build.devShell
config.mission-control.devShell
config.flake-root.devShell
]; ];
shellHook = '' shellHook = ''
# For rust-analyzer 'hover' tooltips to work. # For rust-analyzer 'hover' tooltips to work.
@ -48,6 +42,7 @@
''; '';
buildInputs = nonRustDeps; buildInputs = nonRustDeps;
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
just
rustc rustc
cargo cargo
cargo-watch cargo-watch
@ -64,30 +59,6 @@
rustfmt.enable = true; rustfmt.enable = true;
}; };
}; };
# Makefile'esque but in Nix. Add your dev scripts here.
# cf. https://github.com/Platonic-Systems/mission-control
mission-control.scripts = {
fmt = {
exec = config.treefmt.build.wrapper;
description = "Auto-format project tree";
};
run = {
exec = ''
cargo run "$@"
'';
description = "Run the project executable";
};
watch = {
exec = ''
set -x
cargo watch -x "run -- $*"
'';
description = "Watch for changes and run the project executable";
};
};
}; };
}; };
} }

14
justfile Normal file
View file

@ -0,0 +1,14 @@
default:
@just --list
# Auto-format the source tree
fmt:
treefmt
# Run 'cargo run' on the project
run *ARGS:
cargo run {{ARGS}}
# Run 'cargo watch' to run the project (auto-recompiles)
watch *ARGS:
cargo watch -x "run -- {{ARGS}}"