about summary refs log tree commit diff
path: root/machines/default.nix
blob: 0be491ef44ace416ffaf4b434330fb4ef6f7e356 (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
{ system ? builtins.currentSystem, ... }:

let
  nixpkgs = import ../nixpkgs-path.nix;

  callMachine = path: rec {
    config = import path;
    build = import "${nixpkgs}/nixos/lib/eval-config.nix" {
      inherit system;
      modules = [ config ] ++ import ../modules/module-list.nix;
    };
    iso = import "${nixpkgs}/nixos/lib/eval-config.nix" {
      inherit system;
      modules = [
        { options = { inherit (build.options) vuizvui; };
          config = (builtins.removeAttrs build.config [
            "_module" "boot" "fileSystems"
          ]) // {
            boot = builtins.removeAttrs build.config.boot [ "loader" ];
          };
        }
        "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix"
        (
          { lib, ... }: let
            name = build.config.networking.hostName;
            upperName = lib.toUpper name;
          in rec {
            isoImage.isoName = "${name}.iso";
            isoImage.volumeID = builtins.substring 0 11 "${upperName}_LIVE";
            isoImage.makeEfiBootable = true;
            isoImage.makeUsbBootable = true;
            isoImage.appendToMenuLabel = " \"${name}\" Live System";
          }
        )
      ];
    };
    use = {
      imports = [ config ] ++ import ../modules/module-list.nix;
    };
  };

in {
  aszlig = {
    dnyarri   = callMachine ./aszlig/dnyarri.nix;
    mmrnmhrm  = callMachine ./aszlig/mmrnmhrm.nix;
    arilou    = callMachine ./aszlig/arilou.nix;
    kzerza    = callMachine ./aszlig/kzerza.nix;
    tishtushi = callMachine ./aszlig/tishtushi.nix;
  };
  labnet = {
    heinrich = callMachine ./labnet/heinrich.nix;
    labtop   = callMachine ./labnet/labtop.nix;
  };
  profpatsch = {
    katara = callMachine ./profpatsch/katara.nix;
  };
  misc = {
    mailserver = callMachine ./misc/mailserver.nix;
  };
}