nix fmt rcf-style
This commit is contained in:
parent
b78e40ad6a
commit
b9adba3225
35 changed files with 270 additions and 238 deletions
|
@ -1,42 +1,34 @@
|
|||
{
|
||||
nixpkgs,
|
||||
common-modules,
|
||||
...
|
||||
}:
|
||||
{ nixpkgs, common-modules, ... }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules =
|
||||
common-modules
|
||||
++ [
|
||||
./hardware.nix
|
||||
./nginx.nix
|
||||
../../users/vinzenz.nix
|
||||
../../users/ronja.nix
|
||||
{
|
||||
networking.hostName = "hetzner-vpn1";
|
||||
}
|
||||
{
|
||||
# uncomment for build check on non arm system (requires --impure)
|
||||
# nixpkgs.buildPlatform = builtins.currentSystem;
|
||||
}
|
||||
{
|
||||
users.users = {
|
||||
root.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming''
|
||||
];
|
||||
vinzenz.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming''
|
||||
];
|
||||
ronja.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key''
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
modules = common-modules ++ [
|
||||
./hardware.nix
|
||||
./nginx.nix
|
||||
../../users/vinzenz.nix
|
||||
../../users/ronja.nix
|
||||
{ networking.hostName = "hetzner-vpn1"; }
|
||||
{
|
||||
# uncomment for build check on non arm system (requires --impure)
|
||||
# nixpkgs.buildPlatform = builtins.currentSystem;
|
||||
}
|
||||
{
|
||||
users.users = {
|
||||
root.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming''
|
||||
];
|
||||
vinzenz.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming''
|
||||
];
|
||||
ronja.openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key''
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
|
||||
config = {
|
||||
nixpkgs = {
|
||||
|
@ -26,8 +21,12 @@
|
|||
};
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
|
||||
kernelModules = ["nvme"];
|
||||
availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"xen_blkfront"
|
||||
];
|
||||
kernelModules = [ "nvme" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -48,7 +47,7 @@
|
|||
# This file was populated at runtime with the networking
|
||||
# details gathered from the active system.
|
||||
networking = {
|
||||
nameservers = ["8.8.8.8"];
|
||||
nameservers = [ "8.8.8.8" ];
|
||||
defaultGateway = "172.31.1.1";
|
||||
defaultGateway6 = {
|
||||
address = "fe80::1";
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "acme@zerforschen.plus";
|
||||
|
@ -10,46 +7,51 @@
|
|||
|
||||
security.pam.services.nginx.setEnvironment = false;
|
||||
systemd.services.nginx.serviceConfig = {
|
||||
SupplementaryGroups = ["shadow"];
|
||||
SupplementaryGroups = [ "shadow" ];
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
additionalModules = [pkgs.nginxModules.pam];
|
||||
additionalModules = [ pkgs.nginxModules.pam ];
|
||||
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
|
||||
virtualHosts = let
|
||||
servicesDomain = "services.zerforschen.plus";
|
||||
mkServiceConfig = host: port: {
|
||||
addSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${host}:${toString port}/";
|
||||
extraConfig = ''
|
||||
# bind to tailscale ip
|
||||
proxy_bind 100.88.118.60;
|
||||
# pam auth
|
||||
limit_except OPTIONS {
|
||||
auth_pam "Password Required";
|
||||
auth_pam_service_name "nginx";
|
||||
}
|
||||
'';
|
||||
virtualHosts =
|
||||
let
|
||||
servicesDomain = "services.zerforschen.plus";
|
||||
mkServiceConfig = host: port: {
|
||||
addSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${host}:${toString port}/";
|
||||
extraConfig = ''
|
||||
# bind to tailscale ip
|
||||
proxy_bind 100.88.118.60;
|
||||
# pam auth
|
||||
limit_except OPTIONS {
|
||||
auth_pam "Password Required";
|
||||
auth_pam_service_name "nginx";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net";
|
||||
in
|
||||
{
|
||||
"vscode.${servicesDomain}" = lib.mkMerge [
|
||||
(mkServiceConfig pc2 8542)
|
||||
{ locations."/".proxyWebsockets = true; }
|
||||
];
|
||||
"preon-app.${servicesDomain}" = mkServiceConfig pc2 8543;
|
||||
"preon-api.${servicesDomain}" = mkServiceConfig pc2 8544;
|
||||
};
|
||||
pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net";
|
||||
in {
|
||||
"vscode.${servicesDomain}" = lib.mkMerge [
|
||||
(mkServiceConfig pc2 8542)
|
||||
{locations."/" .proxyWebsockets = true;}
|
||||
];
|
||||
"preon-app.${servicesDomain}" = mkServiceConfig pc2 8543;
|
||||
"preon-api.${servicesDomain}" = mkServiceConfig pc2 8544;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ nixpkgs.lib.nixosSystem {
|
|||
|
||||
{
|
||||
networking.hostName = "vinzenz-lpt2";
|
||||
nix.settings.extra-platforms = ["aarch64-linux"];
|
||||
nix.settings.extra-platforms = [ "aarch64-linux" ];
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{lib, ...}: {
|
||||
imports = [
|
||||
../../modules/intel-graphics.nix
|
||||
];
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [ ../../modules/intel-graphics.nix ];
|
||||
config = {
|
||||
# intel cpu
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
boot.loader = {
|
||||
|
@ -23,7 +22,11 @@
|
|||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
boot.initrd = {
|
||||
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"];
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"nvme"
|
||||
];
|
||||
luks.devices = {
|
||||
"luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = {
|
||||
device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3";
|
||||
|
@ -35,7 +38,7 @@
|
|||
"/" = {
|
||||
device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=@"];
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{...}: {
|
||||
{ ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
||||
|
@ -14,13 +15,17 @@
|
|||
proxyWebsockets = true;
|
||||
};
|
||||
|
||||
serverAliases = ["172.23.42.96"];
|
||||
serverAliases = [ "172.23.42.96" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [80 8001 3000];
|
||||
allowedUDPPorts = [2342];
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
8001
|
||||
3000
|
||||
];
|
||||
allowedUDPPorts = [ 2342 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -19,9 +19,7 @@ nixpkgs.lib.nixosSystem {
|
|||
../../modules/gaming.nix
|
||||
../../modules/printing.nix
|
||||
../../modules/podman.nix
|
||||
{
|
||||
networking.hostName = "vinzenz-pc2";
|
||||
}
|
||||
{ networking.hostName = "vinzenz-pc2"; }
|
||||
{
|
||||
home-manager.users = {
|
||||
vinzenz = import ../../home/vinzenz;
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
"/" = {
|
||||
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=@"];
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
"/home" = {
|
||||
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=@home"];
|
||||
options = [ "subvol=@home" ];
|
||||
};
|
||||
|
||||
"/games" = {
|
||||
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=@games"];
|
||||
options = [ "subvol=@games" ];
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
|
@ -27,7 +27,7 @@
|
|||
# this is convenient for managing the flat subvolume hierarchy
|
||||
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
|
||||
fsType = "btrfs";
|
||||
options = ["subvolid=5"];
|
||||
options = [ "subvolid=5" ];
|
||||
};
|
||||
|
||||
"/mnt/ssd2" = {
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
../../modules/amd-graphics.nix
|
||||
];
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ../../modules/amd-graphics.nix ];
|
||||
config = {
|
||||
# amd cpu
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage"
|
||||
initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
]; # "usb_storage"
|
||||
loader.efi.efiSysMountPoint = "/boot";
|
||||
};
|
||||
|
||||
fileSystems = import ./fstab.nix;
|
||||
swapDevices = [];
|
||||
swapDevices = [ ];
|
||||
|
||||
networking.interfaces.eno1.wakeOnLan.enable = true;
|
||||
};
|
||||
|
|
|
@ -1,16 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.openvscode-server = {
|
||||
enable = true;
|
||||
telemetryLevel = "off";
|
||||
port = 8542;
|
||||
host = "100.125.93.127"; # tailscale
|
||||
withoutConnectionToken = true;
|
||||
extraPackages = with pkgs; [nodejs git gh direnv];
|
||||
extraPackages = with pkgs; [
|
||||
nodejs
|
||||
git
|
||||
gh
|
||||
direnv
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [8542 8543 8544 80];
|
||||
allowedTCPPorts = [
|
||||
8542
|
||||
8543
|
||||
8544
|
||||
80
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue