This commit is contained in:
Mats Rauhala 2021-11-26 16:52:39 +02:00
parent fb9eea52a6
commit c50529e44e
7 changed files with 117 additions and 30 deletions

64
flake.lock Normal file
View File

@ -0,0 +1,64 @@
{
"nodes": {
"easy-hls": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1637250802,
"narHash": "sha256-/crlHEVB148PGQLZCsHOR9L5qgvCAfRSocIoKgmMAhA=",
"owner": "jkachmar",
"repo": "easy-hls-nix",
"rev": "7c123399ef8a67dc0e505d9cf7f2c7f64f1cd847",
"type": "github"
},
"original": {
"owner": "jkachmar",
"repo": "easy-hls-nix",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1637841632,
"narHash": "sha256-QYqiKHdda0EOnLGQCHE+GluD/Lq2EJj4hVTooPM55Ic=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "73369f8d0864854d1acfa7f1e6217f7d6b6e3fa1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"easy-hls": "easy-hls",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

51
flake.nix Normal file
View File

@ -0,0 +1,51 @@
{
description = "rauhala.info";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
easy-hls = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, easy-hls }:
{
overlay = final: prev: {
build-rauhala-info = final.haskellPackages.build-rauhala-info;
rauhala-info = final.callPackage ./rauhala.info { site = final.build-rauhala-info; };
haskellPackages = prev.haskellPackages.override ( old: {
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
build-rauhala-info = f.callPackage ./site {};
});
} );
};
}
//
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
hp = pkgs.haskellPackages;
hls = easy-hls.defaultPackage.${system};
in
rec {
packages = { inherit (pkgs) build-rauhala-info rauhala-info; };
applications.build-rauhala-info = flake-utils.lib.mkApp {
drv = packages.build-rauhala-info;
exePath = "/bin/site";
};
defaultPackage = packages.rauhala-info;
defaultApp = applications.build-rauhala-info;
devShell = hp.shellFor {
packages = h: [h.build-rauhala-info];
buildInputs = with pkgs; [
ghcid
cabal-install
stylish-haskell
entr
hls
];
};
});
}

View File

@ -1 +0,0 @@
use nix

View File

@ -1,10 +0,0 @@
with (import <nixpkgs> {});
let site = haskellPackages.callPackage ../site {};
in
mkShell {
buildInputs = [ site ];
}

View File

@ -1 +0,0 @@
use nix

View File

@ -1,4 +1,4 @@
{ mkDerivation, base, filepath, hakyll, stdenv, time }: { mkDerivation, base, filepath, hakyll, lib, time }:
mkDerivation { mkDerivation {
pname = "site"; pname = "site";
version = "0.1.0.0"; version = "0.1.0.0";
@ -6,5 +6,5 @@ mkDerivation {
isLibrary = false; isLibrary = false;
isExecutable = true; isExecutable = true;
executableHaskellDepends = [ base filepath hakyll time ]; executableHaskellDepends = [ base filepath hakyll time ];
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View File

@ -1,16 +0,0 @@
with (import <nixpkgs> {});
let site = haskellPackages.callPackage ./. {};
in
mkShell {
buildInputs = [
ghcid
stylish-haskell
haskellPackages.cabal-install
hlint
(haskellPackages.ghcWithPackages (_: site.buildInputs ++ site.propagatedBuildInputs))
];
}