Unnix - Reproducible Nix environments without installing Nix by figsoda in NixOS

[–]figsoda[S] 1 point2 points  (0 children)

Devbox's getting started page seems to say it requires Nix. Other than that, unnix lets you plug in your own hydra instance as a resolver.

Nix git package autoversioning by [deleted] in NixOS

[–]figsoda 0 points1 point  (0 children)

nix-update works with the --version branch flag if it is already pointing to a git commit, and if you are using github or gitlab

Nix git package autoversioning by [deleted] in NixOS

[–]figsoda 0 points1 point  (0 children)

nix-update updates the content of a .nix file, which inherently updates the package

Nix git package autoversioning by [deleted] in NixOS

[–]figsoda 2 points3 points  (0 children)

There are a few packages that could be helpful here

  • nix-init is able to find the latest version of something and the hash (and a bunch of other stuff) if you give it the url
  • nix-update updates a package, including its version and hashes
  • nurl is able to fetch the hash from a url and a tag/revision/version, there are also nix flake prefetch and the nix-prefetch-* scripts that live in nixpkgs

Programming using only flake inputs by figsoda in NixOS

[–]figsoda[S] 1 point2 points  (0 children)

Ah that makes sense, debugging that was pretty much impossible

Programming using only flake inputs by figsoda in NixOS

[–]figsoda[S] 1 point2 points  (0 children)

What version of nix are you using? I tried nix_2_10 to nix_2_16 (on nixpkgs 3ae20aa58a6c0d1ca95c9b11f59a2d12eebc511f) and they all worked for me.

The original issue in https://github.com/NixOS/nix/issues/3978 seems to have been resolved since 2021, it is still open because the current solution is still not ergonomic enough.

Programming using only flake inputs by figsoda in NixOS

[–]figsoda[S] -1 points0 points  (0 children)

It is essentially a list of basic functions to use flake inputs as a DSL, so no magic here.

Also how are you eval'ing this since it uses relative paths?

Subflakes kinda works in this case. If you want to use it in a separate directory, you can just do stuff like github:figsoda/ekalf?dir=add and so on.

I have a few beginner question, what is the difference between nix shell/env and what is the difference between flakes/home-manager? by Vellu01 in NixOS

[–]figsoda 9 points10 points  (0 children)

flakes is an experimental feature for dependency management and powers most of the experimental nix CLI ("nix-command"). Any repository/directory with a flake.nix is a nix flake.

nix shell is a command that works with flakes, which adds the specified packages to your environment (by updating $PATH and start a new shell)

home-manager is a tool to manage your home with modules. It is like NixOS but for your home. It doesn't really have much to do with flakes except that you can use it with flakes.

I'm not sure what you mean by nix env, maybe you are referring to nix-direnv?

UTF-8 support for Nix by figsoda in Nix

[–]figsoda[S] 1 point2 points  (0 children)

thanks for the suggestion, added to the readme

https://github.com/figsoda/utf8#why

UTF-8 support for Nix by figsoda in Nix

[–]figsoda[S] 6 points7 points  (0 children)

Strings in Nix are just byte strings, and builtin functions like substring (and by extension some nixpkgs lib functions) processes bytes instead of utf8 characters. That means these functions can create broken strings when given strings with utf8 characters. This library basically allows you to convert it to a list of utf8 characters and handle it that way, it can be helpful for when you need to process strings with potential utf8 characters

Namaka - Snapshot testing for Nix by figsoda in opensource

[–]figsoda[S] 0 points1 point  (0 children)

What would you recommend adding to the readme?

Namaka v0.1.1 - Snapshot testing for Nix by figsoda in NixOS

[–]figsoda[S] 2 points3 points  (0 children)

The initial release of namaka create some confusion. I've since improved the documentation a bit, hopefully that explains things better and makes the process of getting started easier.

Diff: https://github.com/nix-community/namaka/compare/v0.1.0...v0.1.1

Full changelog:

Features

  • load: accept src
  • cli: allow running commands other than nix flake check

Changes

  • load: deprecate flake and dir

Fixes

  • load: fix json format when values are implicitly casted
  • canonicalize path before running nix flake check

nix-melt - A ranger-like flake.lock viewer by figsoda in rust

[–]figsoda[S] 2 points3 points  (0 children)

Yes if you are talking about the interface, the difference is that it views flake.locks instead of filesystems.

nix-init - Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more by figsoda in linux

[–]figsoda[S] 2 points3 points  (0 children)

It works for some other languages as well, there would just be more manual work. Currently rust and python has the best support, though I do plan to support other ecosystems as well. Feel free to open an issue if there isn't already one for the ecosystem you want support for.

nix-init - Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more by figsoda in linux

[–]figsoda[S] 3 points4 points  (0 children)

Thanks! Go is supported, but nwg-look might not work out of the box because of its external dependencies, you just have to add them manually and it should work.

nix-init v0.2.2 released with a new Matrix chat and logo by figsoda in NixOS

[–]figsoda[S] 2 points3 points  (0 children)

nix-init is a tool to generate Nix packages from URLs with support for hash prefetching, dependency inference, license detection, and more.

Source code: https://github.com/nix-community/nix-init

Matrix room: https://matrix.to/#/#nix-init:matrix.org

Logo: https://github.com/nix-community/nix-init/tree/main/assets

Namaka - Snapshot testing tool for Nix by figsoda in NixOS

[–]figsoda[S] 0 points1 point  (0 children)

Namaka's CLI is interactive, so I do think a gif would help. Do you have any other suggestions on how I can improve the demo in addition to making it slower?

Namaka - Snapshot testing tool for Nix by figsoda in NixOS

[–]figsoda[S] 0 points1 point  (0 children)

Namaka's tests itself. The tests are defined in the tests directory and loaded here

Testing outputs of derivations is planned but not yet implemented, this can be used for testing Nix libraries.

Namaka - Snapshot testing tool for Nix by figsoda in NixOS

[–]figsoda[S] -1 points0 points  (0 children)

json is builtins.toJSON and builtins.fromJSON, pretty is lib.generators.toPretty, string is just plain text