-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
113 lines (99 loc) · 2.86 KB
/
flake.nix
File metadata and controls
113 lines (99 loc) · 2.86 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
description = "A Pomodoro timer with daemon support for waybar and other status bars";
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;
};
tomat = pkgs.rustPlatform.buildRustPackage {
pname = "tomat";
version = "2.11.0";
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
baseName = baseNameOf path;
in
# Exclude docs directory to avoid mdbook build issues
!(type == "directory" && baseName == "docs");
};
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = with pkgs; [
pkg-config
installShellFiles
];
# Audio support requires ALSA on Linux
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.alsa-lib
];
nativeCheckInputs = [
pkgs.writableTmpDirAsHomeHook
];
# Skip tests that require access to file system locations not available during Nix builds
checkFlags = [
# Skip tests that require access to file system locations not available during Nix builds
"--skip=timer::tests::test_icon_path_creation"
"--skip=timer::tests::test_notification_icon_config"
"--skip=integration::"
];
postInstall = ''
installShellCompletion --cmd tomat \
--bash target/completions/tomat.bash \
--fish target/completions/tomat.fish \
--zsh target/completions/_tomat
installManPage target/man/*
'';
meta = with pkgs.lib; {
description = "A Pomodoro timer with daemon support for waybar and other status bars";
homepage = "https://jolars.github.io/tomat";
license = licenses.mit;
maintainers = [ ];
mainProgram = "tomat";
};
};
in
{
packages = {
default = tomat;
tomat = tomat;
};
apps = {
default = {
type = "app";
program = "${tomat}/bin/tomat";
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
rustc
rustfmt
clippy
rust-analyzer
go-task
mdbook
alsa-lib
];
};
}
)
// {
overlays.default = final: prev: {
tomat = self.packages.${prev.system}.tomat;
};
};
}