Commit Graph

3718 Commits

Author SHA1 Message Date
Johannes Kirschbauer
c0225ea757 cli: fix dot files not copied $out in buildPythonApplication
File such as .envrc, .gitignore where not copied into the package and thus missing in all templates
2025-07-17 12:12:40 +02:00
Kenji Berthold
7255673440 Merge pull request 'pkgs/cli: Validate clan directory for update-hardware-config' (#4367) from kenji/ke-hardware-update-validation into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4367
2025-07-17 12:12:39 +02:00
a-kenji
26fdfeec00 pkgs/cli: Validate clan directory for update-hardware-config 2025-07-17 12:12:39 +02:00
hsjobeki
338a6ad340 revert bd3861c580
revert Merge pull request 'Remove clanModules/*' (#4202) from remove-modules into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4202

See: https://git.clan.lol/clan/clan-core/issues/4365

Not all modules are migrated.
If they are not migrated, we need to write migration docs and please display the link to the migration docs
2025-07-17 12:12:39 +02:00
Luis Hebendanz
5b651752ba Merge pull request 'pkgs/cli: Fix ssh logging' (#4362) from kenji/ke-ssh-remove-debug into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4362
2025-07-17 12:12:39 +02:00
kenji
a0c3b6d33e Merge pull request 'pkgs/clan(templates): Add shell completions' (#4327) from kenji/ke-disko-shell into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4327
2025-07-17 12:12:39 +02:00
kenji
38fafba6d8 Merge pull request 'pkgs/cli: Add facts deprecation warning to clan facts help output' (#4329) from kenji/ke-facts-cli-warning into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4329
2025-07-17 12:12:39 +02:00
pinpox
7266e4b273 Merge pull request 'Remove clanModules/*' (#4202) from remove-modules into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4202
2025-07-17 12:12:39 +02:00
pinpox
546eeb22d0 Remove clanModules 2025-07-17 12:12:39 +02:00
a-kenji
c40fca6261 pkgs/clan(templates): Add shell completions 2025-07-15 14:46:04 +02:00
a-kenji
936290b01d pkgs/cli: Add facts deprecation warning to clan facts help output 2025-07-15 14:28:36 +02:00
a-kenji
e342996306 pkgs/cli: Fix ssh logging
Fix the ssh logging level.
Currently the ssh commands is printed every time on an ssh connection.
While seeing the command is useful, we should print this when running
clan with the `--debug` flag.
2025-07-15 14:20:40 +02:00
a-kenji
8178c41c7b pkgs/clan: Add clan validation to vars
Add clan validation to vars and facts subcommmands
2025-07-15 14:01:41 +02:00
a-kenji
6347bb7f3a pkgs/clan: Further unify clan flake validation
Further unify clan flake validation and improve test coverage.
2025-07-15 13:03:49 +02:00
a-kenji
2ddba36b17 pkgs/clan: Add flake validation to clan show 2025-07-15 12:04:23 +02:00
a-kenji
d4cb206e3e pkgs/cli: Add require_flake clan validation logic
Add a `require_flake` function that checks, if no argument is passed, if
we are in a clan directory.
If not will throw a helpful error.

Before `clan show`:

```
Traceback (most recent call last):
  File "/nix/store/8kb3l3yvz6svygnxdlrw5lmd3h3chc8a-clan-cli/bin/.clan-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/8kb3l3yvz6svygnxdlrw5lmd3h3chc8a-clan-cli/lib/python3.13/site-packages/clan_cli/cli.py", line 493, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/nix/store/8kb3l3yvz6svygnxdlrw5lmd3h3chc8a-clan-cli/lib/python3.13/site-packages/clan_cli/clan/show.py", line 12, in show_command
    meta = get_clan_details(flake)
  File "/nix/store/8kb3l3yvz6svygnxdlrw5lmd3h3chc8a-clan-cli/lib/python3.13/site-packages/clan_lib/clan/get.py", line 22, in get_clan_details
    if flake.is_local and not flake.path.exists():
       ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'is_local'
```

with `require_flake`:

```
No clan flake found in the current directory or its parents - Use the --flake flag to specify a clan flake path or URL
```
2025-07-15 12:01:20 +02:00
Qubasa
e8b5e2c2c5 clan-cli: Fixup clan install which depends on ssh_parseargs.
clan-cli: Remove --ssh-option for now, as it can't work in current state

clan-cli: Remove nix_config from test as its impure
2025-07-14 20:47:49 +07:00
Qubasa
9630b6dbe4 clan-cli: Make 'clan ssh' read out the targetHost to connect to 2025-07-14 19:35:48 +07:00
Qubasa
36282b92bc clan-cli: improve log messages further
nix fmt
2025-07-14 12:02:03 +07:00
Qubasa
0cf35480a2 clan-cli: Filter out flake select traces to improve debug log visibility 2025-07-14 11:51:35 +07:00
hsjobeki
311d68dfff Merge pull request 'ui/scene: refactor simplify select animation' (#4325) from ui-scene-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4325
2025-07-13 18:56:12 +00:00
Johannes Kirschbauer
8627398e3e ui/scene: simplify select animation 2025-07-13 20:44:12 +02:00
Johannes Kirschbauer
d87a771a78 ui/scene: rename file 2025-07-13 20:43:35 +02:00
hsjobeki
e8ecd22bab Merge pull request 'clan_cli: move __init__.py into cli.py' (#4323) from cli into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4323
2025-07-13 16:14:21 +00:00
Johannes Kirschbauer
b0ef0cf341 clan_cli: add empty __init__.py for relative imports 2025-07-13 18:03:56 +02:00
Johannes Kirschbauer
3e82e63443 clan_cli: rename references 2025-07-13 15:53:10 +02:00
Johannes Kirschbauer
f3dab3f9bb clan_cli: move __init__.py into cli.py
This helps to reduce import cycles in python
If ANY python module from clan_cli is imported all the imports of the __init__.py are executed leading to a lot of cycles
2025-07-13 15:52:29 +02:00
Johannes Kirschbauer
fc6faa882b api/services: add get_service_module_schema 2025-07-13 14:56:57 +02:00
Johannes Kirschbauer
9c7f684ec5 instances: create_service_instance init 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
6d2f522cbb lib/modules: list modules consistent argument 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
079f5d1033 lib/modules: rename 'list_modules' to 'list_service_modules' 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
ceb0221daf lib/disks: move from api to templates 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
943dde4bbf lib/modules: move from api to services module 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
5f19e76cd0 api/modules: remove redundant localModules 2025-07-13 11:52:19 +02:00
Johannes Kirschbauer
9ece8c6d10 Templates/cli: improve ux and docs 2025-07-12 17:21:23 +02:00
hsjobeki
f9f9d8b936 Merge pull request 'pkgs/clan(templates): Fix template help' (#4315) from ke-fix-template-help into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4315
2025-07-12 15:06:31 +00:00
a-kenji
9a5fa7406d pkgs/clan(templates): Fix template help
Currently the template help has the following interface:

```
usage: clan [-h] [SUBCOMMAND]

The clan cli tool

positional arguments:
  {show,backups,b,flakes,f,templates,flash,ssh,secrets,facts,vars,va,machines,m,vms,select,se,state,st}
    show                Show meta information about the clan
    backups (b)         Manage backups of clan machines
    flakes (f)          Create a clan flake inside the current directory
    templates           Subcommands to interact with templates
    flash               Flashes your machine to an USB drive
    ssh                 Ssh to a remote machine
    secrets             Manage secrets
    facts               Manage facts
    vars (va)           Manage vars
    machines (m)        Manage machines and their configuration
    vms                 Manage virtual machines
    select (se)         Select nixos values from the flake
    state (st)          Query state information about machines

options:
  -h, --help            show this help message and exit

Online reference for the clan cli tool: ]8;;https://docs.clan.lol/reference/cli\https://docs.clan.lol/reference/cli]8;;\
For more detailed information, visit: ]8;;https://docs.clan.lol\https://docs.clan.lol]8;;\
```
2025-07-12 16:42:05 +02:00
a-kenji
3ad2e045e8 pkgs/clan(templates): Add machine completions
Add machine completions for the `--to-machine` subcommand
2025-07-12 16:02:51 +02:00
hsjobeki
d861fb435b Merge pull request 'cli/create: add interactive name method' (#4310) from getting-started into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4310
2025-07-12 13:27:38 +00:00
Johannes Kirschbauer
135df0dbe6 clan/create: rename path to name argument 2025-07-12 15:16:31 +02:00
Johannes Kirschbauer
c1bad93d36 templates/copy: fix use shutil to copy hidden dot files 2025-07-12 15:08:40 +02:00
Johannes Kirschbauer
f7b39fc941 cli/create: add interactive name method 2025-07-12 14:12:10 +02:00
a-kenji
f97bbc946e pkgs/clan: Fix command typos 2025-07-12 13:54:37 +02:00
Johannes Kirschbauer
4c4a17ed0c cli/templates: init apply disk 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
78b1931271 lib/disks: add parameter to disable hardware checking 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
c26809df16 cli/machine/hardware: improve error message 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
6d90a39747 get_machine: fix error message for not existing machine 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
615607730d lib/copy: fix, copying the content of tempate directory, not the directory itself 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
69e432e727 openapi: remove verb {open}, noun {file} 2025-07-10 18:44:34 +02:00
Johannes Kirschbauer
480fdfaf8a API: rename {open_file, open_clan_folder} into {get_system_file, get_clan_folder} 2025-07-10 18:42:03 +02:00