diff --git a/clanServices/users/default.nix b/clanServices/users/default.nix index f382fd477..f92ac0003 100644 --- a/clanServices/users/default.nix +++ b/clanServices/users/default.nix @@ -23,7 +23,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 ` + ''; }; groups = lib.mkOption { type = lib.types.listOf lib.types.str; 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..4cde2938b 100644 --- a/templates/clan/default/modules/gnome.nix +++ b/templates/clan/default/modules/gnome.nix @@ -1,19 +1,25 @@ -/* - 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 + # ]; + # ``` + + # 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; + + # 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 d6dc92a85..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, @@ -7,14 +6,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 +24,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 5b30638a9..000000000 --- a/templates/clan/flake-parts/modules/shared.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - 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 - ]; -} 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": {} -}