diff --git a/docs/quickstart.md b/docs/quickstart.md index 65f068327..6d39b2a1e 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -10,7 +10,7 @@ $ nix shell git+https://git.clan.lol/clan/clan-core 2. Then use the following commands to initialize a new clan-flake: -``` +```shellSession $ mkdir ./my-flake $ cd ./my-flake $ clan create @@ -40,7 +40,7 @@ $ clan machines list my-machine ``` -## configure your machine +## Configure your machine In this example we crate a user named `my-user` that is allowed to login to the machine @@ -66,8 +66,8 @@ Absolutely, let's break down the migration step by step, explaining each action 1. **Backup Your Current Configuration**: Always start by making a backup of your current NixOS configuration to ensure you can revert if needed. - ```shell - cp -r /etc/nixos ~/nixos-backup + ```shellSession + $ cp -r /etc/nixos ~/nixos-backup ``` 2. **Update Flake Inputs**: Add a new input for the `clan-core` dependency: @@ -132,8 +132,8 @@ Absolutely, let's break down the migration step by step, explaining each action 4. **Rebuild and Switch**: Rebuild your NixOS configuration using the updated flake: - ```shell - sudo nixos-rebuild switch --flake . + ```shellSession + $ sudo nixos-rebuild switch --flake . ``` - This command rebuilds and switches to the new configuration. Make sure to include the `--flake .` argument to use the current directory as the flake source. @@ -142,8 +142,8 @@ Absolutely, let's break down the migration step by step, explaining each action 6. **Reboot**: If everything is fine, you can reboot your system to apply the changes: - ```shell - sudo reboot + ```shellSession + $ sudo reboot ``` 7. **Verify**: After the reboot, confirm that your system is running with the new configuration, and all services and applications are functioning as expected. diff --git a/docs/secrets-management.md b/docs/secrets-management.md index 86a4adbc5..658abb3e4 100644 --- a/docs/secrets-management.md +++ b/docs/secrets-management.md @@ -9,7 +9,7 @@ integrates with [sops-nix](https://github.com/Mic92/sops-nix) on NixOS machines. To begin, generate a key pair: -```console +```shellSession $ clan secrets key generate ``` @@ -27,7 +27,7 @@ user with your user name) Next, add your public key to the Clan flake repository: -```console +```shellSession $ clan secrets users add ``` @@ -42,7 +42,7 @@ sops/ Now, to set your first secret: -```console +```shellSession $ clan secrets set mysecret Paste your secret: ``` @@ -51,13 +51,13 @@ Note: As you type your secret, keypresses won't be displayed. Press Enter to sav Retrieve the stored secret: -```console +```shellSession $ clan secrets get mysecret ``` And list all secrets like this: -```console +```shellSession $ clan secrets list ``` @@ -79,19 +79,19 @@ By default, secrets are encrypted with your key to ensure readability. New machines in Clan come with age keys stored in `./sops/machines/`. To list these machines: -```console +```shellSession $ clan secrets machines list ``` For existing machines, add their keys: -```console +```shellSession $ clan secrets machines add ``` To fetch an age key from an SSH host key: -```console +```shellSession $ ssh-keyscan | nix shell nixpkgs#ssh-to-age -c ssh-to-age ``` @@ -99,13 +99,13 @@ $ ssh-keyscan | nix shell nixpkgs#ssh-to-age -c ssh-to-age By default, secrets are encrypted for your key. To specify which users and machines can access a secret: -```console +```shellSession $ clan secrets set --machine --machine --user --user ``` You can add machines/users to existing secrets without modifying the secret: -```console +```shellSession $ clan secrets machines add-secret ``` @@ -117,19 +117,19 @@ For convenience, Clan CLI allows group creation to simplify access management. H Assign users to a new group, e.g., `admins`: - ```console + ```shellSession $ clan secrets groups add admins ``` 2. **Listing Groups**: - ```console + ```shellSession $ clan secrets groups list ``` 3. **Assigning Secrets to Groups**: - ```console + ```shellSession $ clan secrets groups add-secret ``` @@ -162,7 +162,7 @@ commonly allows to put all secrets in a yaml or json documents. If you already happend to use sops-nix, you can migrate by using the `clan secrets import-sops` command by importing these documents: -```console +```shellSession % clan secrets import-sops --prefix matchbox- --group admins --machine matchbox nixos/matchbox/secrets/secrets.yaml ```