Updated flakes

flakify
Craige McWhirter 2 years ago
parent eced5a29e4
commit 610418ed7c
Signed by: craige
GPG Key ID: 7DBA9F5689EFB6AA

@ -1,113 +1,109 @@
{
"nodes": {
"haskellNix": {
"flake-utils": {
"locked": {
"lastModified": 1620759905,
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"hakyll-flakes": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixpkgs-2003": "nixpkgs-2003",
"nixpkgs-2009": "nixpkgs-2009",
"nixpkgs-unstable": "nixpkgs-unstable"
"hakyll-sass-src": "hakyll-sass-src",
"hakyll-src": "hakyll-src",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1621242760,
"narHash": "sha256-VdNPg0sgeFFmZPPYeuSGWVUSNkPD3aZ3ncfLwBcFs8A=",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "74d51c1737d0620fde9e9ef304b8db75679c7d2f",
"lastModified": 1618250716,
"narHash": "sha256-CVil/bfkKlOwfpETal9PG5dobrQIRNUUAL81tbvZLdI=",
"owner": "Radvendii",
"repo": "hakyll-flakes",
"rev": "4dd48d4231ae20f08361ca9704d457a485eb1c6f",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "haskell.nix",
"owner": "Radvendii",
"repo": "hakyll-flakes",
"type": "github"
}
},
"nixpkgs": {
"hakyll-sass-src": {
"flake": false,
"locked": {
"lastModified": 1608007629,
"narHash": "sha256-lipVFC/a2pzzA5X2ULj64je+fz1JIp2XRrB5qyoizpQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f02bf8ffb9a5ec5e8f6f66f1e5544fd2aa1a0693",
"lastModified": 1545090064,
"narHash": "sha256-/d0zQwWDjHYym8Wwp2GiybMLn4AYS52kpOAYTWRbZDw=",
"owner": "meoblast001",
"repo": "hakyll-sass",
"rev": "495060d23c2d99047c1448ded1f37fb0f88469e6",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f02bf8ffb9a5ec5e8f6f66f1e5544fd2aa1a0693",
"owner": "meoblast001",
"ref": "release-0.2.4",
"repo": "hakyll-sass",
"type": "github"
}
},
"nixpkgs-2003": {
"hakyll-src": {
"flake": false,
"locked": {
"lastModified": 1607708579,
"narHash": "sha256-QyADEDydJJPa8n3xawnA82IJAcZHNNm6Pp5DU7exMr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7f73e46625f508a793700f5110b86f1a53341d6e",
"lastModified": 1601467679,
"narHash": "sha256-rWd5tSGyPB/vvlhOuDKC85onx2d5+lApTS1lqRJrwpg=",
"owner": "jaspervdj",
"repo": "hakyll",
"rev": "e9a8139152b166eae75083259fc3e824675de6fb",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7f73e46625f508a793700f5110b86f1a53341d6e",
"owner": "jaspervdj",
"ref": "v4.13.4.1",
"repo": "hakyll",
"type": "github"
}
},
"nixpkgs-2009": {
"nixpkgs": {
"locked": {
"lastModified": 1608007629,
"narHash": "sha256-lipVFC/a2pzzA5X2ULj64je+fz1JIp2XRrB5qyoizpQ=",
"lastModified": 1603791972,
"narHash": "sha256-nj2SvACFH+NERpye1kudcuygCcvnsZYv26M2+wgM5vE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f02bf8ffb9a5ec5e8f6f66f1e5544fd2aa1a0693",
"rev": "cd63096d6d887d689543a0b97743d28995bc9bc3",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f02bf8ffb9a5ec5e8f6f66f1e5544fd2aa1a0693",
"type": "github"
"id": "nixpkgs",
"ref": "20.09",
"type": "indirect"
}
},
"nixpkgs-unstable": {
"nixpkgs_2": {
"locked": {
"lastModified": 1612284693,
"narHash": "sha256-efzJNF1jvjK3BMl0gZ0ZaUWcFMv0nLb9AHN/++5+u0U=",
"owner": "NixOS",
"lastModified": 1621331592,
"narHash": "sha256-ekcFef4WmuYVe/GgcZx+Ln2+IWbpD4R9MJf7D1R3o9I=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "410bbd828cdc6156aecd5bc91772ad3a6b1099c7",
"rev": "a39809ade0121f374126b5b499173930672b3736",
"type": "github"
},
"original": {
"owner": "NixOS",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "410bbd828cdc6156aecd5bc91772ad3a6b1099c7",
"type": "github"
}
},
"root": {
"inputs": {
"haskellNix": "haskellNix",
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
],
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1619345332,
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
"flake-utils": "flake-utils",
"hakyll-flakes": "hakyll-flakes",
"nixpkgs": "nixpkgs_2"
}
}
},

@ -1,55 +1,21 @@
{
description = "mcwhirter.io website";
description = "My Website";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.hakyll-flakes.url = "github:Radvendii/hakyll-flakes";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, haskellNix }:
utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
overlays = [ haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
mcwhirterIoProject =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc8104";
};
})
outputs = { self, hakyll-flakes, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (
system:
hakyll-flakes.mkAllOutputs {
inherit system;
name = "mcwhirter-io";
src = ./.;
websiteBuildInputs = with nixpkgs.legacyPackages.${system}; [
rubber
texlive.combined.scheme-full
poppler_utils
];
lib = pkgs.lib;
# Run with `nix run .#repl`
repl = utils.lib.mkApp {
drv = pkgs.writeShellScriptBin "repl" ''
confnix=$(mktemp)
echo "builtins.getFlake (toString $(git rev-parse --show-toplevel))" >$confnix
trap "rm $confnix" EXIT
nix repl $confnix
'';
};
pkgs = import nixpkgs { inherit system overlays; };
flake = pkgs.mcwhirterIoProject.flake {};
in flake // {
# Built by `nix build .`
defaultPackage = flake.packages."project:exe:site";
# Executed by `nix run . -- <args?>`
defaultApp = flake.packages."project:exe:site";
apps = (pkgs.mcwhirterIoProject) // { inherit repl; };
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
devShell = pkgs.mcwhirterIoProject.shellFor {
tools = {
cabal = "latest";
hakyll = "latest";
haskell-language-server = "latest";
hlint = "latest";
};
};
});
}
);
}

@ -0,0 +1,53 @@
pkgsSet:
{ system
, name ? "site"
, src
, websiteBuildInputs ? []
}:
let
pkgs = pkgsSet.${system};
builder = pkgs.haskellPackages.callCabal2nix "${name}" "${src}" { };
haskell-env = pkgs.haskellPackages.ghcWithHoogle (
hp: with hp;
[ haskell-language-server cabal-install ] ++ builder.buildInputs
);
in rec {
packages = {
inherit builder;
website = pkgs.stdenv.mkDerivation {
inherit name src;
buildInputs = [ builder ] ++ websiteBuildInputs;
LANG = "en_AU.UTF-8";
LC_ALL = "en_AU.UTF-8";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
# don't look in caches for this; speeds things up a little
allowSubstitutes = false;
buildPhase = ''
${name} build
'';
installPhase = ''
mkdir -p $out/
cp -R _site/* $out/
'';
dontStrip = true;
};
};
defaultPackage = packages.website;
devShell = pkgs.mkShell {
name = "${name}-env";
buildInputs = [ haskell-env ];
shellHook = ''
export HAKYLL_ENV="development"
export HIE_HOOGLE_DATABASE="${haskell-env}/share/doc/hoogle/default.hoo"
export NIX_GHC="${haskell-env}/bin/ghc"
export NIX_GHCPKG="${haskell-env}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${haskell-env}/share/doc/ghc/html"
export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir )
'';
};
defaultApp = {
type = "app";
program = "${builder}/bin/${name}";
};
}
Loading…
Cancel
Save