2024-05-22 21:10:41 +01:00
|
|
|
{ inputs, config, lib, pkgs, outputs,... }:
|
2024-05-22 21:14:20 +01:00
|
|
|
let
|
|
|
|
pubKeys = lib.filesystem.listFilesRecursive (../common/users/keys);
|
|
|
|
in
|
2024-05-14 14:51:09 +01:00
|
|
|
{
|
2024-05-22 21:10:41 +01:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
# Disk configuration
|
2024-05-16 16:54:21 +01:00
|
|
|
inputs.disko.nixosModules.disko
|
2024-05-22 21:10:41 +01:00
|
|
|
(import ../common/disks/std-disk-config.nix { device = "/dev/vda"; })
|
|
|
|
../common/optional/btrfs-impermanence.nix
|
|
|
|
inputs.impermanence.nixosModules.impermanence
|
2024-05-16 16:54:21 +01:00
|
|
|
|
2024-05-14 14:51:09 +01:00
|
|
|
# Import core options
|
|
|
|
./hardware-configuration.nix
|
|
|
|
../common/core
|
2024-05-22 21:10:41 +01:00
|
|
|
|
|
|
|
];
|
2024-05-14 14:51:09 +01:00
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
nixpkgs = {
|
|
|
|
overlays = [
|
|
|
|
outputs.overlays.additions
|
|
|
|
outputs.overlays.modifications
|
|
|
|
outputs.overlays.unstable-packages
|
|
|
|
];
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
2024-05-14 14:51:09 +01:00
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
fileSystems."/persist".neededForBoot = true;
|
|
|
|
environment.persistence."/persist" = {
|
|
|
|
hideMounts = true;
|
|
|
|
directories = [
|
|
|
|
"/etc/nixos"
|
|
|
|
];
|
|
|
|
files = [
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key"
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
|
|
"/etc/ssh/deploy_key-ssh-ed25519"
|
|
|
|
];
|
|
|
|
};
|
2024-05-16 16:54:21 +01:00
|
|
|
|
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
timeout = 3;
|
2024-05-14 14:51:09 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
users = {
|
|
|
|
mutableUsers = true;
|
|
|
|
extraUsers = {
|
|
|
|
root = {
|
|
|
|
initialPassword = "1234";
|
2024-05-22 21:15:22 +01:00
|
|
|
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
|
2024-05-22 21:10:41 +01:00
|
|
|
};
|
|
|
|
};
|
2024-05-14 14:51:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
2024-05-15 20:55:48 +01:00
|
|
|
hostName = "bootstrap";
|
2024-05-14 14:51:09 +01:00
|
|
|
networkmanager.enable = true;
|
2024-05-15 20:55:48 +01:00
|
|
|
enableIPv6 = false;
|
2024-05-14 14:51:09 +01:00
|
|
|
};
|
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2024-05-22 21:15:58 +01:00
|
|
|
ports = [22];
|
2024-05-22 21:10:41 +01:00
|
|
|
authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
|
|
|
|
hostKeys = [{
|
|
|
|
path = "/persist/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}];
|
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
PermitRootLogin = "yes";
|
|
|
|
PubKeyAuthentication = "yes";
|
|
|
|
StreamLocalBindUnlink = "yes";
|
|
|
|
UsePAM = true;
|
2024-05-14 14:51:09 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
programs.ssh.extraConfig = ''
|
|
|
|
Host git.bitlab21.com
|
|
|
|
IdentitiesOnly yes
|
|
|
|
StrictHostKeyChecking no
|
|
|
|
IdentityFile /etc/ssh/deploy_key-ssh-ed25519
|
2024-05-22 21:14:20 +01:00
|
|
|
'';
|
2024-05-22 21:10:41 +01:00
|
|
|
|
2024-05-14 14:51:09 +01:00
|
|
|
security.pam = {
|
|
|
|
sshAgentAuth.enable = true;
|
|
|
|
};
|
2024-05-22 21:10:41 +01:00
|
|
|
|
2024-05-22 21:14:47 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
2024-05-14 14:51:09 +01:00
|
|
|
|
2024-05-22 21:10:41 +01:00
|
|
|
services = {
|
|
|
|
qemuGuest.enable = true;
|
2024-05-14 14:51:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
system.stateVersion = "23.11";
|
|
|
|
}
|