-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (71 loc) · 2.22 KB
/
flake.nix
File metadata and controls
80 lines (71 loc) · 2.22 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = {nixpkgs, rust-overlay, ...}: let
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-darwin"
"x86_64-linux"
"aarch64-darwin"
"aarch64-linux"
] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [rust-overlay.overlays.default];
};
in function pkgs);
in {
packages = forAllSystems (pkgs: {
default = pkgs.rustPlatform.buildRustPackage {
pname = "radioboat";
version = "0.4.0";
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = [pkgs.mpv];
nativeBuildInputs = [pkgs.makeWrapper pkgs.installShellFiles];
preFixup = ''
wrapProgram $out/bin/radioboat --prefix PATH ":" "${pkgs.lib.makeBinPath [pkgs.mpv]}";
'';
postInstall = ''
installShellCompletion --cmd radioboat \
--bash <($out/bin/radioboat completion bash) \
--fish <($out/bin/radioboat completion fish) \
--zsh <($out/bin/radioboat completion zsh)
'';
passthru = {
updateScript = pkgs.nix-update-script {};
tests.version = pkgs.testers.testVersion {
package = pkgs.radioboat;
command = "radioboat --version";
};
};
meta = with pkgs.lib; {
description = "Radioboat is a terminal web radio client, built with simplicity in mind.";
mainProgram = "radioboat";
homepage = "https://github.com/slashformotion/radioboat";
license = licenses.asl20;
platforms = platforms.linux ++ platforms.darwin;
};
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
mpv
pkg-config
];
nativeBuildInputs = with pkgs; [
gnumake
just
(rust-bin.stable.latest.default.override {
extensions = ["rust-src" "rust-analyzer"];
})
clippy
rustfmt
];
};
});
};
}