confctl 2.2.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/.git-hooks/pre_commit/nixfmt.rb +13 -0
  3. data/.github/workflows/rspec.yml +64 -0
  4. data/.github/workflows/rubocop.yml +27 -0
  5. data/.github/workflows/tests.yml +139 -0
  6. data/.gitignore +12 -7
  7. data/.overcommit.yml +2 -0
  8. data/.rspec +1 -0
  9. data/.rubocop.yml +8 -1
  10. data/AGENTS.md +42 -0
  11. data/CHANGELOG.md +57 -0
  12. data/Gemfile +3 -2
  13. data/Gemfile.lock +198 -0
  14. data/README.md +166 -58
  15. data/Rakefile +5 -0
  16. data/confctl.gemspec +20 -2
  17. data/docs/carrier.md +3 -3
  18. data/docs/flake-inputs.md +159 -0
  19. data/docs/swpins-to-flakes.md +325 -0
  20. data/example/cluster/module-list.nix +2 -1
  21. data/example/cluster/nixos-machine/config.nix +12 -2
  22. data/example/cluster/nixos-machine/hardware.nix +6 -1
  23. data/example/cluster/vpsadminos-container/config.nix +6 -1
  24. data/example/cluster/vpsadminos-container/module.nix +4 -1
  25. data/example/cluster/vpsadminos-machine/config.nix +6 -1
  26. data/example/cluster/vpsadminos-machine/hardware.nix +6 -1
  27. data/example/cluster/vpsadminos-machine/module.nix +5 -2
  28. data/example/cluster/vpsfreecz-vps/config.nix +6 -1
  29. data/example/cluster/vpsfreecz-vps/module.nix +4 -1
  30. data/example/configs/swpins.nix +8 -3
  31. data/example/environments/base.nix +6 -1
  32. data/example/swpins/core.json +35 -0
  33. data/example-flake/.gitignore +2 -0
  34. data/example-flake/README.md +38 -0
  35. data/example-flake/cluster/cluster.nix +5 -0
  36. data/example-flake/cluster/module-list.nix +4 -0
  37. data/example-flake/cluster/nested/nixos-machine/config.nix +25 -0
  38. data/example-flake/cluster/nested/nixos-machine/hardware.nix +9 -0
  39. data/example-flake/cluster/nested/nixos-machine/module.nix +8 -0
  40. data/example-flake/cluster/nixos-machine/config.nix +25 -0
  41. data/example-flake/cluster/nixos-machine/hardware.nix +9 -0
  42. data/example-flake/cluster/nixos-machine/module.nix +8 -0
  43. data/example-flake/cluster/vpsadminos-container/config.nix +28 -0
  44. data/example-flake/cluster/vpsadminos-container/module.nix +8 -0
  45. data/example-flake/cluster/vpsadminos-machine/config.nix +27 -0
  46. data/example-flake/cluster/vpsadminos-machine/hardware.nix +9 -0
  47. data/example-flake/cluster/vpsadminos-machine/module.nix +8 -0
  48. data/example-flake/cluster/vpsfreecz-vps/config.nix +31 -0
  49. data/example-flake/cluster/vpsfreecz-vps/module.nix +8 -0
  50. data/example-flake/configs/confctl.nix +10 -0
  51. data/example-flake/data/default.nix +5 -0
  52. data/example-flake/data/ssh-keys.nix +7 -0
  53. data/example-flake/environments/base.nix +18 -0
  54. data/example-flake/flake.lock +75 -0
  55. data/example-flake/flake.nix +36 -0
  56. data/example-flake/modules/module-list.nix +13 -0
  57. data/example-flake/shell.nix +11 -0
  58. data/flake.lock +159 -0
  59. data/flake.nix +189 -0
  60. data/gemset.nix +1022 -0
  61. data/lib/confctl/cli/app.rb +145 -0
  62. data/lib/confctl/cli/attr_filters.rb +1 -1
  63. data/lib/confctl/cli/cluster.rb +681 -108
  64. data/lib/confctl/cli/command.rb +24 -2
  65. data/lib/confctl/cli/configuration.rb +171 -106
  66. data/lib/confctl/cli/generation.rb +65 -1
  67. data/lib/confctl/cli/inputs/channels.rb +190 -0
  68. data/lib/confctl/cli/inputs/machines.rb +83 -0
  69. data/lib/confctl/cli/inputs/root.rb +101 -0
  70. data/lib/confctl/cli/inputs.rb +5 -0
  71. data/lib/confctl/cli/log_view.rb +21 -10
  72. data/lib/confctl/cli/migrate/swpins_to_flakes.rb +866 -0
  73. data/lib/confctl/cli/migrate.rb +5 -0
  74. data/lib/confctl/cli/output_formatter.rb +5 -7
  75. data/lib/confctl/cli/swpins/base.rb +9 -0
  76. data/lib/confctl/cli/swpins/channel.rb +2 -5
  77. data/lib/confctl/cli/swpins/cluster.rb +2 -5
  78. data/lib/confctl/cli/swpins/core.rb +2 -5
  79. data/lib/confctl/config_type.rb +7 -0
  80. data/lib/confctl/flake_lock.rb +78 -0
  81. data/lib/confctl/flake_lock_diff.rb +36 -0
  82. data/lib/confctl/generation/build.rb +131 -24
  83. data/lib/confctl/generation/build_list.rb +4 -3
  84. data/lib/confctl/generation/unified.rb +14 -1
  85. data/lib/confctl/git_repo_mirror.rb +2 -2
  86. data/lib/confctl/health_checks/run_command.rb +3 -2
  87. data/lib/confctl/health_checks/systemd/properties.rb +1 -1
  88. data/lib/confctl/health_checks/systemd/property_list.rb +2 -2
  89. data/lib/confctl/inputs/commit_message.rb +125 -0
  90. data/lib/confctl/inputs/git_commit.rb +17 -0
  91. data/lib/confctl/inputs/nix_output_guard.rb +37 -0
  92. data/lib/confctl/inputs/setter.rb +179 -0
  93. data/lib/confctl/inputs/updater.rb +76 -0
  94. data/lib/confctl/inputs.rb +5 -0
  95. data/lib/confctl/inputs_info.rb +50 -0
  96. data/lib/confctl/line_buffer.rb +1 -1
  97. data/lib/confctl/machine.rb +18 -3
  98. data/lib/confctl/machine_control.rb +8 -2
  99. data/lib/confctl/machine_list.rb +2 -2
  100. data/lib/confctl/machine_status.rb +63 -20
  101. data/lib/confctl/nix/args.rb +48 -0
  102. data/lib/confctl/nix.rb +30 -437
  103. data/lib/confctl/nix_build_flake.rb +95 -0
  104. data/lib/confctl/nix_copy.rb +14 -2
  105. data/lib/confctl/nix_flake.rb +449 -0
  106. data/lib/confctl/nix_format.rb +3 -3
  107. data/lib/confctl/nix_legacy.rb +467 -0
  108. data/lib/confctl/swpins/change_set.rb +29 -3
  109. data/lib/confctl/swpins/specs/base.rb +2 -2
  110. data/lib/confctl/ui.rb +19 -0
  111. data/lib/confctl/version.rb +1 -1
  112. data/man/index.html +11 -0
  113. data/man/man8/confctl-options.nix.8.html +113 -0
  114. data/man/man8/confctl.8 +152 -21
  115. data/man/man8/confctl.8.html +355 -0
  116. data/man/man8/confctl.8.md +148 -17
  117. data/man/style.css +301 -0
  118. data/nix/evaluator.nix +94 -69
  119. data/nix/flake/mk-confctl-devshell.nix +85 -0
  120. data/nix/flake/mk-confctl-outputs.nix +522 -0
  121. data/nix/flake/mk-config-devshell.nix +168 -0
  122. data/nix/lib/default.nix +118 -65
  123. data/nix/lib/machine/default.nix +65 -45
  124. data/nix/lib/machine/info.nix +16 -5
  125. data/nix/lib/swpins/eval.nix +42 -29
  126. data/nix/lib/swpins/options.nix +6 -2
  127. data/nix/machines.nix +23 -15
  128. data/nix/modules/cluster/default.nix +104 -41
  129. data/nix/modules/confctl/carrier/base.nix +11 -4
  130. data/nix/modules/confctl/carrier/carrier-env.rb +2 -2
  131. data/nix/modules/confctl/carrier/netboot/build-netboot-server.rb +50 -16
  132. data/nix/modules/confctl/carrier/netboot/nixos.nix +56 -24
  133. data/nix/modules/confctl/configuration-info.nix +17 -0
  134. data/nix/modules/confctl/generations.nix +2 -2
  135. data/nix/modules/confctl/host.nix +13 -0
  136. data/nix/modules/confctl/inputs-info.nix +21 -0
  137. data/nix/modules/confctl/kexec-netboot/default.nix +13 -6
  138. data/nix/modules/confctl/kexec-netboot/kexec-netboot.8.adoc +3 -0
  139. data/nix/modules/confctl/kexec-netboot/kexec-netboot.rb +25 -16
  140. data/nix/modules/confctl/nix.nix +31 -1
  141. data/nix/modules/confctl/swpins.nix +13 -6
  142. data/nix/modules/module-list.nix +4 -2
  143. data/nix/modules/system-list.nix +4 -1
  144. data/nix/package.nix +37 -0
  145. data/shell.nix +39 -8
  146. data/skills/confctl-configuration-update/SKILL.md +228 -0
  147. data/skills/confctl-configuration-update/agents/openai.yaml +4 -0
  148. data/skills/confctl-release/SKILL.md +102 -0
  149. data/skills/confctl-release/agents/openai.yaml +4 -0
  150. data/spec/confctl/cli/cluster_health_check_spec.rb +43 -0
  151. data/spec/confctl/cli/cluster_skip_current_deploy_spec.rb +157 -0
  152. data/spec/confctl/cli/cluster_status_flake_spec.rb +83 -0
  153. data/spec/confctl/cli/inputs_set_output_spec.rb +70 -0
  154. data/spec/confctl/configuration_spec.rb +45 -0
  155. data/spec/confctl/inputs_spec.rb +104 -0
  156. data/spec/confctl/machine_control_spec.rb +112 -0
  157. data/spec/confctl/machine_list_spec.rb +47 -0
  158. data/spec/confctl/nix_flake_spec.rb +41 -0
  159. data/spec/confctl/swpins_spec.rb +106 -0
  160. data/spec/generation/build_modes_spec.rb +132 -0
  161. data/spec/inputs/commit_message_spec.rb +205 -0
  162. data/spec/inputs/nix_cached_fallback_spec.rb +50 -0
  163. data/spec/inputs/nix_output_guard_spec.rb +45 -0
  164. data/spec/spec_helper.rb +12 -0
  165. data/spec/support/cli_helper.rb +57 -0
  166. data/test-runner.sh +7 -0
  167. data/tests/all-tests.nix +30 -0
  168. data/tests/make-test.nix +15 -0
  169. data/tests/runner/extensions/confctl_helpers.rb +238 -0
  170. data/tests/runner/extensions/hostfwd_ports.rb +41 -0
  171. data/tests/suite/auto_rollback.nix +344 -0
  172. data/tests/suite/carrier/deploy.nix +751 -0
  173. data/tests/suite/carrier/netboot.nix +849 -0
  174. data/tests/suite/deploy/base.nix +806 -0
  175. data/tests/suite/deploy/flakes.nix +1 -0
  176. data/tests/suite/deploy/swpins.nix +1 -0
  177. metadata +104 -4
  178. data/nix/modules/confctl/overlays.nix +0 -15
