From 03b7dc29d03a950ca496a2d03c1f31d81879d81e Mon Sep 17 00:00:00 2001 From: jahanson Date: Sat, 18 May 2024 10:34:43 -0500 Subject: [PATCH] Add shell for nix --- .envrc | 1 + shell.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 shell.nix diff --git a/.envrc b/.envrc index a094d01..b19e961 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ export SOPS_AGE_KEY_FILE="$(expand_path ./age.key)" +use nix \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8fda4aa --- /dev/null +++ b/shell.nix @@ -0,0 +1,34 @@ +# 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 { inherit system overlays; } +, ... +}: +let +in +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 + pre-commit + gitleaks + mkdocs + mqttui + ]; +}