mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2025-12-28 09:15:03 +08:00
34 lines
677 B
Text
34 lines
677 B
Text
= Access a non-flake package (not in nixpkgs)
|
|
|
|
////
|
|
$ mkdir tempwork
|
|
$ cd tempwork
|
|
$ cp ../flake.nix flake.nix
|
|
$ git add flake.nix
|
|
$ nix develop
|
|
$ git add flake.lock
|
|
$ git commit -a -m temp
|
|
////
|
|
|
|
In this example, we will use a nix package defined in a remote git repo.
|
|
However, you can use any of the flake reference styles defined in <<#flakeref>>.
|
|
|
|
[source,nix,linenums,highlight='5..7,17..20']
|
|
.flake.nix
|
|
....
|
|
$# cat flake.nix
|
|
....
|
|
|
|
Here's a demonstration using the shell.
|
|
|
|
....
|
|
$ hello-nix # this will fail
|
|
$# ../../../../../start-shell nix develop <<EOL
|
|
$ hello-nix
|
|
$# EOL
|
|
....
|
|
|
|
////
|
|
Good adoc0 scripts clean up after themselves.
|
|
$ cd .. ; rm -rf tempwork # clean up
|
|
////
|