@@ -0,0 +1 @@
1
+ import ./base.nix { deployMode = "flakes"; }
@@ -0,0 +1 @@
1
+ import ./base.nix { deployMode = "swpins"; }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan
@@ -199,18 +199,52 @@ extensions: []
199
199
  extra_rdoc_files: []
200
200
  files:
201
201
  - ".editorconfig"
202
+ - ".git-hooks/pre_commit/nixfmt.rb"
203
+ - ".github/workflows/rspec.yml"
204
+ - ".github/workflows/rubocop.yml"
205
+ - ".github/workflows/tests.yml"
202
206
  - ".gitignore"
203
207
  - ".overcommit.yml"
208
+ - ".rspec"
204
209
  - ".rubocop.yml"
205
210
  - ".rubocop_todo.yml"
211
+ - AGENTS.md
206
212
  - CHANGELOG.md
207
213
  - Gemfile
214
+ - Gemfile.lock
208
215
  - LICENSE.txt
209
216
  - README.md
210
217
  - Rakefile
211
218
  - bin/confctl
212
219
  - confctl.gemspec
213
220
  - docs/carrier.md
221
+ - docs/flake-inputs.md
222
+ - docs/swpins-to-flakes.md
223
+ - example-flake/.gitignore
224
+ - example-flake/README.md
225
+ - example-flake/cluster/cluster.nix
226
+ - example-flake/cluster/module-list.nix
227
+ - example-flake/cluster/nested/nixos-machine/config.nix
228
+ - example-flake/cluster/nested/nixos-machine/hardware.nix
229
+ - example-flake/cluster/nested/nixos-machine/module.nix
230
+ - example-flake/cluster/nixos-machine/config.nix
231
+ - example-flake/cluster/nixos-machine/hardware.nix
232
+ - example-flake/cluster/nixos-machine/module.nix
233
+ - example-flake/cluster/vpsadminos-container/config.nix
234
+ - example-flake/cluster/vpsadminos-container/module.nix
235
+ - example-flake/cluster/vpsadminos-machine/config.nix
236
+ - example-flake/cluster/vpsadminos-machine/hardware.nix
237
+ - example-flake/cluster/vpsadminos-machine/module.nix
238
+ - example-flake/cluster/vpsfreecz-vps/config.nix
239
+ - example-flake/cluster/vpsfreecz-vps/module.nix
240
+ - example-flake/configs/confctl.nix
241
+ - example-flake/data/default.nix
242
+ - example-flake/data/ssh-keys.nix
243
+ - example-flake/environments/base.nix
244
+ - example-flake/flake.lock
245
+ - example-flake/flake.nix
246
+ - example-flake/modules/module-list.nix
247
+ - example-flake/shell.nix
214
248
  - example/.gitignore
