Implement self-contained grapho architecture with four data types

Major rewrite of grapho CLI to support:
- Type 1 (Config): grapho init <repo-url> clones NixOS config
- Type 2 (Sync): Isolated Syncthing on port 8385 (separate from system)
- Type 3 (Backup): Restic integration with systemd timer
- Type 4 (Server): Mount point for central server data

New features:
- Welcome flow on first run (detects ~/.config/grapho/grapho.toml)
- grapho setup wizard creates directory structure
- grapho sync/backup/server subcommands
- grapho status shows all four data types
- grapho doctor checks system health

Added modules/grapho.nix NixOS module:
- Configures isolated Syncthing (ports 8385, 22001, 21028)
- Sets up grapho-backup systemd service and timer
- Creates directory structure via tmpfiles
- Optional NFS server mount

Updated flake.nix:
- Export grapho NixOS module
- Add grapho CLI package (nix build .#grapho)

Documented additional Lux language limitations:
- String == comparison broken in C backend
- let _ = pattern not supported
- List literals with recursion cause segfaults

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 06:12:58 -05:00
parent 63fedfb525
commit 117e6af528
5 changed files with 984 additions and 293 deletions

View File

@@ -14,6 +14,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
lux = {
url = "path:/home/blu/src/lux";
inputs.nixpkgs.follows = "nixpkgs";
};
# Optional: Neovim distribution
# nixvim = {
# url = "github:nix-community/nixvim";
@@ -21,7 +26,7 @@
# };
};
outputs = { self, nixpkgs, home-manager, sops-nix, ... }@inputs:
outputs = { self, nixpkgs, home-manager, sops-nix, lux, ... }@inputs:
let
# Supported systems
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
@@ -37,6 +42,7 @@
# Shared modules for all hosts
sharedModules = [
./modules/grapho.nix
./modules/nb.nix
./modules/syncthing.nix
./modules/backup.nix
@@ -60,6 +66,39 @@
};
in {
# Grapho CLI package
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
luxPkg = lux.packages.${system}.default;
in {
grapho = pkgs.stdenv.mkDerivation {
pname = "grapho";
version = "0.1.0";
src = ./cli;
nativeBuildInputs = [ luxPkg pkgs.gcc ];
buildPhase = ''
${luxPkg}/bin/lux compile grapho.lux -o grapho
'';
installPhase = ''
mkdir -p $out/bin
cp grapho $out/bin/
'';
meta = {
description = "Personal data infrastructure CLI";
homepage = "https://github.com/user/grapho";
license = pkgs.lib.licenses.mit;
};
};
default = self.packages.${system}.grapho;
}
);
# NixOS configurations
# Uncomment and customize for your hosts:
#
@@ -132,7 +171,9 @@
default = pkgs.mkShell {
name = "unsbs-dev";
packages = with pkgs; [
packages = [
lux.packages.${system}.default
] ++ (with pkgs; [
# Tier 2: Notes & Sync
nb # Notebook CLI
syncthing # File sync
@@ -159,7 +200,7 @@
# Nix tools
nil # Nix LSP
nixpkgs-fmt # Nix formatter
];
]);
shellHook = ''
printf '\033[1m%s\033[0m\n' "Ultimate Notetaking, Sync & Backup System"
@@ -175,6 +216,7 @@
# Export modules for use in other flakes
nixosModules = {
grapho = import ./modules/grapho.nix;
nb = import ./modules/nb.nix;
syncthing = import ./modules/syncthing.nix;
backup = import ./modules/backup.nix;