mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-05-14 08:01:12 +08:00
temp
This commit is contained in:
parent
a23029eb15
commit
00bfdf2c0f
12 changed files with 161 additions and 140 deletions
|
|
@ -70,7 +70,7 @@ Let's enter a shell with the Glasgow Haskell Compiler ("ghc") and try to run the
|
|||
....
|
||||
$# echo '$ nix shell nixpkgs#ghc'
|
||||
$# nix shell nixpkgs#ghc --command sh
|
||||
$ runghc Main.hs
|
||||
$ runghc Main.hs # Won't work
|
||||
....
|
||||
|
||||
The error message tells us that we need the module `Network.HostName`.
|
||||
|
|
@ -81,7 +81,7 @@ Let's exit that shell and try again, this time adding the `hostname` package.
|
|||
$# echo '$ exit'
|
||||
$# echo '$ nix shell nixpkgs#ghc nixpkgs#hostname'
|
||||
$# nix shell nixpkgs#ghc nixpkgs#hostname --command sh
|
||||
$ runghc Main.hs
|
||||
$ runghc Main.hs # Won't work
|
||||
....
|
||||
|
||||
That reason that failed is that we asked for the wrong package.
|
||||
|
|
@ -95,7 +95,7 @@ Let's try that again, with the correct package.
|
|||
$# echo '$ exit'
|
||||
$# echo '$ nix shell nixpkgs#ghc nixpkgs#haskellPackages.hostname'
|
||||
$# nix shell nixpkgs#ghc nixpkgs#haskellPackages.hostname --command sh
|
||||
$ runghc Main.hs
|
||||
$ runghc Main.hs # Won't work
|
||||
....
|
||||
|
||||
Now what's wrong?
|
||||
|
|
@ -121,10 +121,6 @@ $ runghc Main.hs
|
|||
|
||||
Success! Now we know the program works.
|
||||
|
||||
....
|
||||
$# echo '$ exit'
|
||||
....
|
||||
|
||||
== The cabal file
|
||||
|
||||
It's time to write a Cabal file for this program.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue