3e779be6f3
CI / lint (push) Failing after 13m4s
CI / test (3.11, ubuntu-latest) (push) Failing after 2m4s
CI / test (3.13, ubuntu-latest) (push) Successful in 13m30s
CI / test (3.14, ubuntu-latest) (push) Successful in 17m21s
CI / test (3.12, ubuntu-latest) (push) Successful in 17m55s
CI / discover-apps-ps (push) Successful in 1m56s
CI / test (3.9, ubuntu-latest) (push) Successful in 13m17s
CI / test (3.10, ubuntu-latest) (push) Successful in 26m21s
CI / audit (push) Successful in 13m38s
Deploy site / deploy (push) Has been cancelled
CI / test (3.14, ubuntu-24.04-arm) (push) Has been cancelled
123 lines
3.7 KiB
Nix
123 lines
3.7 KiB
Nix
{
|
|
description = "WinPodX — Windows app integration for Linux desktop";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
|
|
|
# Single source of truth for the package version. Reading from
|
|
# pyproject.toml at evaluation time keeps the Nix store path
|
|
# (winpodx-<version>) in sync with the Python distribution version
|
|
# automatically — no need to bump two files at release time.
|
|
pyprojectVersion = (builtins.fromTOML (builtins.readFile ./pyproject.toml)).project.version;
|
|
in
|
|
{
|
|
packages = forAllSystems (
|
|
pkgs:
|
|
let
|
|
inherit (pkgs) lib;
|
|
python = pkgs.python3;
|
|
|
|
# Runtime CLI tools winpodx shells out to. Podman is the default
|
|
# backend so it ships in the wrapper PATH; docker/libvirt stay
|
|
# opt-in via the host to keep the closure bounded.
|
|
runtimeBins = [
|
|
pkgs.freerdp
|
|
pkgs.iproute2
|
|
pkgs.libnotify
|
|
pkgs.podman
|
|
pkgs.podman-compose
|
|
];
|
|
in
|
|
{
|
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.winpodx;
|
|
|
|
winpodx = python.pkgs.buildPythonApplication {
|
|
pname = "winpodx";
|
|
version = pyprojectVersion;
|
|
pyproject = true;
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
build-system = [ python.pkgs.hatchling ];
|
|
|
|
dependencies = with python.pkgs; [
|
|
pyside6
|
|
docker
|
|
libvirt
|
|
];
|
|
|
|
nativeCheckInputs = with python.pkgs; [
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
export WINPODX_BUNDLE_DIR=$PWD
|
|
'';
|
|
|
|
# scripts/, config/ and data/ live at the repo root rather than
|
|
# inside the Python package; ship them under share/ and point the
|
|
# runtime at it so bundle_dir() resolves correctly for the wheel.
|
|
postInstall = ''
|
|
mkdir -p $out/share/winpodx
|
|
cp -r scripts config data $out/share/winpodx/
|
|
'';
|
|
|
|
makeWrapperArgs = [
|
|
"--prefix"
|
|
"PATH"
|
|
":"
|
|
(lib.makeBinPath runtimeBins)
|
|
"--set"
|
|
"WINPODX_BUNDLE_DIR"
|
|
"${placeholder "out"}/share/winpodx"
|
|
];
|
|
|
|
pythonImportsCheck = [ "winpodx" ];
|
|
|
|
meta = {
|
|
description = "Windows app integration for the Linux desktop (FreeRDP RemoteApp + dockur/windows)";
|
|
homepage = "https://github.com/kernalix7/winpodx";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "winpodx";
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
};
|
|
}
|
|
);
|
|
|
|
checks = forAllSystems (pkgs: {
|
|
winpodx = self.packages.${pkgs.stdenv.hostPlatform.system}.winpodx;
|
|
});
|
|
|
|
devShells = forAllSystems (pkgs: {
|
|
default = pkgs.mkShell {
|
|
inputsFrom = [ self.packages.${pkgs.stdenv.hostPlatform.system}.winpodx ];
|
|
# Runtime tools the wrapper would normally inject; expose them in
|
|
# the dev shell so `python -m winpodx` works against the source tree.
|
|
packages = [
|
|
pkgs.freerdp
|
|
pkgs.iproute2
|
|
pkgs.libnotify
|
|
pkgs.podman
|
|
pkgs.podman-compose
|
|
pkgs.ruff
|
|
pkgs.mypy
|
|
];
|
|
shellHook = ''
|
|
export PYTHONPATH="$PWD/src''${PYTHONPATH:+:$PYTHONPATH}"
|
|
'';
|
|
};
|
|
});
|
|
|
|
formatter = forAllSystems (pkgs: pkgs.nixfmt);
|
|
};
|
|
}
|