diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 56fba0f9..83541d9a 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -16,6 +16,7 @@ ./secrets.nix ./ssh.nix ./users + ./warnings.nix ]; sane.nixcache.enable-trusted-keys = true; diff --git a/hosts/common/warnings.nix b/hosts/common/warnings.nix new file mode 100644 index 00000000..4a40be0a --- /dev/null +++ b/hosts/common/warnings.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +let + ignored = [ + "The user 'colin' has multiple of the options\n`hashedPassword`, `password`, `hashedPasswordFile`, `initialPassword`\n& `initialHashedPassword` set to a non-null value.\nThe options silently discard others by the order of precedence\ngiven above which can lead to surprising results. To resolve this warning,\nset at most one of the options above to a non-`null` value.\n" + ]; +in +{ + options = { + warnings = lib.mkOption { + apply = builtins.filter (w: !(builtins.elem w ignored)); + }; + }; +}