diff --git a/.gitignore b/.gitignore index 97caa8b..f907bf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ **/.envrc -**/shell.nix +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2e69164 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..23f86b6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + description = "Basic flake template for setting up development shells"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: + let systems = inputs.flake-utils.lib.defaultSystems; + in inputs.flake-utils.lib.eachSystem systems (system: { + devShell = + import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; + }); +} diff --git a/shell.nix b/shell.nix new file mode 100755 index 0000000..e5f13c2 --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +let + # See https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs for more information on pinning + nixpkgs = builtins.fetchTarball { + # Descriptive name to make the store path easier to identify + name = "nixpkgs-unstable-2020-11-07"; + # Commit hash for nixos-unstable as of 2019-02-26 + url = https://github.com/NixOS/nixpkgs/archive/c54c614000644ecf9b8f8e9c873cfa91d1c05bf1.tar.gz; + # Hash obtained using `nix-prefetch-url --unpack ` + sha256 = "19xmsj1dhq25arhsfx0sl3r1y0zgpzfwhybc5dsxr1szh71wz3xs"; + }; +in +{ pkgs ? import {} }: + +with pkgs; + +mkShell { + packages = [ + python3 + pyright + stow + ]; +}