From c1c379848a19a31de8febb1385c7b9e4d2a474a3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Nov 2019 15:26:08 +0000 Subject: chore(nix): Move files around to conform to new read-tree layout Broadly speaking, the following things are included: * there is now a uniform `args` struct that is passed to all derivations, package headers have been changed appropriately * overrides are now loaded from a separate `override` folder just using read-tree.nix * third-party packages have moved into the `third_party` attribute set --- default.nix | 84 +++++++++++++++---------------------------------------------- 1 file changed, 20 insertions(+), 64 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 93e2d9fc54..789098667a 100644 --- a/default.nix +++ b/default.nix @@ -14,78 +14,34 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${stableCommit}.tar.gz"; sha256 = "0243qiivxl3z51biy4f5y5cy81x5bki5dazl9wqwgnmd373gpmxy"; }; + readTree = import ./read-tree.nix; - localPkgs = self: super: { - # Local projects should be added here: - tazjin = { - blog = self.callPackage ./services/tazblog {}; - blog_cli = self.callPackage ./tools/blog_cli {}; - gemma = self.callPackage ./services/gemma {}; - nixcon = self.naersk.buildPackage ./services/nixcon-demo {}; + localPkgs = self: super: + let config = { + pkgs = self; + upstream = super; - kms_pass = self.callPackage ./tools/kms_pass { + kms = { project = "tazjins-infrastructure"; region = "europe-north1"; keyring = "tazjins-keys"; key = "kontemplate-key"; }; }; - - # Third-party projects (either vendored or modified from nixpkgs) go here: - nixery = import ./third_party/nixery.nix { pkgs = self; }; - terraform-gcp = self.terraform_0_12.withPlugins(p: [ p.google p.google-beta ]); - ormolu = import (self.fetchFromGitHub { - owner = "tweag"; - repo = "ormolu"; - rev = "a7076c0f83e5c06ea9067b71171859fa2ba8afd9"; - sha256 = "1p4n2ja4ciw3qfskn65ggpy37mvgf2sslxqmqn8s8jjarnqcyfny"; - }) { pkgs = self; }; - naersk = self.callPackage (self.fetchFromGitHub { - owner = "nmattia"; - repo = "naersk"; - rev = "68c1c2b2b661913cdc5ecabea518dfdc4f449027"; - sha256 = "1ll310pl44kdbwfslzwvg2v7khf1y0xkg2j5wcfia4k7sj6bcl28"; - }) {}; - - # Gemma needs an older version of Elm to be built. Updating it to - # the newer version is a lot of effort. - elmPackages = (import (self.fetchFromGitHub { - owner = "NixOS"; - repo = "nixpkgs"; - rev = "14f9ee66e63077539252f8b4550049381a082518"; - sha256 = "1wn7nmb1cqfk2j91l3rwc6yhimfkzxprb8wknw5wi57yhq9m6lv1"; - }) {}).elmPackages; - - # Wrap kontemplate to inject the Cloud KMS version of 'pass' - kontemplate = - let master = super.kontemplate.overrideAttrs(_: { - src = self.fetchFromGitHub { - owner = "tazjin"; - repo = "kontemplate"; - rev = "v1.8.0"; - sha256 = "123mjmmm4hynraq1fpn3j5i0a1i87l265kkjraxxxbl0zacv74i1"; - }; - }); - in self.writeShellScriptBin "kontemplate" '' - export PATH="${self.tazjin.kms_pass}/bin:$PATH" - exec ${master}/bin/kontemplate $@ - ''; - - # One of Gemma's dependencies is missing in nixpkgs' Quicklisp - # package set, it is overlaid locally here. - lispPackages = import ./third_party/common_lisp/quicklisp.nix { - inherit (self) lib; - inherit (super) lispPackages; - }; - - # All projects that should be built by CI should be added here: - ciProjects = [ - self.kontemplate - self.nixery - self.ormolu - self.terraform-gcp - ] ++ filter (d: d ? meta.broken && !d.meta.broken) (attrValues self.tazjin); - }; + in { + services = readTree ./services config; + tools = readTree ./tools config; + third_party = readTree ./third_party config; + } // (readTree ./overrides config); + + # # All projects that should be built by CI should be added here: + # ciProjects = [ + # self.kontemplate + # self.nixery + # self.ormolu + # self.terraform-gcp + # ] ++ filter (d: d ? meta.broken && !d.meta.broken) (attrValues self.tazjin); + # }; in { ... } @ args: import stableSrc (args // { overlays = [ localPkgs ]; -- cgit 1.4.1