about summary refs log tree commit diff
path: root/users/sterni/machines/edwin/default.nix
blob: af1dceada51cf5ec8b51221ce2cc6536deeaca9a (plain) (blame)
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
{ config, lib, pkgs, depot, ... }:

{
  imports = [
    # Third party modules we use
    "${depot.third_party.agenix.src}/modules/age.nix"
    # These modules touch things related to booting (filesystems, initrd network…)
    ./hardware.nix
    ./network.nix
    # These modules configure services, websites etc.
    ../../modules/disk-checkup.nix
    ./minecraft.nix
    ./gopher.nix
    ./http/sterni.lv.nix
    ./http/code.sterni.lv.nix
    ./http/flipdot.openlab-augsburg.de.nix
    ./http/likely-music.sterni.lv.nix
  ];

  config = {
    time.timeZone = "Europe/Berlin";

    nixpkgs.config.allowUnfreeRedistributable = true;
    nix = {
      package = pkgs.nix_2_3;
      settings = {
        trusted-public-keys = lib.mkAfter [
          "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg="
        ];
        substituters = lib.mkAfter [
          "https://hydra.build"
        ];
      };
    };
    tvl.cache.enable = true;

    services = {
      journald.extraConfig = ''
        SystemMaxUse=1024M
      '';

      openssh.enable = true;
    };

    security.acme = {
      defaults.email = builtins.getAttr "email" (
        builtins.head (
          builtins.filter (attrs: attrs.username == "sterni") depot.ops.users
        )
      );
      acceptTerms = true;
    };

    programs = {
      fish.enable = true;
      mosh.enable = true;
      tmux.enable = true;
    };

    environment.systemPackages = [
      pkgs.weechat
      pkgs.wget
      pkgs.git
      pkgs.stow
      pkgs.htop
      pkgs.foot.terminfo
      pkgs.vim
    ];

    users = {
      users = {
        root.openssh.authorizedKeys.keys = depot.users.sterni.keys.all;
        lukas = {
          isNormalUser = true;
          extraGroups = [ "wheel" "http" ];
          openssh.authorizedKeys.keys = depot.users.sterni.keys.all;
          shell = "${pkgs.fish}/bin/fish";
        };
      };
    };

    nix.settings.trusted-users = [
      "lukas"
    ];

    system.stateVersion = "20.09";
  };
}