Personal dotfiles that can be placed in the public repository
Also known as ηζ ½(bonsai) π³
block-beta
columns 3
block:os:3
nixos(("β")) macos(("π")) windows(("πͺ"))
end
block:vm:3
lima("Lima") wsl2("WSL2")
end
block:container:3
podman("π¦") k8s("βΈοΈ")
end
nixos --> lima
macos --> lima
windows --> wsl2
vm --> container
nixos --> container
If you are using Podman, you can test the pre-built ubuntu container-image as follows.
bash <(curl -fsSL https://raw.githubusercontent.com/kachick/dotfiles/main/containers/sandbox-with-ghcr.bash) latestOr, you can directly use some commands with nix run without any installation steps.
nix run 'github:kachick/dotfiles#todo'List them
nix flake show 'github:kachick/dotfiles' --json 2>/dev/null | jq '.packages | ."x86_64-linux" | to_entries | map("\(.key) # \(.value.description)")'List defined hostnames
nix eval --json 'github:kachick/dotfiles#nixosConfigurations' --apply 'builtins.attrNames' | jq '.[]'Using flake style is disabled in NixOS by default and you should inject git command to use flakes.
NOTICE: This command might drop all existing users except which defined in configurations.
nix --extra-experimental-features 'nix-command flakes' shell 'github:NixOS/nixpkgs/nixos-25.11#gitMinimal' \
--command sudo nixos-rebuild switch \
--flake "github:kachick/dotfiles#$(hostname)" \
--show-traceFinally, reboot the device
sudo reboot nowRefer to the sample flake for an example of inheriting modules from another repository.
List definitions
nix eval --json 'github:kachick/dotfiles#homeConfigurations' --apply 'builtins.attrNames' | jq '.[]'-
Install and configure Nix:
curl -fsSL https://raw.githubusercontent.com/kachick/dotfiles/main/scripts/install-nix.bash | bash -
If you forgot something adding in the installation phase, manually add it.
Some config needs rebooting to apply it such astrusted-users. -
Make sure there is a nix directory that is used in the home-manager.
This is a workaround, See the thread for detailmkdir -p ~/.local/state/nix/profiles -
Restart current shell to load Nix as a PATH
bash
-
Apply dotfiles
nix run 'github:kachick/dotfiles#home-manager' -- switch -b backup --flake 'github:kachick/dotfiles#wsl-ubuntu'
-
Apply system level dotfiles with sudo for nix command
sudoc nix run 'github:kachick/dotfiles#apply-system' -
Enable tailscale ssh if required
sudoc tailscale up --ssh
-
Install uidmap without Nix for use of podman even if the podman will be installed from nixpkgs
- "shadow" in nixpkg is not enough for podman - NixOS/nixpkgs#138423
sudo apt-get install --assume-yes uidmap
-
Make sure the cgroup v1 is disabled if you on WSL, See the docs
-
Make sure you can run containers as
podman run public.ecr.aws/debian/debian:stable-slim cat /etc/os-release
After installing missing tools, you can complete same steps as Ubuntu
sudo apt update
sudo apt upgrade
sudo apt install --assume-yes curl
sudo apt install --assume-yes dbus-user-session # For podmanRemember to set special config and reboot if you on WSL
echo '
[boot]
systemd=true' | sudo tee /etc/wsl.conf- Install WSL2 with default Ubuntu. Activate home-manager as
kachick@wsl-ubuntu - Install NixOS-WSL. Activate home-manager with
$(whoami)@wsl-nixos - Adjust Windows experience as written in extracted steps and as written in CI for further detail.
Check traps
Use winboat.
The full-desktop feature is powered-by FreeRDP.
You can exit the full-screen RDP session with Ctrl + Alt + Enter. (Not the End or Pause/Break keys)
I basically give up to maintain my old Intel Mac.
However I should keep the minimum environment for now.
- Make sure installing official Nix. Determinate Nix dropped x86_64-darwin. It is earlier than nixpkgs.
- Apply home-manager with
kachick@macbookfor minimum packages. - Install some packages without Nix
- Use Lima for development tasks.
-
Start a standard Docker guest with Lima:
limactl start --name=docker-nix template:docker
-
Install and configure Nix in the guest:
REV=main; \ curl -fsSL "https://raw.githubusercontent.com/kachick/dotfiles/$REV/scripts/install-nix.bash" | limactl shell docker-nix bash -s -- "$REV"
-
Apply home-manager:
limactl shell docker-nix nix run --accept-flake-config "github:kachick/dotfiles#home-manager" -- switch -b backup --flake "github:kachick/dotfiles#kachick@lima"
-
Run containers:
limactl shell docker-nix docker run --rm hello-world
Extracted to wiki
If you are developing this repository, putting .env makes easy reactivations.
echo 'HM_HOST_SLUG=wsl-ubuntu' > .envThen you can enable configurations with
task apply