diff --git a/flake.nix b/flake.nix index e00084b..f6f5d06 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,13 @@ { - description = "A very basic flake"; + description = "Provides nix flakes for development"; outputs = { self }: { templates = { + rust = { - path = ./rust-template; + path = ./rust; description = "A standard Rust development environment"; }; }; diff --git a/rust-template b/rust/flake.nix similarity index 100% rename from rust-template rename to rust/flake.nix diff --git a/shell/flake.nix b/shell/flake.nix new file mode 100644 index 0000000..b032a22 --- /dev/null +++ b/shell/flake.nix @@ -0,0 +1,39 @@ +{ + description = "A simple Rust development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + utils, + }: + utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + + name = "flake"; + + buildInputs = with pkgs; [ + # Add packages + ]; + + # Environment variables + shellHook = '' + # Trigger zsh + if [[ -z "$ZSH_VERSION" ]]; then + exec zsh + fi + ''; + }; + } + ); +}