Merge pull request 'templates/flake-parts: remove importing clanModules' (#4300) from templates-2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4300
This commit is contained in:
@@ -23,7 +23,19 @@
|
|||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
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 <machine-name>`
|
||||||
|
- `clan vars get <machine-name> <name-of-password-variable>`
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
groups = lib.mkOption {
|
groups = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
|
|||||||
@@ -35,10 +35,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Additional NixOS configuration can be added here.
|
# 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
|
# See: https://docs.clan.lol/guides/more-machines/#automatic-registration
|
||||||
machines = {
|
machines = {
|
||||||
# machine1 = { config, ... }: {
|
# jon = { config, ... }: {
|
||||||
# environment.systemPackages = [ pkgs.asciinema ];
|
# environment.systemPackages = [ pkgs.asciinema ];
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
# Can be imported into machines to enable GNOME and GDM.
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
#
|
||||||
services.xserver.displayManager.gdm.enable = true;
|
# Copy this into a machine's configuration:
|
||||||
|
# `machines/<name>/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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
config,
|
|
||||||
clan-core,
|
clan-core,
|
||||||
# Optional, if you want to access other flakes:
|
# Optional, if you want to access other flakes:
|
||||||
# self,
|
# self,
|
||||||
@@ -7,14 +6,7 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
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
|
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
|
# Locale service discovery and mDNS
|
||||||
@@ -32,6 +24,5 @@
|
|||||||
"input"
|
"input"
|
||||||
];
|
];
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
23
templates/clan/flake-parts/modules/gnome.nix
Normal file
23
templates/clan/flake-parts/modules/gnome.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
# Can be imported into machines to enable GNOME and GDM.
|
||||||
|
#
|
||||||
|
# Copy this into a machine's configuration:
|
||||||
|
# `machines/<name>/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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -3,10 +3,15 @@
|
|||||||
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ self, clan-core, ... }:
|
inputs@{ self, clan-core, ... }:
|
||||||
let
|
let
|
||||||
# Usage see: https://docs.clan.lol
|
# 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
|
in
|
||||||
{
|
{
|
||||||
# all machines managed by Clan
|
# all machines managed by Clan
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"meta": { "name": "__CHANGE_ME__" },
|
|
||||||
"machines": {},
|
|
||||||
"services": {}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user