c1145c95d9
Tests / test (macos-latest, 3.10) (push) Has been cancelled
Tests / test (macos-latest, 3.11) (push) Has been cancelled
Tests / test (macos-latest, 3.12-dev) (push) Has been cancelled
Tests / test (macos-latest, 3.7) (push) Has been cancelled
Tests / test (macos-latest, 3.8) (push) Has been cancelled
Tests / test (macos-latest, 3.9) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.10) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.12-dev) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.7) (push) Has been cancelled
Tests / test (windows-latest, 3.10) (push) Has been cancelled
Tests / test (windows-latest, 3.11) (push) Has been cancelled
Tests / test (windows-latest, 3.12-dev) (push) Has been cancelled
Tests / test (windows-latest, 3.7) (push) Has been cancelled
Tests / test (windows-latest, 3.8) (push) Has been cancelled
Tests / test (windows-latest, 3.9) (push) Has been cancelled
Tests / test-deprecated (2.7) (push) Has been cancelled
Tests / test-deprecated (3.6) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.8) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.9) (push) Has been cancelled
Implement Nushell shell adapter (from nvbn/thefuck#1442) with alias resolution, history management, and subprocess-based command execution. Add uv2nix-based Nix flake for reproducible builds with Python 3.11, pinned setuptools<71 for pkg_resources compatibility, and dev shell with uv for local development.
103 lines
2.7 KiB
Nix
103 lines
2.7 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
pyproject-nix = {
|
|
url = "github:pyproject-nix/pyproject.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
uv2nix = {
|
|
url = "github:pyproject-nix/uv2nix";
|
|
inputs.pyproject-nix.follows = "pyproject-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
pyproject-build-systems = {
|
|
url = "github:pyproject-nix/build-system-pkgs";
|
|
inputs.pyproject-nix.follows = "pyproject-nix";
|
|
inputs.uv2nix.follows = "uv2nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
pyproject-nix,
|
|
uv2nix,
|
|
pyproject-build-systems,
|
|
}:
|
|
let
|
|
workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ./.; };
|
|
|
|
overlay = workspace.mkPyprojectOverlay {
|
|
sourcePreference = "wheel";
|
|
};
|
|
in
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
|
|
python = pkgs.python311;
|
|
|
|
# Override to provide fastentrypoints build-system dep
|
|
# (not in pyproject-build-systems because it's niche)
|
|
buildSystemOverride = final: prev: {
|
|
fastentrypoints = prev.fastentrypoints.overrideAttrs (old: {
|
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
|
(final.resolveBuildSystem { setuptools = [ ]; })
|
|
];
|
|
});
|
|
thefuck = prev.thefuck.overrideAttrs (old: {
|
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
|
(final.resolveBuildSystem {
|
|
setuptools = [ ];
|
|
fastentrypoints = [ ];
|
|
})
|
|
];
|
|
});
|
|
};
|
|
|
|
pythonSet =
|
|
(pkgs.callPackage pyproject-nix.build.packages {
|
|
inherit python;
|
|
}).overrideScope
|
|
(
|
|
nixpkgs.lib.composeManyExtensions [
|
|
pyproject-build-systems.overlays.wheel
|
|
overlay
|
|
buildSystemOverride
|
|
]
|
|
);
|
|
in
|
|
{
|
|
packages.default = pythonSet.mkVirtualEnv "thefuck-env" workspace.deps.default;
|
|
|
|
apps.default = {
|
|
type = "app";
|
|
program = "${self.packages.${system}.default}/bin/thefuck";
|
|
};
|
|
|
|
devShell = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
uv
|
|
gh
|
|
] ++ [ python ];
|
|
env = {
|
|
UV_NO_SYNC = "1";
|
|
UV_PYTHON = python.interpreter;
|
|
UV_PYTHON_DOWNLOADS = "never";
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|