diff options
| Commit | 1ca182d0a51fe0fb9d06acc9db2be90943834e55 (patch) | |
|---|---|---|
| Author | 2024-09-25 19:00:51 +0300 | |
| Committer | 2024-09-25 19:00:51 +0300 | |
| Files | 207fa20c4ca57e0a4481c7d6c63d2942bdd1fc5e | |
| nix-1ca182d0a51fe0fb9d06acc9db2be90943834e55.tar nix-1ca182d0a51fe0fb9d06acc9db2be90943834e55.tar.gz nix-1ca182d0a51fe0fb9d06acc9db2be90943834e55.zip | ||
| Parent | 8cdf01c17d13299a458b8abb7ad08080ce13ff13 (diff) | |
feat(configuration): Force all users to have a placeholder password when creating vm
2 files changed, 10 insertions, 1 deletions
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | configuration.nix | 9 |
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee0c388 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.qcow2 +result diff --git a/configuration.nix b/configuration.nix index edf504a..978074d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: { +{ config, pkgs, lib, ... }: { # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave @@ -16,4 +16,11 @@ nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; + + virtualisation.vmVariant = { + users.users = lib.pipe config.users.users [ + (lib.filterAttrs (username: opts: opts.isNormalUser || username == "root")) + (builtins.mapAttrs (_: opts: lib.mkForce (opts // { password = "john"; }))) + ]; + }; } |
