diff --git a/flake.lock b/flake.lock index 97f8967..044c1eb 100644 --- a/flake.lock +++ b/flake.lock @@ -16,24 +16,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1715395895, @@ -53,24 +35,8 @@ "root": { "inputs": { "edge-nixpkgs": "edge-nixpkgs", - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "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", diff --git a/flake.nix b/flake.nix index 58dc5a7..8029aaa 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,6 @@ # - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; }; outputs = @@ -15,37 +14,48 @@ self, nixpkgs, edge-nixpkgs, - flake-utils, }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - edge-pkgs = edge-nixpkgs.legacyPackages.${system}; - in - { - # Q. Why nixfmt? Not nixpkgs-fmt and alejandra? - # A. nixfmt will be official - # - https://github.com/NixOS/nixfmt/issues/153 - # - https://github.com/NixOS/nixfmt/issues/129 - # - https://github.com/NixOS/rfcs/pull/166 - formatter = edge-pkgs.nixfmt-rfc-style; - devShells.default = - with pkgs; - mkShell { - buildInputs = [ - # https://github.com/NixOS/nix/issues/730#issuecomment-162323824 - # https://github.com/kachick/dotfiles/pull/228 - bashInteractive - findutils # xargs - edge-pkgs.nixfmt-rfc-style - nil - go-task + let + # Candidates: https://github.com/NixOS/nixpkgs/blob/release-23.11/lib/systems/flake-systems.nix + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + # I don't have M1+ mac, providing this for macos-14 free runner https://github.com/actions/runner-images/issues/9741 + "aarch64-darwin" + ]; + in + { + # Q. Why nixfmt? Not nixpkgs-fmt and alejandra? + # A. nixfmt will be official + # - https://github.com/NixOS/nixfmt/issues/153 + # - https://github.com/NixOS/nixfmt/issues/129 + # - https://github.com/NixOS/rfcs/pull/166 + formatter = forAllSystems (system: edge-nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); + devShells = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + edge-pkgs = edge-nixpkgs.legacyPackages.${system}; + in + { + default = + with pkgs; + mkShell { + buildInputs = [ + # https://github.com/NixOS/nix/issues/730#issuecomment-162323824 + # https://github.com/kachick/dotfiles/pull/228 + bashInteractive + findutils # xargs + edge-pkgs.nixfmt-rfc-style + nil + go-task - edge-pkgs.dprint - edge-pkgs.typos - ]; - }; - } - ); + edge-pkgs.dprint + edge-pkgs.typos + ]; + }; + } + ); + }; }