# enable experimental features
mkdir -p ~/.config/nix
cat <<EOF > ~/.config/nix/nix.conf
experimental-features = flakes nix-command
EOF
# install nix package manager (assume done)You can provide custom user variables when running task commands:
# For NixOS systems
task nixos:switch NAME=moon USER="myuser" USER_NAME="My Full Name"
# For Home Manager
task home:switch NAME=mac USER="myuser" USER_NAME="My Full Name"If not provided, defaults to USER=roku and USER_NAME="Roman Kuznetsov".
# Using task (recommended)
task nixos:switch NAME=devos
task home:switch NAME=devos
# Or manually
sudo nixos-rebuild switch --flake github:kuznero/dotfiles#devos --impure
nix run home/master -- switch --flake github:kuznero/dotfiles#devos# Using task (recommended)
task nixos:switch NAME=moon
task home:switch NAME=moon
# Or manually
sudo nixos-rebuild switch --flake github:kuznero/dotfiles#moon --impure
nix run home/master -- switch --flake github:kuznero/dotfiles#moon# Using task (recommended)
task nixos:switch NAME=sun
# Or manually
sudo nixos-rebuild switch --flake github:kuznero/dotfiles#sun --impure# Using task (recommended)
task home:switch NAME=mac
# Or manually
nix run home/master -- switch --flake github:kuznero/dotfiles#macTo list all linux distributions currently installed, run the following PowerShell:
wsl -l -vFollowing installation instructions on how to install NixOS on WSL2.
Make sure to update custom CA certificate according to your company settings.
cat <<EOF | sudo tee /etc/pki/tls/certs/ca-zscaler.crt
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
EOF
# add default CA certificates info new file
cat /etc/ssl/certs/ca-certificates.crt | \
sudo tee --append /etc/pki/tls/certs/ca-zscaler.crtThen, change /etc/nixos/configuration.nix file and ensure it has this line:
security.pki.certificateFiles = [ /etc/pki/tls/certs/ca-zscaler.crt ];
environment.variables = {
"NIX_SSL_CERT_FILE" = "/etc/pki/tls/certs/ca-zscaler.crt";
};
security.sudo.extraConfig = ''
Defaults env_keep += "NIX_SSL_CERT_FILE"
'';You might also want to change default user name by changing
wsl.defaultUserin/etc/nixos/configuration.nixfile.
run sudo -E NIX_SSL_CERT_FILE=/etc/pki/tls/certs/ca-zscaler.crt nixos-rebuild switch command. It will produce some warnings in the begining, but if the
certificate is correct, it will complete the rebuild.
sudo nix-channel --updateAfter the above is done, and corporate proxy is well configured, proceed to the following:
# Using task (recommended)
task nixos:switch NAME=wsl
task home:switch NAME=wsl
# Or manually
sudo nixos-rebuild switch --flake github:kuznero/dotfiles#wsl --impure
nix run home/master -- switch --flake github:kuznero/dotfiles#wsl