Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.

Commit ede0c52

Browse files
committed
nix: refactor package
1 parent 204e2bb commit ede0c52

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

derivation.nix

Lines changed: 0 additions & 12 deletions
This file was deleted.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
in
1515
{
1616
packages = {
17-
zia-client = pkgs.callPackage ./derivation.nix {
17+
zia-client = pkgs.callPackage ./package.nix {
1818
cargoToml = ./zia-client/Cargo.toml;
1919
};
2020

21-
zia-server = pkgs.callPackage ./derivation.nix {
21+
zia-server = pkgs.callPackage ./package.nix {
2222
cargoToml = ./zia-server/Cargo.toml;
2323
};
2424
};

package.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{ lib, rustPlatform, cargoToml, ... }:
2+
3+
let
4+
manifest = (lib.importTOML cargoToml).package;
5+
in
6+
rustPlatform.buildRustPackage {
7+
pname = manifest.name;
8+
inherit (manifest) version;
9+
10+
src = lib.cleanSource ./.;
11+
cargoLock.lockFile = ./Cargo.lock;
12+
13+
cargoBuildFlags = "-p ${manifest.name}";
14+
cargoTestFlags = "-p ${manifest.name}";
15+
16+
meta = {
17+
mainProgram = manifest.name;
18+
};
19+
}

0 commit comments

Comments
 (0)