revamp flake
This commit is contained in:
parent
433967847a
commit
251932e6c0
82 changed files with 444 additions and 2406 deletions
49
README.md
49
README.md
|
|
@ -1,47 +1,10 @@
|
|||
# dots
|
||||
|
||||
This repository contains my dotfiles and a Nix flake that supports multiple hosts (machines) with a shared base and per-host configuration.
|
||||
# limgrave
|
||||
|
||||
## Nix Configuration
|
||||
|
||||
The Nix configuration is located in the `nix/` directory. It uses a shared Home Manager configuration for all hosts, while allowing host-specific NixOS or package settings.
|
||||
|
||||
### Structure
|
||||
|
||||
- `nix/flake.nix`: Entry point, defines hosts and helpers.
|
||||
- `nix/home/`: Shared Home Manager configuration (packages, shell, GNOME settings).
|
||||
- `nix/hosts/`: Host-specific NixOS configurations.
|
||||
|
||||
### Adding New Hosts
|
||||
|
||||
#### NixOS Hosts
|
||||
1. Create a directory in `nix/hosts/<hostname>/`.
|
||||
2. Add `configuration.nix`, `hardware-configuration.nix`, and `packages.nix` there.
|
||||
3. Add the host to `nixosConfigurations` in `nix/flake.nix`:
|
||||
```nix
|
||||
limgrave = mkNixos "limgrave" [
|
||||
nix-snapd.nixosModules.default
|
||||
autofirma-nix.nixosModules.default
|
||||
];
|
||||
```
|
||||
|
||||
#### Non-NixOS Hosts (e.g., Ubuntu)
|
||||
1. Add the host to `homeConfigurations` in `nix/flake.nix`:
|
||||
```nix
|
||||
"catalin@ubuntu" = mkHome "ubuntu" "catalin" [ ];
|
||||
```
|
||||
*Note: `mkHome` takes `hostname`, `username`, and additional modules.*
|
||||
|
||||
### Building and Applying
|
||||
|
||||
#### NixOS
|
||||
Run from the root of the repository:
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake .#hostname
|
||||
```
|
||||
|
||||
#### Non-NixOS (Home Manager)
|
||||
Run from the root of the repository:
|
||||
```bash
|
||||
home-manager switch --flake ./nix#user@hostname
|
||||
```shell
|
||||
sudo nixos-rebuild switch --flake ~/.dotfiles#limgrave --upgrade # first time
|
||||
dotter # create dotfiles symlinks
|
||||
nh os switch ~/.dotfiles/ # after
|
||||
nh home switch ~/.dotfiles # home manager
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue