@cryptotaxi247 / infra-1 / commits / 8488721f

Redeploy survey.nixos.org with working limesurvey

Rok Garbas committed Feb 7, 2022 at 13:04 UTC 8488721f6f95996eaa53bb3caceeaafbcc795fc0
2 files changed +33 -9
survey/flake.lock
+8 -7
@@ -2,17 +2,18 @@
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 - "lastModified": 1639161226,
6 - "narHash": "sha256-75Y08ynJDTq6HHGIF+8IADBJSVip0UyWQH7jqSFnRR8=",
7 - "owner": "NixOS",
5 + "lastModified": 1643797576,
6 + "narHash": "sha256-o4aiI/W3V8qVkEyr/j9lrGhQ+NDcdIgZLyeIBJePy3A=",
7 + "owner": "garbas",
8 "repo": "nixpkgs",
9 - "rev": "573095944e7c1d58d30fc679c81af63668b54056",
9 + "rev": "53be4bd13cb8f25ab93a92d1373ad66178e9aec6",
10 "type": "github"
11 },
12 "original": {
13 - "id": "nixpkgs",
14 - "ref": "nixos-21.11",
15 - "type": "indirect"
13 + "owner": "garbas",
14 + "ref": "update-limesurvey",
15 + "repo": "nixpkgs",
16 + "type": "github"
17 }
18 },
19 "root": {
survey/flake.nix
+25 -2
@@ -6,7 +6,9 @@
6 # $ nixos-rebuild switch --flake ~/nixos-org-configurations/survey
7
8 {
9 - inputs.nixpkgs.url = "nixpkgs/nixos-21.11";
9 + # TODO: temporary bump until the following PR is merged
10 + # https://github.com/NixOS/nixpkgs/pull/157832
11 + inputs.nixpkgs.url = "github:garbas/nixpkgs/update-limesurvey";
12
13 outputs = flakes @ { self, nixpkgs }: {
14 nixosConfigurations.survey = nixpkgs.lib.nixosSystem {
@@ -15,15 +17,36 @@
17 [
18 "${nixpkgs}/nixos/modules/virtualisation/amazon-image.nix"
19 ../modules/common.nix
18 - ({ config, pkgs, ... }:
20 + ({ config, pkgs, lib, ... }:
21 {
22 ec2.hvm = true;
23 +
24 networking.hostName = "survey";
25 networking.firewall.allowedTCPPorts = [ 80 443 ];
26 +
27 system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
28 +
29 nix.package = pkgs.nixUnstable;
30 nix.registry.nixpkgs.flake = nixpkgs;
31 +
32 + # needed since we use latest nixpkgs and we should probably
33 + # backport the limesurvey update to 21.11 channel
34 + nix.extraOptions = lib.mkForce
35 + ''
36 + experimental-features = nix-command flakes
37 + '';
38 +
39 users.users.root.openssh.authorizedKeys.keys = with import ../ssh-keys.nix; [ eelco garbas ];
40 +
41 + services.limesurvey.enable = true;
42 + services.limesurvey.virtualHost.hostName = "survey.nixos.org";
43 + services.limesurvey.virtualHost.adminAddr = "webmaster@nixos.org";
44 + services.limesurvey.virtualHost.enableACME = true;
45 + services.limesurvey.virtualHost.forceSSL = true;
46 +
47 + security.acme.defaults.email = "webmaster@nixos.org";
48 + security.acme.acceptTerms = true;
49 +
50 })
51 ];
52 };