diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..e3fecb3 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +use flake + diff --git a/flake.nix b/flake.nix index 6839780..1aa0432 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,9 @@ packages = forAllSystems ({pkgs}: import ./pkgs {inherit pkgs;}); overlays = import ./overlays {inherit inputs lib;}; formatter = forAllSystems ({pkgs}: pkgs.alejandra); + devShells = forAllSystems ({pkgs}: { + default = import ./shell.nix {inherit pkgs;}; + }); nixosConfigurations = listToAttrs (map (hostname: { name = hostname; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..6588d5f --- /dev/null +++ b/shell.nix @@ -0,0 +1,28 @@ +{ + pkgs ? + # If 'pkgs' isn't defined, instantiate 'nixpkgs' from locked commit. + let + lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; + nixpkgs = fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; + }; + in + import nixpkgs {}, +}: +pkgs.mkShell { + NIX_CONFIG = "extra-experimental-features = nix-command flakes"; + + packages = with pkgs; [ + nix + git + neovim + fzf + + # Code Linting. + statix + deadnix + alejandra + flake-checker + ]; +}