forked from Mirrors/nixos-infect
add my user and passwordless sudo right away
This commit is contained in:
parent
5ef3f953d3
commit
98c8157d75
1 changed files with 29 additions and 17 deletions
46
nixos-infect
46
nixos-infect
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue