From bca8c84ab32ac9fa2b34fc180ffb2089f1a5cff5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Jan 2021 00:26:00 -0500 Subject: [PATCH] Minor refactors & readme revision --- README.md | 25 +++++++++++-------------- lib/nixos.nix | 2 +- modules/services/gitea.nix | 6 +++--- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f343a54f..a0b5c86d 100644 --- a/README.md +++ b/README.md @@ -28,15 +28,17 @@ ## 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. -3. Do your partitions and mount your root to `/mnt` -4. `git clone https://github.com/hlissner/dotfiles /mnt/etc/nixos` -5. Install NixOS: `nixos-install --root /mnt --flake /mnt/etc/nixos#XYZ`, where - `XYZ` is your hostname. Use `#generic` for a simple, universal config. -6. OPTIONAL: Create a sub-directory in `hosts/` for your device. See [host/kuro] - as an example. -7. Reboot! +3. Do your partitions and mount your root to `/mnt` ([for example](hosts/kuro/README.org)) +4. Install these dotfiles: +5. `nix-shell -p git nixFlakes` +6. `git clone https://github.com/hlissner/dotfiles /mnt/etc/dotfiles` +7. Install NixOS: `nixos-install --root /mnt --flake /mnt/etc/nixos#XYZ`, where + `XYZ` is [the host you want to install](hosts/). Use `#generic` for a + 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 @@ -62,13 +64,8 @@ And I say, `bin/hey`. [What's going on?](http://hemansings.com/) + **How do I change the default username?** 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. - -+ **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?** diff --git a/lib/nixos.nix b/lib/nixos.nix index 754fde40..d0679717 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -14,7 +14,7 @@ in { networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path)); } (filterAttrs (n: v: !elem n [ "system" ]) attrs) - ../. + ../. # /default.nix (import path) ]; }; diff --git a/modules/services/gitea.nix b/modules/services/gitea.nix index dd5e6de3..eeda6623 100644 --- a/modules/services/gitea.nix +++ b/modules/services/gitea.nix @@ -9,13 +9,15 @@ in { }; config = mkIf cfg.enable { - # I prefer git@... ssh addresses over gitea@... + # Allows git@... clone addresses rather than gitea@... users.users.git = { useDefaultShell = true; home = "/var/lib/gitea"; group = "gitea"; }; + user.extraGroups = [ "gitea" ]; + services.gitea = { enable = true; @@ -30,8 +32,6 @@ in { settings.server.DISABLE_ROUTER_LOG = true; }; - user.extraGroups = [ "gitea" ]; - services.fail2ban.jails.gitea = '' enabled = true filter = gitea