From 6c840de350e0a7cd7034ad866c4d5ff7edc34439 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Mon, 17 Aug 2026 12:33:05 +0200 Subject: [PATCH] fix: nix flake --- .github/workflows/nix.yml | 4 +-- flake.lock | 61 --------------------------------------- flake.nix | 33 ++++++++++++--------- 3 files changed, 22 insertions(+), 76 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 2befa7b05..bac073bae 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -29,10 +29,10 @@ jobs: submodules: recursive - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v16 + uses: DeterminateSystems/nix-installer-action@v22 - name: Magic Nix Cache - uses: DeterminateSystems/magic-nix-cache-action@v9 + uses: DeterminateSystems/magic-nix-cache-action@v14 - name: Check flake formatting and evaluation run: nix flake check diff --git a/flake.lock b/flake.lock index 072308394..575c72f54 100644 --- a/flake.lock +++ b/flake.lock @@ -1,27 +1,5 @@ { "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "naersk", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1752475459, - "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", - "owner": "nix-community", - "repo": "fenix", - "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -56,27 +34,6 @@ "type": "github" } }, - "naersk": { - "inputs": { - "fenix": "fenix", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1780932914, - "narHash": "sha256-3TJ7skmzAeBRkOihfHSWye7Fkuc1gP01dwa/EX1EA/E=", - "owner": "nix-community", - "repo": "naersk", - "rev": "10d02d63fa3f296786d27f3a35a9926ee3fa6df0", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1780749050, @@ -112,26 +69,8 @@ "inputs": { "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "naersk": "naersk", "nixpkgs": "nixpkgs" } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1752428706, - "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 33361acb6..7aa39ded5 100644 --- a/flake.nix +++ b/flake.nix @@ -9,18 +9,12 @@ flake = false; }; - naersk = { - url = "github:nix-community/naersk"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - self.submodules = true; }; outputs = inputs@{ flake-parts, - naersk, nixpkgs, ... }: @@ -34,22 +28,34 @@ ... }: let - naersk' = pkgs.callPackage naersk { }; - manifest = (lib.importTOML ./crates/pumpkin/Cargo.toml).package; workspace-manifest = (lib.importTOML ./Cargo.toml).workspace.package; in { - packages.default = naersk'.buildPackage { + packages.default = pkgs.rustPlatform.buildRustPackage { pname = manifest.name; inherit (workspace-manifest) version; - nativeBuildInputs = [ pkgs.rustfmt ]; + src = lib.cleanSource ./.; - src = lib.fileset.toSource { - root = ./.; - fileset = lib.fileset.gitTracked ./.; + cargoLock = { + lockFile = ./Cargo.lock; }; + + nativeBuildInputs = [ + pkgs.rustfmt + pkgs.pkg-config + ]; + + cargoBuildFlags = [ + "--package" + "pumpkin" + ]; + + CARGO_PROFILE_RELEASE_LTO = "thin"; + CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "16"; + + doCheck = false; }; devShells.default = pkgs.mkShell { @@ -59,6 +65,7 @@ rust-analyzer rustc rustfmt + pkg-config ]; };