Rename project to hermenix; convert host scripts to a Nu CLI
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>
This commit is contained in:
1 parent
12227460fd
commit
2b33b98bae
10 files changed
+570
-568
No files matched your search
@@ -1,17 +1,9 @@
|
||||
{
|
||||
description = "Hermes Agent in a self-managing NixOS VM, two-disk btrfs-backed, under hardened QEMU";
|
||||
description = "hermenix — Hermes Agent in a self-managing NixOS VM, two-disk btrfs-backed, under hardened QEMU";
|
||||
|
||||
inputs = {
|
||||
# nixpkgs from FlakeHub, so the guest's artifacts come from FlakeHub Cache.
|
||||
# "0.1" is rolling (the nixos-unstable equivalent); use "0" for current
|
||||
# stable instead.
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
||||
|
||||
# Determinate Nix. Note the deliberate absence of inputs.nixpkgs.follows
|
||||
# here: Determinate warn that making this flake follow your nixpkgs causes
|
||||
# cache misses for artifacts that would otherwise come from FlakeHub Cache.
|
||||
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3";
|
||||
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -22,21 +14,50 @@
|
||||
{ self, nixpkgs, determinate, nixos-generators, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
nixosModules.default = ./modules/host.nix;
|
||||
|
||||
# One-time bootstrap image. See the README: building this needs two extra
|
||||
# substituter flags so you aren't compiling Determinate Nix yourself.
|
||||
packages.${system}.hermes-guest-image = nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
format = "raw-efi";
|
||||
modules = [
|
||||
determinate.nixosModules.default
|
||||
./guest/common.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
|
||||
];
|
||||
};
|
||||
|
||||
packages.${system}.default = self.packages.${system}.hermes-guest-image;
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user