summaryrefslogtreecommitdiffstats
path: root/krebs/1systems/hope/config.nix
blob: c19b210c5c27472293ef32c1f2785fcdd69dd6d2 (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
with import <stockholm/lib>;
{ config, pkgs, ... }: let

  ip = config.krebs.build.host.nets.internet.ip4.addr;
  bestGuessGateway = addr: elemAt (match "(.*)(\.[^.])" addr) 0 + ".1";

in {
  imports = [
    <stockholm/krebs>
    <stockholm/krebs/2configs>
    <stockholm/krebs/2configs/os-templates/CAC-CentOS-7-64bit.nix>

    <stockholm/krebs/2configs/secret-passwords.nix>
    {
      users.extraUsers = {
        satan = {
          name = "satan";
          uid = 1338;
          home = "/home/satan";
          group = "users";
          createHome = true;
          useDefaultShell = true;
          initialPassword = "test";
        };
      };
    }
  ];

  krebs.build.host = config.krebs.hosts.hope;

  networking = let
    address = config.krebs.build.host.nets.internet.ip4.addr;
  in {
    defaultGateway = bestGuessGateway address;
    interfaces.enp2s1.ip4 = singleton {
      inherit address;
      prefixLength = 24;
    };
    nameservers = ["8.8.8.8"];
  };
}