Repository navigation
feat: add Nix flake package definition - #693
Closed
TomVollerthun1337 wants to merge 1 commit into
Closed
TomVollerthun1337 wants to merge 1 commit into
TomVollerthun1337 wants to merge 1 commit into
Conversation
Adds packages.default so logsmith can be consumed directly from the
flake in a NixOS machine config:
inputs.logsmith.url = "github:otto-de/logsmith";
environment.systemPackages = [ inputs.logsmith.packages.${system}.default ];
Or run without installing:
nix run github:otto-de/logsmith
Implementation details:
- Uses python313.withPackages with nixpkgs boto3/pyqt6/ruamel-yaml
(nixpkgs PyQt6 is properly linked; no LD_LIBRARY_PATH hack needed)
- Copies only app/ into the store; PYTHONPATH + sys.path[0] cover
the project's non-standard dual-root import layout
- Appends awscli2 to PATH for SSO login support
- Version read from pyproject.toml via builtins.fromTOML
The existing devShell (uv + PyPI workflow) is unchanged.
Also adds .envrc (use flake) and excludes .direnv/ and result from git.
Contributor
Author
|
Superseded by #692 (by @PaulKobow7536), which takes a more complete approach via uv2nix. Planning to contribute macOS support and a few quality fixes directly to that PR instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
packages.defaultto the flake so logsmith can be consumed as an installable Nix package directly from the repo.Usage
In a NixOS machine config:
Run without installing:
Implementation
python313.withPackageswithboto3,pyqt6,ruamel-yamlfrom nixpkgs. Using nixpkgs' PyQt6 means Qt is properly linked in the Nix store - noLD_LIBRARY_PATHworkaround needed (that hack is only for PyPI wheels, which the devShell still uses).makeWrappercreatesbin/logsmithpointing atapp/run.py. The project has a non-standard dual-root import layout (from app.Xand bareimport arguments); this is handled byPYTHONPATH=$out/share/logsmithcombined with Python's automaticsys.path[0]insertion for the script directory.awscli2is appended toPATHfor SSO login (aws sso loginis called at runtime).pyproject.tomlviabuiltins.fromTOML- no need to update the flake on version bumps.uv/PyPI-based devShell is unchanged.Also adds
.envrc(use flake) and excludes.direnv/andresultfrom git.