From 2e8c0bb87f619b364f552fd6858c25d731b2fa71 Mon Sep 17 00:00:00 2001 From: kat witch Date: Sat, 4 Sep 2021 02:55:41 +0100 Subject: [PATCH] nixdirfmt --- config/hosts/shinmyoumaru/nixos.nix | 2 +- config/profiles/default.nix | 4 +- config/profiles/hardware/oracle/common.nix | 62 ++++++++++++---------- config/profiles/hardware/wifi.nix | 4 +- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/config/hosts/shinmyoumaru/nixos.nix b/config/hosts/shinmyoumaru/nixos.nix index f5e01e71..79843b3c 100644 --- a/config/hosts/shinmyoumaru/nixos.nix +++ b/config/hosts/shinmyoumaru/nixos.nix @@ -13,7 +13,7 @@ home-manager.users.hexchen.programs.vim.enable = mkForce false; programs.mosh.enable = mkForce false; -# Terraform + # Terraform deploy.tf = { resources.shinmyoumaru = { diff --git a/config/profiles/default.nix b/config/profiles/default.nix index a47892b6..933ccbaf 100644 --- a/config/profiles/default.nix +++ b/config/profiles/default.nix @@ -6,4 +6,6 @@ let }) (base); in -(wrappedBase (filterAttrs (n: v: ! v ? "default") tree.dirs)) // (mapAttrs (n: v: removeAttrs v [ "default" ]) (filterAttrs (n: v: v ? "default") tree.dirs)) // (removeAttrs tree.files [ "default" ]) +(wrappedBase (filterAttrs (n: v: ! v ? "default") tree.dirs)) +// (mapAttrs (n: v: removeAttrs v [ "default" ]) (filterAttrs (n: v: v ? "default") tree.dirs)) + // (removeAttrs tree.files [ "default" ]) diff --git a/config/profiles/hardware/oracle/common.nix b/config/profiles/hardware/oracle/common.nix index b33b072c..d3820720 100644 --- a/config/profiles/hardware/oracle/common.nix +++ b/config/profiles/hardware/oracle/common.nix @@ -56,40 +56,44 @@ in nixos.oracle ]; config = { - networking.interfaces = let - interface = attrByPath [cfg.specs.shape] (throw "Unsupported shape") { - "VM.Standard.A1.Flex" = "enp0s3"; - "VM.Standard.E2.1.Micro" = "ens3"; - }; - in { - ${interface} = { - useDHCP = true; - ipv6 = { - addresses = mkIf (config.network.addresses.public.nixos.ipv6.enable) [{ - address = config.network.addresses.public.nixos.ipv6.address; - prefixLength = 64; - }]; - routes = [{ - address = "::"; - prefixLength = 0; - }]; + networking.interfaces = + let + interface = attrByPath [ cfg.specs.shape ] (throw "Unsupported shape") { + "VM.Standard.A1.Flex" = "enp0s3"; + "VM.Standard.E2.1.Micro" = "ens3"; + }; + in + { + ${interface} = { + useDHCP = true; + ipv6 = { + addresses = mkIf (config.network.addresses.public.nixos.ipv6.enable) [{ + address = config.network.addresses.public.nixos.ipv6.address; + prefixLength = 64; + }]; + routes = [{ + address = "::"; + prefixLength = 0; + }]; + }; }; }; - }; network = { addresses = { - public = let - addr_ipv6_nix = - let - prefix = head (splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block")); - in - assert hasSuffix "::" prefix; prefix + toString config.kw.oci.network.publicV6; - in { - enable = true; - nixos.ipv6.address = mkIf (tf.state.resources ? ${tf.resources.${config.networking.hostName}.out.reference}) addr_ipv6_nix; - tf.ipv6.address = tf.resources.rinnosuke_ipv6.refAttr "ip_address"; - }; + public = + let + addr_ipv6_nix = + let + prefix = head (splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block")); + in + assert hasSuffix "::" prefix; prefix + toString config.kw.oci.network.publicV6; + in + { + enable = true; + nixos.ipv6.address = mkIf (tf.state.resources ? ${tf.resources.${config.networking.hostName}.out.reference}) addr_ipv6_nix; + tf.ipv6.address = tf.resources.rinnosuke_ipv6.refAttr "ip_address"; + }; }; firewall.public.interfaces = singleton interface; tf = { diff --git a/config/profiles/hardware/wifi.nix b/config/profiles/hardware/wifi.nix index e3de726c..eb861a70 100644 --- a/config/profiles/hardware/wifi.nix +++ b/config/profiles/hardware/wifi.nix @@ -25,8 +25,8 @@ enable = true; networks = mkIf (builtins.getEnv "TF_IN_AUTOMATION" != "" || tf.state.resources ? ${tf.resources.wireless-credentials.out.reference}) { ${builtins.unsafeDiscardStringContext tf.resources.wireless-credentials.getAttr "outputs.ssid"} = { - pskRaw = tf.resources.wireless-credentials.getAttr "outputs.psk"; - }; + pskRaw = tf.resources.wireless-credentials.getAttr "outputs.psk"; + }; }; }; }