mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 15:45:39 +00:00
feat: add vps host configurations
This commit is contained in:
parent
14fdc3875f
commit
d7179b75a8
12 changed files with 113 additions and 0 deletions
9
hosts/vps/modules/boot.nix
Normal file
9
hosts/vps/modules/boot.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix" )];
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
}
|
4
hosts/vps/modules/filesystem.nix
Normal file
4
hosts/vps/modules/filesystem.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
|
||||
swapDevices = [ { device = "/dev/vda2"; } ];
|
||||
}
|
8
hosts/vps/modules/network.nix
Normal file
8
hosts/vps/modules/network.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "vps";
|
||||
networking.domain = "";
|
||||
networking.firewall.enable = true;
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
}
|
7
hosts/vps/modules/services/default.nix
Normal file
7
hosts/vps/modules/services/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./tailscale.nix
|
||||
./vaultwarden.nix
|
||||
./openssh.nix
|
||||
];
|
||||
}
|
3
hosts/vps/modules/services/openssh.nix
Normal file
3
hosts/vps/modules/services/openssh.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.openssh.enable = true;
|
||||
}
|
11
hosts/vps/modules/services/tailscale.nix
Normal file
11
hosts/vps/modules/services/tailscale.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
sops.secrets."tailscale/authkey" = { };
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = config.sops.secrets."tailscale/authkey".path;
|
||||
useRoutingFeatures = "both";
|
||||
};
|
||||
}
|
9
hosts/vps/modules/services/vaultwarden.nix
Normal file
9
hosts/vps/modules/services/vaultwarden.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
config = {
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = 8222;
|
||||
};
|
||||
};
|
||||
}
|
8
hosts/vps/modules/sops.nix
Normal file
8
hosts/vps/modules/sops.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ rootPath, ... }:
|
||||
|
||||
{
|
||||
sops.defaultSopsFile = rootPath + /secrets/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
|
||||
sops.age.keyFile = "/home/toast/.config/sops/age/keys.txt";
|
||||
}
|
8
hosts/vps/modules/users.nix
Normal file
8
hosts/vps/modules/users.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
users.users.toast = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOyVXtny3ca64wdJAwcUro+U4sY4r6v97ypIXdedOuhc toast@nixos'' ];
|
||||
};
|
||||
users.users.root.openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOyVXtny3ca64wdJAwcUro+U4sY4r6v97ypIXdedOuhc toast@nixos'' ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue