aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/turris-board.nix
blob: 02b6dae1b6c184e4ef10a8816275d54cb6ed1f1b (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
{ config, lib, pkgs, ... }:

with lib;

{

  options = {
    turris.board = mkOption {
      type = types.enum [ "omnia" "mox" ];
      description = "The unique Turris board identifier.";
    };
  };

  config = {
    assertions = [{
      assertion = config.turris.board != null;
      message = "Turris board has to be specified";
    }];

    # Enable flakes for nix as we are using that instead of legacy setup
    nix = {
      package = pkgs.nixFlakes;
      extraOptions = "experimental-features = nix-command flakes";
    };

    environment.systemPackages =  with pkgs; [
      # As we override the nix package we have to override nixos-rebuild as well
      (pkgs.nixos-rebuild.override { nix = config.nix.package.out; })
      # The Git is required to access this repository
      git
    ];
  };
}