-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding it to nixpkgs #7
Comments
Hey there! Sure, I'd be down. I've never attempted submitting directly to their package manager. What's the usual process for initial submission, and submitting updates? |
you make a PR to https://github.com/nixos/nixpkgs |
Great, thank you! Once I hit a point where I'm not releasing a version every two days, I'd be down to do this. :D |
@onemoresuza Thanks for the assist in the nixpkgs PR! The patch you put together is quite large, I think I can refactor to get rid of it! If I remember correctly, Nix can consume something like a JSON file with all the theme and syntax dependencies as long as there is a hash included for the archives, right? I can move those all out of build.rs and in to a separate file. And then additional in Watcha think? |
You're welcome!, @dustinblackman. Regarding the theme and syntax dependencies, yes, nix can consume data from either a JSON or TOML file. By having the urls and their respective hashes, we would be able to fetch them with nix. |
Two more things:
|
Awesome! I have a branch up that introduces an
Fixed in f5aab04
I had forked it due to a licensing issue. Looking deeper it was only with the most recent version, so I've rolled back to an older one. Fixed in 5c2359b |
Tested the changes on my branch and the package compiles and generates the manpages and the shell completions --- the With the Regarding the themes and syntaxes change, are these the expected directory trees for the [user@hostname:~] $ ls -lh $OATMEAL_BUILD_DOWNLOADED_THEMES_DIR
dr-xr-xr-x 5 nixbld nixbld 160 Dec 31 14:37 base16-textmate [user@hostname:~] $ ls -lh $OATMEAL_BUILD_DOWNLOADED_SYNTAXES_DIR
dr-xr-xr-x 3 nixbld nixbld 220 Dec 31 14:37 GraphQL-SublimeText3
dr-xr-xr-x 49 nixbld nixbld 1.1K Dec 31 14:37 Packages
dr-xr-xr-x 4 nixbld nixbld 340 Dec 31 14:37 Terraform.tmLanguage
dr-xr-xr-x 10 nixbld nixbld 420 Dec 31 14:37 bat
dr-xr-xr-x 4 nixbld nixbld 240 Dec 31 14:37 elixir-sublime-syntax
dr-xr-xr-x 4 nixbld nixbld 240 Dec 31 14:37 protobuf-syntax-highlighting
dr-xr-xr-x 4 nixbld nixbld 120 Dec 31 14:37 sublime-text-gleam
dr-xr-xr-x 11 nixbld nixbld 380 Dec 31 14:37 sublime-zig-language
dr-xr-xr-x 2 nixbld nixbld 200 Dec 31 14:37 sublime_toml_highlighting |
Yep! Though they matter less than they did before as I walk the directory tree to find assets.
Does it? I've been working on removing any bundled assets in to nixpkgs, and so far I've gotten this to download all that's needed, but it fails due to Nixpkgs having an old version of Rust ( { lib
, stdenv
, fetchFromGitHub
, rustPlatform
, makeRustPlatform
, installShellFiles
}:
let
version = "0.12.1";
oatmeal = fetchFromGitHub {
name = "oatmeal";
owner = "dustinblackman";
repo = "oatmeal";
rev = "622fd5e7d374c9b3434efceeaf3b47c27664523a"; #todo
hash = "sha256-Ps7b2ZKE9K8HxLB+4DZporIpF0JKSuOBjqS95SoLVWY=";
};
assets = lib.importTOML(oatmeal + "/assets.toml");
arrayToSrc = arr: lib.forEach arr (e:
fetchFromGitHub {
inherit (e) rev repo owner;
hash = e.nix-hash;
name = e.repo;
}
);
syntaxes = arrayToSrc assets.syntaxes;
themes = arrayToSrc assets.themes;
syntaxDirs = lib.concatStringsSep " " (lib.forEach (syntaxes) (e: "${e}"));
themeDirs = lib.concatStringsSep " " (lib.forEach (themes) (e: "${e}"));
buildSyntaxes = "${srcs.oatmeal.name}/.cache/syntaxes";
buildThemes = "${srcs.oatmeal.name}/.cache/themes";
in
rustPlatform.buildRustPackage {
pname = "oatmeal";
inherit version;
srcs = [ oatmeal ] ++ syntaxes ++ themes;
sourceRoot = oatmeal.name;
cargoLock.lockFile = oatmeal + "/Cargo.lock";
nativeBuildInputs = [ installShellFiles ];
env = {
OATMEAL_BUILD_DOWNLOADED_SYNTAXES_DIR = buildSyntaxes;
OATMEAL_BUILD_DOWNLOADED_THEMES_DIR = buildThemes;
VERGEN_IDEMPOTENT = 1;
};
preBuild = ''
mkdir -p ${buildSyntaxes} ${buildThemes}
cp -r ${syntaxDirs} ${buildSyntaxes}
cp -r ${themeDirs} ${buildThemes}
'';
postInstall = lib.optionalString (stdenv.hostPlatform.canExecute stdenv.buildPlatform) ''
$out/bin/oatmeal manpages 1>oatmeal.1
installManPage oatmeal.1
installShellCompletion --cmd oatmeal \
--bash <($out/bin/oatmeal completions -s bash) \
--fish <($out/bin/oatmeal completions -s fish) \
--zsh <($out/bin/oatmeal completions -s zsh)
'';
meta = {
description = "Terminal UI to chat with large language models (LLM)";
longDescription = ''
Oatmeal is a terminal UI chat application that speaks with LLMs, complete with
slash commands and fancy chat bubbles. It features agnostic backends to allow
switching between the powerhouse of ChatGPT, or keeping things private with
Ollama. While Oatmeal works great as a stand alone terminal application, it
works even better paired with an editor like Neovim!
'';
homepage = "https://github.com/dustinblackman/oatmeal/";
changelog = "https://github.com/dustinblackman/oatmeal/blob/main/CHANGELOG.md";
downloadPage = "https://github.com/dustinblackman/oatmeal/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dustinblackman ];
mainProgram = "oatmeal";
};
} |
I'm believe so. I don't know of way of using one of the sources --- in this case, the
That's odd. I've checked your branch and the |
I see that you have a custom nur, feel free to ping me when you want to add this to nixpkgs.
The text was updated successfully, but these errors were encountered: