complete-computing-environment/nixos-wobserver.org

11 KiB
Raw Permalink Blame History

The Wobserver

My Wobserver is Terra Firma and resides in Wobscale Technologies's premier datacenter sea1.wobscale.website.

NEXT What's a Wobserver?   Writing

A wobserver is a homeserver managed in an Arroyo System.

Wobserver in the context of Arroyo Systems

The ultimate goal of the Arroyo System is to provide a model for a community homeserver and shared knowledge/thinking system. I think a Wobserver could host a small community of 15-20 people with an ongoing effort of 10 hours a month on an average month. It's reasonable to expect that a larger community could develop a shared consensus environment as a tilde-like server.

The Arroyo System extends on to the local workstation. The local expert can provide a set of reasonable defaults for a computer which can accomplish every day tasks using a Arroyo NixOS Generator and every member of the community can then share other modules from a collection like The Complete Computing Environment and share them amongst themselves using Syncthing and The Arcology Project.

The Wobserver in this equation is the "social hub" of an Arroyo System. NixOS provides packages for Nextcloud, Discourse, Matrix, Mastodon, Mailservers. Let's use them. Let's contribute to them. Let's expand roam:The Commons.

Generating the Wobserver Configuration with Arroyo Nixos

This is a NixOS configuration which is dynamically extended with Arroyo Systems Management modules. It behaves like My NixOS configuration and is pushed to machines using Morph. It can also be built in QEMU below.

{ config, pkgs, lib, ... }:

rec {
  imports = [
    <<arroyo_nixos_imports()>>
  ];

  home-manager.users.rrix.imports = [
    <<arroyo_home-manager_imports()>>
  ];

  system.stateVersion = lib.mkDefault "22.11";

  home-manager.users.rrix = {
    home.stateVersion = config.system.stateVersion;
    # don't ship pinentry-qt
    services.gpg-agent.pinentryFlavor = lib.mkForce "curses";
  };

  services.openssh.enable = true;

  environment.systemPackages = with pkgs; [
    pkgs.htop
  ];

  boot = {
    kernelParams = [ "console=ttyS0" "boot.shell_on_fail" ];
    loader.timeout = 5;
    zfs.devNodes = lib.mkForce "/dev/disk/by-id";
  };
}

Helpers

(setenv "ARCOLOGY_DB_PATH" "/home/rrix/org/arcology-django/db.sqlite3")
(shell-command-to-string "nix run path:/home/rrix/org/arcology-django#arcology -- ingest_files ~/org &>/dev/null")
(shell-command-to-string "nix run path:/home/rrix/org/arcology-django#arcology -- generate -m nixos -r server 2>/dev/null | sort")
../../nixos/akkoma.nix
../../nixos/arcology-config.nix
../../nixos/cachix.nix
../../nixos/cups.nix
../../nixos/emacs.nix
../../nixos/feedbot.nix
../../nixos/feediverse.nix
../../nixos/gitea.nix
../../nixos/gnupg-pam.nix
../../nixos/home-manager.nix
../../nixos/jellyfin.nix
../../nixos/location.nix
../../nixos/matrix.nix
../../nixos/morph-wrapper.nix
../../nixos/nextcloud.nix
../../nixos/nginx.nix
../../nixos/nixos-builder.nix
../../nixos/nix-path.nix
../../nixos/nixpkgs.nix
../../nixos/paperless.nix
../../nixos/poetry2nix.nix
../../nixos/postgresql.nix
../../nixos/restic.nix
../../nixos/rixpkgs.nix
../../nixos/rrix.nix
../../nixos/ssh_client.nix
../../nixos/syncthing.nix
../../nixos/tailscale.nix
../../nixos/ttrss.nix
../../nixos/vaultwarden.nix
../../nixos/wallabag.nix
../../nixos/wobservability.nix
../../nixos/wobserver-docker.nix
../../nixos/zfs.nix
(setenv "ARCOLOGY_DB_PATH" "/home/rrix/org/arcology-django/db.sqlite3")
(shell-command-to-string "nix run path:/home/rrix/org/arcology-django#arcology -- ingest_files ~/org &>/dev/null")
(->> (arroyo-home-manager-imports "server")
     (s-split "\n")
     (-map (lambda (r) (format "../../%s" r)))
     (butlast)
     (s-join "\n"))
../../hm/beets.nix
../../hm/contacts.nix
../../hm/datasette.nix
../../hm/deadgrep.nix
../../hm/defexpr.nix
../../hm/emacs-helpers.nix
../../hm/emacs.nix
../../hm/emacs-pager.nix
../../hm/git.nix
../../hm/gnupg.nix
../../hm/morph.nix
../../hm/nix-update.nix
../../hm/occluded_files.nix
../../hm/org-fc.nix
../../hm/org-protocol.nix
../../hm/org-roam.nix
../../hm/pass.nix
../../hm/profile.nix
../../hm/prompt.nix
../../hm/python.nix
../../hm/shell-helpers.nix
../../hm/spell-check.nix
../../hm/ssh_client.nix
../../hm/syncthing.nix

Packages in the Wobserver

NixOS modules:

(->>
 (arroyo-nixos-imports "server")
 (--map (caar (arroyo-db-query [:select file :from keywords :where (= value $s1)] it)))
 (--map (car (org-roam-db-query [:select [id title] :from nodes :where (= file $s1) :and (= level 0)] it)))
 (--map (format "- [[id:%s][%s]]" (first it) (second it)))
 (-sort #'string<)
 (s-join "\n")
)

Things I need to package:

INPROGRESS Matrix Synapse

  • State "INPROGRESS" from [2022-11-18 Fri 00:04]

INPROGRESS Heisenbridge

NEXT hydra

NEXT Redis

NEXT Calibre-Web

NEXT Calibre-Server

NEXT Docker Registry

NEXT Mail Sync

mbsync

dovecot

NEXT Universal aggregator

NEXT fail2ban

NEXT gitea

NEXT grocy?

CANCELLED wireguard

  • State "CANCELLED" from "NEXT" [2022-11-12 Sat 16:44]

DONE tailscale

  • State "DONE" from "NEXT" [2022-11-12 Sat 16:44]

Why Tailscale?

Arroyo Systems are "self-hosted" the org-mode source runs in an Emacs which can be provided through an Arroyo document system, but it also goes to great effort to not rely on third party services, and goes to greater length to avoid proprietary webservices. and yet i'll probably use Tailscale for it, anyways. why?

Why move to a proprietary solution?

music

NEXT mpd

NEXT mpdscribble

NEXT icecast

Building a QEMU image of the Wobserver

Right now I develop in qemu.

build the VM then run the VM

,#+ARROYO_NIXOS_MODULE: nixos/qemu-vm.nix ,#+ARROYO_SYSTEM_ROLE: server

{ ... }:

{
  imports = <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
    <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
  ];

  # simple VM configuration
  virtualisation = {
    diskSize = 1000; # MB
    memorySize = 2048; # MB
    cores = 2;
    writableStoreUseTmpfs = false;
    diskImage = "/home/rrix/wobserver-test.qcow2";
    graphics = false;

    forwardPorts = [
      { from = "host";
        host = { address = "127.0.0.1"; port = 2222; };
        guest = { address = "10.0.2.15"; port = 22; };
      }
      { from = "host";
        host = { address = "127.0.0.1"; port = 8080; };
        guest = { address = "10.0.2.15"; port = 80; };
      }
    ];
  };
  networking.firewall.enable = false;

  # each of these corresponds to an eventual ZFS volume
  virtualisation.sharedDirectories = {
    media = { source = "/media"; target = "/media"; };
    home = { source = "/home/rrix/wobserver-test-env/home"; target = "/home"; };
    # services = { source = "/home/rrix/wobserver-test-env/svc"; target = "/svc"; };
    backups = { source ="/home/rrix/wobserver-test-env/backup"; target = "/backup"; };
  };

  services.qemuGuest.enable = true;
  boot.growPartition = true;

  boot.zfs.extraPools = [ "tank" ];

  fileSystems."/" = {
    device = "terra-firma/root";
    fsType = "zfs";
  };

  fileSystems."/nix" = {
    device = "terra-firma/nix";
    fsType = "zfs";
  };

  filesystems."/tank/media" = {
    device = "tank/media";
    fsType = "zfs";
  };

  filesystems."/home" = {
    device = "tank/home";
    fsType = "zfs";
  };

}

Cleanup commands:

shell:rm ~/wobserver.qcow2 shell:mkdir -p ~/wobserver-test-env/{home,svc,backup}