Clone this Repo and replace /etc/nixos/configuration.nix with a symlink to the configuration in this repo.
git clone [email protected]:elberfeld/nixos.git
ln -s /home/{username}/{git path}/{configfile}.nix /etc/nixos/configuration.nix
nix-channel --remove nixos
nix-channel --add https://nixos.org/channels/nixos-unstable nixos
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
The folowing extensions in configuration.nix are needed
services.yubikey-agent.enable = true;
-
Insatllation Guide: https://nix-community.github.io/NixOS-WSL/install.html
-
Use this command for import (Windows CMD), so the VHD is stored in
%USERPROFILE%\NixOS\
wsl --import NixOS %USERPROFILE%\NixOS\ %USERPROFILE%\Downloads\nixos-wsl.tar.gz --version 2
-
Confugure and Update Nix-Channels
-
Switch the defult user in configuration.nix and run
nixos-rebuild boot
(do not use switch!)
wsl.defaultUser = "chris";
environment.systemPackages = with pkgs; [
git
nano
socat
wget
];
users.users.chris = {
isNormalUser = true;
initialPassword = "Pass@word1+";
extraGroups = [
"networkmanager"
"wheel"
];
};
- Force WSL to shotdown and relogin
wsl --shutdown
- Manually load SSH Key from wincryptsshagent in windows and clone git Repo
export SSH_AUTH_SOCK=/tmp/wincrypt-hv.sock
ss -lnx | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0 ]; then
rm -f $SSH_AUTH_SOCK
(setsid nohup socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork SOCKET-CONNECT:40:0:x0000x33332222x02000000x00000000 >/dev/null 2>&1)
fi
ssh-add -l