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 .mozilla
**/*.tmp.sops.yaml **/*.tmp.sops.yaml
result result
.direnv

View file

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

View file

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