215
249
  - example/README.md
216
250
  - example/cluster/cluster.nix
@@ -234,6 +268,10 @@ files:
234
268
  - example/shell.nix
235
269
  - example/swpins/channels/nixos-unstable.json
236
270
  - example/swpins/channels/vpsadminos-staging.json
271
+ - example/swpins/core.json
272
+ - flake.lock
273
+ - flake.nix
274
+ - gemset.nix
237
275
  - lib/confctl.rb
238
276
  - lib/confctl/cli.rb
239
277
  - lib/confctl/cli/app.rb
@@ -243,7 +281,13 @@ files:
243
281
  - lib/confctl/cli/configuration.rb
244
282
  - lib/confctl/cli/gen_data.rb
245
283
  - lib/confctl/cli/generation.rb
284
+ - lib/confctl/cli/inputs.rb
285
+ - lib/confctl/cli/inputs/channels.rb
286
+ - lib/confctl/cli/inputs/machines.rb
287
+ - lib/confctl/cli/inputs/root.rb
246
288
  - lib/confctl/cli/log_view.rb
289
+ - lib/confctl/cli/migrate.rb
290
+ - lib/confctl/cli/migrate/swpins_to_flakes.rb
247
291
  - lib/confctl/cli/output_formatter.rb
248
292
  - lib/confctl/cli/swpins.rb
