feat: add direnv shell

This commit is contained in:
truxnell 2024-03-18 20:02:10 +11:00
parent c807e69147
commit 8f96fbb0c5
4 changed files with 14 additions and 25 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.mozilla
**/*.tmp.sops.yaml
result
.direnv

View file

@ -2,11 +2,6 @@
fail_fast: false
repos:
- repo: https://github.com/kamadorueda/alejandra
rev: 3.0.0
hooks:
- id: alejandra-system
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:

View file

@ -1,26 +1,18 @@
# Shell for bootstrapping flake-enabled nix and other tooling
{
pkgs ?
# If pkgs is not defined, instanciate nixpkgs from locked commit
let
lock =
(builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
# Shell for bootstrapping flake-enabled nix and home-manager
{ pkgs ? let
# If pkgs is not defined, instantiate nixpkgs from locked commit
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;
};
system = builtins.currentSystem;
overlays = [ ]; # Explicit blank overlay to avoid interference
in
import nixpkgs {overlays = [];},
...
}:
pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes repl-flake";
nativeBuildInputs = with pkgs; [
nixpkgs-fmt
nil
sops
pre-commit
go-task
alejandra
];
import nixpkgs { inherit system overlays; }
, ...
}: pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [ nix home-manager git nil nixpkgs-fmt go-task sops ];
}