Skip to content

Commit 623c3a7

Browse files
committed
feat: add nix flake for development
Adds nix flake w/ devShell for simpler development Similar to mopidy-tidal, but only supporting devShell for now
1 parent 899e6b3 commit 623c3a7

4 files changed

Lines changed: 107 additions & 1 deletion

File tree

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,7 @@ tidal*.json
8989
*.mpd
9090

9191
# Local devtools
92-
devtools
92+
devtools
93+
94+
# Nix / direnv
95+
.direnv/

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
description = "Unofficial API for TIDAL music streaming service.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
flake-parts.url = "github:hercules-ci/flake-parts";
7+
};
8+
9+
outputs = inputs @ {
10+
nixpkgs,
11+
flake-parts,
12+
...
13+
}:
14+
flake-parts.lib.mkFlake {inherit inputs;} {
15+
systems = nixpkgs.lib.systems.flakeExposed;
16+
perSystem = {
17+
pkgs,
18+
...
19+
}: let
20+
python = pkgs.python3;
21+
buildInputs =
22+
[
23+
python
24+
]
25+
++ (with pkgs; [
26+
# build / dev
27+
poetry
28+
ruff
29+
]);
30+
in {
31+
devShells.default = pkgs.mkShell {
32+
packages = buildInputs;
33+
shellHook = ''
34+
[ ! -d .venv ] && python -m venv .venv
35+
source .venv/bin/activate
36+
poetry install --quiet 2>/dev/null
37+
'';
38+
};
39+
};
40+
};
41+
}

0 commit comments

Comments
 (0)