diff options
| author | Xe Iaso <me@christine.website> | 2022-10-30 14:28:47 -0400 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-10-30 14:28:47 -0400 |
| commit | 5d2935617a0e4bf615a8ffc0f7c1f96d9479cbd8 (patch) | |
| tree | 9f781a75f03ccbc022ebab774ce796893bb23e42 | |
| parent | c654d84537a50e164c57852fc89216eec8e55d69 (diff) | |
| download | xesite-5d2935617a0e4bf615a8ffc0f7c1f96d9479cbd8.tar.xz xesite-5d2935617a0e4bf615a8ffc0f7c1f96d9479cbd8.zip | |
use flake-compat builds
Signed-off-by: Xe Iaso <me@christine.website>
| -rw-r--r-- | default.nix | 67 | ||||
| -rw-r--r-- | flake.lock | 17 | ||||
| -rw-r--r-- | flake.nix | 6 |
3 files changed, 32 insertions, 58 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 @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1659877975, @@ -64,6 +80,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "flake-utils": "flake-utils", "naersk": "naersk", "nixpkgs": "nixpkgs_2" @@ -3,11 +3,15 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; flake-utils.url = "github:numtide/flake-utils"; naersk.url = "github:nix-community/naersk"; }; - outputs = { self, nixpkgs, flake-utils, naersk }: + outputs = { self, nixpkgs, flake-utils, naersk, ... }: flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let pkgs = import nixpkgs { inherit system; }; |
