diff --git a/clanServices/admin/default.nix b/clanServices/admin/default.nix index fb48612f4..807d8a69c 100644 --- a/clanServices/admin/default.nix +++ b/clanServices/admin/default.nix @@ -1,4 +1,3 @@ -{ ... }: { _class = "clan.service"; manifest.name = "clan-core/admin"; diff --git a/clanServices/admin/flake-module.nix b/clanServices/admin/flake-module.nix index bedd498e3..5a2c1fb1b 100644 --- a/clanServices/admin/flake-module.nix +++ b/clanServices/admin/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/borgbackup/flake-module.nix b/clanServices/borgbackup/flake-module.nix index 78066d14d..51b9dd1de 100644 --- a/clanServices/borgbackup/flake-module.nix +++ b/clanServices/borgbackup/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/certificates/flake-module.nix b/clanServices/certificates/flake-module.nix index a58fec290..3a51e1c46 100644 --- a/clanServices/certificates/flake-module.nix +++ b/clanServices/certificates/flake-module.nix @@ -1,12 +1,8 @@ { - self, - lib, ... }: let - module = lib.modules.importApply ./default.nix { - inherit (self) packages; - }; + module = ./default.nix; in { clan.modules.certificates = module; diff --git a/clanServices/coredns/flake-module.nix b/clanServices/coredns/flake-module.nix index 7d74a7407..d08b758f9 100644 --- a/clanServices/coredns/flake-module.nix +++ b/clanServices/coredns/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/data-mesher/flake-module.nix b/clanServices/data-mesher/flake-module.nix index 3ec78883a..c738070a4 100644 --- a/clanServices/data-mesher/flake-module.nix +++ b/clanServices/data-mesher/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/dyndns/flake-module.nix b/clanServices/dyndns/flake-module.nix index f88507a51..14b155dfb 100644 --- a/clanServices/dyndns/flake-module.nix +++ b/clanServices/dyndns/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/emergency-access/flake-module.nix b/clanServices/emergency-access/flake-module.nix index f8a017707..6af395a1c 100644 --- a/clanServices/emergency-access/flake-module.nix +++ b/clanServices/emergency-access/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: { clan.modules = { - emergency-access = lib.modules.importApply ./default.nix { }; + emergency-access = ./default.nix; }; } diff --git a/clanServices/garage/flake-module.nix b/clanServices/garage/flake-module.nix index 21c34d0de..9bb9b81c1 100644 --- a/clanServices/garage/flake-module.nix +++ b/clanServices/garage/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/hello-world/default.nix b/clanServices/hello-world/default.nix index f322030cd..5d668ff94 100644 --- a/clanServices/hello-world/default.nix +++ b/clanServices/hello-world/default.nix @@ -4,7 +4,6 @@ # The test for this module in ./tests/vm/default.nix shows an example of how # the service is used. -{ packages }: { ... }: { _class = "clan.service"; @@ -34,20 +33,17 @@ settings, # The name of this instance of the service - instanceName, # The current machine - machine, # All roles of this service, with their assigned machines - roles, ... }: { # Analog to 'perSystem' of flake-parts. # For every instance of this service we will add a nixosModule to a morning-machine nixosModule = - { config, ... }: + { ... }: { # Interaction examples what you could do here: # - Get some settings of this machine diff --git a/clanServices/hello-world/flake-module.nix b/clanServices/hello-world/flake-module.nix index c6330b1a0..e41c5c196 100644 --- a/clanServices/hello-world/flake-module.nix +++ b/clanServices/hello-world/flake-module.nix @@ -5,9 +5,7 @@ ... }: let - module = lib.modules.importApply ./default.nix { - inherit (self) packages; - }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/importer/flake-module.nix b/clanServices/importer/flake-module.nix index 829039cc0..a9302a630 100644 --- a/clanServices/importer/flake-module.nix +++ b/clanServices/importer/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: { clan.modules = { - importer = lib.modules.importApply ./default.nix { }; + importer = ./default.nix; }; } diff --git a/clanServices/internet/default.nix b/clanServices/internet/default.nix index 0c6303abb..c9222b743 100644 --- a/clanServices/internet/default.nix +++ b/clanServices/internet/default.nix @@ -31,7 +31,6 @@ { roles, lib, - settings, ... }: { diff --git a/clanServices/internet/flake-module.nix b/clanServices/internet/flake-module.nix index e569aed73..ab7b909cf 100644 --- a/clanServices/internet/flake-module.nix +++ b/clanServices/internet/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/localbackup/flake-module.nix b/clanServices/localbackup/flake-module.nix index 9cd9eb626..2e3d3f816 100644 --- a/clanServices/localbackup/flake-module.nix +++ b/clanServices/localbackup/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.localbackup = module; diff --git a/clanServices/matrix-synapse/default.nix b/clanServices/matrix-synapse/default.nix index 0ad9f05ec..9f738176a 100644 --- a/clanServices/matrix-synapse/default.nix +++ b/clanServices/matrix-synapse/default.nix @@ -144,7 +144,7 @@ }; } // lib.mapAttrs' ( - name: user: + _name: user: lib.nameValuePair "matrix-password-${user.name}" { files."matrix-password-${user.name}" = { }; migrateFact = "matrix-password-${user.name}"; diff --git a/clanServices/matrix-synapse/flake-module.nix b/clanServices/matrix-synapse/flake-module.nix index 47cec2726..bb2f79841 100644 --- a/clanServices/matrix-synapse/flake-module.nix +++ b/clanServices/matrix-synapse/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.matrix-synapse = module; diff --git a/clanServices/monitoring/default.nix b/clanServices/monitoring/default.nix index 1369d8ca2..e4ddc67f8 100644 --- a/clanServices/monitoring/default.nix +++ b/clanServices/monitoring/default.nix @@ -1,4 +1,3 @@ -{ packages }: { ... }: { _class = "clan.service"; diff --git a/clanServices/monitoring/flake-module.nix b/clanServices/monitoring/flake-module.nix index 21ad0371f..de23010cc 100644 --- a/clanServices/monitoring/flake-module.nix +++ b/clanServices/monitoring/flake-module.nix @@ -1,12 +1,8 @@ { - self, - lib, ... }: let - module = lib.modules.importApply ./default.nix { - inherit (self) packages; - }; + module = ./default.nix; in { clan.modules.monitoring = module; diff --git a/clanServices/mycelium/flake-module.nix b/clanServices/mycelium/flake-module.nix index 0c475d590..259a1a138 100644 --- a/clanServices/mycelium/flake-module.nix +++ b/clanServices/mycelium/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/packages/flake-module.nix b/clanServices/packages/flake-module.nix index f03bc2b6f..4a4161457 100644 --- a/clanServices/packages/flake-module.nix +++ b/clanServices/packages/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/sshd/flake-module.nix b/clanServices/sshd/flake-module.nix index f1a981541..11b7d02a4 100644 --- a/clanServices/sshd/flake-module.nix +++ b/clanServices/sshd/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/syncthing/flake-module.nix b/clanServices/syncthing/flake-module.nix index f3f2abb24..63368048d 100644 --- a/clanServices/syncthing/flake-module.nix +++ b/clanServices/syncthing/flake-module.nix @@ -5,9 +5,7 @@ ... }: let - module = lib.modules.importApply ./default.nix { - inherit (self) packages; - }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/syncthing/vars.nix b/clanServices/syncthing/vars.nix index 0f38223f3..63fa75410 100644 --- a/clanServices/syncthing/vars.nix +++ b/clanServices/syncthing/vars.nix @@ -11,7 +11,9 @@ pkgs.syncthing ]; script = '' - syncthing generate --config "$out" + export TMPDIR=/tmp + TEMPORARY=$(mktemp -d) + syncthing generate --config "$out" --data "$TEMPORARY" mv "$out"/key.pem "$out"/key mv "$out"/cert.pem "$out"/cert cat "$out"/config.xml | grep -oP '(?<= "$out"/id diff --git a/clanServices/tor/default.nix b/clanServices/tor/default.nix index bdcb2aa7a..b72d6a068 100644 --- a/clanServices/tor/default.nix +++ b/clanServices/tor/default.nix @@ -58,7 +58,7 @@ priority = lib.mkDefault 10; # TODO add user space network support to clan-cli module = "clan_lib.network.tor"; - peers = lib.mapAttrs (name: machine: { + peers = lib.mapAttrs (name: _machine: { host.var = { machine = name; generator = "tor_${instanceName}"; diff --git a/clanServices/tor/flake-module.nix b/clanServices/tor/flake-module.nix index 4f7dd3b80..0e4cce64b 100644 --- a/clanServices/tor/flake-module.nix +++ b/clanServices/tor/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules = { diff --git a/clanServices/trusted-nix-caches/flake-module.nix b/clanServices/trusted-nix-caches/flake-module.nix index a1cb3ca60..155cbfb81 100644 --- a/clanServices/trusted-nix-caches/flake-module.nix +++ b/clanServices/trusted-nix-caches/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.trusted-nix-caches = module; diff --git a/clanServices/users/flake-module.nix b/clanServices/users/flake-module.nix index adf40791d..1c7e91c00 100644 --- a/clanServices/users/flake-module.nix +++ b/clanServices/users/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.users = module; diff --git a/clanServices/wifi/default.nix b/clanServices/wifi/default.nix index 897a1802b..3fa3d053e 100644 --- a/clanServices/wifi/default.nix +++ b/clanServices/wifi/default.nix @@ -1,4 +1,3 @@ -{ packages }: { lib, ... }: let inherit (lib) @@ -50,7 +49,7 @@ in ssid_path = network_name: config.clan.core.vars.generators."wifi.${network_name}".files.network-name.path; - secret_generator = name: value: { + secret_generator = name: _value: { name = "wifi.${name}"; value = { prompts.network-name.type = "line"; diff --git a/clanServices/wifi/flake-module.nix b/clanServices/wifi/flake-module.nix index a2b885bcd..32ee533dc 100644 --- a/clanServices/wifi/flake-module.nix +++ b/clanServices/wifi/flake-module.nix @@ -1,12 +1,8 @@ { - self, - lib, ... }: let - module = lib.modules.importApply ./default.nix { - inherit (self) packages; - }; + module = ./default.nix; in { clan.modules.wifi = module; diff --git a/clanServices/wireguard/flake-module.nix b/clanServices/wireguard/flake-module.nix index 66529b160..8da6931a0 100644 --- a/clanServices/wireguard/flake-module.nix +++ b/clanServices/wireguard/flake-module.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.wireguard = module; diff --git a/clanServices/zerotier/flake-module.nix b/clanServices/zerotier/flake-module.nix index 33fe2aa91..78933d589 100644 --- a/clanServices/zerotier/flake-module.nix +++ b/clanServices/zerotier/flake-module.nix @@ -5,7 +5,7 @@ ... }: let - module = lib.modules.importApply ./default.nix { }; + module = ./default.nix; in { clan.modules.zerotier = module; diff --git a/docs/nix/options/flake-module.nix b/docs/nix/options/flake-module.nix index bcedec830..d78a971ab 100644 --- a/docs/nix/options/flake-module.nix +++ b/docs/nix/options/flake-module.nix @@ -40,8 +40,6 @@ prefix = [ ]; }).config.manifest; - loadFile = file: if builtins.pathExists file then builtins.readFile file else ""; - settingsModules = module: mapAttrs (_roleName: roleConfig: roleConfig.interface) (getRoles module); # Map each letter to its capitalized version @@ -97,7 +95,7 @@ **${manifest.description}** - ${loadFile (module._file + "/../README.md")} + ${lib.optionalString (manifest ? readme) manifest.readme} ${ if manifest.categories != [ ] then diff --git a/flake.lock b/flake.lock index 9d3c23c20..a53c58770 100644 --- a/flake.lock +++ b/flake.lock @@ -115,10 +115,10 @@ "nixpkgs": { "locked": { "lastModified": 315532800, - "narHash": "sha256-h8Sx4S+/0FpodZji6W9lHzwY5BcuUG85Aj3GfhvGC2o=", - "rev": "a650b5d0de99158323597f048667c4d914243224", + "narHash": "sha256-CObjrxTU/Jl3GkNS/QIKYHGymgsB9tglBU8R7ik0cy8=", + "rev": "0b96957fb614f693d0cee1bd65fbfc0e610df47f", "type": "tarball", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre845298.a650b5d0de99/nixexprs.tar.xz" + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre862129.0b96957fb614/nixexprs.tar.xz" }, "original": { "type": "tarball", diff --git a/nixosModules/clanCore/zerotier/default.nix b/nixosModules/clanCore/zerotier/default.nix index 5cc5f71f5..74a900d77 100644 --- a/nixosModules/clanCore/zerotier/default.nix +++ b/nixosModules/clanCore/zerotier/default.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - options, ... }: let diff --git a/pkgs/clan-cli/clan_lib/flash/list.py b/pkgs/clan-cli/clan_lib/flash/list.py index c70a561db..389386b24 100644 --- a/pkgs/clan-cli/clan_lib/flash/list.py +++ b/pkgs/clan-cli/clan_lib/flash/list.py @@ -32,7 +32,7 @@ def get_machine_flash_options() -> FlashOptions: def list_languages() -> list[str]: - cmd = nix_build([f"{nixpkgs_source()}#legacyPackages.x86_64-linux.glibcLocales"]) + cmd = nix_build([f"{nixpkgs_source()}#glibcLocales"]) result = run(cmd, RunOpts(log=Log.STDERR, error_msg="Failed to find glibc locales")) locale_file = Path(result.stdout.strip()) / "share" / "i18n" / "SUPPORTED" @@ -57,7 +57,7 @@ def list_languages() -> list[str]: def list_keymaps() -> list[str]: - cmd = nix_build([f"{nixpkgs_source()}#legacyPackages.x86_64-linux.kbd"]) + cmd = nix_build([f"{nixpkgs_source()}#kbd.out"]) result = run(cmd, RunOpts(log=Log.STDERR, error_msg="Failed to find kbdinfo")) keymaps_dir = Path(result.stdout.strip()) / "share" / "keymaps" diff --git a/pkgs/clan-cli/clan_lib/persist/util.py b/pkgs/clan-cli/clan_lib/persist/util.py index d8167c16a..7781634b3 100644 --- a/pkgs/clan-cli/clan_lib/persist/util.py +++ b/pkgs/clan-cli/clan_lib/persist/util.py @@ -249,7 +249,7 @@ def calc_patches( data_dyn = flatten_data(persisted) all_keys = set(data_all) | set(data_all_updated) - patchset = {} + patchset: dict[str, Any] = {} delete_set = find_deleted_paths(all_values, update, parent_key="") diff --git a/pkgs/clan-cli/clan_lib/templates/__init__.py b/pkgs/clan-cli/clan_lib/templates/__init__.py index 2f6251939..ca2fe4069 100644 --- a/pkgs/clan-cli/clan_lib/templates/__init__.py +++ b/pkgs/clan-cli/clan_lib/templates/__init__.py @@ -2,6 +2,7 @@ import logging from dataclasses import dataclass from clan_lib.dirs import clan_templates +from clan_lib.errors import ClanError from clan_lib.flake import Flake from clan_lib.nix_models.clan import ClanTemplatesType @@ -35,8 +36,7 @@ def list_templates(flake: Flake | None) -> TemplateList: builtin_templates = flake.select("clanInternals.templates") return TemplateList(builtin_templates, custom_templates) - - except (AttributeError, KeyError, Exception): + except ClanError: log.debug( "Failed to get templates from clan inputs, " "falling back to clan-core builtin templates", diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index a4c6cf6b5..2fadf7be7 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -227,8 +227,8 @@ pythonRuntime.pkgs.buildPythonApplication { ../../nixosModules/clanCore/zerotier/generate.py # needed by flash list tests - nixpkgs.legacyPackages.x86_64-linux.kbd - nixpkgs.legacyPackages.x86_64-linux.glibcLocales + pkgs.kbd + pkgs.glibcLocales # Pre-built VMs for impure tests pkgs.stdenv.drvPath