From c56bb3c37f193cb405254e1e9238403aec6a84be Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Thu, 10 Jul 2025 19:00:39 +0200 Subject: [PATCH 1/5] docs: fix user module prompt description --- clanServices/users/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/clanServices/users/default.nix b/clanServices/users/default.nix index d5e6c3447..8297be177 100644 --- a/clanServices/users/default.nix +++ b/clanServices/users/default.nix @@ -20,7 +20,19 @@ type = lib.types.bool; default = true; example = false; - description = "Whether the user should be prompted."; + description = '' + Whether the user should be prompted for a password. + + Effects: + + - *enabled* (`true`) - Prompt for a passwort during the machine installation or update workflow. + - *disabled* (`false`) - Generate a passwort during the machine installation or update workflow. + + The password can be shown in two steps: + + - `clan vars list ` + - `clan vars get ` + ''; }; }; }; From 5e8faa144da600fd73365d94e6e97ef1a1b6879a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Thu, 10 Jul 2025 19:01:15 +0200 Subject: [PATCH 2/5] templates/flake-parts: remove importing clanModules --- templates/clan/flake-parts/modules/shared.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/templates/clan/flake-parts/modules/shared.nix b/templates/clan/flake-parts/modules/shared.nix index 5b30638a9..4be5c8eb0 100644 --- a/templates/clan/flake-parts/modules/shared.nix +++ b/templates/clan/flake-parts/modules/shared.nix @@ -1,14 +1,6 @@ +{ ... }: { - clan-core, - # Optional, if you want to access other flakes: - # self, - ... -}: -{ - imports = [ - clan-core.clanModules.sshd - clan-core.clanModules.root-password - # You can access other flakes imported in your flake via `self` like this: - # self.inputs.nix-index-database.nixosModules.nix-index - ]; + # Shared logic + # Can be imported into many machines + } From 4f98f8c2f0da11f8818211bfeb3825e6a853ad8a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 11 Jul 2025 08:57:06 +0200 Subject: [PATCH 3/5] templates: remove duplicate logic, update gnome template --- templates/clan/default/clan.nix | 4 +-- templates/clan/default/modules/gnome.nix | 36 ++++++++++--------- templates/clan/default/modules/shared.nix | 8 ----- templates/clan/flake-parts/modules/gnome.nix | 23 ++++++++++++ templates/clan/flake-parts/modules/shared.nix | 6 ---- 5 files changed, 45 insertions(+), 32 deletions(-) create mode 100644 templates/clan/flake-parts/modules/gnome.nix delete mode 100644 templates/clan/flake-parts/modules/shared.nix diff --git a/templates/clan/default/clan.nix b/templates/clan/default/clan.nix index 3bc5f1815..f18dd7a8a 100644 --- a/templates/clan/default/clan.nix +++ b/templates/clan/default/clan.nix @@ -35,10 +35,10 @@ }; # Additional NixOS configuration can be added here. - # machines/machine1/configuration.nix will be automatically imported. + # machines/jon/configuration.nix will be automatically imported. # See: https://docs.clan.lol/guides/more-machines/#automatic-registration machines = { - # machine1 = { config, ... }: { + # jon = { config, ... }: { # environment.systemPackages = [ pkgs.asciinema ]; # }; }; diff --git a/templates/clan/default/modules/gnome.nix b/templates/clan/default/modules/gnome.nix index b4f77768d..e8c43224b 100644 --- a/templates/clan/default/modules/gnome.nix +++ b/templates/clan/default/modules/gnome.nix @@ -1,19 +1,23 @@ -/* - This is an example of a simple nixos module: - - Enables the GNOME desktop environment and the GDM display manager. - - To use this module, import it in your machines NixOS configuration like this: - - ```nix - imports = [ - modules/gnome.nix - ]; - ``` -*/ { ... }: { - services.xserver.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.xserver.displayManager.gdm.enable = true; + # Can be imported into machines to enable GNOME and GDM. + # + # Copy this into a machine's configuration: + # `machines//configuration.nix` + # ```nix + # imports = [ + # ../../modules/gnome.nix + # ]; + # ``` + + # Enable the GNOME desktop environment and the GDM display manager. + # Pre NixOS: 25.11 + # services.xserver.enable = true; + # services.xserver.displayManager.gdm.enable = true; + # services.xserver.desktopManager.gnome.enable = true; + + # => 25.11 + # services.displayManager.gdm.enable = true; + # services.desktopManager.gnome.enable = true; + } diff --git a/templates/clan/default/modules/shared.nix b/templates/clan/default/modules/shared.nix index d6dc92a85..684b7426c 100644 --- a/templates/clan/default/modules/shared.nix +++ b/templates/clan/default/modules/shared.nix @@ -7,14 +7,7 @@ }: { imports = [ - # Enables the OpenSSH server for remote access - clan-core.clanModules.sshd - # Set a root password - clan-core.clanModules.root-password clan-core.clanModules.user-password - - # You can access other flakes imported in your flake via `self` like this: - # self.inputs.nix-index-database.nixosModules.nix-index ]; # Locale service discovery and mDNS @@ -32,6 +25,5 @@ "input" ]; uid = 1000; - openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys; }; } diff --git a/templates/clan/flake-parts/modules/gnome.nix b/templates/clan/flake-parts/modules/gnome.nix new file mode 100644 index 000000000..e8c43224b --- /dev/null +++ b/templates/clan/flake-parts/modules/gnome.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + # Can be imported into machines to enable GNOME and GDM. + # + # Copy this into a machine's configuration: + # `machines//configuration.nix` + # ```nix + # imports = [ + # ../../modules/gnome.nix + # ]; + # ``` + + # Enable the GNOME desktop environment and the GDM display manager. + # Pre NixOS: 25.11 + # services.xserver.enable = true; + # services.xserver.displayManager.gdm.enable = true; + # services.xserver.desktopManager.gnome.enable = true; + + # => 25.11 + # services.displayManager.gdm.enable = true; + # services.desktopManager.gnome.enable = true; + +} diff --git a/templates/clan/flake-parts/modules/shared.nix b/templates/clan/flake-parts/modules/shared.nix deleted file mode 100644 index 4be5c8eb0..000000000 --- a/templates/clan/flake-parts/modules/shared.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - # Shared logic - # Can be imported into many machines - -} From a1e9195cd267dda3ab2146b80ef8932c84676406 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 11 Jul 2025 14:52:05 +0200 Subject: [PATCH 4/5] Templates/minimal: move name to flake.nix --- templates/clan/minimal/flake.nix | 9 +++++++-- templates/clan/minimal/inventory.json | 5 ----- 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 templates/clan/minimal/inventory.json diff --git a/templates/clan/minimal/flake.nix b/templates/clan/minimal/flake.nix index 5beb5f5b1..3762f5e3a 100644 --- a/templates/clan/minimal/flake.nix +++ b/templates/clan/minimal/flake.nix @@ -3,10 +3,15 @@ inputs.nixpkgs.follows = "clan-core/nixpkgs"; outputs = - { self, clan-core, ... }: + inputs@{ self, clan-core, ... }: let # Usage see: https://docs.clan.lol - clan = clan-core.lib.clan { inherit self; }; + clan = clan-core.lib.clan { + inherit self; + # Change this to your clan name + # Setting a name is required + meta.name = inputs.nixpkgs.lib.mkDefault "__clan__"; + }; in { # all machines managed by Clan diff --git a/templates/clan/minimal/inventory.json b/templates/clan/minimal/inventory.json deleted file mode 100644 index 40109ebd5..000000000 --- a/templates/clan/minimal/inventory.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "meta": { "name": "__CHANGE_ME__" }, - "machines": {}, - "services": {} -} From 85943e22a3c9989cfe19b478efef718708d50655 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 11 Jul 2025 14:56:40 +0200 Subject: [PATCH 5/5] Template/docs: improve gnome example --- templates/clan/default/modules/gnome.nix | 8 +++++--- templates/clan/default/modules/shared.nix | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/clan/default/modules/gnome.nix b/templates/clan/default/modules/gnome.nix index e8c43224b..4cde2938b 100644 --- a/templates/clan/default/modules/gnome.nix +++ b/templates/clan/default/modules/gnome.nix @@ -10,13 +10,15 @@ # ]; # ``` - # Enable the GNOME desktop environment and the GDM display manager. - # Pre NixOS: 25.11 + # Uncomment one block to enable the + # GNOME desktop environment and the GDM display manager. + + # Pre NixOS 25.11 # services.xserver.enable = true; # services.xserver.displayManager.gdm.enable = true; # services.xserver.desktopManager.gnome.enable = true; - # => 25.11 + # As of NixOS 25.11 # services.displayManager.gdm.enable = true; # services.desktopManager.gnome.enable = true; diff --git a/templates/clan/default/modules/shared.nix b/templates/clan/default/modules/shared.nix index 684b7426c..4f25bb63b 100644 --- a/templates/clan/default/modules/shared.nix +++ b/templates/clan/default/modules/shared.nix @@ -1,5 +1,4 @@ { - config, clan-core, # Optional, if you want to access other flakes: # self,