about summary refs log tree commit diff
path: root/release.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-04-29 07:47:04 +0200
committeraszlig <aszlig@redmoonstudios.org>2015-04-29 07:47:04 +0200
commita5b7e827d76a5c3e1da879b6c1157d48081b4bdc (patch)
tree5e2739b5a269f47ad396bb91b324334a95419c0b /release.nix
parentd22d1069d8adf8116b68fb679ecac68b485d862c (diff)
release.nix: Also patch vuizvui itself.
This is needed because we're relying on nixpkgs-path.nix to point to a
valid nixpkgs tree, which we deliberately don't have anymore because we
wanted to avoid references to <nixpkgs>.

So providing vuizvuiSrc instead of vuizvui has another advantage that we
now are no longer dependant on the channel name and also have a safety
net (Hydra) to inform us of references to <vuizvui> in the form of
failed builds and/or evaluations.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix45
1 files changed, 29 insertions, 16 deletions
diff --git a/release.nix b/release.nix
index 7a320e2f..2cb09451 100644
--- a/release.nix
+++ b/release.nix
@@ -1,4 +1,4 @@
-{ vuizvui ? { outPath  = ./.; revCount = 12345; shortRev = "abcdefg"; }
+{ vuizvuiSrc ? null
 , nixpkgsSrc ? null
 , supportedSystems ? [ "i686-linux" "x86_64-linux" ]
 }:
@@ -21,38 +21,51 @@ let
     };
   in if nixpkgsSrc == null then <nixpkgs> else patchedNixpkgs;
 
+  vuizvuiRevCount = vuizvuiSrc.revCount or 12345;
+  vuizvuiShortRev = vuizvuiSrc.shortRev or "abcdefg";
+  vuizvuiVersion = "pre${toString vuizvuiRevCount}.${vuizvuiShortRev}";
+
+  vuizvui = let
+    patchedVuizvui = (import nixpkgs {}).stdenv.mkDerivation {
+      name = "vuizvui-${vuizvuiVersion}";
+      inherit nixpkgsVersion;
+      src = vuizvuiSrc;
+      phases = [ "unpackPhase" "installPhase" ];
+      installPhase = ''
+        cp -r --no-preserve=mode,ownership "${nixpkgs}/" nixpkgs
+        echo -n "$nixpkgsVersion" > nixpkgs/.version-suffix
+        echo -n ${nixpkgs.rev or nixpkgsShortRev} > nixpkgs/.git-revision
+        echo './nixpkgs' > nixpkgs-path.nix
+        cp -r . "$out"
+      '';
+    };
+  in if vuizvuiSrc == null then ./. else patchedVuizvui;
+
   system = "x86_64-linux";
   pkgsUpstream = import nixpkgs { inherit system; };
-  root = import ./default.nix { inherit system; };
+  root = import vuizvui { inherit system; };
 
 in with pkgsUpstream.lib; with builtins; {
 
   machines = mapAttrsRecursiveCond (m: !(m ? build)) (path: attrs:
     attrs.build.config.system.build.toplevel
-  ) (import ./machines { inherit system; });
+  ) (import "${vuizvui}/machines" { inherit system; });
 
-  tests = mapAttrsRecursiveCond (t: !(t ? test)) (const id) (import ./tests {
-    inherit system;
-  });
+  tests = mapAttrsRecursiveCond (t: !(t ? test)) (const id)
+    (import "${vuizvui}/tests" { inherit system; });
 
   pkgs = let
     releaseLib = import "${nixpkgs}/pkgs/top-level/release-lib.nix" {
       inherit supportedSystems;
-      packageSet = attrs: (import ./default.nix attrs).pkgs;
+      packageSet = attrs: (import vuizvui attrs).pkgs;
     };
   in with releaseLib; mapTestOn (packagePlatforms releaseLib.pkgs);
 
   channels = let
     mkChannel = attrs: root.pkgs.mkChannel (rec {
-      name = "vuizvui-channel-${attrs.name or "generic"}-${version}";
-      version = "${toString vuizvui.revCount}.${vuizvui.shortRev}";
-      inherit nixpkgsVersion;
+      name = "vuizvui-channel-${attrs.name or "generic"}-${vuizvuiVersion}";
       src = vuizvui;
       patchPhase = ''
-        cp -r --no-preserve=mode,ownership "${nixpkgs}/" nixpkgs
-        echo -n "$nixpkgsVersion" > nixpkgs/.version-suffix
-        echo -n ${nixpkgs.rev or nixpkgsShortRev} > nixpkgs/.git-revision
-        echo './nixpkgs' > nixpkgs-path.nix
         touch .update-on-nixos-rebuild
       '';
     } // removeAttrs attrs [ "name" ]);
@@ -63,12 +76,12 @@ in with pkgsUpstream.lib; with builtins; {
     machines = mapAttrsRecursiveCond (m: !(m ? build)) (path: attrs: mkChannel {
       name = "machine-${last path}";
       constituents = singleton attrs.build.config.system.build.toplevel;
-    }) (import ./machines { inherit system; });
+    }) (import "${vuizvui}/machines" { inherit system; });
   };
 
   manual = let
     modules = import "${nixpkgs}/nixos/lib/eval-config.nix" {
-      modules = import ./modules/module-list.nix;
+      modules = import "${vuizvui}/modules/module-list.nix";
       check = false;
       inherit system;
     };