-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
72 lines (69 loc) · 2.35 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
{
description = "Musium";
inputs.nixpkgs.url = "nixpkgs/nixos-24.05";
inputs.purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
inputs.purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
inputs.squiller.url = "github:ruuda/squiller?ref=v0.4.0";
inputs.squiller.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, purescript-overlay, squiller }:
let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
# Ridiculous boilerplate required to make flakes somewhat usable.
forEachSystem = f:
builtins.zipAttrsWith
(name: values: builtins.foldl' (x: y: x // y) {} values)
(map
(k: builtins.mapAttrs (name: value: { "${k}" = value; }) (f k))
supportedSystems
);
in
forEachSystem (system:
let
name = "musium";
version = builtins.substring 0 8 self.lastModifiedDate;
pkgs = import nixpkgs {
inherit system;
overlays = [ purescript-overlay.overlays.default ];
};
python = pkgs.python3.withPackages (ps: [
ps.scipy
ps.numpy
ps.matplotlib
]);
in
rec {
devShells.default = pkgs.mkShell {
inherit name;
nativeBuildInputs = [
pkgs.esbuild
pkgs.mkdocs
pkgs.purescript
pkgs.rustup
pkgs.spago-unstable
pkgs.sqlite
python
squiller.packages.${system}.default
]
++ packages.default.nativeBuildInputs
++ packages.default.buildInputs;
};
packages.default = pkgs.rustPlatform.buildRustPackage {
inherit name version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"claxon-0.4.3" = "sha256-aYFNOVGl2Iiw8/u1NrL3ZprTt48OFpG9LKs1EwEAfms=";
"nanorand-0.8.0" = "sha256-X4VgXXw6cquRV3TcSnSBo7XudemDrdIH0NFLGSTyByY=";
};
};
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [
pkgs.alsa-lib
pkgs.sqlite
pkgs.systemd
];
};
}
);
}