feat(nixos): integrate agent VM into host configurations

This commit is contained in:
2026-10-22 10:20:30 +08:00
parent d71fab81d5
commit 5c2e25b989
14 changed files with 826 additions and 28 deletions
+34 -12
View File
@@ -3,6 +3,15 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
agent-nixpkgs.url = "tarball+https://mirrors.cernet.edu.cn/nix-channels/nixos-26.05/nixexprs.tar.xz";
nixpkgs-unstable.url = "tarball+https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz";
# Exact revisions of the source archives previously used on agent.
hermes-agent.url = "github:NousResearch/hermes-agent/3f2afed3eb813cb00bd381d29b084d0e01de048f";
omp.url = "github:can1357/oh-my-pi/08542ed0df02ecaa78aaab28388aa6a563045f16";
herdr-nix = {
url = "github:herdrdev/herdr-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
@@ -14,6 +23,11 @@
url = "github:nix-community/nix4nvchad";
inputs.nixpkgs.follows = "nixpkgs";
};
# Keep the agent VM on its currently installed NvChad module revision.
agent-nix4nvchad = {
url = "github:nix-community/nix4nvchad/042bbb1be519d01c76d8c65b2e004212b5b706ad";
inputs.nixpkgs.follows = "agent-nixpkgs";
};
# NixOS WSL
nixos-wsl = {
@@ -31,17 +45,25 @@
};
};
outputs = inputs@{ nixpkgs, home-manager, ... }:
let
username = "luochen570";
hosts = import ./lib/hosts.nix;
mkHost = import ./lib/mkHost.nix {
inherit nixpkgs home-manager inputs;
outputs =
inputs@{ nixpkgs, home-manager, ... }:
let
username = "luochen570";
hosts = import ./lib/hosts.nix;
mkConfiguredHost =
hostname: cfg:
(import ./lib/mkHost.nix {
nixpkgs = if hostname == "agent" then inputs.agent-nixpkgs else nixpkgs;
inherit home-manager inputs;
})
(
{
inherit hostname username;
}
// cfg
);
in
{
nixosConfigurations = nixpkgs.lib.mapAttrs mkConfiguredHost hosts;
};
mkConfiguredHost = hostname: cfg: mkHost ({
inherit hostname username;
} // cfg);
in {
nixosConfigurations = nixpkgs.lib.mapAttrs mkConfiguredHost hosts;
};
}