File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 4141 let
4242 pkgs = nixpkgs . legacyPackages . ${ system } ;
4343
44+ evalServerScript = pkgs . writeShellApplication {
45+ name = "eval-server" ;
46+ runtimeInputs = [ pkgs . nix ] ;
47+ text = ''
48+ set -euo pipefail
49+
50+ echo "▶ Evaluating NixOS configuration for '.#server'..."
51+ nix eval .#nixosConfigurations.server.config.system.build.toplevel > /dev/null
52+ echo "✅ Evaluation succeeded — configuration is valid."
53+ '' ;
54+ } ;
55+
4456 deployServerScript = pkgs . writeShellApplication {
4557 name = "deploy-server" ;
46- runtimeInputs = [
47- pkgs . nix
48- pkgs . openssh
58+ runtimeInputs = with pkgs ; [
59+ nix
60+ openssh
4961 ] ;
5062 text = ''
63+ set -euo pipefail
64+
65+ "${ evalServerScript } /bin/eval-server"
66+
5167 nix run nixpkgs#nixos-rebuild-ng -- \
5268 --flake .#server \
53695874 } ;
5975 in
6076 {
77+ eval-server = {
78+ type = "app" ;
79+ program = "${ evalServerScript } /bin/eval-server" ;
80+ } ;
81+
6182 deploy-server = {
6283 type = "app" ;
6384 program = "${ deployServerScript } /bin/deploy-server" ;
You can’t perform that action at this time.
0 commit comments