mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
|
|
||
|---|---|---|
| .vscode | ||
| home | ||
| nixos | ||
| systems | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| Makefile | ||
| README.md | ||
| treefmt.toml | ||
This repository contains the Nix / NixOS configuration for all of my systems. Start from flakes.nix (see Flakes).
To build,
# First, edit nixosConfigurations or darwinConfigurations in flake.nix to add
# your system's hostname. And then change `userName` to your username.
make
Install notes
- NixOS Linux
- Install NixOS
- Hetzner dedicated from Linux Rescue system: https://github.com/serokell/nixos-install-scripts/pull/1#pullrequestreview-746593205
- Digital Ocean: https://github.com/elitak/nixos-infect
- X1 Carbon: https://www.srid.ca/x1c7-install
- Windows (via WSL): https://github.com/nix-community/NixOS-WSL
- Clone this repo at
/etc/nixos - Edit
flake.nixand add your Linux's hostname in thenixosConfigurationsset, as well as updateuserName. - Run
make. That's it. Re-open your shell.
- Install NixOS
- macOS:
- Install Nix normally (multi-user)
- Install nix-darwin
- This will create a
~/.nixpkgs/darwin-configuration.nix, but we do not need that.
- This will create a
- Clone this repo anywhere
- Edit
flake.nixand add your Mac's hostname in thedarwinConfigurationsset, as well updateuserName. - Run
make.1 That's it. Re-open your shell.
Directory layout
home: home-manager confignixos: nixos config (includes nix-darwin)systems: top-level configuration.nix('ish) for various kinds of system
Tips
- To update NixOS (and other inputs) run
nix flake update2 - To autoformat the project tree using nixpkgs-fmt, run
nix fmt.