forked from mirrors/nixpkgs
Merge pull request #112332 from urbas/amazon-init-options
virtualization/amazon-init: enable option
This commit is contained in:
commit
ba6d848c40
|
@ -1,6 +1,10 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
cfg = config.virtualisation.amazon-init;
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
#!${pkgs.runtimeShell} -eu
|
#!${pkgs.runtimeShell} -eu
|
||||||
|
|
||||||
|
@ -41,6 +45,18 @@ let
|
||||||
nixos-rebuild switch
|
nixos-rebuild switch
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
options.virtualisation.amazon-init = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Enable or disable the amazon-init service.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
systemd.services.amazon-init = {
|
systemd.services.amazon-init = {
|
||||||
inherit script;
|
inherit script;
|
||||||
description = "Reconfigure the system from EC2 userdata on startup";
|
description = "Reconfigure the system from EC2 userdata on startup";
|
||||||
|
@ -57,4 +73,5 @@ in {
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue