Commit de8b1cf6 authored by zimbatm's avatar zimbatm
Browse files

cloud-init module: format with nixpkgs-fmt

parent a28301d4
Loading
Loading
Loading
Loading
+79 −73
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

with lib;

let cfg = config.services.cloud-init;
let
  cfg = config.services.cloud-init;
  path = with pkgs; [
    cloud-init
    iproute2
@@ -11,7 +12,8 @@ let cfg = config.services.cloud-init;
    shadow
    util-linux
    busybox
    ] ++ optional cfg.btrfs.enable btrfs-progs
  ]
  ++ optional cfg.btrfs.enable btrfs-progs
  ++ optional cfg.ext4.enable e2fsprogs
  ;
in
@@ -124,13 +126,13 @@ in

    systemd.network.enable = cfg.network.enable;

    systemd.services.cloud-init-local =
      { description = "Initial cloud-init job (pre-networking)";
    systemd.services.cloud-init-local = {
      description = "Initial cloud-init job (pre-networking)";
      wantedBy = [ "multi-user.target" ];
      before = [ "systemd-networkd.service" ];
      path = path;
        serviceConfig =
          { Type = "oneshot";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.cloud-init}/bin/cloud-init init --local";
        RemainAfterExit = "yes";
        TimeoutSec = "infinity";
@@ -138,17 +140,21 @@ in
      };
    };

    systemd.services.cloud-init =
      { description = "Initial cloud-init job (metadata service crawler)";
    systemd.services.cloud-init = {
      description = "Initial cloud-init job (metadata service crawler)";
      wantedBy = [ "multi-user.target" ];
        wants = [ "network-online.target" "cloud-init-local.service"
                  "sshd.service" "sshd-keygen.service" ];
      wants = [
        "network-online.target"
        "cloud-init-local.service"
        "sshd.service"
        "sshd-keygen.service"
      ];
      after = [ "network-online.target" "cloud-init-local.service" ];
      before = [ "sshd.service" "sshd-keygen.service" ];
      requires = [ "network.target" ];
      path = path;
        serviceConfig =
          { Type = "oneshot";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.cloud-init}/bin/cloud-init init";
        RemainAfterExit = "yes";
        TimeoutSec = "infinity";
@@ -156,15 +162,15 @@ in
      };
    };

    systemd.services.cloud-config =
      { description = "Apply the settings specified in cloud-config";
    systemd.services.cloud-config = {
      description = "Apply the settings specified in cloud-config";
      wantedBy = [ "multi-user.target" ];
      wants = [ "network-online.target" ];
      after = [ "network-online.target" "syslog.target" "cloud-config.target" ];

      path = path;
        serviceConfig =
          { Type = "oneshot";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.cloud-init}/bin/cloud-init modules --mode=config";
        RemainAfterExit = "yes";
        TimeoutSec = "infinity";
@@ -172,15 +178,15 @@ in
      };
    };

    systemd.services.cloud-final =
      { description = "Execute cloud user/final scripts";
    systemd.services.cloud-final = {
      description = "Execute cloud user/final scripts";
      wantedBy = [ "multi-user.target" ];
      wants = [ "network-online.target" ];
      after = [ "network-online.target" "syslog.target" "cloud-config.service" "rc-local.service" ];
      requires = [ "cloud-config.target" ];
      path = path;
        serviceConfig =
          { Type = "oneshot";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.cloud-init}/bin/cloud-init modules --mode=final";
        RemainAfterExit = "yes";
        TimeoutSec = "infinity";
@@ -188,8 +194,8 @@ in
      };
    };

    systemd.targets.cloud-config =
      { description = "Cloud-config availability";
    systemd.targets.cloud-config = {
      description = "Cloud-config availability";
      requires = [ "cloud-init-local.service" "cloud-init.service" ];
    };
  };