diff --git a/flake.lock b/flake.lock index d7e7584..6eacb3a 100644 --- a/flake.lock +++ b/flake.lock @@ -18,41 +18,7 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "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": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 9a22931..465cae9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,16 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, utils }: + outputs = { self, nixpkgs }: let inherit (nixpkgs) lib; + + forAllSystems = function: lib.genAttrs + [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ] + (system: function nixpkgs.legacyPackages.${system}); + deadnixLambda = pkgs: pkgs.rustPlatform.buildRustPackage { pname = "deadnix"; @@ -35,32 +39,28 @@ maintainers = with maintainers; [ astro ]; }; }; - in - utils.lib.eachDefaultSystem - (system: - let - pkgs = nixpkgs.legacyPackages.${system}; + in { + packages = forAllSystems (pkgs: { + default = self.packages.${pkgs.system}.deadnix; + deadnix = deadnixLambda pkgs; + }); - packages = { - default = self.packages."${system}".deadnix; - deadnix = deadnixLambda pkgs; - }; - in - { - inherit packages; + checks = self.packages; - checks = packages; + apps = forAllSystems (pkgs: { + default = { + type = "app"; + program = lib.getExe self.packages.${pkgs.system}.default; + }; + }); - apps.default = utils.lib.mkApp { - drv = self.packages."${system}".default; - }; + devShells = forAllSystems (pkgs: { + default = with pkgs; mkShell { + nativeBuildInputs = [ cargo rustc rustfmt rustPackages.clippy rust-analyzer libiconv ]; + RUST_SRC_PATH = rustPlatform.rustLibSrc; + }; + }); - devShells.default = with pkgs; mkShell { - nativeBuildInputs = [ cargo rustc rustfmt rustPackages.clippy rust-analyzer libiconv ]; - RUST_SRC_PATH = rustPlatform.rustLibSrc; - }; - }) - // { overlays.default = (final: _: { deadnix = deadnixLambda final; });