Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions flake.nix
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; };
Comment on lines +26 to +29
Copy link

Copilot AI Apr 9, 2026

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 build on aarch64-linux/macOS won’t expose a packages.<localSystem> attr). Consider generating outputs via an eachSystem/genAttrs pattern so the flake evaluates cleanly across systems, and only defines the package for supported ones (or errors with a clear message).

Copilot uses AI. Check for mistakes.

# 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
Copy link

Copilot AI Apr 9, 2026

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 build on aarch64-linux/macOS won’t expose a packages.<localSystem> attr). Consider generating outputs via an eachSystem/genAttrs pattern so the flake evaluates cleanly across systems, and only defines the package for supported ones (or errors with a clear message).

Copilot uses AI. Check for mistakes.
};
}
16 changes: 16 additions & 0 deletions nix/openviking-env/pyproject.toml
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]
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this workspace is intended to be metadata/dependency-resolution only (i.e., not a buildable/installable project itself), it’s worth making that explicit to avoid accidental attempts to build/package openviking-env (which can happen depending on how tooling consumes the workspace). Consider either adding a minimal [build-system] section (so it can be built reliably if needed) or explicitly disabling packaging for the root project in the tool configuration (e.g., via a uv setting) to match the intent stated in the header comment.

Suggested change
[tool.uv]
[tool.uv]
# This workspace is only used for dependency resolution; do not package it.
package = false

Copilot uses AI. Check for mistakes.
environments = [
"platform_system == 'Linux' and platform_machine == 'x86_64'",
]
Loading
Loading