Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/infinisil/nix-quote-urls

Utility against unquoted Nix URIs
https://github.com/infinisil/nix-quote-urls

nix uri

Last synced: about 2 months ago
JSON representation

Utility against unquoted Nix URIs

Awesome Lists containing this project

README

        

* nix-quote-urls

This is a simple program to quote all URLs in Nix files, written for [[https://github.com/NixOS/rfcs/pull/45][RFC45]]. It uses [[https://github.com/haskell-nix/hnix][hnix]] to parse the files. It can verify/fixup all of nixpkgs in ~25 seconds on my machine.

#+BEGIN_SRC source
nix-quote-urls - a helper against unquoted Nix urls

Usage: nix-quote-urls COMMAND
Verify or fixup unquoted URLs in PATH

Available options:
-h,--help Show this help text

Available commands:
fixup Fixup files/directories by quoting all urls
verify Verify files/directories to not have any unquoted
urls
#+END_SRC

#+BEGIN_SRC bash
$ cat test.nix
{ foo = https://example.com; }
$ alias nix-quote-urls="$(nix-build --no-out-link \
https://github.com/infinisil/nix-quote-urls/tarball/master)/bin/nix-quote-urls"
$ nix-quote-urls fixup test.nix
Processing file test.nix
Inserting quotes on line 0 at columns 8, 27
$ cat test.nix
{ foo = "https://example.com"; }
#+END_SRC