add my user and passwordless sudo right away

This commit is contained in:
CherryKitten 2024-04-06 22:19:46 +02:00
parent 5ef3f953d3
commit 98c8157d75
Signed by: sammy
GPG key ID: 98D8F75FB0658276

View file

@ -34,24 +34,36 @@ makeConf() {
[[ -n "$doNetConf" ]] && network_import="./networking.nix # generated at runtime by nixos-infect"
cat > /etc/nixos/configuration.nix << EOF
{ ... }: {
imports = [
./hardware-configuration.nix
$network_import
$NIXOS_IMPORT
];
{ ... }:
let
keys = [$(while read -r line; do
line=$(echo -n "$line" | sed 's/\r//g')
trimmed_line=$(echo -n "$line" | xargs)
echo -n "''$trimmed_line'' "
done <<< "$keys")];
in
{
imports = [
./hardware-configuration.nix
$network_import
$NIXOS_IMPORT
];
boot.tmp.cleanOnBoot = true;
zramSwap.enable = ${zramswap};
networking.hostName = "$(hostname -s)";
networking.domain = "$(hostname -d)";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [$(while read -r line; do
line=$(echo -n "$line" | sed 's/\r//g')
trimmed_line=$(echo -n "$line" | xargs)
echo -n "''$trimmed_line'' "
done <<< "$keys")];
system.stateVersion = "23.11";
boot.tmp.cleanOnBoot = true;
zramSwap.enable = ${zramswap};
networking.hostName = "$(hostname -s)";
networking.domain = "$(hostname -d)";
services.openssh.enable = true;
security.sudo.wheelNeedsPassword = false;
system.stateVersion = "23.11";
users.users.root.openssh.authorizedKeys.keys = keys;
users.users.sammy = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = keys;
};
};
}
EOF