Minor refactors & readme revision

This commit is contained in:
Henrik Lissner 2021-01-02 00:26:00 -05:00
parent 608b3472b9
commit bca8c84ab3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 15 additions and 18 deletions

View file

@ -28,15 +28,17 @@
## Quick start ## Quick start
1. Yoink [NixOS 20.09][nixos] (must be newer than Sept 12, 2020 for `nixos-install --flake`). 1. Yoink the latest stable build of [NixOS 20.09][nixos].
2. Boot into the installer. 2. Boot into the installer.
3. Do your partitions and mount your root to `/mnt` 3. Do your partitions and mount your root to `/mnt` ([for example](hosts/kuro/README.org))
4. `git clone https://github.com/hlissner/dotfiles /mnt/etc/nixos` 4. Install these dotfiles:
5. Install NixOS: `nixos-install --root /mnt --flake /mnt/etc/nixos#XYZ`, where 5. `nix-shell -p git nixFlakes`
`XYZ` is your hostname. Use `#generic` for a simple, universal config. 6. `git clone https://github.com/hlissner/dotfiles /mnt/etc/dotfiles`
6. OPTIONAL: Create a sub-directory in `hosts/` for your device. See [host/kuro] 7. Install NixOS: `nixos-install --root /mnt --flake /mnt/etc/nixos#XYZ`, where
as an example. `XYZ` is [the host you want to install](hosts/). Use `#generic` for a
7. Reboot! simple, universal config, or create a sub-directory in `hosts/` for your device. See [host/kuro] for an example.
8. Reboot!
9. Change your `root` and `$USER` passwords!
## Management ## Management
@ -62,13 +64,8 @@ And I say, `bin/hey`. [What's going on?](http://hemansings.com/)
+ **How do I change the default username?** + **How do I change the default username?**
1. Set `USER` the first time you run `nixos-install`: `USER=myusername 1. Set `USER` the first time you run `nixos-install`: `USER=myusername
nixos-install --root /mnt --flake #XYZ` nixos-install --root /mnt --flake /path/to/dotfiles#XYZ`
2. Or change `"hlissner"` in modules/options.nix. 2. Or change `"hlissner"` in modules/options.nix.
+ **How do I "set up my partitions"?**
My main host [has a README](hosts/kuro/README.org) you can use as a reference.
I set up an EFI+GPT system and partitions with `parted` and `zfs`.
+ **Why did you write bin/hey?** + **Why did you write bin/hey?**

View file

@ -14,7 +14,7 @@ in {
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path)); networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
} }
(filterAttrs (n: v: !elem n [ "system" ]) attrs) (filterAttrs (n: v: !elem n [ "system" ]) attrs)
../. ../. # /default.nix
(import path) (import path)
]; ];
}; };

View file

@ -9,13 +9,15 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# I prefer git@... ssh addresses over gitea@... # Allows git@... clone addresses rather than gitea@...
users.users.git = { users.users.git = {
useDefaultShell = true; useDefaultShell = true;
home = "/var/lib/gitea"; home = "/var/lib/gitea";
group = "gitea"; group = "gitea";
}; };
user.extraGroups = [ "gitea" ];
services.gitea = { services.gitea = {
enable = true; enable = true;
@ -30,8 +32,6 @@ in {
settings.server.DISABLE_ROUTER_LOG = true; settings.server.DISABLE_ROUTER_LOG = true;
}; };
user.extraGroups = [ "gitea" ];
services.fail2ban.jails.gitea = '' services.fail2ban.jails.gitea = ''
enabled = true enabled = true
filter = gitea filter = gitea