Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (62 loc) · 1.82 KB
/
Copy pathflake.nix
File metadata and controls
64 lines (62 loc) · 1.82 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
# SPDX-License-Identifier: AGPL-3.0-or-later
{
inputs.nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs) lib;
forAllSystems =
f:
lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
] (system: f nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (
pkgs:
let
callPackage = lib.callPackageWith (pkgs // packages // { src = self; });
packages = {
sable-wasm-bindgen-cli = callPackage ./packaging/nix/wasm-bindgen-cli.nix { };
sable-unwrapped = callPackage ./packaging/nix/unwrapped.nix { };
sable = callPackage ./packaging/nix/sable.nix { };
default = packages.sable;
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
sable-desktop = callPackage ./packaging/nix/desktop.nix { };
};
in
packages
);
checks = forAllSystems (
pkgs:
let
inherit (self.packages.${pkgs.stdenv.hostPlatform.system}) sable-unwrapped;
pnpmCheck =
name: script:
sable-unwrapped.overrideAttrs {
pname = "sable-${name}";
postPatch = "";
buildPhase = ''
pnpm wasm:dev
pnpm exec svelte-kit sync
pnpm run ${script}
'';
installPhase = "touch $out";
};
in
lib.mapAttrs pnpmCheck {
lint = "lint";
fmt = "fmt:check";
test = "test";
typecheck = "check";
knip = "knip";
}
// {
build = self.packages.${pkgs.stdenv.hostPlatform.system}.sable;
}
);
};
}