-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathflake.nix
More file actions
93 lines (78 loc) · 2.23 KB
/
flake.nix
File metadata and controls
93 lines (78 loc) · 2.23 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
81
82
83
84
85
86
87
88
89
90
91
92
93
{
description = "Fum: A fully ricable tui-based music client";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
updateScript = pkgs.writeShellScriptBin "update-fum" ''
nix flake update
${pkgs.nix-update}/bin/nix-update -vr 'v(.*)' --flake --commit fum
'';
in {
packages.fum = pkgs.rustPlatform.buildRustPackage rec {
pname = "fum";
version = "0.9.17";
src = pkgs.fetchFromGitHub {
owner = "qxb3";
repo = pname;
rev = "v${version}";
hash = "sha256-E9Z8bs5bdNcXHRJIkzcISIz8R1wnZu8sO6tXQp+5bpQ=";
};
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = with pkgs; [
pkg-config
autoPatchelfHook
];
buildInputs = with pkgs; [
openssl
dbus
libgcc
];
OPENSSL_DIR = "${pkgs.openssl.dev}";
OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
meta = with pkgs.lib; {
description = "A fully ricable tui-based music client";
homepage = "https://github.com/qxb3/fum";
license = licenses.mit;
maintainers = with maintainers; [linuxmobile];
platforms = platforms.linux;
};
};
packages.default = self.packages.${system}.fum;
devShells.default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.fum];
buildInputs = with pkgs; [
cargo
rust-analyzer
rustfmt
clippy
updateScript
];
};
apps.update = {
type = "app";
program = "${updateScript}/bin/update-fum";
};
nixosModules.fum = import ./modules/default.nix;
homeManagerModules.fum = {
config,
pkgs,
lib,
...
}:
import ./nix/hm-module.nix {
inherit config pkgs lib;
fumPackage = self.packages.${system}.fum;
};
});
}