Cardano and Nix Package manager


#1

I am new to Haskell and Nix. Can someone explain where Nix seats and what role it plays ? I can’t get my head around it.

I managed to compile the node CLI using Nix but I still can’t fully understand what is going on ?

Thanks


#2

Main work by building cardano-sl will be done by stack.
Stack is a powerful tool for developing and management of Haskell projects.
nix is a package manager, which could be integrated in stack. For instance NisOS is a Linux distribution based on nix.

See also Nix integration for stack.


#3

@p-alik I am using https://github.com/input-output-hk/cardano-sl/blob/develop/scripts/build/cardano-sl.sh to build cardano-sl. It complete the build after 30 mins but I don’t know where its creating the assemblies. where does Stack spit out those assemblies ?


#4

They are in .stack-work directories.

$ find . -maxdepth 2 -name ".stack-work" 
./node/.stack-work
./infra/.stack-work
./delegation/.stack-work
./explorer/.stack-work
./godtossing/.stack-work
./.stack-work
./client/.stack-work
./update/.stack-work
./tools/.stack-work
./auxx/.stack-work
./generator/.stack-work
./networking/.stack-work
./crypto/.stack-work
./util/.stack-work
./wallet/.stack-work
./lib/.stack-work
./txp/.stack-work
./block/.stack-work
./ssc/.stack-work
./db/.stack-work
./wallet-new/.stack-work
./core/.stack-work
./lrc/.stack-work
./binary/.stack-work

For instance node/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/cardano-node-simple/cardano-node-simple is the part of cardano-node-simple in my environment.


#5

@p-alik thanks very much. I found those assemblies. It is starting to make sense now.