https://github.com/kahnwong/nix
nix
https://github.com/kahnwong/nix
brew darwin dotfiles flatpak linux nix setup-script
Last synced: 3 days ago
JSON representation
nix
- Host: GitHub
- URL: https://github.com/kahnwong/nix
- Owner: kahnwong
- License: mit
- Created: 2022-11-30T09:19:57.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-12-22T07:38:30.000Z (5 days ago)
- Last Synced: 2025-12-23T18:56:09.279Z (3 days ago)
- Topics: brew, darwin, dotfiles, flatpak, linux, nix, setup-script
- Language: Shell
- Homepage:
- Size: 2.29 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nix
Flake migration based on .
## Pre-requisites
Create `./scripts/apply.sh` and set appropriate build command. See `flake.nix` for available options.
File content should look like this:
```bash
#!/bin/bash
export NIXPKGS_ALLOW_UNFREE=1
## macbook
#nix build '.#homeManagerConfigurations.macbookMain.system' --experimental-features 'nix-command flakes' --impure
# linux
nix build '.#homeManagerConfigurations.workstation.activationPackage' --experimental-features 'nix-command flakes' --impure
if [[ $(uname -s) == 'Darwin' ]]; then
sudo ./result/activate
elif [[ $(uname -s) == 'Linux' ]]; then
./result/activate
fi
```
## Usage
```bash
make common
# optional
make common-dev
```
### Rust
If nix gc borks rust, run following commands:
```bash
rustup show
rustup toolchain remove $toolchain_version
rustup install 1.90.0
```
### Run `sudo` without typing password
```bash
echo "$(whoami) ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/99-nopasswd-$(whoami)
```
### Mac OS Extras
1. Login to `App Store`
2. `make mac`
### Linux Extras
- If you need `tailscale`, `caddy`, `fail2ban`, or `docker` on your server, install it via your system's package
manager, since nix requires you to set up systemd services explicitly.
## Post-installation instructions
### Linux: Set default shell
```bash
`chsh` and type `$HOME/.nix-profile/bin/fish`
# or this one
`vi /etc/passwd` and specify shell for your user
```
### MacOS: Misc config
- set `tap to single click`
- set `three-finger drag`
## Useful commands
```bash
# backup vscode extensions list
code --list-extensions | xargs -L 1 echo code --install-extension > ext_install.sh
# backup vscode config
cp "/users/$USER/Library/Application Support/Code/User/keybindings.json" .
cp "/users/$USER/Library/Application Support/Code/User/settings.json" .
```