diff options
| author | Xe Iaso <me@christine.website> | 2022-11-24 17:32:48 -0500 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-11-24 17:32:48 -0500 |
| commit | facf97b1f861ea66961a72e43595c5a1b1db8a31 (patch) | |
| tree | 6ee826804fde9e7d29554249ccc3515b387e28a5 | |
| parent | f264fcb6246fcc52c6b634fdb1bf41dd07f76d42 (diff) | |
| download | xesite-facf97b1f861ea66961a72e43595c5a1b1db8a31.tar.xz xesite-facf97b1f861ea66961a72e43595c5a1b1db8a31.zip | |
fix non-flakes build
Signed-off-by: Xe Iaso <me@christine.website>
| -rw-r--r-- | default.nix | 67 |
1 files 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 |
