summaryrefslogtreecommitdiffstats
path: root/makefu/1systems/darth/config.nix
blob: 7accb13d35082430ddf60d9226c279d65c8bea3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{ config, pkgs, lib, ... }:

with import <stockholm/lib>;
let
  byid = dev: "/dev/disk/by-id/" + dev;
  rootDisk = byid "ata-INTEL_SSDSC2BW480H6_CVTR53120385480EGN";
  bootPart = rootDisk + "-part1";
  rootPart = rootDisk + "-part2";

  allDisks = [ rootDisk ]; # auxDisk
in {
  imports = [
      <stockholm/makefu>
      <stockholm/makefu/2configs/fs/sda-crypto-root.nix>
      <stockholm/makefu/2configs/sshd-totp.nix>
      <stockholm/makefu/2configs/zsh-user.nix>
      <stockholm/makefu/2configs/smart-monitor.nix>
      <stockholm/makefu/2configs/exim-retiolum.nix>
      # <stockholm/makefu/2configs/virtualisation/libvirt.nix>

      <stockholm/makefu/2configs/tinc/retiolum.nix>
      <stockholm/makefu/2configs/tools/core.nix>
      <stockholm/makefu/2configs/stats/client.nix>
      <stockholm/makefu/2configs/nsupdate-data.nix>

      # SIEM
      #<stockholm/makefu/2configs/tinc/siem.nix>
      # {services.tinc.networks.siem = {
      #     name = "sdarth";
      #     extraConfig = "ConnectTo = sjump";
      #   };
      # }

      # {
      #   makefu.forward-journal = {
      #     enable = true;
      #     src = "10.8.10.2";
      #     dst = "10.8.10.6";
      #   };
      # }

      ## Sharing
      # <stockholm/makefu/2configs/share/temp-share-samba.nix>
      #{
      #  services.samba.shares = {
      #      isos = {
      #        path = "/data/isos/";
      #        "read only" = "yes";
      #        browseable = "yes";
      #        "guest ok" = "yes";
      #      };
      #  };
      #}
      <stockholm/makefu/2configs/share/anon-ftp.nix>
  ];



  #networking.firewall.enable = false;
  makefu.server.primary-itf = "enp0s25";
  krebs.hidden-ssh.enable = true;
  boot.kernelModules = [ "coretemp" "f71882fg" ];
  hardware.enableAllFirmware = true;
  nixpkgs.config.allowUnfree = true;
  networking = {
    wireless.enable = true;
    firewall = {
      allowPing = true;
      logRefusedConnections = false;
      # trustedInterfaces = [ "eno1" ];
      allowedUDPPorts = [ 80 655 1655 67 ];
      allowedTCPPorts = [ 80 655 1655 ];
    };
    # fallback connection to the internal virtual network
    # interfaces.virbr3.ip4 =  [{
    #   address = "10.8.8.2";
    #   prefixLength = 24;
    # }];
  };

  # TODO smartd omo darth gum all-in-one
  services.smartd.devices = builtins.map (x: { device = x; }) allDisks;

  boot.loader.grub.device = rootDisk;
  boot.initrd.luks.devices = [
    { name = "luksroot";
      device = rootPart;
      allowDiscards = true;
      keyFileSize = 4096;
      keyFile = "/dev/sdb";
    }
  ];

  krebs.build.host = config.krebs.hosts.darth;
}