summaryrefslogtreecommitdiff
path: root/modules/examples/ofborg.nix
blob: 1054c57cd346603dba97db6051f7a5f440713ecb (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
{ config, lib, pkgs, ... }:

with lib;

{
  # Logs are enabled by default.
  # $ tail -f /var/log/ofborg.log
  services.ofborg.enable = true;
  # services.ofborg.configFile = "/var/lib/ofborg/config.json";

  # $ nix-channel --add https://github.com/NixOS/ofborg/archive/released.tar.gz ofborg
  # $ nix-channel --update
  services.ofborg.package = (import <ofborg> {}).ofborg.rs;

  # Keep nix-daemon updated.
  services.nix-daemon.enable = true;

  nix.gc.automatic = true;
  nix.gc.options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";

  # Manage user for ofborg, this enables creating/deleting users
  # depending on what modules are enabled.
  users.knownGroups = [ "ofborg" ];
  users.knownUsers = [ "ofborg" ];

  # Used for backwards compatibility, please read the changelog before changing.
  # $ darwin-rebuild changelog
  system.stateVersion = 4;
}