From d72071c9735153faa633589f7cdcf2e8b30755d2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sun, 23 Jul 2023 10:10:10 -0400 Subject: [PATCH] mission-control -> just --- README.md | 2 +- flake.lock | 32 -------------------------------- flake.nix | 31 +------------------------------ justfile | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 63 deletions(-) create mode 100644 justfile diff --git a/README.md b/README.md index dba2bdd..55077d2 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,4 @@ nix develop -c cargo run 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. \ No newline at end of file diff --git a/flake.lock b/flake.lock index d135809..2904a5f 100644 --- a/flake.lock +++ b/flake.lock @@ -18,36 +18,6 @@ "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": { "locked": { "lastModified": 1690031011, @@ -101,8 +71,6 @@ "root": { "inputs": { "flake-parts": "flake-parts", - "flake-root": "flake-root", - "mission-control": "mission-control", "nixpkgs": "nixpkgs", "systems": "systems", "treefmt-nix": "treefmt-nix" diff --git a/flake.nix b/flake.nix index 662c776..7ce3902 100644 --- a/flake.nix +++ b/flake.nix @@ -6,8 +6,6 @@ # Dev tools treefmt-nix.url = "github:numtide/treefmt-nix"; - mission-control.url = "github:Platonic-Systems/mission-control"; - flake-root.url = "github:srid/flake-root"; }; outputs = inputs: @@ -15,8 +13,6 @@ systems = import inputs.systems; imports = [ inputs.treefmt-nix.flakeModule - inputs.mission-control.flakeModule - inputs.flake-root.flakeModule ]; perSystem = { config, self', pkgs, lib, system, ... }: @@ -39,8 +35,6 @@ devShells.default = pkgs.mkShell { inputsFrom = [ config.treefmt.build.devShell - config.mission-control.devShell - config.flake-root.devShell ]; shellHook = '' # For rust-analyzer 'hover' tooltips to work. @@ -48,6 +42,7 @@ ''; buildInputs = nonRustDeps; nativeBuildInputs = with pkgs; [ + just rustc cargo cargo-watch @@ -64,30 +59,6 @@ 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"; - }; - }; }; }; } diff --git a/justfile b/justfile new file mode 100644 index 0000000..c03df42 --- /dev/null +++ b/justfile @@ -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}}" \ No newline at end of file