Skip to content

Commit

Permalink
feat: introduce development shell configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
BastianAsmussen committed Dec 30, 2024
1 parent 7dfedb2 commit cc402e6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake

3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 28 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -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
];
}

0 comments on commit cc402e6

Please sign in to comment.