prop/flake.nix
Graham McInitre a8ecee32b0 feat: add Nix flake dev environment with Erlang 29.0.3 + Elixir 1.20.2
- Add flake.nix + flake.lock pinning nixpkgs-unstable
- Add nix/shell.nix with PostgreSQL, Rust, Elixir LSP, pre-commit hooks
- Add shell.nix flake-compat shim for non-flake nix-shell users
- Bump Dockerfile to Elixir 1.20.2 / OTP 29.0.3
- Add nix.md with setup and troubleshooting docs
- Gitignore Nix runtime state and generated pre-commit config

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-15 12:57:10 -05:00

69 lines
1.7 KiB
Nix

{
description = "Prop Microwave propagation prediction for NTMS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
nixpkgs,
flake-parts,
systems,
pre-commit-hooks,
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.filter (s: s != "x86_64-darwin") (import systems);
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
_module.args.pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [
# Pin Erlang 29.0.3 and Elixir 1.20.2 (matches .tool-versions)
(final: prev: {
erlang = prev.beam.interpreters.erlang_29;
elixir = prev.beam.packages.erlang_29.elixir_1_20;
beamPackages = prev.beam.packages.erlang_29.extend (
self: super: {
elixir = super.elixir_1_20;
}
);
})
];
};
# Development shell with PostgreSQL, Rust, Elixir LSP
devShells.default = pkgs.callPackage ./nix/shell.nix {
pre-commit-hooks = inputs.pre-commit-hooks.lib.${system};
};
# Nix formatter for flake files
formatter = pkgs.nixfmt;
};
};
}