-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a nix flake setup #17
base: master
Are you sure you want to change the base?
Changes from 2 commits
ba6d6ba
ef7fd54
374b180
0dba23d
c1595ef
cceffed
79d5989
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
description = "Python package for controlling an ElGato key light"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs"; | ||
|
||
outputs = { self, nixpkgs }: | ||
let | ||
pkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
|
||
leglight = pkgs.python38Packages.buildPythonPackage rec { | ||
pname = "leglight"; | ||
version = "0.2.0"; | ||
|
||
src = pkgs.python38Packages.fetchPypi { | ||
inherit pname version; | ||
sha256 = "41ab462fe12e2ec3e02ff29a00316f822b078c331c70bd36a635568bd1c4204a"; | ||
}; | ||
|
||
propagatedBuildInputs = with pkgs.python38Packages; [ | ||
zeroconf | ||
requests | ||
]; | ||
|
||
doCheck = false; | ||
}; | ||
in { | ||
devShell.x86_64-linux = pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
python38 | ||
pipenv | ||
]; | ||
}; | ||
|
||
defaultPackage.x86_64-linux = pkgs.python38Packages.buildPythonPackage rec { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this package only support x86_64-linux? Theres a project called flake-utils you can check out which makes this process easier, so you can go |
||
pname = "PyElgato"; | ||
version = "1.2.0"; | ||
|
||
src = pkgs.python38Packages.fetchPypi { | ||
inherit pname version; | ||
sha256 = "7834d4c6dac7a1646b5238dcec187645d6cd4d8dc4e2f3f9e0d789a3bddd369c"; | ||
}; | ||
|
||
buildInputs = with pkgs.python38Packages; [ | ||
setuptools-scm | ||
wheel | ||
]; | ||
|
||
propagatedBuildInputs = [ | ||
leglight | ||
]; | ||
|
||
doCheck = false; | ||
}; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is opinionated and I have seen other flakes not follow this, but I try not to put too much logic like package creation in the flake.nix. I would put the package in a
default.nix
and this flake can just call that. I consider flakes more of a place where the sharing aspect comes in and including implementation logic hurts other's ability to see whats happening in your flake.flake.nix
to me is a summary of your repo: what it needs, what it exports.