penglei / nix-configs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

my nixos/home-manager flake configurations

  • darwin: home-manager only, I don’t employ nix-darwin.

  • aarch64, x86_64 vm(cloud and local): nixos with embeded home-manager.

  • legacy linux distribution like ubuntu: home-manager only.

bootstrap tips

The newly installed NixOS does not come with vim by default, I’m not used to the nano editor. Use the following command to temporarily use vim:

nix --extra-experimental-features nix-command --extra-experimental-features flakes shell nixpkgs#vim
: make pin-registry
: nix shell nixpkgs#git nixpkgs#home-manager
: home-manager switch --flake .
: #or
: nix run nixpkgs#home-manager switch -- --flake .

: sudo nixos-rebuild switch --flake .#tart-vm

installation

new disk install

in-place installation by copytoram

lustrate installation

first, install nix, then install nixos from the flake:

$ bash <(curl -L https://nixos.org/nix/install) --daemon
$ e2label /dev/vda1 nixos
$ mkdir ~/.config/nix
$ cat <<EOF >~/.config/nix/nix.conf
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
max-jobs = auto
EOF
$ nix profile install --profile /nix/var/nix/profiles/system github:penglei/nix-configs#nixosConfigurations.slim.config.system.build.toplevel
$ sudo chown -R 0:0 /nix
$ sudo touch /etc/NIXOS
$ sudo touch /etc/NIXOS_LUSTRATE
$ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE
etc/nixos
$ sudo mv -v /boot /boot.bak
renamed '/boot' -> '/boot.bak'
$ sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
$ shutdown -r now
$ nix-collect-garbage

references

yabai

# launchctl load -F ~/Library/LaunchAgents/org.nix-community.home.yabai.plist
# launchctl unload -F ~/Library/LaunchAgents/org.nix-community.home.yabai.plist
# launchctl kickstart -k gui/$(id -u)/org.nix-community.home.yabai

rime/squirrel

based on: github.com/iDvel/rime-ice

log location:

  • $TMPDIR/rime.squirrel.INFO

  • $TMPDIR/rime.squirrel.ERROR

force deploy (nix home-manager links rime config):

rm -rf ~/Library/Rime/build

# Press Ctrl+Option(left)+` to re-deploy

Shift+space as switcher key: rime/squirrel#113

installation.yaml should be writable after upgrading squirrel.

launchctl

launchctl bootout gui/$UID ./org.sketchybar.plist

About


Languages

Language:Nix 77.5%Language:Lua 9.2%Language:Shell 7.5%Language:Python 5.6%Language:Ruby 0.1%Language:Makefile 0.1%