mirror of
https://github.com/youwen5/blog.git
synced 2024-11-24 18:03:50 -08:00
chore: run nixfmt
This commit is contained in:
parent
aea6f85d0e
commit
f377b5ca11
1 changed files with 23 additions and 11 deletions
34
flake.nix
34
flake.nix
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "hakyll-nix-template";
|
description = "gradient ascent";
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
allow-import-from-derivation = "true";
|
allow-import-from-derivation = "true";
|
||||||
|
@ -16,16 +16,24 @@
|
||||||
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
|
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, haskellNix }:
|
outputs =
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
haskellNix,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
hls = pkgs.haskell-language-server;
|
hls = pkgs.haskell-language-server;
|
||||||
overlays = [ haskellNix.overlay
|
overlays = [
|
||||||
|
haskellNix.overlay
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
hakyllProject = final.haskell-nix.project' {
|
hakyllProject = final.haskell-nix.project' {
|
||||||
src = ./ssg;
|
src = ./ssg;
|
||||||
compiler-nix-name = "ghc948";
|
compiler-nix-name = "ghc948";
|
||||||
modules = [{ doHaddock = false; }];
|
modules = [ { doHaddock = false; } ];
|
||||||
shell.buildInputs = [
|
shell.buildInputs = [
|
||||||
hakyll-site
|
hakyll-site
|
||||||
hls
|
hls
|
||||||
|
@ -44,7 +52,7 @@
|
||||||
inherit (haskellNix) config;
|
inherit (haskellNix) config;
|
||||||
};
|
};
|
||||||
|
|
||||||
flake = pkgs.hakyllProject.flake {};
|
flake = pkgs.hakyllProject.flake { };
|
||||||
|
|
||||||
executable = "ssg:exe:hakyll-site";
|
executable = "ssg:exe:hakyll-site";
|
||||||
|
|
||||||
|
@ -52,7 +60,7 @@
|
||||||
|
|
||||||
website = pkgs.stdenv.mkDerivation {
|
website = pkgs.stdenv.mkDerivation {
|
||||||
name = "website";
|
name = "website";
|
||||||
buildInputs = [];
|
buildInputs = [ ];
|
||||||
src = pkgs.nix-gitignore.gitignoreSourcePure [
|
src = pkgs.nix-gitignore.gitignoreSourcePure [
|
||||||
./.gitignore
|
./.gitignore
|
||||||
".git"
|
".git"
|
||||||
|
@ -64,9 +72,9 @@
|
||||||
# https://github.com/NixOS/nix/issues/318#issuecomment-52986702
|
# https://github.com/NixOS/nix/issues/318#issuecomment-52986702
|
||||||
# https://github.com/MaxDaten/brutal-recipes/blob/source/default.nix#L24
|
# https://github.com/MaxDaten/brutal-recipes/blob/source/default.nix#L24
|
||||||
LANG = "en_US.UTF-8";
|
LANG = "en_US.UTF-8";
|
||||||
LOCALE_ARCHIVE = pkgs.lib.optionalString
|
LOCALE_ARCHIVE = pkgs.lib.optionalString (
|
||||||
(pkgs.buildPlatform.libc == "glibc")
|
pkgs.buildPlatform.libc == "glibc"
|
||||||
"${pkgs.glibcLocales}/lib/locale/locale-archive";
|
) "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
${flake.packages.${executable}}/bin/hakyll-site build --verbose
|
${flake.packages.${executable}}/bin/hakyll-site build --verbose
|
||||||
|
@ -78,7 +86,9 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
in flake // rec {
|
in
|
||||||
|
flake
|
||||||
|
// {
|
||||||
apps = {
|
apps = {
|
||||||
default = flake-utils.lib.mkApp {
|
default = flake-utils.lib.mkApp {
|
||||||
drv = hakyll-site;
|
drv = hakyll-site;
|
||||||
|
@ -90,6 +100,8 @@
|
||||||
inherit hakyll-site website;
|
inherit hakyll-site website;
|
||||||
default = website;
|
default = website;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formatter = pkgs.nixfmt-rfc-style;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue