aboutsummaryrefslogtreecommitdiff
path: root/flakes/backports/flake.nix
blob: 8be885f5cd51259559e946639610f4b17a1130f6 (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
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
123
124
125
126
127
128
{
  description = "Backported packages";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system:
    let
      pkgs = import nixpkgs { inherit system; overlays = []; };
    in rec {
      packages = {
        apprise = pkgs.apprise;
        bitlbee-mastodon = pkgs.bitlbee-mastodon;
        cointop = pkgs.cointop;
        cryptpad = pkgs.cryptpad;
        dovecot_fts-xapian = pkgs.dovecot_fts_xapian;
        duply = pkgs.duply;
        fiche = pkgs.fiche;
        influxdb2 = pkgs.influxdb2;
        ldapvi = pkgs.ldapvi;
        lego = pkgs.lego;
        mpd = pkgs.mpd;
        mpd-small = pkgs.mpd-small;
        opensmtpd = pkgs.opensmtpd;
        pass = pkgs.pass;
        pg_activity = pkgs.pg_activity;
        signald = pkgs.signald;
        ssh-to-age = pkgs.ssh-to-age;
        stgit = pkgs.stgit;
        sops = pkgs.sops;
        sudo = pkgs.sudo;
        telegram-cli = pkgs.telegram-cli;
        woob = pkgs.python3Packages.woob;
        zrepl = pkgs.zrepl;
      };
      legacyPackages = packages;
      apps = {
        apprise = flake-utils.lib.mkApp { drv = packages.apprise; name = "apprise"; };
        cointop = flake-utils.lib.mkApp { drv = packages.cointop; name = "cointop"; };
        cryptpad = flake-utils.lib.mkApp { drv = packages.cryptpad; name = "cryptpad"; };
        duply = flake-utils.lib.mkApp { drv = packages.duply; name = "duply"; };
        fiche = flake-utils.lib.mkApp { drv = packages.fiche; name = "fiche"; };
        influxd = flake-utils.lib.mkApp { drv = packages.influxdb2; name = "influxd"; };
        influx = flake-utils.lib.mkApp { drv = packages.influxdb2; name = "influx"; };
        ldapvi = flake-utils.lib.mkApp { drv = packages.ldapvi; name = "ldapvi"; };
        lego = flake-utils.lib.mkApp { drv = packages.lego; name = "lego"; };
        mpd = flake-utils.lib.mkApp { drv = packages.mpd; name = "mpd"; };
        mpd-small = flake-utils.lib.mkApp { drv = packages.mpd-small; name = "mpd"; };
        opensmtpd = flake-utils.lib.mkApp { drv = packages.opensmtpd; name = "opensmtpd"; };
        pass = flake-utils.lib.mkApp { drv = packages.pass; name = "pass"; };
        pg_activity = flake-utils.lib.mkApp { drv = packages.pg_activity; name = "pg_activity"; };
        signald = flake-utils.lib.mkApp { drv = packages.signald; name = "signald"; };
        ssh-to-age = flake-utils.lib.mkApp { drv = packages.ssh-to-age; name = "ssh-to-age"; };
        stgit = flake-utils.lib.mkApp { drv = packages.stgit; name = "stgit"; };
        sops = flake-utils.lib.mkApp { drv = packages.sops; name = "sops"; };
        sudo = flake-utils.lib.mkApp { drv = packages.sudo; name = "sudo"; };
        telegram-cli = flake-utils.lib.mkApp { drv = packages.telegram-cli; name = "telegram-cli"; };
        woob = flake-utils.lib.mkApp { drv = packages.woob; name = "woob"; };
        zrepl = flake-utils.lib.mkApp { drv = packages.zrepl; name = "zrepl"; };
      };
    }
  ) // rec {
    lib = {
      overrideDeps = pkgs: package: let
          packageDeps = builtins.attrNames package.override.__functionArgs;
        in package.override (pkgs.lib.genAttrs packageDeps (n: pkgs."${n}"));
    };
    overlays = {
      apprise = final: prev: { apprise = self.packages."${final.system}".apprise; };
      bitlbee-mastodon = final: prev: {
        bitlbee-mastodon = lib.overrideDeps final self.packages."${final.system}".bitlbee-mastodon;
      };
      cointop = final: prev: { cointop = self.packages."${final.system}".cointop; };
      cryptpad = final: prev: { cryptpad = self.packages."${final.system}".cryptpad; };
      dovecot_fts-xapian = final: prev: {
        dovecot_fts-xapian = lib.overrideDeps final self.packages."${final.system}".dovecot_fts-xapian;
      };
      duply = final: prev: { duply = self.packages."${final.system}".duply; };
      fiche = final: prev: { fiche = self.packages."${final.system}".fiche; };
      influxdb2 = final: prev: { influxdb2 = self.packages."${final.system}".influxdb2; };
      ldapvi = final: prev: { ldapvi = self.packages."${final.system}".ldapvi; };
      lego = final: prev: { lego = self.packages."${final.system}".lego; };
      mpd = final: prev: { mpd = self.packages."${final.system}".mpd; };
      opensmtpd = final: prev: { opensmtpd = self.packages."${final.system}".opensmtpd; };
      pass = final: prev: { pass = self.packages."${final.system}".pass; };
      pg_activity = final: prev: { pg_activity = self.packages."${final.system}".pg_activity; };
      signald = final: prev: { signald = self.packages."${final.system}".signald; };
      ssh-to-age = final: prev: { ssh-to-age = self.packages."${final.system}".ssh-to-age; };
      stgit = final: prev: { stgit = self.packages."${final.system}".stgit; };
      sops = final: prev: { sops = self.packages."${final.system}".sops; };
      sudo = final: prev: { sudo = self.packages."${final.system}".sudo; };
      telegram-cli = final: prev: { telegram-cli = self.packages."${final.system}".telegram-cli; };
      woob = final: prev: { woob = self.packages."${final.system}".woob; };
      zrepl = final: prev: { zrepl = self.packages."${final.system}".zrepl; };
    };
    overlay = final: prev: ({}
      // overlays.apprise final prev
      // overlays.bitlbee-mastodon final prev
      // overlays.cointop final prev
      // overlays.cryptpad final prev
      // overlays.dovecot_fts-xapian final prev
      // overlays.duply final prev
      // overlays.fiche final prev
      // overlays.influxdb2 final prev
      // overlays.ldapvi final prev
      // overlays.lego final prev
      // overlays.mpd final prev
      // overlays.opensmtpd final prev
      // overlays.pass final prev
      // overlays.pg_activity final prev
      // overlays.signald final prev
      // overlays.ssh-to-age final prev
      // overlays.stgit final prev
      // overlays.sops final prev
      // overlays.sudo final prev
      // overlays.telegram-cli final prev
      // overlays.woob final prev
      // overlays.zrepl final prev
    );

    nixosModules = {
      influxdb2 = import (nixpkgs + "/nixos/modules/services/databases/influxdb2.nix");
      mpd = import (nixpkgs + "/nixos/modules/services/audio/mpd.nix");
      zrepl = import (nixpkgs + "/nixos/modules/services/backup/zrepl.nix");
    };
  };
}