Flakes
This commit is contained in:
parent
fb9eea52a6
commit
c50529e44e
64
flake.lock
Normal file
64
flake.lock
Normal 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
51
flake.nix
Normal 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
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
@ -1 +0,0 @@
|
||||
use nix
|
@ -1,10 +0,0 @@
|
||||
with (import <nixpkgs> {});
|
||||
|
||||
let site = haskellPackages.callPackage ../site {};
|
||||
|
||||
in
|
||||
|
||||
mkShell {
|
||||
buildInputs = [ site ];
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
use nix
|
@ -1,4 +1,4 @@
|
||||
{ mkDerivation, base, filepath, hakyll, stdenv, time }:
|
||||
{ mkDerivation, base, filepath, hakyll, lib, time }:
|
||||
mkDerivation {
|
||||
pname = "site";
|
||||
version = "0.1.0.0";
|
||||
@ -6,5 +6,5 @@ mkDerivation {
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [ base filepath hakyll time ];
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
|
@ -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))
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user