3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/misc/nixops-autoluks.nix
pennae ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00

44 lines
1.6 KiB
Nix
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, options, lib, ... }:
let
path = [ "deployment" "autoLuks" ];
hasAutoLuksConfig = lib.hasAttrByPath path config && (lib.attrByPath path {} config) != {};
inherit (config.nixops) enableDeprecatedAutoLuks;
in {
options.nixops.enableDeprecatedAutoLuks = lib.mkEnableOption (lib.mdDoc "Enable the deprecated NixOps AutoLuks module");
config = {
assertions = [
{
assertion = if hasAutoLuksConfig then hasAutoLuksConfig && enableDeprecatedAutoLuks else true;
message = ''
!!! WARNING !!!
NixOps autoLuks is deprecated. The feature was never widely used and the maintenance did outgrow the benefit.
If you still want to use the module:
a) Please raise your voice in the issue tracking usage of the module:
https://github.com/NixOS/nixpkgs/issues/62211
b) make sure you set the `_netdev` option for each of the file
systems referring to block devices provided by the autoLuks module.
If you do not set the option your system will not boot anymore!
{
fileSystems."/secret" = { options = [ "_netdev" ]; };
}
b) set the option >nixops.enableDeprecatedAutoLuks = true< to remove this error.
For more details read through the following resources:
- https://github.com/NixOS/nixops/pull/1156
- https://github.com/NixOS/nixpkgs/issues/47550
- https://github.com/NixOS/nixpkgs/issues/62211
- https://github.com/NixOS/nixpkgs/pull/61321
'';
}
];
};
}