# Nix Configuration Flake-based NixOS configuration with home-manager. ## Commands ### Daily Use ```bash # System rebuild sudo nixos-rebuild switch --flake .# # or use alias: oss # Home Manager home-manager switch --flake .#yanlin@ # or use alias: hms # the full switch alias `fs` will perform system rebuild then home manager switch # Update flake nix flake update ``` ### Occasional Commands ```bash # Garbage collection nix-collect-garbage -d sudo nix-collect-garbage -d # Check flake nix flake check nix flake show # Search packages nix search nixpkgs # Rollback sudo nixos-rebuild switch --rollback # Build without switching nixos-rebuild build --flake .# ``` ## Structure ``` . ├── flake.nix # Entry point ├── hosts/ │ └── nixos/ # NixOS configurations │ ├── system-default.nix │ ├── home-default.nix │ └── / ├── modules/ # Reusable modules ├── config/ # Static config files └── scripts/ # Helper scripts ``` ## Workflows ### Project Management `proj` - Launch tmux sessions from `config/projects.json` ### Quick Aliases - `hms` - Rebuild home-manager - `oss` - Rebuild NixOS system - `cdf` - Interactive file search with cd - `pwdf` - Get file path interactively - `zi` - Interactive zoxide with fzf ### Tmux Reminders - Prefix: `Ctrl-a` - Split: `|` and `-` - Navigate: `hjkl` - Resize: `HJKL` ## Service Management (NixOS) ```bash # Check service status systemctl status journalctl -u -f # Container management podman ps # Actually podman podman logs podman exec -it bash # Systemd timers systemctl list-timers ```