-
Notifications
You must be signed in to change notification settings - Fork 3
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
Nix, package manager migration. Defaults to nixpkgs as specified at nix
installation.
#20
base: main
Are you sure you want to change the base?
Conversation
Nix is a package manager --such as apt-- based on nix, a functional programming language. We can use nix to declare global dependencies of this project -- such as pnpm and biome --; as well as project-specific. The main reason I'm looking to use nix in this repo is I'll be able to make reproducible development environtments, declare and pin dependencies, to ensure a local-first CI pipeline. We can even containerized such workflow, allowing is to deploy, almost, everywhere. This is the first step of our nix integration. In this commit, there's a `shell.nix` file that deploys our development environtment. It currently pins to nixpkgs repository that you configured when you installed NixOS or Nix. This file was generated using `lorri` (https://github.com/nix-community/lorri/) and we intend to deploy the next toolkit: lorri, for shell.nix and related files management, direnv, for automatic integration to shell.nix -- and .envrc / .env -- npins, to pin specific dependency, a-la package-lock.json
If the user hasn't configure a nix-channel yet, `nix-shell` invocation won't work for it expectas a <nixpkgs> channel -- that the user hasn't configured!-- This fixes that.
Hi, @IvanM9!, thank you for your input. The problem is At cf4d5f8, I tagged the lastes stable release at nix-shell, now this should work as expected. Sure, this can be fixed at user side, adding channels using Let me know if this helps you!, |
This is a great resource on how to install nix in imperative distribution: https://nix-community.github.io/nix-installers/ It supports deb, pacman and rpm. We should consider writing a script for this to be setup. |
mkShellNoCC is a variant that doesn't ships a C compiler. Also, remove bashInteractive as dependency. This changes provide us a leaner development environtment.
Yes, that may be a problem with Debian installation.
As soon as I get to office, I'll troubleshoot it back.
Can you access to `biome` and related development tools?
Thank you!,
Brayen
El mar., 10 de diciembre de 2024 11:15 p. m., Iván Manzaba <
***@***.***> escribió:
… Works, but still sometimes there are problems with the daemon :(
Screenshot.from.2024-12-10.21-12-44.png (view on web)
<https://github.com/user-attachments/assets/cb63668c-dacc-458c-813f-92cfdc4e043d>
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3YSTNCRXLPAJM7MSIYXQOL2E6N4VAVCNFSM6AAAAABTKE4MUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZTGQ3DMOBVHE>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Yes, works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bjgavilanes
Please include instructions on what to do when there is a problem with the nix daemon.
Hello!,
On Wed Dec 11, 2024 at 2:08 PM -03, Iván Manzaba wrote:
@IvanM9 approved this pull request.
On README.md:
Hi @bjgavilanes
Please include instructions on what to do when there is a problem with the nix daemon.
Sure. I'll troubleshoot it first; but, yes. As soon as I get into office, I'll push a commit.
|
I haven't troubleshot problem in debian installation -- I know Arch Linux and Void Linux repo install do okay, I've done it -- I'll update README and point out potential problems / solutions. And I don't like it, but I'll make more obvious that upstream install -- a curl into sh pipe X.X -- would be best bet for anyone not having native package manager support for nix. I have thunk deeply about this. I'll dockerize -- throught podman! -- nix workflow, for best compatibility... But that'll get done in another PR. |
I'm using distrobox to troubleshoot debian nix problem. I haven't been able to reproduce problem with (ins)📦[bjgavilanes@debian www]$ nix-shell
unpacking 'https://github.com/NixOS/nixpkgs/tarball/nixos-24.11' into the Git cache...
these 44 paths will be fetched (49.76 MiB download, 235.27 MiB unpacked):
/nix/store/nrl5m466dwdscvavf1nqzdnqhszjyy9n-acl-2.3.2
/nix/store/nmq6s9l9zlym3qjx76zzrqbp05a63y90-attr-2.5.2
/nix/store/p6k7xp1lsfmbdd731mlglrdj2d66mr82-bash-5.2p37
/nix/store/2bpqfzq78d0li8hn21flnpydnmkngw3k-biome-1.9.4
/nix/store/hl3iw85v12gh9mwgvr9yfgjgy0rk81hb-bzip2-1.0.8 Altought, reading 489 sudo apt-get update
# (...)
495 sudo apt install nix-setup-systemd That I did and For the record, I'm testing in debian-unstable distrobox list
ID | NAME | STATUS | IMAGE
6c613be53703 | debian | Up 35 minutes | docker.io/library/debian:unstable Using distrobox distrobox --version
distrobox: 1.8.0 |
So, I remove (ins)📦[bjgavilanes@debian ~]$ sudo apt remove nix-setup-systemd
The following packages were automatically installed and are no longer required:
bash-static libdbi-perl
libarchive13t64 liblowdown1
libboost-context1.83.0 libsodium23
libcpuid17 libwww-curl-perl
libdbd-sqlite3-perl nix-bin
Use 'sudo apt autoremove' to remove them.
REMOVING:
nix-setup-systemd
Summary:
Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 5
Freed space: 36.9 kB
Continue? [Y/n]
(ins)📦[bjgavilanes@debian ~]$ sudo apt autoremove
REMOVING:
bash-static libboost-context1.83.0 libdbd-sqlite3-perl liblowdown1 libwww-curl-perl
libarchive13t64 libcpuid17 libdbi-perl libsodium23
# (...) And then perform I began to think that maybe it did work because distrobox was communicating with my host-machine's ● nix-daemon.service - Nix Daemon
Loaded: loaded (/etc/systemd/system/nix-daemon.service; linked; preset: ignored)
Drop-In: /nix/store/qxahi9pkgfdanxj2bfswvn44cx9wk21v-system-units/nix-daemon.service.d
└─overrides.conf
Active: active (running) since Wed 2024-12-25 03:03:13 -03; 1 day 19h ago
Invocation: 276ff05ef67b4ef7b77d94f1b9c202a6
TriggeredBy: ● nix-daemon.socket
Docs: man:nix-daemon
https://nixos.org/manual
Main PID: 1726 (nix-daemon)
IP: 330.3M in, 4.1M out
IO: 358M read, 1.7G written
Tasks: 2 (limit: 1048576)
Memory: 607.9M (peak: 870.2M swap: 3.4M swap peak: 3.5M)
CPU: 2min 5.834s
CGroup: /system.slice/nix-daemon.service
└─1726 nix-daemon --daemon
Dec 26 15:04:41 natja nix-daemon[1726]: accepted connection from pid 130001
# (...)
Dec 26 22:42:18 natja nix-daemon[1726]: accepted connection from pid 190377, user bjgavilanes (trusted) As last resource, I can troubleshoot in a Debian VM... However, I would advise to reinstall nix. Preferably, using upstream method IF local package manager installation still doesn't work. |
According to this thread you can fix problem with nix-daemon.socket by adding your user to the |
Still having problems :( |
On Mon Dec 30, 2024 at 2:14 PM -03, Iván Manzaba wrote:
Still having problems :(
I tried again on Arch and Debian
Thank you for your assistance. I'll troubleshoot in a VM ASAP.
I'll continue development for our tooling at #21 PR. I'll update README to globally install `biome` and `dprint`. Also, I'll began a `make` scheme from that PR.
Thanks!,
Brayen
|
The main reason about this migration is explained at 7891ace. It resumes to point out we need a way to provide a stable/maintained development environtment. In that commit, too, explains a tentative roadmap, if this PR gets merge.
At commit 52b06c8, added nix-related information to the README.md
Commits 7b10016 and aa022ad are the formatter and linting process. I would like to point out that biome has partial support to HTML and supersets, but that can be easily fix using dprint, a rust-based formatter with integrations; so we use biome just as linter.
Linter, formatter, and related tools will get managed in their own PR.
Setting up a task runner -- I'm debating wether to use
make
, as God intented, orjust
a rust-based make-inspired alternative, as the young lads out there do.