aboutsummaryrefslogtreecommitdiff
path: root/flakes/flake.nix
blob: aecff57460b9e8babd04c3cba6746849bc425be4 (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
{
  description = "immae-eu infrastructure";
  inputs = {
    s-backports.url = "path:./backports";
    s-copanier.url = "path:./copanier";
    s-diaspora.url = "path:./diaspora";
    s-etherpad-lite.url = "path:./etherpad-lite";
    s-fiche.url = "path:./fiche";
    s-files-watcher.url = "path:./files-watcher";
    s-grocy.url = "path:./grocy";
    s-lib.url = "path:./lib";
    s-loginctl-linger.url = "path:./loginctl-linger";
    s-mastodon.url = "path:./mastodon";
    s-mediagoblin.url = "path:./mediagoblin";
    s-multi-apache-container.url = "path:./multi-apache-container";
    s-mypackages.url = "path:./mypackages";
    s-myuids.url = "path:./myuids";
    s-naemon.url = "path:./naemon";
    s-openarc.url = "path:./openarc";
    s-opendmarc.url = "path:./opendmarc";
    s-paste.url = "path:./paste";
    s-peertube.url = "path:./peertube";
    s-rsync_backup.url = "path:./rsync_backup";
    s-secrets.url = "path:./secrets";
    s-surfer.url = "path:./surfer";
    s-taskwarrior-web.url = "path:./taskwarrior-web";

    s-private-buildbot.url = "path:./private/buildbot";
    s-private-chatons.url = "path:./private/chatons";
    s-private-environment.url = "path:./private/environment";
    s-private-mail-relay.url = "path:./private/mail-relay";
    s-private-milters.url = "path:./private/milters";
    s-private-monitoring.url = "path:./private/monitoring";
    s-private-openarc.url = "path:./private/openarc";
    s-private-opendmarc.url = "path:./private/opendmarc";
    s-private-openldap.url = "path:./private/openldap";
    s-private-paste.url = "path:./private/paste";
    s-private-peertube.url = "path:./private/peertube";
    s-private-php.url = "path:./private/php";
    s-private-ssh.url = "path:./private/ssh";
    s-private-system.url = "path:./private/system";

    n-backup-2.url = "path:../systems/backup-2";
    n-dilion.url = "path:../systems/dilion";
    n-eldiron.url = "path:../systems/eldiron";
    n-monitoring-1.url = "path:../systems/monitoring-1";
    n-quatresaisons.url = "path:../systems/quatresaisons";
    n-zoldene.url = "path:../systems/zoldene";

    secrets.url = "path:./private/environment-dummy";
  };
  outputs = inputs@{ self, secrets, ... }: {
    subflakes = let
      flakeNames = builtins.map (a: builtins.substring 2 (builtins.stringLength a) a) (builtins.filter (a: builtins.substring 0 2 a == "s-") (builtins.attrNames inputs));
      partitionned = builtins.partition (a: builtins.substring 0 8 a == "private-") flakeNames;
      privateFlakes = builtins.map (a: builtins.substring 8 (builtins.stringLength a) a) partitionned.right;
      publicFlakes = partitionned.wrong;

      nodeFlakes = builtins.map (a: builtins.substring 2 (builtins.stringLength a) a) (builtins.filter (a: builtins.substring 0 2 a == "n-") (builtins.attrNames inputs));
    in {
      public = builtins.foldl' (a: b: a // { "${b}" = inputs."s-${b}"; }) {} publicFlakes;
      private = builtins.foldl' (a: b: a // { "${b}" = inputs."s-private-${b}"; }) {} privateFlakes;
      nodes = builtins.foldl' (a: b: a // { "${b}" = inputs."n-${b}"; }) {} nodeFlakes;
      inherit secrets;
    };
  };
}