From facf97b1f861ea66961a72e43595c5a1b1db8a31 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Thu, 24 Nov 2022 17:32:48 -0500 Subject: fix non-flakes build Signed-off-by: Xe Iaso --- default.nix | 67 +++++++++---------------------------------------------------- 1 file changed, 10 insertions(+), 57 deletions(-) diff --git a/default.nix b/default.nix index 5ce17c1..2cccff2 100644 --- a/default.nix +++ b/default.nix @@ -1,57 +1,10 @@ -{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }: -with pkgs; - -let - rust = pkgs.callPackage ./nix/rust.nix { }; - - srcNoTarget = dir: - builtins.filterSource - (path: type: type != "directory" || builtins.baseNameOf path != "target") - dir; - - naersk = pkgs.callPackage sources.naersk { - rustc = rust; - cargo = rust; - }; - dhallpkgs = import sources.easy-dhall-nix { inherit pkgs; }; - src = srcNoTarget ./.; - - xesite = naersk.buildPackage { - inherit src; - doCheck = true; - buildInputs = [ pkg-config openssl git ]; - remapPathPrefix = true; - }; - - config = stdenv.mkDerivation { - pname = "xesite-config"; - version = "HEAD"; - buildInputs = [ pkgs.dhall ]; - - phases = "installPhase"; - - installPhase = '' - cd ${src} - dhall resolve < ${src}/config.dhall >> $out - ''; - }; - -in pkgs.stdenv.mkDerivation { - inherit (xesite) name; - inherit src; - phases = "installPhase"; - - installPhase = '' - mkdir -p $out $out/bin - - cp -rf ${config} $out/config.dhall - cp -rf $src/blog $out/blog - cp -rf $src/css $out/css - cp -rf $src/data $out/data - cp -rf $src/gallery $out/gallery - cp -rf $src/static $out/static - cp -rf $src/talks $out/talks - - cp -rf ${xesite}/bin/xesite $out/bin/xesite - ''; -} +(import + ( + let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { src = ./.; } +).defaultNix -- cgit v1.2.3