Compare commits

..

3 Commits

Author SHA1 Message Date
Guilhem Saurel
45720e29a8 clanServices/wifi: fix for multiple instances
Without this, `nix build .#checks.x86_64-linux.wifi` fails with:
```
error: The option `nodes.first.systemd.services.NetworkManager-setup-secrets.serviceConfig.ExecStart' has conflicting definition values:
- In `/nix/store/x0…45-source/clanServices/wifi/default.nix, via option mappedServices."self-@clan/wifi".roles.default.perInstance, via option nixosModule': <derivation wifi-secrets>
- In `/nix/store/x0…45-source/clanServices/wifi/default.nix, via option mappedServices."self-@clan/wifi".roles.default.perInstance, via option nixosModule': <derivation wifi-secrets>
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
```
2025-07-16 14:02:03 +02:00
Guilhem Saurel
dfce4e6cd5 clanServices/wifi: update test with a second instance 2025-07-16 14:02:03 +02:00
Jörg Thalheim
5d070511a9 waypipe: disable gpu for now 2025-07-16 14:02:03 +02:00
7 changed files with 13 additions and 36 deletions

View File

@@ -39,7 +39,7 @@ in
}; };
perInstance = perInstance =
{ settings, ... }: { instanceName, settings, ... }:
{ {
nixosModule = nixosModule =
{ pkgs, config, ... }: { pkgs, config, ... }:
@@ -86,7 +86,7 @@ in
# service to generate the environment file containing all secrets, as # service to generate the environment file containing all secrets, as
# expected by the nixos NetworkManager-ensure-profile service # expected by the nixos NetworkManager-ensure-profile service
systemd.services.NetworkManager-setup-secrets = { systemd.services."NetworkManager-setup-secrets-${instanceName}" = {
description = "Generate wifi secrets for NetworkManager"; description = "Generate wifi secrets for NetworkManager";
requiredBy = [ "NetworkManager-ensure-profiles.service" ]; requiredBy = [ "NetworkManager-ensure-profiles.service" ];
partOf = [ "NetworkManager-ensure-profiles.service" ]; partOf = [ "NetworkManager-ensure-profiles.service" ];

View File

@@ -7,8 +7,16 @@
inventory = { inventory = {
machines.test = { }; machines.test = { };
machines.second = { };
instances = { instances = {
wg-test-all = {
module.name = "@clan/wifi";
module.input = "self";
roles.default.tags.all = { };
roles.default.settings.networks.all = { };
};
wg-test-one = { wg-test-one = {
module.name = "@clan/wifi"; module.name = "@clan/wifi";
module.input = "self"; module.input = "self";

View File

@@ -275,8 +275,6 @@ in
templates = lib.mkOption { type = lib.types.raw; }; templates = lib.mkOption { type = lib.types.raw; };
machines = lib.mkOption { type = lib.types.raw; }; machines = lib.mkOption { type = lib.types.raw; };
clan-cli = lib.mkOption { type = lib.types.raw; };
}; };
}; };
}; };

View File

@@ -273,9 +273,6 @@ in
# machine specifics # machine specifics
machines = configsPerSystem; machines = configsPerSystem;
# export clan-cli in clanInternals to tie the CLI to the flake
clan-cli = builtins.mapAttrs (_sys: pkgs: pkgs.clan-cli) clan-core.packages;
}; };
}; };
} }

View File

@@ -13,12 +13,7 @@
]; ];
perSystem = perSystem =
{ { config, pkgs, ... }:
config,
pkgs,
self',
...
}:
{ {
packages = { packages = {
agit = pkgs.callPackage ./agit { }; agit = pkgs.callPackage ./agit { };
@@ -33,25 +28,6 @@
classgen = pkgs.callPackage ./classgen { }; classgen = pkgs.callPackage ./classgen { };
zerotierone = pkgs.callPackage ./zerotierone { }; zerotierone = pkgs.callPackage ./zerotierone { };
update-clan-core-for-checks = pkgs.callPackage ./update-clan-core-for-checks { }; update-clan-core-for-checks = pkgs.callPackage ./update-clan-core-for-checks { };
clan-autorefresh = pkgs.symlinkJoin {
name = "clan";
paths = [
(pkgs.writeScriptBin "clan" ''
#!/bin/sh
set -efu
system=$(nix config show system)
nix \
--extra-experimental-features 'flakes nix-command' \
run ".#clanInternals.clan-cli.$system" -- "$@"
'')
self'.packages.clan-cli
];
postBuild = ''
rm -r $out/lib
'';
};
}; };
}; };
} }

View File

@@ -25,9 +25,7 @@
] ]
(system: { (system: {
default = clan-core.inputs.nixpkgs.legacyPackages.${system}.mkShell { default = clan-core.inputs.nixpkgs.legacyPackages.${system}.mkShell {
packages = [ packages = [ clan-core.packages.${system}.clan-cli ];
clan-core.packages.${system}.clan-autorefresh
];
}; };
}); });
}; };

View File

@@ -28,7 +28,7 @@
perSystem = perSystem =
{ pkgs, inputs', ... }: { pkgs, inputs', ... }:
{ {
devShells.default = pkgs.mkShell { packages = [ inputs'.clan-core.packages.clan-autorefresh ]; }; devShells.default = pkgs.mkShell { packages = [ inputs'.clan-core.packages.clan-cli ]; };
}; };
}; };
} }