aboutsummaryrefslogtreecommitdiff
path: root/tharos.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tharos.nix')
-rw-r--r--tharos.nix133
1 files changed, 0 insertions, 133 deletions
diff --git a/tharos.nix b/tharos.nix
deleted file mode 100644
index 6d96754..0000000
--- a/tharos.nix
+++ /dev/null
@@ -1,133 +0,0 @@
-{
- self,
- inputs,
- lib,
- ...
-}:
-{
- flake.machines.tharos = {
- bootstrap-target = "root@${self.machines.tharos.deploy-target}";
- # Administratoren verbinden sich mit ihrem selbst festgelegten Nutzernamen
- deploy-target = "81.169.239.254";
- nixos =
- {
- config,
- pkgs,
- modulesPath,
- ...
- }:
-
- {
- imports = [
- inputs.disko.nixosModules.default
- "${modulesPath}/profiles/qemu-guest.nix"
- ];
-
- nixpkgs.hostPlatform = "x86_64-linux";
- system.stateVersion = "25.05";
-
- services.cloud-init = {
- enable = true;
- network.enable = true;
- };
- # `cloud-init` übernimmt Netzwerkeinstellungen
- networking.useDHCP = false;
-
- # Kein Login für Nutzer die nicht explizit deklariert sind
- users.mutableUsers = false;
- users.users = lib.mapAttrs (username: keyFiles: {
- isNormalUser = true;
- openssh.authorizedKeys.keyFiles = keyFiles;
- # ANMERKUNG: Der Einfachheit halber sind bis auf Weiteres alle Nutzer mit SSH-Zugang auch Administratoren
- extraGroups = [ "wheel" ];
- }) self.keys;
-
- /*
- `sudo` über SSH ohne Passworteingabe
- ANMERKUNG: Nutzer sollten in ihrem ` ~/.ssh/config` für die Maschine einstellen:
-
- ForwardAgent: yes
- */
- security.pam.sshAgentAuth.enable = true;
- security.pam.services.sudo.sshAgentAuth = true;
-
- # Nur Administratoren können den angemeldeten Benutzer wechseln
- security.pam.services.su.requireWheel = true;
-
- networking.firewall.allowPing = true;
- services.openssh = {
- enable = true;
- settings = {
- PasswordAuthentication = false;
- PermitRootLogin = "prohibit-password";
- };
- };
-
- nix = {
- settings.trusted-users = [
- "root"
- "@wheel"
- ];
- settings.experimental-features = [
- "nix-command"
- "flakes"
- ];
- };
-
- disko.devices.disk.main = {
- device = "/dev/vda";
- type = "disk";
- content = {
- type = "gpt";
- partitions = {
- # Die KVM läuft auf SeaBIOS, daher muss es hier eine MBR-Partition sein
- boot = {
- size = "1M";
- type = "EF02";
- };
- root = {
- size = "100%";
- content = {
- type = "filesystem";
- format = "ext4";
- mountpoint = "/";
- };
- };
- };
- };
- };
-
- /*
- ANMERKUNG: Erhalten durch:
-
- nix run .#machines.infect-tharos -- --no-reboot --generate-hardware-config nixos-hardware-config <datei>
- */
- boot.initrd.availableKernelModules = [
- "ata_piix"
- "uhci_hcd"
- "virtio_pci"
- "virtio_blk"
- ];
- boot.kernelModules = [ "kvm-amd" ];
- };
-
- vm =
- {
- config,
- lib,
- pkgs,
- ...
- }:
- {
- virtualisation = {
- memorySize = 4096;
- diskSize = 4096;
- cores = 2;
- graphics = false;
- };
-
- services.cloud-init.enable = lib.mkForce false;
- networking.useDHCP = lib.mkForce true;
- };
- };
-}