diff options
-rw-r--r-- | nixops/modules/buildbot/default.nix | 40 | ||||
-rw-r--r-- | nixops/modules/databases/mysql.nix | 3 | ||||
-rw-r--r-- | nixops/modules/databases/postgresql.nix | 40 | ||||
-rwxr-xr-x | nixops/scripts/nixops_wrap | 2 |
4 files changed, 49 insertions, 36 deletions
diff --git a/nixops/modules/buildbot/default.nix b/nixops/modules/buildbot/default.nix index 9b661f1..3962e65 100644 --- a/nixops/modules/buildbot/default.nix +++ b/nixops/modules/buildbot/default.nix | |||
@@ -1,21 +1,23 @@ | |||
1 | { lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: | 1 | { lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: |
2 | let | 2 | let |
3 | pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; | ||
4 | |||
3 | varDir = "/var/lib/buildbot"; | 5 | varDir = "/var/lib/buildbot"; |
4 | buildslist_src = mylibs.fetchedGitPrivate ./buildslist.json; | 6 | buildslist_src = mylibs.fetchedGitPrivate ./buildslist.json; |
5 | buildslist_yarn = pkgsNext.yarn2nix.mkYarnModules { | 7 | buildslist_yarn = pkgs.yarn2nix.mkYarnModules { |
6 | name = "buildslist-yarn-modules"; | 8 | name = "buildslist-yarn-modules"; |
7 | packageJSON = "${buildslist_src.src}/package.json"; | 9 | packageJSON = "${buildslist_src.src}/package.json"; |
8 | yarnLock = "${buildslist_src.src}/yarn.lock"; | 10 | yarnLock = "${buildslist_src.src}/yarn.lock"; |
9 | }; | 11 | }; |
10 | buildslist_bower = pkgsNext.buildBowerComponents { | 12 | buildslist_bower = pkgs.buildBowerComponents { |
11 | name = "buildslist"; | 13 | name = "buildslist"; |
12 | generated = ./bower.nix; | 14 | generated = ./bower.nix; |
13 | src = "${buildslist_src.src}/guanlecoja/"; | 15 | src = "${buildslist_src.src}/guanlecoja/"; |
14 | }; | 16 | }; |
15 | 17 | ||
16 | buildslist = pkgsNext.python3Packages.buildPythonPackage rec { | 18 | buildslist = pkgs.python3Packages.buildPythonPackage rec { |
17 | pname = "buildbot-buildslist"; | 19 | pname = "buildbot-buildslist"; |
18 | inherit (pkgsNext.buildbot-pkg) version; | 20 | inherit (pkgs.buildbot-pkg) version; |
19 | 21 | ||
20 | preConfigure = '' | 22 | preConfigure = '' |
21 | export HOME=$PWD | 23 | export HOME=$PWD |
@@ -24,26 +26,26 @@ let | |||
24 | cp -a ${buildslist_bower}/bower_components ./libs | 26 | cp -a ${buildslist_bower}/bower_components ./libs |
25 | chmod -R u+w libs | 27 | chmod -R u+w libs |
26 | ''; | 28 | ''; |
27 | propagatedBuildInputs = with pkgsNext.python3Packages; [ | 29 | propagatedBuildInputs = with pkgs.python3Packages; [ |
28 | (klein.overridePythonAttrs(old: { checkPhase = ""; })) | 30 | (klein.overridePythonAttrs(old: { checkPhase = ""; })) |
29 | buildbot-pkg | 31 | buildbot-pkg |
30 | ]; | 32 | ]; |
31 | nativeBuildInputs = with pkgsNext; [ yarn nodejs ]; | 33 | nativeBuildInputs = with pkgs; [ yarn nodejs ]; |
32 | buildInputs = [ buildslist_yarn buildslist_bower ]; | 34 | buildInputs = [ buildslist_yarn buildslist_bower ]; |
33 | 35 | ||
34 | doCheck = false; | 36 | doCheck = false; |
35 | src = buildslist_src.src; | 37 | src = buildslist_src.src; |
36 | }; | 38 | }; |
37 | buildbot_common = pkgsNext.python3Packages.buildPythonPackage rec { | 39 | buildbot_common = pkgs.python3Packages.buildPythonPackage rec { |
38 | name = "buildbot_common"; | 40 | name = "buildbot_common"; |
39 | src = ./common; | 41 | src = ./common; |
40 | format = "other"; | 42 | format = "other"; |
41 | installPhase = '' | 43 | installPhase = '' |
42 | mkdir -p $out/${pkgsNext.python3.pythonForBuild.sitePackages} | 44 | mkdir -p $out/${pkgs.python3.pythonForBuild.sitePackages} |
43 | cp -a $src $out/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_common | 45 | cp -a $src $out/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_common |
44 | ''; | 46 | ''; |
45 | }; | 47 | }; |
46 | buildbot = pkgsNext.python3Packages.buildbot-full.withPlugins ([ buildslist ]); | 48 | buildbot = pkgs.python3Packages.buildbot-full.withPlugins ([ buildslist ]); |
47 | in | 49 | in |
48 | { | 50 | { |
49 | options = { | 51 | options = { |
@@ -90,7 +92,7 @@ in | |||
90 | system.activationScripts = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" { | 92 | system.activationScripts = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" { |
91 | deps = [ "users" "wrappers" ]; | 93 | deps = [ "users" "wrappers" ]; |
92 | text = let | 94 | text = let |
93 | master-cfg = "${buildbot_common}/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_common/master.cfg"; | 95 | master-cfg = "${buildbot_common}/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_common/master.cfg"; |
94 | buildbot_key = pkgs.writeText "buildbot_key" (builtins.readFile "${myconfig.privateFiles}/buildbot_ssh_key"); | 96 | buildbot_key = pkgs.writeText "buildbot_key" (builtins.readFile "${myconfig.privateFiles}/buildbot_ssh_key"); |
95 | tac_file = pkgs.writeText "buildbot.tac" '' | 97 | tac_file = pkgs.writeText "buildbot.tac" '' |
96 | import os | 98 | import os |
@@ -151,24 +153,24 @@ in | |||
151 | description = "Buildbot Continuous Integration Server ${project.name}."; | 153 | description = "Buildbot Continuous Integration Server ${project.name}."; |
152 | after = [ "network-online.target" ]; | 154 | after = [ "network-online.target" ]; |
153 | wantedBy = [ "multi-user.target" ]; | 155 | wantedBy = [ "multi-user.target" ]; |
154 | path = project.packages pkgs ++ (project.pythonPackages buildbot.pythonModule pkgsNext); | 156 | path = project.packages pkgs ++ (project.pythonPackages buildbot.pythonModule pkgs); |
155 | environment = let | 157 | environment = let |
156 | project_env = lib.attrsets.mapAttrs' (k: v: lib.attrsets.nameValuePair "BUILDBOT_${k}" v) project.environment; | 158 | project_env = lib.attrsets.mapAttrs' (k: v: lib.attrsets.nameValuePair "BUILDBOT_${k}" v) project.environment; |
157 | buildbot_config = pkgsNext.python3Packages.buildPythonPackage (rec { | 159 | buildbot_config = pkgs.python3Packages.buildPythonPackage (rec { |
158 | name = "buildbot_config-${project.name}"; | 160 | name = "buildbot_config-${project.name}"; |
159 | src = ./projects + "/${project.name}"; | 161 | src = ./projects + "/${project.name}"; |
160 | format = "other"; | 162 | format = "other"; |
161 | installPhase = '' | 163 | installPhase = '' |
162 | mkdir -p $out/${pkgsNext.python3.pythonForBuild.sitePackages} | 164 | mkdir -p $out/${pkgs.python3.pythonForBuild.sitePackages} |
163 | cp -a $src $out/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_config | 165 | cp -a $src $out/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_config |
164 | ''; | 166 | ''; |
165 | }); | 167 | }); |
166 | HOME = "${varDir}/${project.name}"; | 168 | HOME = "${varDir}/${project.name}"; |
167 | PYTHONPATH = "${buildbot.pythonModule.withPackages (self: project.pythonPackages self pkgsNext ++ [ | 169 | PYTHONPATH = "${buildbot.pythonModule.withPackages (self: project.pythonPackages self pkgs ++ [ |
168 | pkgsNext.python3Packages.treq pkgsNext.python3Packages.ldap3 buildbot | 170 | pkgs.python3Packages.treq pkgs.python3Packages.ldap3 buildbot |
169 | pkgsNext.python3Packages.buildbot-worker | 171 | pkgs.python3Packages.buildbot-worker |
170 | buildbot_common buildbot_config | 172 | buildbot_common buildbot_config |
171 | ])}/${buildbot.pythonModule.sitePackages}${if project.pythonPathHome then ":${varDir}/${project.name}/.local/${pkgsNext.python3.pythonForBuild.sitePackages}" else ""}"; | 173 | ])}/${buildbot.pythonModule.sitePackages}${if project.pythonPathHome then ":${varDir}/${project.name}/.local/${pkgs.python3.pythonForBuild.sitePackages}" else ""}"; |
172 | in project_env // { inherit PYTHONPATH HOME; }; | 174 | in project_env // { inherit PYTHONPATH HOME; }; |
173 | 175 | ||
174 | serviceConfig = { | 176 | serviceConfig = { |
diff --git a/nixops/modules/databases/mysql.nix b/nixops/modules/databases/mysql.nix index 635f212..39d25d3 100644 --- a/nixops/modules/databases/mysql.nix +++ b/nixops/modules/databases/mysql.nix | |||
@@ -1,5 +1,6 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | 1 | { lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: |
2 | let | 2 | let |
3 | pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; | ||
3 | cfg = config.services.myDatabases; | 4 | cfg = config.services.myDatabases; |
4 | in { | 5 | in { |
5 | options.services.myDatabases = { | 6 | options.services.myDatabases = { |
diff --git a/nixops/modules/databases/postgresql.nix b/nixops/modules/databases/postgresql.nix index f839d63..7046b45 100644 --- a/nixops/modules/databases/postgresql.nix +++ b/nixops/modules/databases/postgresql.nix | |||
@@ -1,5 +1,6 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | 1 | { lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: |
2 | let | 2 | let |
3 | pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; | ||
3 | cfg = config.services.myDatabases; | 4 | cfg = config.services.myDatabases; |
4 | in { | 5 | in { |
5 | options.services.myDatabases = { | 6 | options.services.myDatabases = { |
@@ -15,20 +16,29 @@ in { | |||
15 | 16 | ||
16 | config = lib.mkIf cfg.enable { | 17 | config = lib.mkIf cfg.enable { |
17 | nixpkgs.overlays = [ (self: super: rec { | 18 | nixpkgs.overlays = [ (self: super: rec { |
18 | postgresql = postgresql111; | 19 | postgresql = postgresql_11; |
19 | postgresql111 = super.postgresql100.overrideAttrs(old: rec { | 20 | postgresql_11 = if builtins.hasAttr "postgresql_11" super |
20 | passthru = old.passthru // { psqlSchema = "11.0"; }; | 21 | then super.postgresql_11.overrideAttrs(old: rec { |
21 | name = "postgresql-11.1"; | 22 | passthru = old.passthru // { psqlSchema = "11.0"; }; |
22 | src = self.fetchurl { | 23 | configureFlags = old.configureFlags ++ [ "--with-pam" ]; |
23 | url = "mirror://postgresql/source/v11.1/${name}.tar.bz2"; | 24 | buildInputs = (old.buildInputs or []) ++ [ self.pam ]; |
24 | sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch"; | 25 | patches = old.patches ++ [ |
25 | }; | 26 | ./postgresql_run_socket_path.patch |
26 | configureFlags = old.configureFlags ++ [ "--with-pam" ]; | 27 | ]; |
27 | buildInputs = (old.buildInputs or []) ++ [ self.pam ]; | 28 | }) |
28 | patches = old.patches ++ [ | 29 | else super.postgresql100.overrideAttrs(old: rec { |
29 | ./postgresql_run_socket_path.patch | 30 | passthru = old.passthru // { psqlSchema = "11.0"; }; |
30 | ]; | 31 | name = "postgresql-11.1"; |
31 | }); | 32 | src = self.fetchurl { |
33 | url = "mirror://postgresql/source/v11.1/${name}.tar.bz2"; | ||
34 | sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch"; | ||
35 | }; | ||
36 | configureFlags = old.configureFlags ++ [ "--with-pam" ]; | ||
37 | buildInputs = (old.buildInputs or []) ++ [ self.pam ]; | ||
38 | patches = old.patches ++ [ | ||
39 | ./postgresql_run_socket_path.patch | ||
40 | ]; | ||
41 | }); | ||
32 | }) ]; | 42 | }) ]; |
33 | 43 | ||
34 | networking.firewall.allowedTCPPorts = [ 5432 ]; | 44 | networking.firewall.allowedTCPPorts = [ 5432 ]; |
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index f61bdf4..4cf714c 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap | |||
@@ -28,7 +28,7 @@ for file in $files; do | |||
28 | done | 28 | done |
29 | nixops set-args --argstr privateFiles "$TEMP" | 29 | nixops set-args --argstr privateFiles "$TEMP" |
30 | 30 | ||
31 | nixpkgsNext="https://releases.nixos.org/nixos/19.03/nixos-19.03beta171477.5847485e3ec/nixexprs.tar.xz" | 31 | nixpkgsNext="https://releases.nixos.org/nixos/19.03/nixos-19.03beta171832.ff9c3f0f26d/nixexprs.tar.xz" |
32 | nixpkgs="https://releases.nixos.org/nixos/18.09/nixos-18.09.1834.9d608a6f592/nixexprs.tar.xz" | 32 | nixpkgs="https://releases.nixos.org/nixos/18.09/nixos-18.09.1834.9d608a6f592/nixexprs.tar.xz" |
33 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext" | 33 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext" |
34 | nixops "$@" | 34 | nixops "$@" |