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

Unify shell.*.nix into one #3361

Open
aadcg opened this issue Mar 18, 2024 · 2 comments
Open

Unify shell.*.nix into one #3361

aadcg opened this issue Mar 18, 2024 · 2 comments

Comments

@aadcg
Copy link
Member

aadcg commented Mar 18, 2024

It makes little sense to have several files to define the dev env in Nix.

I've tried it but got stuck. I have no experience with Nix, so help is highly appreciated.

# SPDX-FileCopyrightText: Atlas Engineer LLC
# SPDX-License-Identifier: BSD-3-Clause

{ pkgs ? import <nixpkgs> {} } :
with builtins;
let inherit (pkgs) stdenv; in
with pkgs;
stdenv.mkDerivation {
  name = "nyxt-dev";

  nativeBuildInputs = [
    pkgs.libressl.out
    pkgs.libfixposix.out
    pkgs.sqlite.out
    pkgs.pkg-config.out
    pkgs.sbcl
  ]
  ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [
    pkgs.webkitgtk
  ];

  buildInputs = [
    pkgs.electron
    pkgs.sqlite
    pkgs.pkg-config
    pkgs.enchant.out
    pkgs.libfixposix.out
  ]
  ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [
    pkgs.gobject-introspection
    pkgs.gsettings-desktop-schemas.out
    pkgs.glib-networking.out
    pkgs.pango.out
    pkgs.cairo.out
    pkgs.gdk-pixbuf.out
    pkgs.gtk3.out
    pkgs.glib.out
    pkgs.webkitgtk
  ]
  ++ (with gst_all_1; [
    gst-plugins-base
    gst-plugins-good
    gst-plugins-bad
    gst-plugins-ugly
    gst-libav
  ]);

  LD_LIBRARY_PATH = with lib; "${makeLibraryPath
    [ pkgs.enchant.out
      pkgs.sqlite.out
      pkgs.pkg-config.out
      pkgs.libfixposix.out
      pkgs.libressl.out
    ]
    ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [
      pkgs.gobject-introspection
      pkgs.gsettings-desktop-schemas.out
      pkgs.glib-networking.out
      pkgs.pango.out
      pkgs.cairo.out
      pkgs.gdk-pixbuf.out
      pkgs.gtk3.out
      pkgs.glib.out
      pkgs.webkitgtk
    ]};";

  GIO_MODULE_DIR = "${pkgs.glib-networking.out}/lib/gio/modules/";
  GIO_EXTRA_MODULES = "${pkgs.glib-networking.out}/lib/gio/modules/";
}
$ nix-shell build-scripts/shell.nix
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nyxt-dev'
         whose name attribute is located at /nix/store/ilsxjz1r5p29q11jbx5zdgy8vhzaydv4-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:354:7

       … while evaluating attribute 'LD_LIBRARY_PATH' of derivation 'nyxt-dev'

         at /home/aadcg/common-lisp/nyxt/build-scripts/shell.nix:48:3:

           47|
           48|   LD_LIBRARY_PATH = with lib; "${makeLibraryPath
             |   ^
           49|     [ pkgs.enchant.out

       error: value is a string with context while a list was expected
@aliyss
Copy link

aliyss commented May 7, 2024

not sure... but it ran when doing this:

      LD_LIBRARY_PATH = with lib;
        makeLibraryPath (
          [
            pkgs.enchant.out
            pkgs.sqlite.out
            pkgs.pkg-config.out
            pkgs.libfixposix.out
            pkgs.libressl.out
          ]
          ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [
            pkgs.gobject-introspection
            pkgs.gsettings-desktop-schemas.out
            pkgs.glib-networking.out
            pkgs.pango.out
            pkgs.cairo.out
            pkgs.gdk-pixbuf.out
            pkgs.gtk3.out
            pkgs.glib.out
            pkgs.webkitgtk
          ]
        );

@aadcg
Copy link
Member Author

aadcg commented May 8, 2024

Most likely, it won't make sense to pursue the goal of the original issue anymore due to atlas-engineer/cl-electron#43. In other words, the dev env for electron won't be based on Nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants