From c9be231c9fdd086ab22583dffae1df8267ff2a1b Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 3 Mar 2024 22:20:06 -0800 Subject: [PATCH] forgejo -> gitea, general documentation changes, build hack --- flake.lock | 6 +++--- hosts/server/default.nix | 6 +++++- hosts/server/hardware-configuration.nix | 5 ++--- modules/services/forgejo.nix | 24 +++++++++--------------- readme.md | 14 ++++++++------ 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index b798848..586528d 100755 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1709445365, - "narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=", + "lastModified": 1709485962, + "narHash": "sha256-rmFB4uE10+LJbcVE4ePgiuHOBlUIjQOeZt4VQVJTU8M=", "owner": "nix-community", "repo": "home-manager", - "rev": "4de84265d7ec7634a69ba75028696d74de9a44a7", + "rev": "d579633ff9915a8f4058d5c439281097e92380a8", "type": "github" }, "original": { diff --git a/hosts/server/default.nix b/hosts/server/default.nix index cf0c096..7608a91 100755 --- a/hosts/server/default.nix +++ b/hosts/server/default.nix @@ -10,6 +10,10 @@ in { users.groups.dotfiles = {}; + # HACK HACK HACK + services.logrotate.checkConfig = false; + # HACK HACK HACK + normalUsers = { reidlab = { conf = { @@ -48,7 +52,7 @@ in { mosh.enable = true; }; - security.useDoas = true; + security.useDoas = false; }; networking = { diff --git a/hosts/server/hardware-configuration.nix b/hosts/server/hardware-configuration.nix index 8183581..b880e8d 100755 --- a/hosts/server/hardware-configuration.nix +++ b/hosts/server/hardware-configuration.nix @@ -9,12 +9,11 @@ boot = { initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; initrd.kernelModules = [ ]; - kernelPackages = pkgs.linuxPackages_hardened; + kernelPackages = pkgs.linuxPackages_latest; kernelModules = [ ]; loader = { - # zigglebop 👽 + # use u-boot over grub grub.enable = lib.mkForce false; - generic-extlinux-compatible.enable = true; }; }; diff --git a/modules/services/forgejo.nix b/modules/services/forgejo.nix index 4743b4c..73b3e31 100755 --- a/modules/services/forgejo.nix +++ b/modules/services/forgejo.nix @@ -20,24 +20,18 @@ in { type = types.int; default = 3000; }; - package = mkOption { - type = types.package; - default = pkgs.forgejo; - }; }; config = mkIf cfg.enable { services = { - gitea = { + forgejo = { enable = true; - package = cfg.package; stateDir = "/var/lib/${cfg.domain}"; - appName = "reidlab's git instance"; - database = { - type = "postgres"; - name = "gitea"; - }; + database.type = "postgres"; settings = { + "DEFAULT" = { + APP_NAME = "reidlab's git instance"; + }; "security" = { INSTALL_LOCK = true; PASSWORD_HASH_ALGO = "argon2"; @@ -90,11 +84,11 @@ in { }; }; - systemd.services.gitea = { + systemd.services.forgejo = { preStart = mkAfter '' - rm -rf ${config.services.gitea.customDir}/public/assets - mkdir -p ${config.services.gitea.customDir}/public/assets - ln -sf ${theme} ${config.services.gitea.customDir}/public/assets/css + rm -rf ${config.services.forgejo.customDir}/public/assets + mkdir -p ${config.services.forgejo.customDir}/public/assets + ln -sf ${theme} ${config.services.forgejo.customDir}/public/assets/css ''; }; }; diff --git a/readme.md b/readme.md index 74a8b1e..5db5b04 100755 --- a/readme.md +++ b/readme.md @@ -1,16 +1,18 @@ # flake-o-rama -nix flake dotfilez!! this is used on personal server +nix flake config! this is just used on my personal server at the moment + +please do not use this as a learning resource for nix as i have essentially zero clue what i'm doing ## users -this flake is built for a multi-user experience per host, enforced my `modules/user.nix`, and found in the `default.nix` file for each host. +this flake is built for a multi-user experience per host, enforced by `modules/user.nix`, and found in the `default.nix` file for each host. as this is a multi-user setup, the `dotfiles` group will be used for read and write access to the flake ## development -to build the system, run `sudo nixos-rebuild switch --flake ".#server"` +to build the system, run `sudo nixos-rebuild switch --flake .#server` please periodically run `nix flake update` to make sure we arent slacking on package versions @@ -18,8 +20,8 @@ before committing, please run `nix flake check` and make sure everything is ok ## todo -- remove the lua static stuff from nginx + the cf ip +- remove the lua static stuff from nginx + maybe cloudflare ips too - per-host architecture selection, atm it is hardcoded to `aarch64` -- some weird perl error abt locales when building - `keepEnv` in `doas` might fix this +- some weird perl error abt locales when building using doas - `keepEnv` might fix this - leverage nixos-hardware -- even tho no one else uses these systems, i still want to keep this mutli user layout we have, this is gonna be pretty hard once we start bringing in desktop environments. we should find a compromise sometime. this could be another flake entirely now that i think about it. +- somehow add desktop evironments and per-user dotfiles while keeping a multi-user setup