diff options
| author | 2026-05-13 13:43:24 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:24 +0100 | |
| commit | ebad39adab212ab4e26f9a98befa0048c7eea710 (patch) | |
| tree | 92fae17be7a264595bbbaf7a52dec1249f043f08 /dot_config/nix/templates/dev | |
| parent | 415d55a7b5f87dec2d5ecfe3cd109c0530e4cbd7 (diff) | |
| download | dotfiles-ebad39adab212ab4e26f9a98befa0048c7eea710.tar.gz dotfiles-ebad39adab212ab4e26f9a98befa0048c7eea710.tar.bz2 dotfiles-ebad39adab212ab4e26f9a98befa0048c7eea710.zip | |
feat(nix): hybrid setup with flakes + direnv for per-project dev shells
Install Nix (multi-user daemon) on Arch and wire up direnv so any project
can declare its toolchain in a flake.nix and get a hermetic dev shell on
cd. No NixOS, no home-manager, no migration off paru/chezmoi — just one
new package manager scoped to project dev shells.
- meta/nix.txt: nix from extra repo
- meta/dev.txt: direnv (general-purpose, not nix-specific)
- systemd-units/system/nix.txt: nix-daemon.socket (socket-activated)
- etc/nix/nix.conf: enable flakes + nix-command, trusted-users=@wheel,
auto-optimise-store, keep-outputs/derivations so direnv envs survive GC
- dot_config/direnv/direnvrc: load nix-direnv 3.1.1 via source_url with
pinned sha256 (not packaged for Arch; refusing -git AUR)
- dot_config/nix/templates/{flake.nix,dev/}: flake template usable via
'nix flake init -t ~/.config/nix/templates'
- dot_config/zsh/dot_zshrc: 'eval "$(direnv hook zsh)"'
Diffstat (limited to 'dot_config/nix/templates/dev')
| -rw-r--r-- | dot_config/nix/templates/dev/dot_envrc | 1 | ||||
| -rw-r--r-- | dot_config/nix/templates/dev/flake.nix | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/dot_config/nix/templates/dev/dot_envrc b/dot_config/nix/templates/dev/dot_envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/dot_config/nix/templates/dev/dot_envrc @@ -0,0 +1 @@ +use flake diff --git a/dot_config/nix/templates/dev/flake.nix b/dot_config/nix/templates/dev/flake.nix new file mode 100644 index 0000000..84b3179 --- /dev/null +++ b/dot_config/nix/templates/dev/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Project dev shell"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" "aarch64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in + { + devShells = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + # Add per-project tools here. + # Example: nodejs_22 python313 cargo gcc + ]; + + shellHook = '' + # Per-project env setup (printed once on shell entry). + ''; + }; + }); + }; +} |
