revise readme
This commit is contained in:
parent
50b1c7592d
commit
3800fc8494
1 changed files with 13 additions and 10 deletions
23
README.md
23
README.md
|
|
@ -7,11 +7,12 @@ Flake-based NixOS configuration with home-manager.
|
||||||
### Daily Use
|
### Daily Use
|
||||||
```bash
|
```bash
|
||||||
# System rebuild
|
# System rebuild
|
||||||
sudo nixos-rebuild switch --flake .#<host>
|
sudo nixos-rebuild switch --flake .#<host> # NixOS
|
||||||
|
sudo darwin-rebuild switch --flake .#<host> # Nix-darwin
|
||||||
# or use alias: oss
|
# or use alias: oss
|
||||||
|
|
||||||
# Home Manager
|
# Home Manager
|
||||||
home-manager switch --flake .#yanlin@<host>
|
home-manager switch --flake .#<user>@<host>
|
||||||
# or use alias: hms
|
# or use alias: hms
|
||||||
# the full switch alias `fs` will perform system rebuild then home manager switch
|
# the full switch alias `fs` will perform system rebuild then home manager switch
|
||||||
|
|
||||||
|
|
@ -22,12 +23,12 @@ nix flake update
|
||||||
### New Host Installation
|
### New Host Installation
|
||||||
```bash
|
```bash
|
||||||
# For NixOS and disko
|
# For NixOS and disko
|
||||||
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake .#<host>
|
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake github:Logan-Lin/nix-config#<host>
|
||||||
sudo nixos-install --flake .#<host>
|
sudo nixos-install --flake .#<host>
|
||||||
|
|
||||||
# For nix-darwin
|
# For nix-darwin
|
||||||
sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake ~/.config/nix#<host>
|
sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake github:Logan-Lin/nix-config#<host>
|
||||||
nix --extra-experimental-features "nix-command flakes" run home-manager/master -- switch --flake ~/.config/nix#<user>@<host>
|
nix --extra-experimental-features "nix-command flakes" run home-manager/master -- switch --flake github:Logan-Lin/nix-config#<user>@<host>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Occasional Commands
|
### Occasional Commands
|
||||||
|
|
@ -45,9 +46,6 @@ nix search nixpkgs <package>
|
||||||
|
|
||||||
# Rollback
|
# Rollback
|
||||||
sudo nixos-rebuild switch --rollback
|
sudo nixos-rebuild switch --rollback
|
||||||
|
|
||||||
# Build without switching
|
|
||||||
nixos-rebuild build --flake .#<host>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
@ -56,7 +54,11 @@ nixos-rebuild build --flake .#<host>
|
||||||
.
|
.
|
||||||
├── flake.nix # Entry point
|
├── flake.nix # Entry point
|
||||||
├── hosts/
|
├── hosts/
|
||||||
│ └── nixos/ # NixOS configurations
|
│ ├── nixos/ # NixOS configurations
|
||||||
|
│ │ ├── system-default.nix
|
||||||
|
│ │ ├── home-default.nix
|
||||||
|
│ │ └── <host>/
|
||||||
|
│ └── darwin/ # Nix-darwin configurations
|
||||||
│ ├── system-default.nix
|
│ ├── system-default.nix
|
||||||
│ ├── home-default.nix
|
│ ├── home-default.nix
|
||||||
│ └── <host>/
|
│ └── <host>/
|
||||||
|
|
@ -75,6 +77,7 @@ nixos-rebuild build --flake .#<host>
|
||||||
- `oss` - Rebuild NixOS system
|
- `oss` - Rebuild NixOS system
|
||||||
- `cdf` - Interactive file search with cd
|
- `cdf` - Interactive file search with cd
|
||||||
- `pwdf` - Get file path interactively
|
- `pwdf` - Get file path interactively
|
||||||
|
- `fm` - Open current directory in GUI file manager
|
||||||
|
|
||||||
### Tmux Reminders
|
### Tmux Reminders
|
||||||
- Prefix: `Ctrl-a`
|
- Prefix: `Ctrl-a`
|
||||||
|
|
@ -82,7 +85,7 @@ nixos-rebuild build --flake .#<host>
|
||||||
- Navigate: `hjkl`
|
- Navigate: `hjkl`
|
||||||
- Resize: `HJKL`
|
- Resize: `HJKL`
|
||||||
|
|
||||||
## Service Management (NixOS)
|
## Service Management
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Container services
|
# Container services
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue