templates: remove duplicate logic, update gnome template

This commit is contained in:
Johannes Kirschbauer
2025-07-11 08:57:06 +02:00
parent 5e8faa144d
commit 4f98f8c2f0
5 changed files with 45 additions and 32 deletions

View File

@@ -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 ];
# }; # };
}; };

View File

@@ -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; # 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
# ];
# ```
# 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;
} }

View File

@@ -7,14 +7,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 +25,5 @@
"input" "input"
]; ];
uid = 1000; uid = 1000;
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
}; };
} }

View 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;
}

View File

@@ -1,6 +0,0 @@
{ ... }:
{
# Shared logic
# Can be imported into many machines
}