-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
78 lines (67 loc) · 2.2 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
{
description = "Screenly CLI flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsForSystem = system: (import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in
{
overlays.default = final: _prev:
let
inherit ((builtins.fromTOML (builtins.readFile ./Cargo.toml)).package) version;
inherit (final) openssl perl pkg-config stdenv lib darwin rustPlatform;
in
{
screenly-cli = rustPlatform.buildRustPackage rec {
inherit version;
pname = "screenly-cli";
src = lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [
pkg-config
perl
];
buildInputs = [
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
meta = {
description = "Command Line Interface (CLI) for Screenly.";
homepage = "https://www.screenly.io/developers/cli/";
license = lib.licenses.mit;
mainProgram = "screenly";
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ jnsgruk vpetersson ];
};
};
};
packages = forAllSystems (system: rec {
inherit (pkgsForSystem system) screenly-cli;
default = screenly-cli;
});
devShells = forAllSystems (system: {
default = (pkgsForSystem system).mkShell {
name = "screenly-cli";
NIX_CONFIG = "experimental-features = nix-command flakes";
inputsFrom = [ self.packages.${system}.screenly-cli ];
shellHook = "exec $SHELL";
};
});
};
}