fix: nix flake

This commit is contained in:
Alexander Medvedev
2026-08-17 12:33:05 +02:00
parent 96cfde9091
commit 6c840de350
3 changed files with 22 additions and 76 deletions

View File

@@ -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

61
flake.lock generated
View File

@@ -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",

View File

@@ -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
];
};