forked from mpiorowski/late-sh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
84 lines (76 loc) · 2.06 KB
/
default.nix
File metadata and controls
84 lines (76 loc) · 2.06 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
lib,
stdenv,
rustPlatform,
gitRev ? null,
pkg-config,
cmake,
perl,
alsa-lib,
mold,
}: let
packageVersion = (builtins.fromTOML (builtins.readFile ./late-ssh/Cargo.toml)).package.version;
filterSrc = src: regexes:
lib.cleanSourceWith {
inherit src;
filter = path: type: let
relPath = lib.removePrefix (toString src + "/") (toString path);
in
lib.all (re: builtins.match re relPath == null) regexes;
};
in
rustPlatform.buildRustPackage {
pname = "late-sh";
version = "${packageVersion}-unstable-${
if gitRev != null
then gitRev
else "dirty"
}";
# Build all deployable workspace binaries. late-web's CSS is a pre-built,
# committed asset; tailwind is not invoked at build time.
cargoBuildFlags = ["--workspace" "--bins"];
useNextest = true;
src = filterSrc ./. [
".*\\.nix$"
"^.jj/"
"^.git/"
"^flake\\.lock$"
"^target/"
"^late-web/node_modules/"
];
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs =
[
pkg-config
cmake
perl
rustPlatform.bindgenHook
]
++ lib.optionals stdenv.isLinux [
mold
];
buildInputs = lib.optionals stdenv.isLinux [
alsa-lib
];
# Integration tests require a live postgres; skip by default.
doCheck = false;
env = {
RUST_BACKTRACE = 1;
CARGO_INCREMENTAL = "0"; # https://github.com/rust-lang/rust/issues/139110
RUSTFLAGS = lib.optionalString stdenv.isLinux "-C link-arg=-fuse-ld=mold";
NIX_LATE_GIT_HASH = gitRev;
};
meta = {
description = "Social SSH terminal — late.sh";
homepage = "https://github.com/mpiorowski/late-sh";
# Source-available under FSL-1.1-MIT (converts to MIT after 2 years).
license = {
shortName = "FSL-1.1-MIT";
fullName = "Functional Source License, Version 1.1, MIT Future License";
url = "https://fsl.software/";
free = true;
redistributable = true;
};
mainProgram = "late-ssh";
};
}