diff options
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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 |