249
293
  - lib/confctl/cli/swpins/base.rb
@@ -254,8 +298,11 @@ files:
254
298
  - lib/confctl/cli/tag_filters.rb
255
299
  - lib/confctl/conf_cache.rb
256
300
  - lib/confctl/conf_dir.rb
301
+ - lib/confctl/config_type.rb
257
302
  - lib/confctl/erb_template.rb
258
303
  - lib/confctl/exceptions.rb
304
+ - lib/confctl/flake_lock.rb
305
+ - lib/confctl/flake_lock_diff.rb
259
306
  - lib/confctl/gcroot.rb
260
307
  - lib/confctl/generation/build.rb
261
308
  - lib/confctl/generation/build_list.rb
@@ -271,6 +318,13 @@ files:
271
318
  - lib/confctl/health_checks/systemd/property_check.rb
272
319
  - lib/confctl/health_checks/systemd/property_list.rb
273
320
  - lib/confctl/hook.rb
321
+ - lib/confctl/inputs.rb
322
+ - lib/confctl/inputs/commit_message.rb
323
+ - lib/confctl/inputs/git_commit.rb
324
+ - lib/confctl/inputs/nix_output_guard.rb
325
+ - lib/confctl/inputs/setter.rb
326
+ - lib/confctl/inputs/updater.rb
327
+ - lib/confctl/inputs_info.rb
274
328
  - lib/confctl/line_buffer.rb
