urob / dotfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bootstrap config

Preliminaries (WSL only)

  1. Enable system.d

    sudo sh -c 'echo "[boot]" > /etc/resolv.conf'
    sudo sh -c 'echo "systemd=true" >> /etc/resolv.conf'
  2. Fix name resolution on corporate networks

    # Debian 12 does not yet support net.ipv4.ping_group_range which allows non-root pings
    sudo ping www.google.com
    
    # Run this if name resolution fails
    sudo unlink /etc/resolv.conf
    sudo sh -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
    
    # Prevent WSL from auto-generating resolv.conf on reboot
    sudo sh -c 'echo "[network]" >> /etc/resolv.conf'
    sudo sh -c 'echo "generateResolvConf=false" >> /etc/resolv.conf'
  3. Reboot

    # Run this on ps1
    wsl -t debian
    wsl -d debian

Install config on Debian

  1. Install curl

    sudo apt-get update && sudo apt-get install curl
  2. Run the installer script

    cd && bash <(curl https://raw.githubusercontent.com/urob/dotfiles/main/bootstrap.sh)

Manually Set Up Home Manager

# Install Nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

# Start nix daemon without reloading shell
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh

# Initialize home manager in current directory
cd <path/to/flake.nix>
nix run . -- init --switch . --impure

Maintainance

  • Rebuild config

    # outOfStoreSymlinks require impure
    home-manager switch --flake <path/to/flake.nix> --impure
  • Update all packages

    # update all inputs
    nix flake update --flake <path/to/flake.nix>
    
    # update a single flake input
    nix flake lock --update-input <input>

Troubleshooting

  • Permission errors when creating outOfStoreSymlinks: see issues #4692, #9579, and PR #9723

    error:
        … while setting up the build environment
    
        error: getting attributes of path '/nix/store/d5w0zqag0v8wkyab59aph7v9ypkr3h6y-hm_nvim':
        Permission denied
    

    Workaround:

    # uninstall nix if already installed
    /nix/nix-installer uninstall
    
    # install old-stable version 2.18.1
    curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --nix-package-url https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz
  • The following error occurs if systemd is not enabled

    error: could not set permissions on '/nix/var/nix/profiles/per-user' to 755:
    Operation not permitted
    
  • See https://nixos.wiki/wiki/Locales on how to set locales. TLDR: add the following to .zshenv (done automatically in my config):

    export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive

About


Languages

Language:Shell 45.3%Language:CSS 19.8%Language:Vim Script 18.9%Language:Nix 7.9%Language:Python 5.3%Language:PowerShell 1.6%Language:Lua 1.2%