54 lines
1016 B
Nix
Raw Normal View History

2025-01-14 23:17:26 -05:00
{
config,
lib,
pkgs,
...
}:
let
alias_tf = pkgs.writeShellScriptBin "tf" ''
exec ${pkgs.terraform}/bin/terraform "''${@}"
'';
in
{
imports = [ ];
options.me = {
terraform.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install terraform.";
2025-01-14 23:17:26 -05:00
};
};
config = lib.mkIf config.me.terraform.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
terraform
alias_tf
];
allowedUnfree = [
"terraform"
];
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".terraform.d";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
};
};
}
]
);
2025-01-14 23:17:26 -05:00
}