275
329
  - lib/confctl/logger.rb
276
330
  - lib/confctl/machine.rb
@@ -279,10 +333,14 @@ files:
279
333
  - lib/confctl/machine_status.rb
280
334
  - lib/confctl/module_options.rb
281
335
  - lib/confctl/nix.rb
336
+ - lib/confctl/nix/args.rb
282
337
  - lib/confctl/nix_build.rb
338
+ - lib/confctl/nix_build_flake.rb
283
339
  - lib/confctl/nix_collect_garbage.rb
284
340
  - lib/confctl/nix_copy.rb
341
+ - lib/confctl/nix_flake.rb
285
342
  - lib/confctl/nix_format.rb
343
+ - lib/confctl/nix_legacy.rb
286
344
  - lib/confctl/nix_literal_expression.rb
287
345
  - lib/confctl/null_logger.rb
288
346
  - lib/confctl/parallel_executor.rb
@@ -303,16 +361,24 @@ files:
303
361
  - lib/confctl/swpins/specs/git.rb
304
362
  - lib/confctl/swpins/specs/git_rev.rb
305
363
  - lib/confctl/system_command.rb
364
+ - lib/confctl/ui.rb
306
365
  - lib/confctl/user_script.rb
307
366
  - lib/confctl/user_scripts.rb
308
367
  - lib/confctl/utils/file.rb
309
368
  - lib/confctl/version.rb
310
369
  - libexec/auto-rollback.rb
370
+ - man/index.html
311
371
  - man/man8/confctl-options.nix.8
372
+ - man/man8/confctl-options.nix.8.html
312
373
  - man/man8/confctl-options.nix.8.md
313
374
  - man/man8/confctl.8
375
+ - man/man8/confctl.8.html
314
376
  - man/man8/confctl.8.md
377
+ - man/style.css
315
378
  - nix/evaluator.nix
379
+ - nix/flake/mk-confctl-devshell.nix
380
+ - nix/flake/mk-confctl-outputs.nix
381
+ - nix/flake/mk-config-devshell.nix
316
382
  - nix/lib/default.nix
317
383
  - nix/lib/machine/default.nix
318
384
  - nix/lib/machine/info.nix
@@ -325,18 +391,52 @@ files:
325
391
  - nix/modules/confctl/carrier/netboot/build-netboot-server.rb
326
392
  - nix/modules/confctl/carrier/netboot/nixos.nix
327
393
  - nix/modules/confctl/cli.nix
394
+ - nix/modules/confctl/configuration-info.nix
328
395
  - nix/modules/confctl/generations.nix
