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) latest
Or, 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 | jq '.apps | ."x86_64-linux" | keys[]'
Using flake style is disabled in NixOS by default and you should inject git command to use flakes.
For example
nix --extra-experimental-features 'nix-command flakes' shell 'github:NixOS/nixpkgs/nixos-24.11#git' \
--command sudo nixos-rebuild switch \
--flake "github:kachick/dotfiles#$(hostname)" \
--show-trace
sudo reboot now
List defined hostnames
nix flake show 'github:kachick/dotfiles' --json | jq '.nixosConfigurations | keys[]'
This repository intentionally reverts the home-manager NixOS module.\ So, you should activate the user dotfiles with standalone home-manager even though NixOS.
nix run 'github:kachick/dotfiles#home-manager' -- switch -b backup --flake 'github:kachick/dotfiles#kachick@nixos-desktop'
See GH-680 for background
NixOS is often difficult for beginners like me. So I also use Lima for several issues.
Install Nix package manager with DeterminateSystems/nix-installer to enable Flakes by default.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Make sure there is a nix directory that is used in the home-manager.\ This is a workaround, See the thread for detail
mkdir -p ~/.local/state/nix/profiles
Restart current shell to load Nix as a PATH
bash
Apply dotfiles for each use
nix run 'github:kachick/dotfiles#home-manager' -- switch -b backup --flake 'github:kachick/dotfiles#user@linux-cli'
Candidates
user@linux-cli
# Used in containerhome-manager installed OpenSSH disabled GSSAPI by default.\
So suppress /etc/ssh/ssh_config line 53: Unsupported option "gssapiauthentication"
with following command
sudo chmod -r /etc/ssh/ssh_config
If you faced to lcoale errors such as -bash: warning: setlocale: LC_TIME: cannot change locale (en_DK.UTF-8): No such file or directory
sudo localedef -f UTF-8 -i en_DK en_DK.UTF-8
Install uidmap without Nix for use of podman even if the podman will be installed from nixpkgs
sudo apt-get install --assume-yes uidmap
Make sure putting /etc/containers/policy.json, it is not a home-manager role
sudo mkdir -p /etc/containers
cd /etc/containers
sudo curl -OL https://raw.githubusercontent.com/kachick/dotfiles/main/config/containers/policy.json
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:12.6-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 podman
Remember to set special config and reboot if you on WSL
echo '
[boot]
systemd=true' | sudo tee /etc/wsl.conf
kachick@wsl-ubuntu
$(whoami)@wsl-nixos
Check traps
I basically give up to maintain macOS environment.
kachick@macbook
for minimum packages.limactl start
, apply home-manager with kachick@lima
lima nerdctl run --rm hello-world
. You can also use podman after above Podman on Ubuntu
setupsExtracted to wiki
If you are developing this repository, the simple reactivation is as follows.
makers apply 'kachick@wsl-ubuntu'
For NixOS
sudo nixos-rebuild switch --flake ".#$(hostname)" --show-trace && \
makers apply 'kachick@nixos-desktop'
If you encounter any errors in the above steps, Check and update CI and wiki.