Giter VIP home page Giter VIP logo

julia2nix.jl's Introduction

Julia2Nix

The Nix interface to Julia Pkg

Simple Usage

Templates

Initializing your default shellEnv of julia2nix with flake template

default

nix flake init --template github:JuliaCN/Julia2Nix.jl#templates.devshell
## add these files in your git stage
nix develop

jlrs

nix flake init --template github:JuliaCN/Julia2Nix.jl#templates.jlrs

learn-julia

git clone https://github.com/GTrunSec/learn-julia

Attribution

This project was forked from NixSourcerer.jl.

Thanks the original author colinxs of this project.

LICENSE

Julia2nix is licensed under the LICENSE.

julia2nix.jl's People

Contributors

gtrunsec avatar ocfox avatar dependabot[bot] avatar johnnychen94 avatar

Stargazers

Pierre Navaro avatar  avatar dunxen avatar Daniel Schwabeneder avatar M.F.B. avatar  avatar Jose Storopoli avatar Matt avatar Nikita avatar Kanyang Ying avatar David Pätzel avatar Yanni Papandreou avatar Thibaut Lamadon avatar Adrian Hill avatar Sandro avatar Oliver Evans avatar Suraj avatar Syver Døving Agdestein avatar  avatar songjhaha avatar Hoang Phan avatar Hai Zhu avatar Gabriel Wu avatar Taine Zhao avatar  avatar SnO₂WMaN avatar Gardanta Spirito avatar Nick Bathum avatar  avatar  avatar Jade Mackay avatar  avatar Átila Saraiva Quintela Soares avatar oluceps avatar Steve Kelly avatar rewine avatar Daniel Kahlenberg avatar

Watchers

Zhang Xianyi avatar David Pätzel avatar  avatar Jade Mackay avatar  avatar Taine Zhao avatar

julia2nix.jl's Issues

add Comonicon.jl to julia2nix

Nested command support

Yeh, It would be a nice feature once we support the julia2nix in static compilation with nix.

It could be as follows:
image

- julia2nix --help
   - update flake
   - update project
   -  ...

julia2nix update flake

1.8.1: The regspec.url couldn't find the url field.

@johnnychen94

This issue appeared in #21 when I updated the julia1.7.2 to 1.8.1.

ERROR: LoadError: type RegistryInstance has no field url                                                                 
Stacktrace:                                                                                                              
  [1] getproperty                                                                                                        
    @ ./Base.jl:38 [inlined]                                                                                             
  [2] (::Julia2Nix.JuNix.var"#2#3")(regspec::Pkg.Registry.RegistryInstance)                                              
    @ Julia2Nix.JuNix ~/ghq/github.com/JuliaCN/julia2nix/src/JuNix/types.jl:46                                           
  [3] iterate                                                                                                            
    @ ./generator.jl:47 [inlined]                                                                                        
  [4] _collect                                                                                                           
    @ ./array.jl:807 [inlined]                                                  

julia: 1.8.1
nix: 2.9.x

`error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)`

What am I doing wrong here? or is this a bug?

╰─🚧 nix run github:JuliaCN/Julia2Nix.jl\#packages.x86_64-linux.julia2nix    
  Activating project at `/nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl`
