refactor: restructure project to remove profiles, users, ...

This commit is contained in:
Kat Inskip 2022-07-10 12:59:40 -07:00
parent cb3ae5f434
commit 53655a05fc
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
177 changed files with 544 additions and 2877 deletions

31
hardware/wifi.nix Normal file
View 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";
};
};
};
}