~sircmpwn/sr.ht-discuss

1

Support for sourcehut nix flakes added in Nix 2.7

Details
Message ID
<20220312171657.a3dyqixcup7jiptc@atlas>
DKIM signature
pass
Download raw message
Hey folks!

To any Nix users around who might be interested, support for `sourcehut` 
flakes has been introduced (by yours truly) with the 2.7 version (now 
available on nixos-unstable).

You can use the easier to remember (and more bandwidth efficient) type 
for referring to flakes hosted on `git.sr.ht` (or any other sourcehut 
git/hg instance, just specify a `host` attribute). Works both on the Nix 
commands and as inputs on other flakes.

For example, building a flake package from a git.sr.ht repo:
`nix build sourcehut:~misterio/misterio.me`

Or, when using a git.sr.ht repo as a flake input:
```nix
{
   inputs = {
     nix-colors.url = "sourcehut:~misterio/nix-colors"
   };
}
```

For reference, these previously had to be written like so:
`git+https://git.sr.ht/~misterio/nix-colors?ref=main`

Some docs about it:
https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#:~:text=sourcehut


Cheers!

-- 
Gabriel Fontes

https://misterio.me
PGP: 7088 C742 1873 E0DB 97FF 17C2 245C AB70 B4C2 25E9

Re: Support for sourcehut nix flakes added in Nix 2.7

Details
Message ID
<DD390BB6-0FAF-4FA2-8D8F-72E000404CEA@mkaito.net>
In-Reply-To
<20220312171657.a3dyqixcup7jiptc@atlas> (view parent)
DKIM signature
pass
Download raw message
El 12 de marzo de 2022 17:16:57 UTC, Gabriel Fontes <eu@misterio.me> escribió:
>Hey folks!
>
>To any Nix users around who might be interested, support for `sourcehut` 
>flakes has been introduced (by yours truly) with the 2.7 version (now 
>available on nixos-unstable).
>
>You can use the easier to remember (and more bandwidth efficient) type 
>for referring to flakes hosted on `git.sr.ht` (or any other sourcehut 
>git/hg instance, just specify a `host` attribute). Works both on the Nix 
>commands and as inputs on other flakes.
>
>For example, building a flake package from a git.sr.ht repo:
>`nix build sourcehut:~misterio/misterio.me`
>
>Or, when using a git.sr.ht repo as a flake input:
>```nix
>{
>   inputs = {
>     nix-colors.url = "sourcehut:~misterio/nix-colors"
>   };
>}
>```
>
>For reference, these previously had to be written like so:
>`git+https://git.sr.ht/~misterio/nix-colors?ref=main`
>
>Some docs about it:
>https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#:~:text=sourcehut
>
>
>Cheers!
>

Nice work, Gabriel. I'll definitely make use of this.
-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi brevedad.
Reply to thread Export thread (mbox)