mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
nixdirfmt
This commit is contained in:
parent
6b4e18bbb5
commit
2e8c0bb87f
4 changed files with 39 additions and 33 deletions
|
|
@ -13,7 +13,7 @@
|
|||
home-manager.users.hexchen.programs.vim.enable = mkForce false;
|
||||
programs.mosh.enable = mkForce false;
|
||||
|
||||
# Terraform
|
||||
# Terraform
|
||||
|
||||
deploy.tf = {
|
||||
resources.shinmyoumaru = {
|
||||
|
|
|
|||
|
|
@ -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" ])
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue