summary refs log tree commit diff
path: root/flake.nix
blob: d34ccc4aefbdf60789b332b6b93c25a53de42a35 (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
  description = "Rory&'s services flake";

  inputs = {
    # Different nixpkgs versions
    nixpkgs = {
      url = "github:NixOS/nixpkgs/nixos-unstable";
    };

    nixpkgs-master = {
      url = "github:NixOS/nixpkgs/master";
    };

    nixpkgs-RoryNix = {
      #url = "github:NixOS/nixpkgs/nixos-23.05";
      url = "github:NixOS/nixpkgs/nixos-23.11";
    };

    # Draupnir module/package
    nixpkgs-Draupnir = {
      url = "github:TheArcaneBrony/nixpkgs/master";
    };

    # Base modules
    home-manager.url = "github:nix-community/home-manager/master";
    sops-nix.url = "github:Mic92/sops-nix";

    # Packages
    grapevine.url = "gitlab:matrix/grapevine-fork?host=gitlab.computer.surgery"; # &ref=benjamin/debug-emma-kde-room";
    conduit.url = "gitlab:famedly/conduit/next";
    #conduwuit.url = "github:girlbossceo/conduwuit";
    nixos-wsl.url = "github:nix-community/NixOS-WSL";

    # Own projects
    botcore-v4 = {
      url = "gitlab:BotCore-Devs/BotCore-v4/staging";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    # Packages built from git
    nhekoSrc = {
      url = "github:Nheko-reborn/nheko/master";
      flake = false;
    };
    mtxclientSrc = {
      url = "github:Nheko-reborn/mtxclient/master";
      flake = false;
    };
  };

  outputs =
    inputs: with inputs; {
      nixosConfigurations = {
        #NIXPKGS FORK
        Rory-nginx = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            ./host/Rory-nginx/configuration.nix
            ./hardware-configuration.nix
            home-manager.nixosModules.home-manager
            grapevine.nixosModules.default

            # these arent really modules...
            botcore-v4.modules.bots
            botcore-v4.modules.frontend
            botcore-v4.modules.dataupdater
            botcore-v4.modules.users

            (
              { pkgs, ... }:
              {
                disabledModules = [ "services/matrix/synapse.nix" ];
                imports = [
                  "${nixpkgs-master}/nixos/modules/services/matrix/synapse.nix"
                  "${nixpkgs-Draupnir}/nixos/modules/services/matrix/draupnir.nix"
                ];
                nixpkgs.overlays = [
                  (final: prev: {
                    matrix-synapse-unwrapped = inputs.nixpkgs-master.legacyPackages.${pkgs.stdenv.hostPlatform.system}.matrix-synapse-unwrapped;
                    draupnir = inputs.nixpkgs-Draupnir.legacyPackages.${pkgs.stdenv.hostPlatform.system}.draupnir;
                  })
                ];
              }
            )
          ];
          specialArgs = {
            inherit botcore-v4;
            inherit home-manager;
            inherit grapevine;
            inherit conduit;
            inherit nixpkgs-Draupnir;
            #inherit conduwuit;
          };
        };

        #UNSTABLE
        Rory-devenv = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            ./host/Rory-devenv/configuration.nix
            ./hardware-configuration.nix
            home-manager.nixosModules.home-manager
          ];
          specialArgs = {
            inherit home-manager;
          };
        };

        Rory-desktop = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            ./host/Rory-desktop/configuration.nix
            ./hardware-configuration.nix
            home-manager.nixosModules.home-manager
            sops-nix.nixosModules.sops
            (
              { ... }:
              {
                nix = {
                  registry.nixpkgs.flake = nixpkgs;
                  nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
                };
              }
            )
          ];
          specialArgs = {
            inherit home-manager;
            inherit (inputs) mtxclientSrc;
            inherit (inputs) nhekoSrc;
          };
        };

        Rory-portable = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            ./host/Rory-portable/configuration.nix
            ./hardware-configuration.nix
            home-manager.nixosModules.home-manager
            (
              { ... }:
              {
                nix = {
                  registry.nixpkgs.flake = nixpkgs;
                  nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
                };
              }
            )
            # ... add this line to the rest of your configuration modules
            #nix-ld.nixosModules.nix-ld

            # The module in this repository defines a new module under (programs.nix-ld.dev) instead of (programs.nix-ld) 
            # to not collide with the nixpkgs version.
            #{ programs.nix-ld.dev.enable = true; }
          ];
          specialArgs = {
            inherit home-manager;
            inherit (inputs) mtxclientSrc;
            inherit (inputs) nhekoSrc;
          };
        };

        #STABLE
        RoryNix = nixpkgs-RoryNix.lib.nixosSystem {
          system = "i686-linux";
          modules = [
            ./host/RoryNix/configuration.nix
            ./hardware-configuration.nix
            (
              { ... }:
              {
                nix.registry.nixpkgs.flake = nixpkgs-RoryNix;
              }
            )
          ];
        };

        #WSL
        Rory-wsl = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            nixos-wsl.nixosModules.default
            ./host/Rory-wsl/configuration.nix
            #          ./hardware-configuration.nix
            home-manager.nixosModules.home-manager
            #nur.nixosModules.nur
          ];
          specialArgs = {
            inherit (inputs) mtxclientSrc;
            inherit (inputs) nhekoSrc;
          };
        };
      };
    };
}