-- Leo's gemini proxy

-- Connecting to perso.pw:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;

How to hack on Nix and try your changes


Author: Solène

Date: 19 August 2022

Tags: nix development nixos


Comment on Mastodon


Introduction


Not obvious development process is hard to document. I wanted to make changes to the nix program, but I didn't know how to try them.


Fortunately, a coworker explained to me the process, and here it is!


The nix project GitHub page


Get the sources and compile


First, you need to get the sources of the project, and compile it in some way to run it from the project directory:


git clone https://github.com/NixOS/nix/
cd nix
nix-shell
./bootstrap.sh
./configure --prefix=$PWD
make

Run the nix daemon


In order to try nix, we need to stop nix-daemon.service, but also stop nix-daemon.socket to prevent it to restart the nix-daemon.


systemctl stop nix-daemon.socket
systemctl stop nix-daemon.service

Now, when you want your nix-daemon to work, just run this command from the project directory:


sudo bin/nix --extra-experimental-features nix-command daemon

Note this command doesn't fork on background.


If you need some settings in the nix.conf file, you have to create etc/nix/nix.conf relative to the project directory.


Restart the nix-daemon


Once you are done with the development, exit your running daemon and restart the service and socket.


systemctl start nix-daemon.socket
systemctl start nix-daemon.service

-- Response ended

-- Page fetched on Sun May 5 20:58:09 2024