-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
82 lines (79 loc) · 2.16 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
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
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/release-24.05";
rust-overlay.url = "github:oxalica/rust-overlay";
npmlock2nix.url = "github:nix-community/npmlock2nix";
npmlock2nix.flake = false;
flocken = {
url = "github:mirkolenz/flocken/v2";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
utils,
rust-overlay,
npmlock2nix,
flocken,
}:
utils.lib.eachDefaultSystem (system: let
overlays = [
(import rust-overlay)
(final: prev: {
npmlock2nix = final.callPackage npmlock2nix {};
})
(import ./overlay.nix)
(final: prev: {
demostf-frontend-toolchain = final.rust-bin.nightly."2024-06-04".default;
})
];
pkgs = (import nixpkgs) {
inherit system overlays;
};
inherit (flocken.legacyPackages.${system}) mkDockerManifest;
inherit (builtins) fromTOML readFile;
version = (fromTOML (readFile ./Cargo.toml)).package.version;
in rec {
packages = rec {
node_modules = pkgs.demostf-frontend-node-modules;
frontend = pkgs.demostf-frontend;
docker = pkgs.demostf-frontend-docker;
default = frontend;
dockerManifest = mkDockerManifest {
tags = ["latest"];
registries = {
"docker.io" = {
enable = true;
repo = "demostf/frontend";
username = "$DOCKERHUB_USERNAME";
password = "$DOCKERHUB_TOKEN";
};
};
inherit version;
images = with self.packages; [x86_64-linux.docker aarch64-linux.docker];
};
};
devShells.default = pkgs.mkShell {
OPENSSL_NO_VENDOR = 1;
nativeBuildInputs = with pkgs; [
demostf-frontend-toolchain
bacon
cargo-edit
cargo-outdated
clippy
cargo-audit
cargo-watch
pkg-config
openssl
nodejs
nodePackages.svgo
typescript
sqlx-cli
];
};
}) // {
overlays.default = import ./overlay.nix;
};
}