mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-23 02:40:45 -06:00
Compare commits
1 commit
761152da52
...
cf9e6959f0
Author | SHA1 | Date | |
---|---|---|---|
cf9e6959f0 |
12 changed files with 81 additions and 201 deletions
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
|
@ -30,13 +30,6 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# needed to access ghostty repo for now
|
|
||||||
- name: Setup SSH
|
|
||||||
uses: MrSquaare/ssh-setup-action@v3
|
|
||||||
with:
|
|
||||||
host: github.com
|
|
||||||
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- uses: ./.github/actions/clean-disk
|
- uses: ./.github/actions/clean-disk
|
||||||
with:
|
with:
|
||||||
purge-packages: 'true'
|
purge-packages: 'true'
|
||||||
|
@ -50,15 +43,10 @@ jobs:
|
||||||
|
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@v8
|
- uses: DeterminateSystems/magic-nix-cache-action@v8
|
||||||
|
|
||||||
# - name: Install and login to attic cache
|
- uses: cachix/cachix-action@v15
|
||||||
# run: |
|
with:
|
||||||
# nix profile install "nixpkgs#attic-client"
|
name: daylin
|
||||||
# attic login oizys https://attic.dayl.in "${{ secrets.ATTIC_TOKEN }}"
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
|
||||||
# - uses: cachix/cachix-action@v15
|
|
||||||
# with:
|
|
||||||
# name: daylin
|
|
||||||
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
|
|
||||||
- name: write lock file
|
- name: write lock file
|
||||||
if: "${{ inputs.lockFile != '' }}"
|
if: "${{ inputs.lockFile != '' }}"
|
||||||
|
|
12
.github/workflows/update.yml
vendored
12
.github/workflows/update.yml
vendored
|
@ -20,9 +20,8 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# needed to access ghostty repo for now
|
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
uses: MrSquaare/ssh-setup-action@v3
|
uses: MrSquaare/ssh-setup-action@v1
|
||||||
with:
|
with:
|
||||||
host: github.com
|
host: github.com
|
||||||
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
@ -39,6 +38,7 @@ jobs:
|
||||||
experimental-features = pipe-operator
|
experimental-features = pipe-operator
|
||||||
accept-flake-config = true
|
accept-flake-config = true
|
||||||
|
|
||||||
|
|
||||||
- name: Install and login to attic cache
|
- name: Install and login to attic cache
|
||||||
run: |
|
run: |
|
||||||
nix profile install "nixpkgs#attic-client"
|
nix profile install "nixpkgs#attic-client"
|
||||||
|
@ -69,8 +69,6 @@ jobs:
|
||||||
--host "othalan"
|
--host "othalan"
|
||||||
--flake .
|
--flake .
|
||||||
--debug
|
--debug
|
||||||
--
|
|
||||||
--print-build-logs
|
|
||||||
|
|
||||||
- name: Commit Updates
|
- name: Commit Updates
|
||||||
uses: daylin-bot/actions/commit-and-push@main
|
uses: daylin-bot/actions/commit-and-push@main
|
||||||
|
@ -94,12 +92,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup SSH
|
|
||||||
uses: MrSquaare/ssh-setup-action@v1
|
|
||||||
with:
|
|
||||||
host: github.com
|
|
||||||
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v14
|
- uses: DeterminateSystems/nix-installer-action@v14
|
||||||
with:
|
with:
|
||||||
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
|
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
|
||||||
|
|
59
flake.lock
59
flake.lock
|
@ -306,11 +306,11 @@
|
||||||
"zig": "zig"
|
"zig": "zig"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730743100,
|
"lastModified": 1730677137,
|
||||||
"narHash": "sha256-CE5XFfbNfuZnKzmcdWpAYU3ExinL7K41dIoPBut/xtg=",
|
"narHash": "sha256-I1JBi0F7FMQTfF37t4oeiLNJDF/xSsXa34DYjGXsAcE=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "960e52573b383b5d757d61e6e97b6263a5bfddd1",
|
"rev": "9665ff8945bd77f44647aea2109984680330a6e1",
|
||||||
"revCount": 7877,
|
"revCount": 7868,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@github.com/ghostty-org/ghostty"
|
"url": "ssh://git@github.com/ghostty-org/ghostty"
|
||||||
},
|
},
|
||||||
|
@ -405,11 +405,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730743300,
|
"lastModified": 1730652188,
|
||||||
"narHash": "sha256-dsqITa3ZwfGtw9E7s4ET+uSR74w8VfZZYNwuixQwg0Y=",
|
"narHash": "sha256-3L+Jh3J3JvJPsGTqSOIKjwZy/AysR0WOLgGKNkXFqxs=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "0fb9a04526b06adfb3fd16b64e13b7d110ae7855",
|
"rev": "cd0d0491261728260de3d1aff150e1b6c05f9e86",
|
||||||
"revCount": 5409,
|
"revCount": 5407,
|
||||||
"submodules": true,
|
"submodules": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hyprwm/Hyprland/"
|
"url": "https://github.com/hyprwm/Hyprland/"
|
||||||
|
@ -425,11 +425,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730743354,
|
"lastModified": 1729224425,
|
||||||
"narHash": "sha256-gU4NySYyXeAzVaF5bI6BKmj2CdgiwGFnuPjXUId3Dx0=",
|
"narHash": "sha256-w9dNUedNe2qnhHuhcRf7A1l29+/6DxdMfwN6g4U3c/w=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "contrib",
|
"repo": "contrib",
|
||||||
"rev": "792f6b83dc719214e0e2a0b380c34f147b28ece2",
|
"rev": "d72bc8b1cd30d448bd438e8328f8eeb4c0f2ddb6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -585,36 +585,38 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729298361,
|
"lastModified": 1730610940,
|
||||||
"narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
|
"narHash": "sha256-ZsTpii4kZcioRF3bu3/pS374R9GYQVyrMpBNr2ZUnVg=",
|
||||||
"rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
|
"rev": "b1a0e3c0029c2dd5fb7c8dd2db4f9e0b309c9f54",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/b1a0e3c0029c2dd5fb7c8dd2db4f9e0b309c9f54.tar.gz?rev=b1a0e3c0029c2dd5fb7c8dd2db4f9e0b309c9f54"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
|
"url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lix-module": {
|
"lix-module": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"flakey-profile": "flakey-profile",
|
"flakey-profile": "flakey-profile",
|
||||||
"lix": "lix",
|
"lix": [
|
||||||
|
"lix"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729360442,
|
"lastModified": 1727752861,
|
||||||
"narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=",
|
"narHash": "sha256-jowmo2aEzrEpPSM96IWtajuogdJm7DjAWxFTEb7Ct0s=",
|
||||||
"rev": "9098ac95768f7006d7e070b88bae76939f6034e6",
|
"rev": "fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz?rev=9098ac95768f7006d7e070b88bae76939f6034e6"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d.tar.gz?rev=fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"
|
"url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"my-nixpkgs": {
|
"my-nixpkgs": {
|
||||||
|
@ -1076,6 +1078,7 @@
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"hyprland-contrib": "hyprland-contrib",
|
"hyprland-contrib": "hyprland-contrib",
|
||||||
"hyprman": "hyprman",
|
"hyprman": "hyprman",
|
||||||
|
"lix": "lix",
|
||||||
"lix-module": "lix-module",
|
"lix-module": "lix-module",
|
||||||
"my-nixpkgs": "my-nixpkgs",
|
"my-nixpkgs": "my-nixpkgs",
|
||||||
"nim2nix": "nim2nix_2",
|
"nim2nix": "nim2nix_2",
|
||||||
|
@ -1341,11 +1344,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730743262,
|
"lastModified": 1730187742,
|
||||||
"narHash": "sha256-iTLqj3lU8kFehPm5tXpctzkD274t/k1nwSSq3qCWXeg=",
|
"narHash": "sha256-M0umGIIvVFqCwA0fQ5edivMTbRYA0r/5tXK8sr+M7EA=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "xdg-desktop-portal-hyprland",
|
"repo": "xdg-desktop-portal-hyprland",
|
||||||
"rev": "09b23cef06fe248e61cec8862c04b9bcb62f4b6d",
|
"rev": "998f646762b94fbac61b0271ce66d3e617262858",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1388,11 +1391,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730722337,
|
"lastModified": 1730593948,
|
||||||
"narHash": "sha256-tvbAprVy34KXPywdbPhIW9+0ZfrHvmtaGWSk16dg/Z8=",
|
"narHash": "sha256-1ndLLzFUh2uKaWjvH25lohGCSpBXANwyVmhGCDBFM6c=",
|
||||||
"owner": "mitchellh",
|
"owner": "mitchellh",
|
||||||
"repo": "zig-overlay",
|
"repo": "zig-overlay",
|
||||||
"rev": "efff314a4daabec1de625a1780e774fdaea50605",
|
"rev": "68091a14f9c3d803ba6ae13cab2a52623c15633d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
17
flake.nix
17
flake.nix
|
@ -12,19 +12,14 @@
|
||||||
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
||||||
nix-index-database.url = "github:nix-community/nix-index-database";
|
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||||
|
|
||||||
# lix = {
|
lix = {
|
||||||
# url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||||
# flake = false;
|
flake = false;
|
||||||
# };
|
};
|
||||||
# lix-module = {
|
|
||||||
# url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
# inputs.lix.follows = "lix";
|
|
||||||
# };
|
|
||||||
|
|
||||||
lix-module = {
|
lix-module = {
|
||||||
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.lix.follows = "lix";
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/ghostty-org/ghostty/issues/2025
|
# https://github.com/ghostty-org/ghostty/issues/2025
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|> listify;
|
|> listify;
|
||||||
}
|
}
|
||||||
// (
|
// (
|
||||||
# llm
|
|
||||||
''
|
''
|
||||||
vpn|desktop|hyprland|chrome
|
vpn|desktop|hyprland|chrome
|
||||||
backups|hp-scanner|llm
|
backups|hp-scanner|llm
|
||||||
|
|
|
@ -2,18 +2,22 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
mkOizysModule,
|
mkOizysModule,
|
||||||
flake,
|
# enabled,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (pkgs) python3Packages;
|
||||||
|
# llm-ollama = python3Packages.callPackage ./llm-plugins/llm-ollama { };
|
||||||
|
llm-claude3 = python3Packages.callPackage ./llm-plugins/llm-claude-3 { };
|
||||||
|
in
|
||||||
|
|
||||||
mkOizysModule config "llm" {
|
mkOizysModule config "llm" {
|
||||||
|
# services.ollama = enabled;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(python3.withPackages (ps:
|
(python3.withPackages (ps: [
|
||||||
with (flake.pkgs "self");
|
ps.llm
|
||||||
[
|
llm-claude3
|
||||||
llm
|
]))
|
||||||
llm-claude-3
|
|
||||||
]
|
|
||||||
))
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "llm-claude-3";
|
pname = "llm-claude-3";
|
||||||
version = "0.7";
|
version = "0.4";
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
|
@ -1,11 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let inherit (pkgs) python3Packages;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
nph = pkgs.callPackage ./nim/nph { }; # doesn't compile with 2.2.0 :/
|
nph = pkgs.callPackage ./nim/nph { }; # doesn't compile with 2.2.0 :/
|
||||||
nimlangserver = pkgs.callPackage ./nim/nimlangserver { };
|
nimlangserver = pkgs.callPackage ./nim/nimlangserver { };
|
||||||
nimble = pkgs.callPackage ./nim/nimble { };
|
nimble = pkgs.callPackage ./nim/nimble { };
|
||||||
distrobox = pkgs.callPackage ./distrobox {};
|
distrobox = pkgs.callPackage ./distrobox {};
|
||||||
llm = python3Packages.callPackage ./llm {};
|
|
||||||
llm-claude-3 = python3Packages.callPackage ./llm-plugins/llm-claude-3 {};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
buildPythonPackage,
|
|
||||||
fetchFromGitHub,
|
|
||||||
pytestCheckHook,
|
|
||||||
pythonOlder,
|
|
||||||
setuptools,
|
|
||||||
click-default-group,
|
|
||||||
numpy,
|
|
||||||
openai,
|
|
||||||
pip,
|
|
||||||
pluggy,
|
|
||||||
pydantic,
|
|
||||||
python-ulid,
|
|
||||||
pyyaml,
|
|
||||||
sqlite-migrate,
|
|
||||||
cogapp,
|
|
||||||
pytest-httpx,
|
|
||||||
puremagic,
|
|
||||||
sqlite-utils,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
llm = buildPythonPackage rec {
|
|
||||||
pname = "llm";
|
|
||||||
version = "0.17.1";
|
|
||||||
pyproject = true;
|
|
||||||
|
|
||||||
build-system = [ setuptools ];
|
|
||||||
|
|
||||||
disabled = pythonOlder "3.8";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "simonw";
|
|
||||||
repo = "llm";
|
|
||||||
rev = "refs/tags/${version}";
|
|
||||||
hash = "sha256-6OO0SIIxChM5HRJoUM4CYGbsINmc3i+iyL/oahLHhrY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# patches = [ ./001-disable-install-uninstall-commands.patch ];
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
click-default-group
|
|
||||||
numpy
|
|
||||||
openai
|
|
||||||
pip
|
|
||||||
pluggy
|
|
||||||
pydantic
|
|
||||||
python-ulid
|
|
||||||
pyyaml
|
|
||||||
setuptools # for pkg_resources
|
|
||||||
sqlite-migrate
|
|
||||||
sqlite-utils
|
|
||||||
puremagic
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeCheckInputs = [
|
|
||||||
cogapp
|
|
||||||
numpy
|
|
||||||
pytest-httpx
|
|
||||||
pytestCheckHook
|
|
||||||
];
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
pytestFlagsArray = [
|
|
||||||
"-svv"
|
|
||||||
"tests/"
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = [ "llm" ];
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit withPlugins;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://github.com/simonw/llm";
|
|
||||||
description = "Access large language models from the command-line";
|
|
||||||
changelog = "https://github.com/simonw/llm/releases/tag/${version}";
|
|
||||||
license = licenses.asl20;
|
|
||||||
mainProgram = "llm";
|
|
||||||
maintainers = with maintainers; [
|
|
||||||
aldoborrero
|
|
||||||
mccartykim
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
withPlugins = throw ''
|
|
||||||
llm.withPlugins was confusing to use and has been removed.
|
|
||||||
Please migrate to using python3.withPackages(ps: [ ps.llm ]) instead.
|
|
||||||
|
|
||||||
See https://nixos.org/manual/nixpkgs/stable/#python.withpackages-function for more usage examples.
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
llm
|
|
|
@ -134,14 +134,8 @@ proc evaluateDerivations(drvs: seq[string]): Table[string, NixDerivation] =
|
||||||
cmd.addArgs drvs
|
cmd.addArgs drvs
|
||||||
let (output, _) =
|
let (output, _) =
|
||||||
runCmdCaptWithSpinner(cmd, "evaluating derivations")
|
runCmdCaptWithSpinner(cmd, "evaluating derivations")
|
||||||
fromJson(output, Table[string, NixDerivation])
|
fromJson(output, Table[string,NixDerivation])
|
||||||
|
|
||||||
proc nixDerivationShow(drvs: seq[string]): Table[string, NixDerivation] =
|
|
||||||
var cmd = "nix derivation show"
|
|
||||||
cmd.addArgs drvs
|
|
||||||
let (output, _ ) =
|
|
||||||
runCmdCaptWithSpinner(cmd, "evaluating " & drvs.join(" "))
|
|
||||||
fromJson(output, Table[string, NixDerivation])
|
|
||||||
|
|
||||||
# TODO: replace asserts in this proc, would be easier with results type
|
# TODO: replace asserts in this proc, would be easier with results type
|
||||||
proc findSystemPaths(drvs: Table[string, NixDerivation]): seq[string] =
|
proc findSystemPaths(drvs: Table[string, NixDerivation]): seq[string] =
|
||||||
|
@ -178,36 +172,33 @@ func isIgnored(drv: string): bool =
|
||||||
if name.startswith(pkg):
|
if name.startswith(pkg):
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
# proc systemPathDrvsToBuild(): seq[string] =
|
||||||
|
|
||||||
type
|
type
|
||||||
OizysDerivation = object
|
OizysDerivation = object
|
||||||
drv: NixDerivation # do i need this ?
|
drv: NixDerivation # do i need this ?
|
||||||
output: string
|
output: string
|
||||||
name: string
|
name: string
|
||||||
|
|
||||||
proc getSystemPathDrvs(): seq[string] =
|
iterator getSystemPathDrvs(drvs: Table[string, NixDerivation]): string =
|
||||||
let systemDrvs = nixDerivationShow(nixosConfigAttrs())
|
let systemPaths = findSystemPaths(drvs)
|
||||||
let systemPathDrvs = findSystemPaths(systemDrvs)
|
for p in systemPaths:
|
||||||
result =
|
for d in drvs[p].inputDrvs.keys():
|
||||||
collect:
|
yield d
|
||||||
for k, drv in nixDerivationShow(systemPathDrvs):
|
|
||||||
for inputDrv, _ in drv.inputDrvs:
|
|
||||||
inputDrv
|
|
||||||
|
|
||||||
|
|
||||||
proc getOizysDerivations(): seq[OizysDerivation] =
|
proc getOizysDerivations(): seq[OizysDerivation] =
|
||||||
let
|
let toBuild = toBuildNixosConfiguration()
|
||||||
toBuildDrvs = toBuildNixosConfiguration()
|
let drvs = evaluateDerivations(nixosConfigAttrs())
|
||||||
systemPathDrvs = getSystemPathDrvs()
|
|
||||||
toActullyBuildDrvs = systemPathDrvs.filterIt(it in toBuildDrvs and not isIgnored(it))
|
|
||||||
|
|
||||||
for name, drv in nixDerivationShow(toActullyBuildDrvs):
|
for name in getSystemPathDrvs(drvs):
|
||||||
result.add OizysDerivation(
|
if name in toBuild and not isIgnored(name):
|
||||||
|
let nixDrv = drvs[name]
|
||||||
|
result.add OizysDerivation(
|
||||||
name: name,
|
name: name,
|
||||||
output: drv.outputs.`out`.path,
|
output: nixDrv.outputs.`out`.path,
|
||||||
drv: drv,
|
drv: nixDrv,
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: remove this proc
|
|
||||||
proc systemPathDrvsToBuild(): seq[string] =
|
proc systemPathDrvsToBuild(): seq[string] =
|
||||||
var inputDrvs, dropped: seq[string]
|
var inputDrvs, dropped: seq[string]
|
||||||
let toBuild = toBuildNixosConfiguration()
|
let toBuild = toBuildNixosConfiguration()
|
||||||
|
@ -219,6 +210,12 @@ proc systemPathDrvsToBuild(): seq[string] =
|
||||||
|
|
||||||
(result, _) = filterSeq(inputDrvs, (s) => s in toBuild)
|
(result, _) = filterSeq(inputDrvs, (s) => s in toBuild)
|
||||||
(dropped, result) = filterSeq(result, isIgnored)
|
(dropped, result) = filterSeq(result, isIgnored)
|
||||||
|
echo "SOMETHING SHOULD HAPPEN HERE!"
|
||||||
|
for drv in result:
|
||||||
|
echo drv
|
||||||
|
echo drvs[drv]
|
||||||
|
|
||||||
|
|
||||||
debug fmt"ignored {dropped.len} derivations"
|
debug fmt"ignored {dropped.len} derivations"
|
||||||
result = result.mapIt(it & "^*")
|
result = result.mapIt(it & "^*")
|
||||||
|
|
||||||
|
@ -297,6 +294,8 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i
|
||||||
var cmd = "nix build"
|
var cmd = "nix build"
|
||||||
cmd.addArg drv.name & "^*"
|
cmd.addArg drv.name & "^*"
|
||||||
cmd.addArg "--no-link"
|
cmd.addArg "--no-link"
|
||||||
|
# cmd.addArg "--print-out-paths"
|
||||||
|
# cmd.addArg "-L"
|
||||||
cmd.addArgs rest
|
cmd.addArgs rest
|
||||||
let buildCode = runCmd(cmd)
|
let buildCode = runCmd(cmd)
|
||||||
if buildCode != 0:
|
if buildCode != 0:
|
||||||
|
|
0
pkgs/oizys/src/oizys/pkgs/oizys/src/oizys/nix.nim
Normal file
0
pkgs/oizys/src/oizys/pkgs/oizys/src/oizys/nix.nim
Normal file
Loading…
Reference in a new issue