[ Info: Fetching registries...
Failed to run cmd:
`nix-prefetch '    let pkgs = import "/nix/store/cwr7p465zbfp60hg3jng1cfkmq14ka49-source" { };
    in with pkgs; pkgs.fetchzip
' --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url 'https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz'`
Error:


┌ Error: Fetcher failed: nix-prefetch pkgs.fetchzip --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz
│ failed process: Process(`nix-prefetch '    let pkgs = import "/nix/store/cwr7p465zbfp60hg3jng1cfkmq14ka49-source" { };
│     in with pkgs; pkgs.fetchzip
│ ' --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url 'https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz'`, ProcessExited(1)) [1]
│ 
│ Stacktrace:
│  [1] select_fetcher(fetchers::Vector{Julia2Nix.JuNix.Fetcher}, opts::Julia2Nix.JuNix.Options)
│    @ Julia2Nix.JuNix /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:219
│  [2] macro expansion
│    @ /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:170 [inlined]
│  [3] (::Julia2Nix.JuNix.var"#12#14"{Julia2Nix.JuNix.Options, Channel{Tuple{Julia2Nix.JuNix.RegistryInfo, Union{Nothing, Julia2Nix.JuNix.Fetcher}}}, Channel{Tuple{Julia2Nix.JuNix.RegistryInfo, Vector{Julia2Nix.JuNix.Fetcher}}}})()
│    @ Julia2Nix.JuNix ./task.jl:514
└ @ Julia2Nix.JuNix /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:220
Failed to run cmd:
`nix-prefetch '    let pkgs = import "/nix/store/cwr7p465zbfp60hg3jng1cfkmq14ka49-source" { };
    in with pkgs; pkgs.fetchzip
' --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url 'https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz'`
Error:

error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)


┌ Error: Fetcher failed: nix-prefetch pkgs.fetchzip --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz
│ failed process: Process(`nix-prefetch '    let pkgs = import "/nix/store/cwr7p465zbfp60hg3jng1cfkmq14ka49-source" { };
│     in with pkgs; pkgs.fetchzip
│ ' --hash-algo sha256 --output raw --name registry-General --no-stripRoot --url 'https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ae0a924102c812ef7f3dc1ce135c92589797952#registry.tar.gz'`, ProcessExited(1)) [1]
│ 
│ Stacktrace:
│  [1] select_fetcher(fetchers::Vector{Julia2Nix.JuNix.Fetcher}, opts::Julia2Nix.JuNix.Options)
│    @ Julia2Nix.JuNix /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:219
│  [2] macro expansion
│    @ /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:170 [inlined]
│  [3] (::Julia2Nix.JuNix.var"#12#14"{Julia2Nix.JuNix.Options, Channel{Tuple{Julia2Nix.JuNix.RegistryInfo, Union{Nothing, Julia2Nix.JuNix.Fetcher}}}, Channel{Tuple{Julia2Nix.JuNix.RegistryInfo, Vector{Julia2Nix.JuNix.Fetcher}}}})()
│    @ Julia2Nix.JuNix ./task.jl:514
└ @ Julia2Nix.JuNix /nix/store/nddhsbqkrppixfwr5vcwvy217mn6xgs3-incl/src/JuNix/fetch.jl:220

CUDA.function() == false;

Not exactly sure how to use this to create a Nix package that has FHS. When I try to use the example tamplate I can't get CUDA.jl to see my GPU. My GPU works on the system with Julia and CUDA but if I use the Julia that is packaged with Julia2Nix the GPU is not functional.

Plotly is Broken

Am I doing it all wrong or is Plotly broke?

julia> using Plotly
┌ Warning: Kaleido is not available on this system. Julia will be unable to save images of any plots.
└ @ PlotlyJS ~/.config/julia/packages/PlotlyJS/qhYQ5/src/kaleido.jl:65
┌ Warning: ErrorException("Could not start Kaleido process")
└ @ PlotlyJS ~/.config/julia/packages/PlotlyJS/qhYQ5/src/kaleido.jl:66

