mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-28 06:40:44 -06:00
Compare commits
2 commits
40fb99a47b
...
4c0b71d1de
Author | SHA1 | Date | |
---|---|---|---|
4c0b71d1de | |||
53e6e9951c |
4 changed files with 93 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
}: let
|
||||
inherit (lib) mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
pixi = pkgs.callPackage ../../pkgs/pixi.nix {};
|
||||
in {
|
||||
config = mkIfIn "python" cfg {
|
||||
environment.systemPackages = let
|
||||
|
|
|
@ -17,6 +17,14 @@ proc error(args: varargs[string, `$`]) =
|
|||
args.join("")
|
||||
)
|
||||
|
||||
proc warn(args: varargs[string, `$`]) =
|
||||
stdout.styledWriteLine(
|
||||
fgCyan, "oizys", resetStyle, "|",
|
||||
fgYellow, "WARN", resetStyle, "| ",
|
||||
args.join("")
|
||||
)
|
||||
|
||||
|
||||
type
|
||||
OizysContext = object
|
||||
flake, host: string
|
||||
|
@ -43,7 +51,13 @@ proc check(c: OizysContext) =
|
|||
info "host: ", c.host
|
||||
|
||||
proc cmd(c: OizysContext): string {.inline.} =
|
||||
if c.pinix: "pix" else: "nix"
|
||||
let pixExists = findExe("pix") != ""
|
||||
if c.pinix:
|
||||
if pixExists:
|
||||
return "pix"
|
||||
else:
|
||||
warn "pinix not found, falling back to nix"
|
||||
return "nix"
|
||||
|
||||
proc systemFlakePath(c: OizysContext): string =
|
||||
c.flake & "#nixosConfigurations." & c.host & ".config.system.build.toplevel"
|
||||
|
|
76
pkgs/pixi.nix
Normal file
76
pkgs/pixi.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, openssl
|
||||
, installShellFiles
|
||||
, darwin
|
||||
, testers
|
||||
, pixi
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "pixi";
|
||||
version = "0.15.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prefix-dev";
|
||||
repo = "pixi";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-bh8Uu6Q2AND50Qzivc6k1Z8JWudkHC2i4YW1Hxa69SM=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-yMIcPwnuN7F2ZrOtJw8T+nxeSzLsYn+iC34bYeWpi/w=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin (
|
||||
with darwin.apple_sdk_11_0.frameworks; [ CoreFoundation IOKit SystemConfiguration Security ]
|
||||
);
|
||||
|
||||
# There are some CI failures with Rattler. Tests on Aarch64 has been skipped.
|
||||
# See https://github.com/prefix-dev/pixi/pull/241.
|
||||
doCheck = !stdenv.isAarch64;
|
||||
|
||||
preCheck = ''
|
||||
export HOME="$(mktemp -d)"
|
||||
'';
|
||||
|
||||
checkFlags = [
|
||||
# Skip tests requiring network
|
||||
"--skip=add_channel"
|
||||
"--skip=add_functionality"
|
||||
"--skip=add_functionality_os"
|
||||
"--skip=add_functionality_union"
|
||||
"--skip=add_pypi_functionality"
|
||||
"--skip=test_alias"
|
||||
"--skip=test_cwd"
|
||||
"--skip=test_incremental_lock_file"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd pix \
|
||||
--bash <($out/bin/pixi completion --shell bash) \
|
||||
--fish <($out/bin/pixi completion --shell fish) \
|
||||
--zsh <($out/bin/pixi completion --shell zsh)
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = pixi;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Package management made easy";
|
||||
homepage = "https://pixi.sh/";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ aaronjheng edmundmiller ];
|
||||
mainProgram = "pixi";
|
||||
};
|
||||
}
|
3
todo.md
3
todo.md
|
@ -1,8 +1,7 @@
|
|||
# oizys todo's
|
||||
|
||||
- [ ] add graceful fall back for oizys-cli if pinix isn't installed system-wide yet
|
||||
- [-] add graceful fall back for oizys-cli if pinix isn't installed system-wide yet
|
||||
- [ ] trackdown wezterm bug... (try building from flake?)
|
||||
> https://github.com/wez/wezterm/issues/5067
|
||||
- [ ] add auto-sleep functionality to hyprland environment
|
||||
|
||||
<!-- generated with <3 by daylinmorgan/todo -->
|
||||
|
|
Loading…
Reference in a new issue