From f1e12c945faaf3c50cb905539a28953a38279c2e Mon Sep 17 00:00:00 2001 From: Eric Rodrigues Pires Date: Sun, 8 Feb 2026 18:49:21 -0300 Subject: [PATCH] [skip ci] Remove flake-utils --- flake.lock | 34 ------------------ flake.nix | 102 +++++++++++++++++++++++++++++++---------------------- 2 files changed, 59 insertions(+), 77 deletions(-) diff --git a/flake.lock b/flake.lock index 98b7127..58e1412 100644 --- a/flake.lock +++ b/flake.lock @@ -15,24 +15,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1766025857, @@ -51,7 +33,6 @@ "root": { "inputs": { "crane": "crane", - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" } @@ -75,21 +56,6 @@ "repo": "rust-overlay", "type": "github" } - }, - "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 8b627ee..f403bec 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,6 @@ inputs = { nixpkgs.url = "nixpkgs/nixpkgs-unstable"; crane.url = "github:ipetkov/crane"; - flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -16,11 +15,34 @@ self, nixpkgs, crane, - flake-utils, rust-overlay, ... }: - flake-utils.lib.eachDefaultSystem ( + let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + eachSystem = + f: + (builtins.foldl' ( + acc: system: + let + fSystem = f system; + in + builtins.foldl' ( + acc': attr: + acc' + // { + ${attr} = (acc'.${attr} or { }) // fSystem.${attr}; + } + ) acc (builtins.attrNames fSystem) + ) { } systems); + in + eachSystem ( system: let rustChannel = "stable"; @@ -123,53 +145,47 @@ ); in { - packages = { + packages.${system} = { inherit duperfmt duperq duper_lsp; }; - apps = { - duperfmt = - (flake-utils.lib.mkApp { - drv = duperfmt; - }) - // { - meta = { - description = "Official Duper formatting library and CLI"; - homepage = "https://duper.dev.br"; - license = lib.licenses.mit; - mainProgram = "sandhole"; - platforms = lib.platforms.linux ++ lib.platforms.darwin; - }; + apps.${system} = { + duperfmt = { + name = "duperfmt"; + drv = duperfmt; + meta = { + description = "Official Duper formatting library and CLI"; + homepage = "https://duper.dev.br"; + license = lib.licenses.mit; + mainProgram = "sandhole"; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; - duperq = - (flake-utils.lib.mkApp { - drv = duperq; - }) - // { - meta = { - description = "A fast Duper and JSON filter/processor"; - homepage = "https://duper.dev.br"; - license = lib.licenses.mit; - mainProgram = "sandhole"; - platforms = lib.platforms.linux ++ lib.platforms.darwin; - }; + }; + duperq = { + name = "duperq"; + drv = duperq; + meta = { + description = "A fast Duper and JSON filter/processor"; + homepage = "https://duper.dev.br"; + license = lib.licenses.mit; + mainProgram = "sandhole"; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; - duper_lsp = - (flake-utils.lib.mkApp { - drv = duper_lsp; - }) - // { - meta = { - description = "Official Duper language server, with auto-formatting and diagnostics"; - homepage = "https://duper.dev.br"; - license = lib.licenses.mit; - mainProgram = "sandhole"; - platforms = lib.platforms.linux ++ lib.platforms.darwin; - }; + }; + duper_lsp = { + name = "duper_lsp"; + drv = duper_lsp; + meta = { + description = "Official Duper language server, with auto-formatting and diagnostics"; + homepage = "https://duper.dev.br"; + license = lib.licenses.mit; + mainProgram = "sandhole"; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; + }; }; - checks = { + checks.${system} = { duper-clippy = craneLib.cargoClippy ( commonArgs // { @@ -200,7 +216,7 @@ ); }; - devShells.default = craneLib.devShell { + devShells.${system}.default = craneLib.devShell { checks = self.checks.${system}; packages = -- 2.51.2