claymager / idris2-pkgs Goto Github PK
View Code? Open in Web Editor NEWAn unofficial Idris2 package repository for Nix
License: MIT License
An unofficial Idris2 package repository for Nix
License: MIT License
idris2-dom
was added in #8. I added depends = dom
in the .pkg file, but idris is unable to locate the JS
module from that package:
idris2 -o main.js src/Main.idr --cg javascript
Error: Module JS not found
src.Main:3:1--3:10
1 | module Main
2 |
3 | import JS
^^^^^^^^^
Error: Undefined name unsafePerformIO.
(Interactive):1:1--1:1
1 | module Main
To reproduce, run nix develop -c make idrisid
in this tree: srid/idris-web-playground@eb279f0
I'm very new to nix flakes and I'm struggling to find out how I might have a shell where idris2-lsp is available for my IDE.
When I try to install lsp while idris2 is installed (I tried both github:idris-lang/Idris2
and github:claymager/idris2-pkgs#idris2
) or vice-versa, I get the following error:
$ nix profile install github:claymager/idris2-pkgs#lsp
error: packages '/nix/store/k3sjar5qg6gyxmyawc1f06si32swwwan-lsp-0.4.0/idris2-0.5.1/prelude-0.5.1/Builtin.ttc' and '/nix/store/ha29cylxibyspmhlsdgvw6293vma2cb2-idris2-0.5.1/idris2-0.5.1/prelude-0.5.1/Builtin.ttc' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
I tried running nix-env --set-flag
but it says the profile is incompatible with nix-env
and nix profile --set-flag
doesn't exist.
$ nix develop
MacBook-Pro:IdrisNixTest michaelmesser$ idris2 --build mypkg.ipkg
1/1: Building Main (src/Main.idr)
Error: Error in TTC
file: TTC data is in an newer format, file: /Users/michaelmesser/.idris2/idris2-0.5.1/prelude-0.5.1/Prelude.ttc, expected version: 71, actual version: 2022041300 (the most likely case is that the ./build directory in your current project contains files from a previous build of idris2 or the idris2 executable is from a different build than the installed .ttc files)
Since buildIdris
is now exposed to consumer flakes, it must be possible to add custom packages to a project (via an overlay (?)), that are then callable in a TOML file. To be completely honest, I'm not exactly certain the steps to do so, but here's exactly what I'd like to do:
# myproject/other-packages/some-package.toml
name = "some-package"
[ source ]
# etc...
# myproject/myproject.toml
[ depends ]
idrisLibs = [ "some-package" ]
# myproject/flake.nix
# ???
Am I overthinking this?
Hi,
https://github.com/stefan-hoeck/idris2-dom is a link to the repository. I see there are already some Stefan Hoeck packages packaged here, so I imagine it won't be too challenging :)
I am nowhere near an expert in Idris (and hence in packaging Idris packages, for that matter), which is why I'm opening an issue instead of a PR.
From the documentation, I understand that this is a base template:
name = "idris2-dom"
version = "0.1.0"
[ source ]
owner = "stefan-hoeck"
repo = "idris2-dom"
rev = "v0.1.0"
# sha256 = ""
However... Should a target
be set? I'm not sure if a target is set here or not, and more importantly, I have no clue where to start looking to find out :)
Having this package would mean a lot to me, thanks!
The x86 version of Idris2 in nixpkgs is working, so we could use that in theory instead of doing native support. It would be great if the 'nix flake new' generated project worked seamlessly with it. Currently:
❯ nix flake new -t github:claymager/idris2-pkgs mypkg
...
❯ nix develop
warning: creating lock file '/private/tmp/mypkg/flake.lock'
error: flake 'path:/private/tmp/mypkg' does not provide attribute 'devShells.aarch64-darwin.devShell.aarch64-darwin', 'packages.aarch64-darwin.devShell.aarch64-darwin', 'legacyPackages.aarch64-darwin.devShell.aarch64-darwin', 'devShell.aarch64-darwin' or 'defaultPackage.aarch64-darwin'
and
❯ nix --system x86_64-darwin develop
error: a 'x86_64-darwin' with features {} is required to build '/nix/store/k174flg06xlgpmf8x0s2d7rfi2dd2ykn-idris2-0.5.1.drv', but I am a 'aarch64-darwin' with features {benchmark, big-parallel, nixos-test, recursive-nix}
(use '--show-trace' to show detailed location information)
Following the Idris2 backend tutorial, running
$ ./build/exec/lazy-idris2
fails with error:
Uncaught error: Error: Module Prelude not found
This is because the executable new executable expects to find them in the standard prefix ~/.idris2
. (Or should, if idris2api
is patched correctly.)
As a dirty hack, you can cp $(which idris2)
into your build directory, and fix change the second code line to point to lazy-idris2 instead of the nix store .idris2-wrapped_
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.