-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
58 lines (47 loc) · 1.72 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
description = "A very basic flake with integrated Rust project geni";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Using unstable channel for packages
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
# Importing the package configuration from previously separate default.nix
geni = let
manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
in pkgs.rustPlatform.buildRustPackage rec {
pname = "geni";
version = manifest.version;
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.sources.cleanSource ./.;
doCheck = false;
buildPhase = ''
cargo build --release --locked
'';
installPhase = ''
mkdir -p $out/bin
cp target/release/geni $out/bin/
'';
meta = with pkgs.lib; {
description = manifest.description;
longDescription = ''
Standalone database migration tool which works for Postgres, MariaDB, MySQL, Sqlite and LibSQL(Turso).
'';
homepage = manifest.repository;
changelog = "${manifest.repository}/releases/tag/v${version}";
license = licenses.mit;
maintainers = [ maintainers.emilpriver ];
platforms = platforms.all;
};
};
in rec {
packages.geni = geni;
legacyPackages = packages;
defaultPackage = self.packages.${system}.geni;
devShell = pkgs.mkShell {
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";
buildInputs = with pkgs; [ cargo rustc git ];
};
});
}