add inputs to specialArgs and make templates use it.

This commit is contained in:
Jörg Thalheim
2025-05-30 19:22:32 +02:00
parent 8cb6424504
commit 00984ec581
5 changed files with 23 additions and 15 deletions

View File

@@ -189,6 +189,10 @@ in
./computed-tags.nix
];
specialArgs = {
self = lib.mkDefault config.self;
};
# Ready to use configurations
# These are only shallow wrapping the 'nixosModules' or 'darwinModules' with
# lib.nixosSystem

View File

@@ -22,12 +22,6 @@
clan = {
meta.name = "__CHANGE_ME__"; # Ensure this is unique among all clans you want to use.
# This makes flake inputs available in NixOS modules.
specialArgs = {
self = self;
inputs = self.inputs;
};
inherit self;
machines = {
# "jon" will be the hostname of the machine

View File

@@ -1,7 +1,14 @@
{ clan-core, ... }:
{
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
];
}

View File

@@ -3,7 +3,7 @@
inputs.nixpkgs.follows = "clan-core/nixpkgs";
outputs =
{ self, clan-core, ... } @ inputs:
{ self, clan-core, ... }:
let
# Usage see: https://docs.clan.lol
clan = clan-core.clanLib.buildClan {
@@ -11,12 +11,6 @@
# Ensure this is unique among all clans you want to use.
meta.name = "__CHANGE_ME__";
# This makes flake inputs available in NixOS modules.
specialArgs = {
self = self;
inputs = inputs;
};
# All machines in ./machines will be imported.
# Prerequisite: boot into the installer.

View File

@@ -1,4 +1,10 @@
{ config, clan-core, ... }:
{
config,
clan-core,
# Optional, if you want to access other flakes:
# self,
...
}:
{
imports = [
# Enables the OpenSSH server for remote access
@@ -7,6 +13,9 @@
clan-core.clanModules.root-password
clan-core.clanModules.user-password
clan-core.clanModules.state-version
# 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