396
+ - nix/modules/confctl/host.nix
397
+ - nix/modules/confctl/inputs-info.nix
329
398
  - nix/modules/confctl/kexec-netboot/default.nix
330
399
  - nix/modules/confctl/kexec-netboot/kexec-netboot.8.adoc
331
400
  - nix/modules/confctl/kexec-netboot/kexec-netboot.rb
332
401
  - nix/modules/confctl/nix.nix
333
- - nix/modules/confctl/overlays.nix
334
402
  - nix/modules/confctl/swpins.nix
335
403
  - nix/modules/module-list.nix
336
404
  - nix/modules/system-list.nix
405
+ - nix/package.nix
337
406
  - shell.nix
407
+ - skills/confctl-configuration-update/SKILL.md
408
+ - skills/confctl-configuration-update/agents/openai.yaml
409
+ - skills/confctl-release/SKILL.md
410
+ - skills/confctl-release/agents/openai.yaml
411
+ - spec/confctl/cli/cluster_health_check_spec.rb
412
+ - spec/confctl/cli/cluster_skip_current_deploy_spec.rb
413
+ - spec/confctl/cli/cluster_status_flake_spec.rb
414
+ - spec/confctl/cli/inputs_set_output_spec.rb
415
+ - spec/confctl/configuration_spec.rb
416
+ - spec/confctl/inputs_spec.rb
417
+ - spec/confctl/machine_control_spec.rb
418
+ - spec/confctl/machine_list_spec.rb
419
+ - spec/confctl/nix_flake_spec.rb
420
+ - spec/confctl/swpins_spec.rb
421
+ - spec/generation/build_modes_spec.rb
422
+ - spec/inputs/commit_message_spec.rb
423
+ - spec/inputs/nix_cached_fallback_spec.rb
424
+ - spec/inputs/nix_output_guard_spec.rb
425
+ - spec/spec_helper.rb
426
+ - spec/support/cli_helper.rb
338
427
  - template/confctl-options.nix/main.erb
339
428
  - template/confctl-options.nix/options.erb
429
+ - test-runner.sh
430
+ - tests/all-tests.nix
431
+ - tests/make-test.nix
432
+ - tests/runner/extensions/confctl_helpers.rb
433
+ - tests/runner/extensions/hostfwd_ports.rb
434
+ - tests/suite/auto_rollback.nix
435
+ - tests/suite/carrier/deploy.nix
436
+ - tests/suite/carrier/netboot.nix
437
+ - tests/suite/deploy/base.nix
438
+ - tests/suite/deploy/flakes.nix
439
+ - tests/suite/deploy/swpins.nix
340
440
  licenses:
341
441
  - GPL-3.0-only
342
442
  metadata: {}
@@ -347,14 +447,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
347
447
  requirements:
348
448
  - - ">="
349
449
  - !ruby/object:Gem::Version
350
- version: 3.1.0
450
+ version: 3.3.0
351
451
  required_rubygems_version: !ruby/object:Gem::Requirement
352
452
  requirements:
353
453
  - - ">="
354
454
  - !ruby/object:Gem::Version
355
455
  version: '0'
356
456
  requirements: []
357
- rubygems_version: 3.6.6
457
+ rubygems_version: 3.7.2
358
458
  specification_version: 4
359
459
  summary: Nix deployment management tool
360
460
  test_files: []
@@ -1,15 +0,0 @@
1
- { config, ... }:
2
- {
3
- nixpkgs.overlays = [
4
- (self: super: {
5
- # nixos-unstable removed pkgs.substituteAll, but nixos-25.05 does not
6
- # include the new function pkgs.replaceVarsWith
7
- confReplaceVarsWith =
8
- { replacements, ... } @ args:
9
- if builtins.hasAttr "replaceVarsWith" self then
10
- self.replaceVarsWith args
11
- else
12
- self.substituteAll ((builtins.removeAttrs args [ "replacements" ]) // replacements);
13
- })
14
- ];
15
- }