Commit graph

108 commits

Author SHA1 Message Date
Justinas Stankevicius
10f98d715f Propagate same 'pkgs' to all modules 2021-02-16 20:53:43 +02:00
Zhaofeng Li
6a9282e121 exec: Remove outdated doc 2021-02-12 16:21:38 -08:00
Zhaofeng Li
30dc352eb9 eval.nix: Add type checking to meta/network
Primarily to make the evaluation error out if the configuration
tries to use non-existent options (e.g., pinning Nixpkgs with
morph-specific options).
2021-02-12 14:52:09 -08:00
Zhaofeng Li
d0bba90d04 ssh: Fix shell escaping
The previous `sh -c` invocation was incorrect and just happened
to work on hosts with a Bourne-compatible shell set as the login
shell. Commands in the deploy script were being executed in the
login shell.
2021-02-12 13:55:44 -08:00
Zhaofeng Li
95ddbcbfd6 ssh/deploy-key: Skip chown if the user/group doesn't exist
This matches the behavior of NixOps.

Potential solution to #10.
2021-02-12 13:54:17 -08:00
Zhaofeng Li
dbd66d7c7c Add initial set of tests 2021-02-11 13:27:21 -08:00
Zhaofeng Li
114c344dbb
Merge pull request #9 from justinas/handle-keycommand-errors
Handle and report errors of key source, do not write out key if keyCommand failed
2021-02-11 13:13:08 -08:00
Justinas Stankevicius
4c7f8eb838 keyCommand: on error, do not upload key, report 2021-02-11 21:16:56 +02:00
Zhaofeng Li
e49e9367c0 key: Serialize KeySource through an intermediate struct
Well, still better than `if/else`-ing all the way. Also we
definitely need unit tests.

See #8.
2021-02-11 00:51:11 -08:00
Zhaofeng Li
2886662e18 nix: Key names can contain one path component only
Well, I changed my mind and this should be cleaner.
2021-02-10 18:17:55 -08:00
Zhaofeng Li
28b635a6e8 README.md: Add example usage of keyCommand 2021-02-10 18:12:28 -08:00
Zhaofeng Li
52622ecd27 Add 'deployment.keys.<key>.keyCommand' support
Fixes #3.
2021-02-10 18:08:47 -08:00
Zhaofeng Li
ce9f639a53 key: Make the key source better typed 2021-02-10 17:34:52 -08:00
Zhaofeng Li
62753ea138 progress: Let's just call them "tasks" instead of "processes"... 2021-02-10 17:20:49 -08:00
Zhaofeng Li
9d59a6a288
Merge pull request #5 from justinas/keys-keyfile
Add 'deployment.keys.<key>.keyFile' option
2021-02-10 17:20:28 -08:00
Justinas Stankevicius
d90fc56bc3 Implement key upload from local file 2021-02-10 20:37:54 +02:00
Justinas Stankevicius
f521f19629 Add deployment.keys.<key>.keyFile option 2021-02-10 20:37:54 +02:00
Zhaofeng Li
afabd8c6f9 Minor tokio cleanup 2021-02-10 10:29:17 -08:00
Zhaofeng Li
9f4d5a2221 Target stable toolchain 2021-02-10 00:41:02 -08:00
Zhaofeng Li
9a588815c8 exec.rs: Wording 2021-02-10 00:22:17 -08:00
Zhaofeng Li
13903800a8 README.md: More docs and sample output 2021-02-10 00:19:39 -08:00
Zhaofeng Li
d9d9bf48f6 apply.rs: Remove unused build limit flag 2021-02-09 22:33:45 -08:00
Zhaofeng Li
78a6825be6 Add exec command 2021-02-09 22:07:10 -08:00
Zhaofeng Li
1c9e7cdb83 Allow customization of SSH configurations 2021-02-09 21:02:00 -08:00
Zhaofeng Li
a2fa8f1da7 Clean up logging / progress display 2021-02-09 19:28:45 -08:00
Zhaofeng Li
8934726664 More fixes to key deployment and logging 2021-02-09 14:57:11 -08:00
Zhaofeng Li
a703a8b031 README.md: Fix silly typos :/ 2021-02-09 14:30:50 -08:00
Zhaofeng Li
84aa165aef Refactoring and deployment.keys implementation
More refactoring of the deployment process, as well as an initial
implementation of `deployment.keys`.

Fixes #2.
2021-02-08 19:00:29 -08:00
Zhaofeng Li
21c2bef3ad Small fixes to eval logging 2021-02-05 02:20:57 -08:00
Zhaofeng Li
406e5a6443 apply-local: Allow overriding the node name 2021-02-05 02:20:08 -08:00
Zhaofeng Li
6e909477ae nix/deployment: Well, that's an embarrassing typo... 2021-01-29 21:24:05 -08:00
Zhaofeng Li
68ecb095b8 nix: Small fixes to logging 2021-01-28 23:58:54 -08:00
Zhaofeng Li
ade2095919 Remove unused --no-build-substitutes
Ended up not implementing this.
2021-01-24 17:26:50 -08:00
Zhaofeng Li
506b894be6 Redesign deployment process
Now evaluation can be automatically split into chunks based on available
RAM. All three stages of the deployment process (evaluate, build,
apply) can happen concurrently.

Fixes #1.
2021-01-24 14:08:48 -08:00
Zhaofeng Li
f53ebef41c nix/eval.nix: Disallow setting network and meta at the same time 2021-01-17 00:06:45 -08:00
Zhaofeng Li
2050e84bb8 nix/eval.nix: Support setting meta.nixpkgs to a .nix that returns an initialized Nixpkgs attrset 2021-01-17 00:06:20 -08:00
Zhaofeng Li
9152c7b91d README.md: Add nix-env installation instructions 2021-01-13 16:58:18 -08:00
Zhaofeng Li
f3bf3dc492 Allow disabling --use-substitutes and --gzip during copying 2021-01-13 12:20:34 -08:00
Zhaofeng Li
2cb429ed8d Minor fixes to CLI help messages 2021-01-01 20:45:41 -08:00
Zhaofeng Li
be8e30cebf deployment.rs: Strip line endings for error logs 2020-12-30 16:54:07 -08:00
Zhaofeng Li
1125eb6d1b nix: Suppress GC warnings
The derivations and built closures are intentionally not added as GC
roots. Maybe we can provide an option for those who want GC roots
to be created.
2020-12-29 12:10:00 -08:00
Zhaofeng Li
4c1ce95c15 apply_local.rs: s/Coult/Could 2020-12-29 12:05:06 -08:00
Zhaofeng Li
60d6475897 Traverse up to find hive.nix by default, and other CLI ergonomics fixes 2020-12-29 12:02:50 -08:00
Zhaofeng Li
9c8e3034f7 deployment.rs: Clippy 2020-12-28 21:35:57 -08:00
Zhaofeng Li
ed52e259aa Add support for --show-trace 2020-12-28 21:35:43 -08:00
Zhaofeng Li
ab6515d935 eval.nix: Do not specify system in evalConfig 2020-12-28 17:17:13 -08:00
Zhaofeng Li
9a75598962 Hi Tokio 1.0! 2020-12-23 13:28:25 -08:00
Zhaofeng Li
c60d63e053 deployment.rs: There is nothing "internal" now about the error after the refactor 2020-12-20 00:58:51 -08:00
Zhaofeng Li
d99089ad6b nix: Set profile only with certain goals 2020-12-19 16:34:24 -08:00
Zhaofeng Li
480d7ea5a1 apply_local: Refactoring oops 2020-12-19 16:28:55 -08:00