about summary refs log tree commit diff
path: root/machines/openlab/hannswurscht.nix
blob: 4ef21bac6689e99e9950727b9fef79ef9b6664fd (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
{ pkgs, ... }:

let
  musicDir = "/data/music";
  webserverRootDir = "/var/www";

in {
  vuizvui.user.openlab.base.enable = true;

  nixpkgs.system = "i686-linux";

  users.users.openlab.extraGroups = [ "audio" ];
  services.mingetty.autologinUser = "openlab";

  hardware.pulseaudio = {
    enable = true;
    systemWide = true;
    package = pkgs.pulseaudioFull;
    zeroconf.discovery.enable = false;
    zeroconf.publish.enable = true;
    tcp.enable = true;
    tcp.anonymousClients.allowedIpRanges = [ "172.16.0.0/16" "127.0.0.1" ];
  };

  hardware.bluetooth = {
    enable = true;
    extraConfig = ''
      [General]
      Enable=Source,Sink,Media,Socket
    '';
  };

  hardware.sane.enable = true;
  services.saned = {
    enable = true;
    extraConfig = ''
      172.16.0.0/16
    '';
  };

  # TODO: haskell module broken
  # vuizvui.user.openlab.stackenblocken = {
  #   enable = true;
  #   volume = 35;
  # };
  vuizvui.user.openlab.speedtest = {
    enable = true;
    outputPath = "${webserverRootDir}/speedtest.yaml";
  };

  services.nginx = {
    enable = true;
    virtualHosts."hannswurscht.openlab.lan" = {
      default = true;
      root = webserverRootDir;
    };
  };

  # machine mostly runs headless with the screen shut
  services.logind.extraConfig = "HandleLidSwitch=ignore";

  fileSystems = {
    "${musicDir}" = {
      device = "ftp.openlab.lan:/data/upload/music";
      fsType = "nfs";
      label = "lab-ftp";
      options = [ "nolock" "x-systemd.automount"];
    };
  };
}