Skip to content

Commit 5d3fb09

Browse files
authored
tree-wide: drop deployments.nix and move config to flake#nynxDeployments (#4)
* drop deployments.nix and move config to flake#nynxDeployments * tree-wide: nix fmt * README.md, flake.nix: document new schema * flake: fix darin output
1 parent 805527a commit 5d3fb09

8 files changed

Lines changed: 1464 additions & 129 deletions

File tree

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ nix build .#nynx
1515
Run deployments:
1616

1717
```
18-
nix run .#nynx -- --flake <flake-url> --operation <operation> --deployments <deployments-file>
18+
nix run .#nynx -- --flake <flake-url> --operation <operation>
1919
```
2020

2121
### Flags
2222

2323
- `--build-host`: Specify the host on which to build closures (default: `localhost`).
24-
- `--deployments`: Path to the `deployments.nix` file (default: `deployments.nix`).
2524
- `--flake`: Specify the flake path or URL (e.g., `github:alyraffauf/nixcfg`).
2625
- `--jobs`: Comma-separated subset of jobs to run (default: all jobs).
2726
- `--operation`: Operation to perform (`switch`, or `activate` for Darwin; `boot`, `test`, `switch` for NixOS).
@@ -42,31 +41,25 @@ Run specific deployment jobs:
4241
nix run .#nynx -- --flake github:alyraffauf/nixcfg --operation switch --jobs server,workstation
4342
```
4443

45-
### Sample deployments.nix
44+
### Sample #nynxDeployments
4645

47-
Nynx is configured with a Nix attrset that defines a set of deployment jobs.
46+
Nynx is configured with a Flake output containing an attrset that defines a set of deployment jobs. Outputs can be declared in the same Flake or in an upstream Flake.
4847

4948
```nix
5049
{
51-
job1 = {
52-
output = "host1"; # Will be inferred from job name if not present.
53-
hostname = "192.168.1.1"; # Also inferred from job name if not present.
54-
type = "nixos";
55-
user = "root";
56-
};
57-
58-
job2 = {
59-
output = "host2";
60-
hostname = "website.com";
61-
type = "nixos";
62-
user = "root";
63-
};
64-
65-
job2 = {
66-
output = "host3";
67-
hostname = "host3.local";
68-
user = "root";
69-
type = "darwin";
50+
nynxDeployments = {
51+
evergrande = {
52+
hostname = "evergrande"; # Will be assumed from deployment name if not specified.
53+
output = self.inputs.nixcfg.nixosConfigurations.evergrande.config.system.build.toplevel;
54+
type = "nixos";
55+
user = "root";
56+
};
57+
58+
fortree = {
59+
output = self.darwinConfigurations.fortree.config.system.build.toplevel;
60+
user = "aly";
61+
type = "darwin";
62+
};
7063
};
7164
}
7265
```

examples/darwin.nix

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/mixed.nix

Lines changed: 0 additions & 24 deletions
This file was deleted.

examples/nixos.nix

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)