mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
refactor: restructure project to remove profiles, users, ...
This commit is contained in:
parent
cb3ae5f434
commit
53655a05fc
177 changed files with 544 additions and 2877 deletions
31
hardware/wifi.nix
Normal file
31
hardware/wifi.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, tf, lib, ... }: with lib;
|
||||
|
||||
{
|
||||
kw.secrets.variables = mapListToAttrs
|
||||
(field:
|
||||
nameValuePair "wireless-${field}" {
|
||||
path = "secrets/wifi";
|
||||
inherit field;
|
||||
}) [ "ssid" "psk" ];
|
||||
|
||||
deploy.tf.resources = {
|
||||
wireless-credentials = {
|
||||
provider = "null";
|
||||
type = "data_source";
|
||||
dataSource = true;
|
||||
inputs.inputs = {
|
||||
ssid = tf.variables.wireless-ssid.ref;
|
||||
psk = tf.variables.wireless-psk.ref;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.wireless = {
|
||||
enable = true;
|
||||
networks = mkIf (builtins.getEnv "TF_IN_AUTOMATION" != "" || tf.state.enable) {
|
||||
${builtins.unsafeDiscardStringContext (tf.resources.wireless-credentials.getAttr "outputs.ssid")} = {
|
||||
pskRaw = tf.resources.wireless-credentials.getAttr "outputs.psk";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue