-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add flake-based OpenViking service package #1328
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
Changes from all commits
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,58 @@ | ||
| { | ||
| description = "OpenViking service env from published wheel"; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
|
|
||
| pyproject-nix = { | ||
| url = "github:pyproject-nix/pyproject.nix"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| }; | ||
|
|
||
| uv2nix = { | ||
| url = "github:pyproject-nix/uv2nix"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| inputs.pyproject-nix.follows = "pyproject-nix"; | ||
| }; | ||
|
|
||
| pyproject-build-systems = { | ||
| url = "github:pyproject-nix/build-system-pkgs"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| inputs.pyproject-nix.follows = "pyproject-nix"; | ||
| inputs.uv2nix.follows = "uv2nix"; | ||
| }; | ||
| }; | ||
|
|
||
| outputs = { nixpkgs, pyproject-nix, uv2nix, pyproject-build-systems, ... }: | ||
| let | ||
| system = "x86_64-linux"; | ||
| pkgs = import nixpkgs { inherit system; }; | ||
|
|
||
| # This flake currently packages the published OpenViking wheel via the | ||
| # tiny env project under nix/openviking-env. It does not package the | ||
| # local checkout source tree. | ||
| workspace = uv2nix.lib.workspace.loadWorkspace { | ||
| workspaceRoot = ./nix/openviking-env; | ||
| }; | ||
|
|
||
| overlay = workspace.mkPyprojectOverlay { | ||
| sourcePreference = "wheel"; | ||
| }; | ||
|
|
||
| pythonSet = (pkgs.callPackage pyproject-nix.build.packages { | ||
| python = pkgs.python311; | ||
| }).overrideScope (pkgs.lib.composeManyExtensions [ | ||
| pyproject-build-systems.overlays.default | ||
| overlay | ||
| ]); | ||
|
|
||
| publishedOpenVikingServiceEnv = pythonSet.mkVirtualEnv | ||
| "openviking-published-wheel-env" | ||
| workspace.deps.default; | ||
| in { | ||
| packages.${system} = { | ||
| default = publishedOpenVikingServiceEnv; | ||
| openviking = publishedOpenVikingServiceEnv; | ||
| }; | ||
|
Comment on lines
+53
to
+56
|
||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||
| # Packaging-only project for the repo-root flake. | ||||||||||
| # This intentionally resolves the published OpenViking wheel for service use; | ||||||||||
| # it does not build the local checkout in this repository. | ||||||||||
| [project] | ||||||||||
| name = "openviking-env" | ||||||||||
| version = "0.1.0" | ||||||||||
| requires-python = "==3.11.*" | ||||||||||
| dependencies = [ | ||||||||||
| # Keep this pinned to the published wheel consumed by the service package. | ||||||||||
| "openviking==0.2.10", | ||||||||||
| ] | ||||||||||
|
|
||||||||||
| [tool.uv] | ||||||||||
|
||||||||||
| [tool.uv] | |
| [tool.uv] | |
| # This workspace is only used for dependency resolution; do not package it. | |
| package = 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.
The flake hard-codes
system = "x86_64-linux", which makes evaluation/builds on other systems awkward (e.g.,nix buildonaarch64-linux/macOS won’t expose apackages.<localSystem>attr). Consider generating outputs via aneachSystem/genAttrspattern so the flake evaluates cleanly across systems, and only defines the package for supported ones (or errors with a clear message).