From 207d66963e5e68fbb5da69befef16a7ceadb2a2e Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 7 Feb 2026 12:30:48 -0600 Subject: [PATCH] fix: Make Nix flake compatible with macOS - Make inotify-tools Linux-only (not available on Darwin) - Replace nixfmt-rfc-style with nixfmt (deprecated warning) - Add flake.lock for reproducible builds Changes: - nix/shell.nix: Conditionally include inotify-tools only on Linux - flake.nix: Use pkgs.nixfmt instead of pkgs.nixfmt-rfc-style - flake.lock: Lock dependencies for reproducibility --- flake.lock | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 2 +- nix/shell.nix | 11 +++-- 3 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..15dcb22e --- /dev/null +++ b/flake.lock @@ -0,0 +1,124 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769939035, + "narHash": "sha256-Fok2AmefgVA0+eprw2NDwqKkPGEI5wvR+twiZagBvrg=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "a8ca480175326551d6c4121498316261cbb5b260", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 3d6d8b12..b8c69b56 100644 --- a/flake.nix +++ b/flake.nix @@ -53,7 +53,7 @@ }; # Nix formatter for flake files - formatter = pkgs.nixfmt-rfc-style; + formatter = pkgs.nixfmt; }; flake = { diff --git a/nix/shell.nix b/nix/shell.nix index 8c9140e6..7d0df44b 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -15,10 +15,9 @@ pkg-config, # Development tools git-lfs, - inotify-tools, # LSPs and formatters elixir-ls, - nixfmt-rfc-style, + nixfmt, shellcheck, # Pre-commit hooks pre-commit-hooks, @@ -182,7 +181,7 @@ let # Nix formatting nixfmt = { enable = true; - entry = "${nixfmt-rfc-style}/bin/nixfmt"; + entry = "${nixfmt}/bin/nixfmt"; }; # Shellcheck for shell scripts @@ -213,16 +212,18 @@ mkShell { # Development tools git-lfs - inotify-tools # For Mix file watching # LSPs and formatters elixir-ls - nixfmt-rfc-style + nixfmt shellcheck # Service management scripts startServices stopServices + ] ++ lib.optionals lib.isLinux [ + # Linux-only tools + inotify-tools # For Mix file watching ]; # Environment variables