diff --git a/flake.lock b/flake.lock index f493155..06ce42e 100644 --- a/flake.lock +++ b/flake.lock @@ -37,24 +37,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -115,7 +97,6 @@ "inputs": { "fenix": "fenix", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "gitignore": "gitignore", "naersk": "naersk", "nixpkgs": "nixpkgs" @@ -137,21 +118,6 @@ "repo": "rust-analyzer", "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 cdc801e..9b8da6f 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; - flake-utils.url = "github:numtide/flake-utils"; gitignore = { url = "github:hercules-ci/gitignore.nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -22,7 +21,7 @@ }; }; - outputs = { self, nixpkgs, flake-utils, gitignore, fenix, naersk, ... }: + outputs = { self, nixpkgs, gitignore, fenix, naersk, ... }: let inherit (gitignore.lib) gitignoreSource; @@ -116,10 +115,13 @@ }; }; - mkApp = drv: flake-utils.lib.mkApp { - inherit drv; - name = "himalaya"; - }; + mkApp = drv: + let exePath = drv.passthru.exePath or "/bin/himalaya"; + in + { + type = "app"; + program = "${drv}${exePath}"; + }; mkApps = buildPlatform: let @@ -141,11 +143,12 @@ in mkApp app; }; - + supportedSystems = [ "aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems f; in - flake-utils.lib.eachDefaultSystem (system: { - devShells = mkDevShells system; - packages = mkPackages system; - apps = mkApps system; - }); + { + apps = forEachSupportedSystem mkApps; + packages = forEachSupportedSystem mkPackages; + devShells = forEachSupportedSystem mkDevShells; + }; }