services.hermesVm -> services.hermenix throughout. setup.sh and
migrate-docker-hermes.sh are replaced by nu/hermenix.nu (setup + migrate
subcommands), packaged as a flake output (packages.${system}.hermenix,
pkgs.writers.writeNuBin) so it's installable without cloning conventions
beyond the repo itself. Both subcommands verified end-to-end against a
sandboxed dry run (stubbed disk/cache tools, a local ssh stand-in for the
migrate path) before landing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
64 lines
1.9 KiB
Nix
64 lines
1.9 KiB
Nix
{
|
|
description = "hermenix — Hermes Agent in a self-managing NixOS VM, two-disk btrfs-backed, under hardened QEMU";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
|
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3";
|
|
nixos-generators = {
|
|
url = "github:nix-community/nixos-generators";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs, determinate, nixos-generators, ... }@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
nixosModules.default = ./modules/host.nix;
|
|
|
|
packages.${system} = {
|
|
# One-time bootstrap image. See the README: building this needs two
|
|
# extra substituter flags so you aren't compiling Determinate Nix
|
|
# yourself.
|
|
hermes-guest-image = nixos-generators.nixosGenerate {
|
|
inherit system;
|
|
format = "raw-efi";
|
|
modules = [
|
|
determinate.nixosModules.default
|
|
./guest/common.nix
|
|
];
|
|
};
|
|
|
|
# The host-side CLI: `hermenix setup` (guided disk/cache/image setup)
|
|
# and `hermenix migrate <source>` (carry over an existing flat
|
|
# HERMES_HOME). A Nu script, wrapped so its external dependencies are
|
|
# always on PATH regardless of what the host happens to have
|
|
# installed.
|
|
hermenix = pkgs.writers.writeNuBin "hermenix"
|
|
{
|
|
makeWrapperArgs = [
|
|
"--prefix"
|
|
"PATH"
|
|
":"
|
|
(pkgs.lib.makeBinPath (with pkgs; [
|
|
openssh
|
|
socat
|
|
gnutar
|
|
gnused
|
|
btrfs-progs
|
|
e2fsprogs
|
|
coreutils
|
|
nix
|
|
]))
|
|
];
|
|
}
|
|
(builtins.readFile ./nu/hermenix.nu);
|
|
|
|
default = self.packages.${system}.hermenix;
|
|
};
|
|
};
|
|
}
|