Skip to content
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

Reusing quicklisp-to-nix #150941

Open
teu5us opened this issue Dec 16, 2021 · 2 comments
Open

Reusing quicklisp-to-nix #150941

teu5us opened this issue Dec 16, 2021 · 2 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@teu5us
Copy link

teu5us commented Dec 16, 2021

Using quicklisp packages is not really convenient currently. I think we could make it a little better with some suble changes.

quicklisp-to-nix shell

A local shell is used to generate expressions for quicklisp packages in the nixpkgs tree. It cannot be copied to a directory and used directly because relative paths are used (lines 2 and 4).

I wonder if all the required dependencies can be included with quicklisp-to-nix. For now at least I rewrote the paths with pkgs.path in a local shell.

generated quicklisp-to-nix.nix

quicklisp-to-nix.nix also uses a relative path ./define-package.nix, so it cannot be used without editing in a local shell.

Perhaps buildLispPackage could be inherited like clwrapper. An absolute path with pkgs.path also works, but does not seem right to me.

quicklisp-to-nix-overrides.nix missing

quicklisp-to-nix-overrides.nix is not created by the generator if no such file exists and has to be manually copied over to the local shell.

@teu5us
Copy link
Author

teu5us commented Dec 16, 2021

Shell I'm using:

{ pkgs ? import <nixpkgs> {} }:

with pkgs;

let
  buildLispPackage = lispPackages.buildLispPackage;
  qlPkgsFor = clwrapper: callPackage ./nix-lisp/quicklisp-to-nix.nix {
    inherit clwrapper buildLispPackage;
  };
  localQlPkgs = dontRecurseIntoAttrs (qlPkgsFor (wrapLisp sbcl));
  qlPkgs = localQlPkgs // quicklispPackagesSBCL;
  lp = recurseIntoAttrs (qlPkgs // (lispPackagesFor (wrapLisp sbcl)));
in
mkShell {
  buildInputs = [
    sbcl lp.clwrapper lp.hunchentoot lp.djula lp.cl-pass
  ];
}

Modified part of the generator shell:

{ pkgs ? import <nixpkgs> {} }:
with import (pkgs.path + "/default.nix") {};
let
openssl_lib_marked = import (pkgs.path + "/pkgs/development/lisp-modules/openssl-lib-marked.nix");
...

Here I use packages that exist in the pkgs.lispPackages set. They are checked by quicklisp-to-nix and expressions are created, but nix uses the old ones from the tree.

quicklisp-to-nix, when used locally, should check if a requested package already exists in pkgs/development/lisp-modules/quicklisp-to-nix-systems.txt.

@teu5us
Copy link
Author

teu5us commented Dec 17, 2021

I made a shell for this here.

ql-to-nix.lisp is edited to check if the requested package exists in the nixpkgs tree and skip it when called with argument --local.
top-package.emb is edited to accept buildLispPackage as an argument.

Seems to work, but I have not tested it with something requiring overrides like in quicklisp-to-nix-overrides.nix.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

1 participant