julia> plot(1:10)
Error showing value of type PlotlyJS.SyncPlot:
ERROR: IOError: could not spawn `/home/mcamp/.config/julia/packages/Blink/mwJC9/deps/atom/electron /home/mcamp/.config/julia/packages/Blink/mwJC9/src/AtomShell/main.js port 6285`: no such file or directory (ENOENT)
Stacktrace:
  [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, IO}})
    @ Base ./process.jl:128
  [2] #760
    @ ./process.jl:139 [inlined]
  [3] setup_stdios(f::Base.var"#760#761"{Cmd}, stdios::Vector{Union{RawFD, IO}})
    @ Base ./process.jl:223
  [4] _spawn
    @ ./process.jl:138 [inlined]
  [5] run(::Cmd; wait::Bool)
    @ Base ./process.jl:483
  [6] run
    @ ./process.jl:477 [inlined]
  [7] init(; debug::Bool)
    @ Blink.AtomShell ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/process.jl:92
  [8] init
    @ ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/process.jl:87 [inlined]
  [9] #shell#9
    @ ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/process.jl:149 [inlined]
 [10] shell
    @ ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/process.jl:140 [inlined]
 [11] #Window#14
    @ ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/window.jl:89 [inlined]
 [12] Blink.AtomShell.Window(args::Dict{String, Int64})
    @ Blink.AtomShell ~/.config/julia/packages/Blink/mwJC9/src/AtomShell/window.jl:89
 [13] display_blink(p::PlotlyJS.SyncPlot)
    @ PlotlyJS ~/.config/julia/packages/PlotlyJS/qhYQ5/src/display.jl:169
 [14] display(#unused#::PlotlyJS.PlotlyJSDisplay, p::PlotlyJS.SyncPlot)
    @ PlotlyJS ~/.config/julia/packages/PlotlyJS/qhYQ5/src/display.jl:160
 [15] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:340
 [16] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [17] invokelatest
    @ ./essentials.jl:813 [inlined]
 [18] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:305
 [19] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:287
 [20] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:557
 [21] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:285
 [22] (::REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:899
 [23] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [24] invokelatest
    @ ./essentials.jl:813 [inlined]
 [25] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:2647
 [26] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1300
 [27] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:514

(@v1.9) pkg> build Plotly
    Building WebIO ───→ `~/.config/julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/0eef0765186f7452e52236fa42ca8c9b3c11c6e3/build.log`
    Building Blink ───→ `~/.config/julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/08d0b679fd7caa49e2bca9214b131289e19808c0/build.log`
    Building PlotlyJS → `~/.config/julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/3db9e7724e299684bf0ca8f245c0265c4bdd8dc6/build.log`

The electron binary is put into the Julia directory but something is off..

drwxr-xr-x mcamp ldap_user  494 B  Sat Nov  4 20:03:04 2023  ./
drwxr-xr-x mcamp ldap_user   42 B  Sat Nov  4 20:03:04 2023  ../
drwxr-xr-x mcamp ldap_user  682 B  Sat Nov  4 20:03:04 2023  locales/
drwxr-xr-x mcamp ldap_user   58 B  Sat Nov  4 20:03:04 2023  resources/
drwxr-xr-x mcamp ldap_user   42 B  Sat Nov  4 20:03:04 2023  swiftshader/
.rw-r--r-- mcamp ldap_user  164 KB Sat Feb  2 02:54:26 2019  chrome_100_percent.pak
.rw-r--r-- mcamp ldap_user  244 KB Sat Feb  2 02:54:26 2019  chrome_200_percent.pak
.rwxr-xr-x mcamp ldap_user  110 MB Sat Feb  2 03:07:56 2019  electron*
.rw-r--r-- mcamp ldap_user  9.7 MB Sat Feb  2 02:39:14 2019  icudtl.dat
.rwxr-xr-x mcamp ldap_user  250 KB Sat Feb  2 03:07:56 2019  libEGL.so*
.rwxr-xr-x mcamp ldap_user  3.0 MB Sat Feb  2 03:07:56 2019  libffmpeg.so*
.rwxr-xr-x mcamp ldap_user  5.8 MB Sat Feb  2 03:07:56 2019  libGLESv2.so*
.rwxr-xr-x mcamp ldap_user  6.9 MB Sat Feb  2 02:46:00 2019  libVkICD_mock_icd.so*
.rw-r--r-- mcamp ldap_user  1.0 KB Sat Feb  2 02:16:36 2019  LICENSE
.rw-r--r-- mcamp ldap_user  1.9 MB Sat Feb  2 02:43:56 2019  LICENSES.chromium.html
.rw-r--r-- mcamp ldap_user  122 KB Sat Feb  2 03:00:04 2019  natives_blob.bin
.rw-r--r-- mcamp ldap_user  8.3 MB Sat Feb  2 02:54:26 2019  resources.pak
.rw-r--r-- mcamp ldap_user  627 KB Sat Feb  2 03:07:26 2019  snapshot_blob.bin
.rw-r--r-- mcamp ldap_user 1016 KB Sat Feb  2 03:07:38 2019  v8_context_snapshot.bin
.rw-r--r-- mcamp ldap_user    5 B  Sat Feb  2 02:16:36 2019  version
╭─mcamp on butler in ~/.config/julia/packages/Blink/mwJC9/deps/atom
╰─ ./electron /home/mcamp/.config/julia/packages/Blink/mwJC9/src/AtomShell/main.js
zsh: no such file or directory: ./electron

All this is being run from the templated devshell.

Refactor discussion

Julia2nix not only serves as a Nix library for building Julia projects but also provides interfaces for the DevOps and Software Development Life Cycle (SDLC) revolving around Julia projects, offering the best development experience for Julia developers. Based on the extensive work done in PR NixOS/nixpkgs#225513, here are some ideas for refactoring and simplifying julia2nix:

  1. Utilize https://github.com/codedownio/General to require the hash value for each package.
  2. Remove the dependence of nix-prefetch in julia2nix(
  3. Refactor julia2nix to establish compatibility with https://github.com/SamuraiAku/PkgToSoftwareBOM.jl.
  4. Add a building option in julia2nix to generate reports, which is provided by https://juliaecosystem.github.io/PackageAnalyzer.jl/dev/.
  5. Restructure the Nix library interface in julia2nix with a similar implementation to https://github.com/GTrunSec/omnibus/blob/main/flake.nix, aiming for a streamlined Nix library introduction(without transitive inputs).
  6. (automation): Parse Artifacts to generate information related to nixpkgs and Julia Artifacts, aiding the replacement of nixpkgs with Artifacts.
  7. Introduce multi-system support for building Julia projects.
  8. (Further) Incorporate functions in julia2nix, similar to those in https://github.com/nix-community/go-nix, enabling julia2nix.jl to parse Nix-related elements.

building optimize

  • per-package precompilation derivations: NixOS/nixpkgs#225513 (comment)
  • system fetch not only for the x86_64-linux (patchelf problem)
  • [DOING] make the PR can be fetched the sources from either ["Plot"] or [ {package = "Plots", uuid = "xxxxx"}]
    #42 also [package = "Plots"; source = pkgs.fetchGit {....}] for fetching a private julia package
  • implement https://github.com/Roger-luo/Ion with nix ecosystem.

Software Development Life Cycle

  • Compatibilities
  • devshell

image

APIs namespace

  • julia2nix.buildPackage
  • julia2nix.buildProject
  • julia2nix.buildApplication

Error: flake doesn't provide architecture attributes

Hi GuangTao, this project looks really promising.

Can you help me get started? I have done the following:

nix shell nixpkgs#julia-bin
julia 
]activate .
]add Distributions
# C-d
nix run github:JuliaCN/Julia2Nix.jl#packages.x86_64-linux.julia2nix
nix flake init --template github:JuliaCN/Julia2Nix.jl#templates.devshell
git add .
nix develop

which yields

error: flake 'git+file:///home/jade/tmp/Nix/julia-nix' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'

Many thanks

can not run Julia2Nix successfully on MacBook M1

When I followed the instructions on my MacBook M1 Pro, I got the error messages as below:

warning: input 'nix-filter' has an override for a non-existent input 'nixpkgs'
error: attribute 'julia-17-release-aarch64-darwin' missing

   at /nix/store/shndcj46cdfmb1kibdjrhvryc7mxksh4-nix/julia2nix/overlays/installApp.nix:19:12:

       18|   inherit version;
       19|   inherit (julia-sources."julia-${version}-${system}") pname src;
         |            ^
       20|
   Did you mean julia-18-release-aarch64-darwin?

(use '--show-trace' to show detailed location information)
/nix/store/19lf3x5r6z169wg98m6m40y8v8fy4bj9-source/direnv_lib.sh:58: /Users/alan/projects/Julia2Nix/.std/julia2nix/devshells/default/shell-profile/entrypoint: No such file or directory

Pycall

Many Julia projects use Pycall (at least I am finding).

What is a good Julia2nix..jl way to handle the installing or build of pycall, and packages that rely on Pycall?

error: builder for '/nix/store/nqnskjr9ccbxfg3sb1vg3n42cy7phpaa-julia-ion.drv' failed with exit code 1;

Just trying to go through everything to figure out how I might be able to fix the Julia2Nix toml creation error I am getting among other things and thought I'd try the Ion help you have in the docks but it fails with this error.

─mcamp on reckless in ~
╰─ nix run github:JuliaCN/Julia2Nix.jl#x86_64-linux.julia2nix.entrypoints.ion --refresh -- --help
warning: Ignoring setting 'auto-allocate-uids' because experimental feature 'auto-allocate-uids' is not enabled
warning: Ignoring setting 'impure-env' because experimental feature 'configurable-impure-env' is not enabled
error: builder for '/nix/store/nqnskjr9ccbxfg3sb1vg3n42cy7phpaa-julia-ion.drv' failed with exit code 1;
       last 50 log lines:
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/GitTools.jl:74 [inlined]
       >   [8] ensure_clone
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/GitTools.jl:70 [inlined]
       >   [9] install_git(io::Base.TTY, uuid::Base.UUID, name::String, hash::Base.SHA1, urls::Set{String}, version_path::String)
       >     @ Pkg.Operations /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:678
       >  [10] download_source(ctx::Pkg.Types.Context; readonly::Bool)
       >     @ Pkg.Operations /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:905
       >  [11] download_source
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:791 [inlined]
       >  [12] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
       >     @ Pkg.Operations /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1408
       >  [13] develop
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1398 [inlined]
       >  [14] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
       >     @ Pkg.API /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/API.jl:222
       >  [15] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
       >     @ Pkg.API /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
       >  [16] develop(pkgs::Vector{Pkg.Types.PackageSpec})
       >     @ Pkg.API /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
       >  [17] #develop#14
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/API.jl:143 [inlined]
       >  [18] develop
       >     @ /nix/store/2wcn9b3izbbiy1f3qmw55lj9zzvdhrvx-julia-1.9.1/share/julia/stdlib/v1.9/Pkg/src/API.jl:143 [inlined]
       >  [19] create_command_env(m::Module, envpath::String; test_deps::Bool)
       >     @ Comonicon.Builder /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/sysimg.jl:90
       >  [20] create_command_env
       >     @ /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/sysimg.jl:40 [inlined]
       >  [21] install_project_env(m::Module, options::Comonicon.Configs.Comonicon)
       >     @ Comonicon.Builder /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/install.jl:27
       >  [22] install(m::Module, options::Comonicon.Configs.Comonicon)
       >     @ Comonicon.Builder /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/install.jl:8
       >  [23] (::Comonicon.Builder.var"#2#3"{Module, Comonicon.Configs.Comonicon})()
       >     @ Comonicon.Builder /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/cli.jl:64
       >  [24] with_logstate(f::Function, logstate::Any)
       >     @ Base.CoreLogging ./logging.jl:514
       >  [25] with_logger
       >     @ ./logging.jl:626 [inlined]
       >  [26] command_main(m::Module, options::Comonicon.Configs.Comonicon)
       >     @ Comonicon.Builder /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/cli.jl:63
       >  [27] #command_main#1
       >     @ /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/cli.jl:49 [inlined]
       >  [28] command_main
       >     @ /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/builder/cli.jl:47 [inlined]
       >  [29] #comonicon_install#4
       >     @ /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/frontend/cast.jl:495 [inlined]
       >  [30] comonicon_install()
       >     @ Ion /nix/store/gqs58hlhyffz10f64dfa82scx9l79iwc-julia-ion/packages/Comonicon/1NWD0/src/frontend/cast.jl:495
       >  [31] top-level scope
       >     @ none:1
       > /nix/store/74l4x6m97bvry7ccxv51h952ayvg2j46-stdenv-linux/setup: line 144: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/nqnskjr9ccbxfg3sb1vg3n42cy7phpaa-julia-ion.drv'.
error: 1 dependencies of derivation '/nix/store/vvy6lzd2m97ms5p60qhqzh8pyicxy2zp-julia-ion.drv' failed to build

Use quarto to publish the notebooks

Nix-based workflow and APIs

Add your runtime packages to https://github.com/GTrunSec/workflow-template/blob/main/nix/julia/packages/Project.toml. Then run nxi develop .#doc --command mkQuarto, and make sure have created the _quarto.toml in your doc file.
https://github.com/GTrunSec/workflow-template/blob/main/docs/quarto/_quarto.yml

input 'cells-lab/microvm' follows a non-existent input 'lambda-microvm-lab/microvm'

Hello,

Just stumbled on this repo and was interested in trying it in a shell using nix develop.

That and the following

nix build github:JuliaCN/Julia2Nix.jl#packages.x86_64-linux.build-project

result in:

error: input 'cells-lab/microvm' follows a non-existent input 'lambda-microvm-lab/microvm'

I haven't investigated further. Could you share whether this input based on your other project is necessary or more for convenience?

The artifacts solution for Julia project

@samuela

As one of Julia's nix users, I have some questions for you.

  • What do you think about the artifacts issue?
  • The pathelf can only relieve some pain, but how to path them automatically in different - projecl.toml paths that are still an issue.
  • What are your thoughts on how to replace artifacts with nix-store?

nix develop: hash mismatch in fixed-output derivation

I am a Nix novice so the the following might not be an issue, however, in the Julia2Nix.jl current latest version of main (commit 4983f91) nix develop fails with

error: hash mismatch in fixed-output derivation '/nix/store/if8hv0v7204xa19jhn9syng8ir4xnznf-julia-latest-linux-x86_64.tar.gz.drv':
         specified: sha256-RasDQSrcq62R4HM+RDP2QuFeHbpemWtfnZLU/Y8VR+M=
            got:    sha256-bC7y+zep1guINMGfEwDIHZ1dU9vLQiGp+5IoQuF5oow=

I overcame the problem by issuing

nix develop .#update --command nvfetcher-update

but I suspect this is not the desired practice? ... Perhaps an out of date CICD setting?

Guidance on using private packages and registries

Hello,

This might be more of a question about using Nix itself.

My Project /Manifest includes a package QuxPrivate that resides in a private repository. Running

nix run github:JuliaCN/Julia2Nix.jl#packages.x86_64-linux.julia2nix

results in error:

  Activating project at `/nix/store/z1x616mawlfjsljxsmbl16nc7jrhwwnq-incl`
[ Info: Fetching registries...
[ Info: Fetching packages...
Failed to run cmd:===============>                   ]  17/33
`nix-prefetch '    { nixpkgs ? <nixpkgs> }:
    let pkgs = import nixpkgs { };
    in with pkgs; pkgs.fetchgit
' --hash-algo sha256 --output raw --name package-QuxPrivate --rev 2bf158ea22deb09c0da06783d51ad6651f83f9b0 --url [email protected]:dejakaymac/QuxPrivate.jl.git`
Error:

The fetcher will be called as follows:
> fetchgit {
>   name = "package-QuxPrivate";
>   rev = "2bf158ea22deb09c0da06783d51ad6651f83f9b0";
>   sha256 = "sha256:0000000000000000000000000000000000000000000000000000";
>   url = "[email protected]:dejakaymac/QuxPrivate.jl.git";
> }

exporting [email protected]:dejakaymac/QuxPrivate.jl.git (rev 2bf158ea22deb09c0da06783d51ad6651f83f9b0) into /nix/store/ci5gpc6736l0674h163p7cvng1f1b0x9-package-QuxPrivate
Initialized empty Git repository in /nix/store/ci5gpc6736l0674h163p7cvng1f1b0x9-package-QuxPrivate/.git/
error: cannot run ssh: No such file or directory
fatal: unable to fork
error: cannot run ssh: No such file or directory
fatal: unable to fork
error: cannot run ssh: No such file or directory
fatal: unable to fork
Unable to checkout 2bf158ea22deb09c0da06783d51ad6651f83f9b0 from [email protected]:dejakaymac/QuxPrivate.jl.git.
error: builder for '/nix/store/gz6vli90d63pcv8x029lw4nd5wdp5nq4-package-QuxPrivate.drv' failed with exit code 1;
       last 9 log lines:
       > exporting [email protected]:dejakaymac/QuxPrivate.jl.git (rev 2bf158ea22deb09c0da06783d51ad6651f83f9b0) into /nix/store/ci5gpc6736l0674h163p7cvng1f1b0x9-package-QuxPrivate
       > Initialized empty Git repository in /nix/store/ci5gpc6736l0674h163p7cvng1f1b0x9-package-QuxPrivate/.git/
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > Unable to checkout 2bf158ea22deb09c0da06783d51ad6651f83f9b0 from [email protected]:dejakaymac/QuxPrivate.jl.git.
       For full logs, run 'nix log /nix/store/gz6vli90d63pcv8x029lw4nd5wdp5nq4-package-QuxPrivate.drv'.


┌ Error: Fetcher failed: nix-prefetch pkgs.fetchgit --hash-algo sha256 --output raw --name package-QuxPrivate --rev 2bf158ea22deb09c0da06783d51ad6651f83f9b0 --url [email protected]:dejakaymac/QuxPrivate.jl.git
│ failed process: Process(`nix-prefetch '    { nixpkgs ? <nixpkgs> }:
│     let pkgs = import nixpkgs { };
│     in with pkgs; pkgs.fetchgit
│ ' --hash-algo sha256 --output raw --name package-QuxPrivate --rev 2bf158ea22deb09c0da06783d51ad6651f83f9b0 --url [email protected]:dejakaymac/QuxPrivate.jl.git`, ProcessExited(1)) [1]
│
│ Stacktrace:
│  [1] select_fetcher(fetchers::Vector{Julia2Nix.JuNix.Fetcher}, opts::Julia2Nix.JuNix.Options)
│    @ Julia2Nix.JuNix /nix/store/z1x616mawlfjsljxsmbl16nc7jrhwwnq-incl/src/JuNix/fetch.jl:219
│  [2] macro expansion
│    @ /nix/store/z1x616mawlfjsljxsmbl16nc7jrhwwnq-incl/src/JuNix/fetch.jl:170 [inlined]
│  [3] (::Julia2Nix.JuNix.var"#12#14"{Julia2Nix.JuNix.Options, Channel{Tuple{Julia2Nix.JuNix.PackageInfo, Union{Nothing, Julia2Nix.JuNix.Fetcher}}}, Channel{Tuple{Julia2Nix.JuNix.PackageInfo, Vector{Julia2Nix.JuNix.Fetcher}}}})()
│    @ Julia2Nix.JuNix ./task.jl:484
└ @ Julia2Nix.JuNix /nix/store/z1x616mawlfjsljxsmbl16nc7jrhwwnq-incl/src/JuNix/fetch.jl:220

I think I need to communicate my credentials to julia2nix but am not sure how to do so.

Attribution

Howdy! I thought I was experiencing Deja Vu when I ran across this repo. No worries about copying colinxs/NixSourcerer.jl -- I'm glad someone's using it -- but would you mind including a brief attribution in the README and the license? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.