From c59f9f4b1911f9a076e8cf8bd88c678ef73080fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 26 Sep 2023 15:49:45 +0200 Subject: [PATCH 1/2] use shellSession everywhere for markdown --- docs/quickstart.md | 16 ++++++++-------- docs/secrets-management.md | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) 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 ``` From 86378320befd7cedf05cf8db53278e5dd71831fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 26 Sep 2023 15:50:02 +0200 Subject: [PATCH 2/2] drop wonky ipdb PYTHONBREAKPOINT --- pkgs/clan-cli/default.nix | 2 -- pkgs/clan-cli/shell.nix | 2 -- 2 files changed, 4 deletions(-) diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 860e071b7..94738a5cd 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -25,7 +25,6 @@ , zbar , tor , git -, ipdb , nixpkgs }: let @@ -44,7 +43,6 @@ let openssh git stdenv.cc - ipdb # used for debugging ]; # Optional dependencies for clan cli, we re-expose them here to make sure they all build. diff --git a/pkgs/clan-cli/shell.nix b/pkgs/clan-cli/shell.nix index b44934ac3..6d53c9c98 100644 --- a/pkgs/clan-cli/shell.nix +++ b/pkgs/clan-cli/shell.nix @@ -10,8 +10,6 @@ mkShell { openssh clan-cli.checkPython ]; - # sets up an editable install and add enty points to $PATH - PYTHONBREAKPOINT = "ipdb.set_trace"; shellHook = '' tmp_path=$(realpath ./.direnv)