summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..0d94ad0
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,34 @@
+{
+ description = "Rust development";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+ };
+
+ outputs =
+ { self, nixpkgs }:
+ let
+ pkgs = nixpkgs.legacyPackages.x86_64-linux;
+ in
+ {
+ devShells.x86_64-linux.default = pkgs.mkShell {
+ packages = with pkgs; [
+ gcc
+ bashInteractive
+ rustc
+ clippy
+ cargo
+ rustfmt
+ rust-analyzer
+ ];
+
+ shellHook = ''
+ export SHELL=${pkgs.bashInteractive}/bin/bash
+ export NIX_SHELL_NAME="Rust development"
+ if [[ -n "$PS1" ]]; then
+ PS1="\[\e[38;5;45m\][nix:$NIX_SHELL_NAME]\[\e[0m\] $PS1"
+ fi
+ '';
+ };
+ };
+}