From 1ca182d0a51fe0fb9d06acc9db2be90943834e55 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 25 Sep 2024 19:00:51 +0300 Subject: feat(configuration): Force all users to have a placeholder password when creating vm --- .gitignore | 2 ++ configuration.nix | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .gitignore 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"; }))) + ]; + }; } -- cgit v1.3.1-26-gb76a