aboutsummaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/shell.nix b/shell.nix
index c70c2eb..7e73840 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,11 +1,29 @@
-{ pkgs ? import (import ./nix/sources.nix).nixpkgs { } }:
+{ pkgs ? import (import ./nix/sources.nix).nixpkgs {
+ overlays = [
+ (self: super: {
+ "format" = pkgs.writers.writeDashBin "format" ''
+ set -efu
+ cd ${self.lib.escapeShellArg (toString ./.)}
+ find src -iname '*.rs' -exec ${pkgs.rustfmt}/bin/rustfmt '{}' \;
+ '';
+ "watch" = pkgs.writers.writeDashBin "watch" ''
+ set -efu
+ cd ${self.lib.escapeShellArg (toString ./.)}
+ find src -iname '*.rs' | entr -rs 'clear; cargo check'
+ '';
+ })
+ ];
+ }
+}:
let inherit (pkgs) lib; in
pkgs.mkShell rec {
nativeBuildInputs = [
pkgs.cargo
+ pkgs.format
pkgs.pkg-config
pkgs.rustc
pkgs.rustfmt
+ pkgs.watch
];
buildInputs = [
pkgs.alsa-lib