2022-12-13 14:25:50 -06:00
|
|
|
{
|
|
|
|
description = "My Streamdeck";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs = {
|
2023-03-28 09:01:43 -05:00
|
|
|
url = "nixpkgs/nixos-unstable";
|
2022-12-13 14:25:50 -06:00
|
|
|
};
|
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
|
|
|
flake-utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells.default =
|
2023-02-11 10:24:44 -06:00
|
|
|
# let
|
|
|
|
# python = pkgs.python310.withPackages (ps: with ps; [
|
|
|
|
# poetry-core
|
|
|
|
# ]);
|
|
|
|
# in
|
2022-12-13 14:25:50 -06:00
|
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = [
|
2023-02-11 10:22:58 -06:00
|
|
|
#python
|
|
|
|
pkgs.poetry
|
2022-12-13 14:25:50 -06:00
|
|
|
pkgs.hidapi
|
|
|
|
pkgs.libusb1
|
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
export HIDAPI_HOME=${pkgs.hidapi}
|
|
|
|
export MAGICK_HOME=${pkgs.imagemagickBig}
|
|
|
|
export POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
|
|
export PS1='\[\033[1;34m\][greendeck:\w]\$\[\033[0m\] '
|
|
|
|
export PATH=''$(pwd)/.venv/bin:$PATH
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
packages = {
|
|
|
|
greendeck = pkgs.poetry2nix.mkPoetryApplication {
|
|
|
|
python = pkgs.python310;
|
|
|
|
projectDir = ./.;
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pkgs.hidapi
|
|
|
|
];
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace greendeck/lib/hidapi/library.py \
|
|
|
|
--replace \
|
|
|
|
'os.getenv("HIDAPI_LIBRARY")' \
|
|
|
|
'"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"'
|
|
|
|
'';
|
|
|
|
overrides = pkgs.poetry2nix.overrides.withDefaults
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
wand = super.wand.overridePythonAttrs
|
|
|
|
(
|
|
|
|
old: {
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace wand/api.py \
|
|
|
|
--replace \
|
|
|
|
"os.environ.get('MAGICK_HOME')" \
|
|
|
|
"'${pkgs.imagemagickBig}'"
|
|
|
|
'';
|
|
|
|
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ];
|
|
|
|
}
|
|
|
|
);
|
|
|
|
types-deprecated = super.types-deprecated.overridePythonAttrs (
|
|
|
|
old: {
|
2022-12-24 11:10:51 -06:00
|
|
|
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ];
|
2022-12-13 14:25:50 -06:00
|
|
|
}
|
|
|
|
);
|
|
|
|
pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (
|
|
|
|
old: {
|
2022-12-24 11:10:51 -06:00
|
|
|
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ];
|
2022-12-13 14:25:50 -06:00
|
|
|
}
|
|
|
|
);
|
2023-02-11 10:00:07 -06:00
|
|
|
pydocstyle = super.pydocstyle.overridePythonAttrs (
|
|
|
|
old: {
|
|
|
|
buildInputs = old.buildInputs ++ [
|
2023-03-28 09:01:43 -05:00
|
|
|
# pkgs.python3Packages.poetry-core
|
2023-02-11 10:00:07 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
);
|
2022-12-13 14:25:50 -06:00
|
|
|
pydocstringformatter = super.pydocstringformatter.overridePythonAttrs (
|
|
|
|
old: {
|
2023-02-11 10:00:07 -06:00
|
|
|
buildInputs = old.buildInputs ++ [
|
2023-02-11 10:24:44 -06:00
|
|
|
pkgs.python3Packages.poetry-core
|
2023-02-11 10:00:07 -06:00
|
|
|
pkgs.python3Packages.setuptools
|
|
|
|
];
|
2022-12-24 11:10:51 -06:00
|
|
|
}
|
|
|
|
);
|
|
|
|
asyncdbus = super.asyncdbus.overridePythonAttrs (
|
|
|
|
old: {
|
2023-01-09 16:42:18 -06:00
|
|
|
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools-scm ];
|
2022-12-13 14:25:50 -06:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
default = self.packages.${system}.greendeck;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|