-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
61 lines (50 loc) · 1.94 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
{
description = "Display your currently playing track from Last.fm, ListenBrainz, and other services in your Revolt status.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, flake-parts, gitignore, rust-overlay, ... }: flake-parts.lib.mkFlake { inherit inputs; }
{
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { self', lib, pkgs, system, ... }:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
packages.default =
let
cargoTOML = lib.importTOML ./Cargo.toml;
rustToolchain = pkgs.rust-bin.stable.latest.minimal;
inherit (gitignore.lib) gitignoreSource;
in
(pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
}).buildRustPackage {
inherit (cargoTOML.package) version;
pname = cargoTOML.package.name;
src = gitignoreSource ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = with pkgs; [ openssl ] ++ lib.optional stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ CoreFoundation Security ]);
nativeBuildInputs = with pkgs; [ pkg-config ];
meta = {
inherit (cargoTOML.package) description license;
homepage = cargoTOML.package.repository;
platforms = lib.platforms.unix;
};
};
};
flake.nixosModules.default = import ./module.nix self;
};
}