Created
February 11, 2019 23:55
-
-
Save benley/a31f0635cca3f5bff4eeccf48c6789a7 to your computer and use it in GitHub Desktop.
Revisions
-
benley created this gist
Feb 11, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ { "url": "https://github.com/nixos/nixpkgs/archive/804c227b83faa017c377eb899d18e5931e0ad936.tar.gz" } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ with rec { versionFile = ./.version; repoVersion = if builtins.pathExists versionFile then builtins.readFile versionFile else "dev"; nixpkgsSrc = fetchTarball (builtins.fromJSON (builtins.readFile ./.nixpkgs.json)); pkgs = import nixpkgsSrc { config = {}; overlays = [(import ./pkgs_overlay.nix)]; }; }; { docker_tag ? pkgs.lib.removeSuffix "\n" repoVersion }: let myPkgs = self: rec { inherit (self) lib callPackage; recurseInto = target: overrides: self.recurseIntoAttrs (lib.callPackagesWith self target overrides); inherit docker_tag; local_app_1 = recurseInto ./src/local_app_1 {}; local_app_2 = recurseInto ./src/local_app_2 {}; local_app_3 = recurseInto ./src/local_app_3 {}; }; in # This calls myPkgs with a combined packageset of itself, our overlay, and # nixpkgs. Then the part that gets exposed to the "outside" is just the things # defined in myPkgs. Believe it or not, this does not result in infinite # recursion. myPkgs (pkgs // myPkgs pkgs) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ self: super: rec { inherit (super) fetchFromGitHub callPackage; python = super.python.override { packageOverrides = callPackage ./python-packages.nix {}; }; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ { fetchFromGitHub }: self: super: { herp_derp_python_example = self.callPackage ./src/herp_derp_python_example {}; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/bin/sh set -xe rev=$(curl -L https://nixos.org/channels/nixpkgs-unstable/git-revision) url="https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz" cat > .nixpkgs.json <<EOF { "url": "$url" } EOF echo "Updated .nixpkgs.json" >&2