summaryrefslogtreecommitdiffstats
path: root/makefu/source.nix
blob: 82a41886b7c0d58d3e33bb7c981125e565d90197 (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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
with import <stockholm/lib>;
host@{ name,
  override ? {}
, secure ? false
, full ? false
, torrent ? false
, hw ? false
, musnix ? false
, python ? false
, unstable ? false #unstable channel checked out
, mic92 ? false
, nms ? false
, clever_kexec ?false
}:
let
  builder = if getEnv "dummy_secrets" == "true"
              then "buildbot"
              else "makefu";
  _file = <stockholm> + "/makefu/1systems/${name}/source.nix";
  pkgs = import <nixpkgs> {
    overlays = map import [
      <stockholm/krebs/5pkgs>
      <stockholm/submodules/nix-writers/pkgs>
    ];
  };
  # TODO: automate updating of this ref + cherry-picks
  ref = "8f991294288"; # nixos-18.03 @ 2018-08-06
                       # + do_sqlite3 ruby:   55a952be5b5
                       # + exfat-nofuse bump: ee6a5296a35
                       # + uhub/sqlite: 5dd7610401747

in
  evalSource (toString _file) [
    {
      nixos-config.symlink = "stockholm/makefu/1systems/${name}/config.nix";
      # always perform a full populate when buildbot
      nixpkgs = if full || (builder == "buildbot" ) then {
          git = {
            url = https://github.com/makefu/nixpkgs;
            inherit ref;
          };
        } else {
          # right now it is simply extracted revision folder

          ## prepare so we do not have to wait for rsync:
          ## cd /var/src; curl https://github.com/nixos/nixpkgs/tarball/125ffff  -L | tar zx  && mv NixOS-nixpkgs-125ffff nixpkgs
          file = "/home/makefu/store/${ref}";
        };

      secrets = getAttr builder {
        buildbot.file = toString <stockholm/makefu/0tests/data/secrets>;
        makefu.pass = {
          inherit name;
          dir = "${getEnv "HOME"}/.secrets-pass";
        };
      };


      stockholm.file = toString <stockholm>;
      stockholm-version.pipe = "${pkgs.stockholm}/bin/get-version";
    }
    (mkIf ( musnix ) {
      musnix.git = {
        url = https://github.com/musnix/musnix.git;
        ref = "master"; # follow the musnix channel, lets see how this works out
      };
    })

    (mkIf ( hw ) {
      nixos-hardware.git = {
        url = https://github.com/nixos/nixos-hardware.git;
        ref = "30fdd53";
      };
    })

    (mkIf ( python ) {
      python.git = {
        url = https://github.com/garbas/nixpkgs-python;
        ref = "cac319b7";
      };
    })

    (mkIf ( torrent ) {
      torrent-secrets = getAttr builder {
        buildbot.file = toString <stockholm/makefu/0tests/data/secrets>;
        makefu.pass = {
          name = "torrent";
          dir = "${getEnv "HOME"}/.secrets-pass";
        };
      };
    })

    (mkIf ( unstable ) {
      nixpkgs-unstable.git = {
        url = https://github.com/nixos/nixpkgs-channels;
        ref = "nixos-unstable";
      };
    })

    (mkIf ( mic92 ) {
      mic92.git = {
        url = https://github.com/Mic92/dotfiles/;
        ref = "48a1f49";
      };
    })

    (mkIf ( nms ) {
      nms.git = {
        url = https://github.com/r-raymond/nixos-mailserver;
        ref = "v2.1.2";
      };
    })

    (mkIf ( clever_kexec ) {
      clever_kexec.git = {
        url = https://github.com/cleverca22/nix-tests;
        ref = "5a670de7f2decfaafc95c34ffeb0f1896662f3d7";
      };
    })

    override
  ]