-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
109 lines (98 loc) · 2.81 KB
/
flake.nix
File metadata and controls
109 lines (98 loc) · 2.81 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
{
description = "Flake for obs-cli development and packaging";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
python = pkgs.python312;
pyPkgs = python.pkgs;
obswsPython = pyPkgs.buildPythonPackage rec {
pname = "obsws-python";
version = "1.6.2";
pyproject = true;
src = pyPkgs.fetchPypi {
pname = "obsws_python";
inherit version;
hash = "sha256-cR1gnZ5FxZ76SD9GlHSIhv142ejsqs/Bp8wV1A1kfdw=";
};
nativeBuildInputs = [
pyPkgs.hatchling
];
propagatedBuildInputs = [
pyPkgs.tomli
pyPkgs.websocket-client
];
doCheck = false;
meta = with pkgs.lib; {
description = "Python SDK for OBS Studio WebSocket v5.0";
homepage = "https://github.com/aatikturk/obsws-python";
license = licenses.gpl3;
maintainers = with maintainers; [ pschmitt ];
};
};
obsCli = pyPkgs.buildPythonApplication {
pname = "obs-cli";
version = "0.8.3";
src = ./.;
pyproject = true;
nativeBuildInputs = with pyPkgs; [
setuptools
setuptools-scm
wheel
];
propagatedBuildInputs = with pyPkgs; [
obswsPython
rich
];
pythonImportsCheck = [ "obs_cli" ];
meta = with pkgs.lib; {
description = "CLI for controlling OBS Studio";
homepage = "https://github.com/pschmitt/obs-cli";
license = licenses.gpl3Only;
maintainers = with maintainers; [ pschmitt ];
mainProgram = "obs-cli";
};
};
devTools = python.withPackages (
ps: with ps; [
black
ipython
neovim
ruff
]
);
in
{
packages = {
default = obsCli;
obs-cli = obsCli;
obsws-python = obswsPython;
};
devShells.default = pkgs.mkShell {
name = "obs-cli-devshell";
packages = [
devTools
pkgs.git
pkgs.pre-commit
pkgs.uv
];
shellHook = ''
export PYTHONPATH="''${PWD}:''${PYTHONPATH:-}"
export UV_PROJECT_ENVIRONMENT=".venv"
echo "Entering obs-cli dev shell (Python ${python.version})."
echo "Run 'uv sync' to populate .venv and 'obs-cli --help' to get started."
'';
};
}
);
}