ci: eval deploy

This commit is contained in:
xinyangli 2024-12-20 18:03:12 +08:00
parent 273c0932b1
commit 6fe7504460
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
3 changed files with 65 additions and 8 deletions

51
.github/workflows/eval.yaml vendored Normal file
View file

@ -0,0 +1,51 @@
name: Eval NixOS Configurations
on:
push:
branches:
- deploy
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: deploy
- name: Install Nix
uses: cachix/install-nix-action@v25
- name: Configure Git
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "actions@github.com"
- name: Process Configurations
run: |
git checkout -b deploy-comin-eval
mkdir -p eval
hosts=$(nix flake show --json | jq -r '.nixosConfigurations | keys[]')
echo "Found hosts: $hosts"
for host in $hosts; do
echo "Eval derivation for $host"
if ! nix show-derivation -L ".#nixosConfigurations.$host.config.system.build.toplevel" > "eval/$host.json"; then
echo "❌ Failed to evaluate $host"
else
echo "✅ Successfully evaluated $host"
fi
done
echo "Total hosts: $(echo "$hosts" | wc -w)"
echo "Failed hosts: $failed_hosts"
git add eval/
git commit -m "Update deployment configurations for all hosts"
git push origin deploy-comin-eval

4
flake.lock generated
View file

@ -382,11 +382,11 @@
"rev": "a3709a89797ea094f82d38edeb4a538c07c8c3fa", "rev": "a3709a89797ea094f82d38edeb4a538c07c8c3fa",
"revCount": 20, "revCount": 20,
"type": "git", "type": "git",
"url": "https://git.xinyang.life/xin/nixvim" "url": "https://git.xiny.li/xin/nixvim"
}, },
"original": { "original": {
"type": "git", "type": "git",
"url": "https://git.xinyang.life/xin/nixvim" "url": "https://git.xiny.li/xin/nixvim"
} }
}, },
"nix-darwin": { "nix-darwin": {

View file

@ -43,7 +43,7 @@
}; };
my-nixvim = { my-nixvim = {
url = "git+https://git.xinyang.life/xin/nixvim"; url = "git+https://git.xiny.li/xin/nixvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
@ -286,16 +286,22 @@
{ {
imports = nodeNixosModules.biotite ++ sharedColmenaModules; imports = nodeNixosModules.biotite ++ sharedColmenaModules;
}; };
osmium =
{ ... }:
{
deployment = {
targetHost = "osmium.coho-tet.ts.net";
buildOnTarget = false;
};
imports = nodeNixosModules.osmium ++ sharedColmenaModules;
};
}; };
nixosConfigurations = { nixosConfigurations = {
calcite = mkNixos { calcite = mkNixos {
hostname = "calcite"; hostname = "calcite";
}; };
osmium = mkNixos {
hostname = "osmium";
};
} // self.colmenaHive.nodes; } // self.colmenaHive.nodes;
} }
@ -305,7 +311,7 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
mkHomeConfiguration = user: host: { mkHomeConfiguration = user: host: {
name = user; name = "${user}-${host}";
value = home-manager.lib.homeManagerConfiguration { value = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [