Turn the site into a package
And an app Build with `nix build`, run with `nix run`main
parent
7aa1e8e19d
commit
eb872da91a
|
@ -1,6 +1,7 @@
|
||||||
{ sealImagesPath = "./website/images"
|
{ sealImagesPath = "images"
|
||||||
, postsOutputPath = "./website/posts"
|
, postsOutputPath = "posts"
|
||||||
, startDate = 2022-01-01
|
, startDate = 2022-09-11
|
||||||
|
, seed = +137
|
||||||
, adjectives1 =
|
, adjectives1 =
|
||||||
[ "absorbing"
|
[ "absorbing"
|
||||||
, "adorable"
|
, "adorable"
|
||||||
|
|
14
flake.lock
14
flake.lock
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690927903,
|
"lastModified": 1691421349,
|
||||||
"narHash": "sha256-D5gCaCROnjEKDOel//8TO/pOP87pAEtT0uT8X+0Bj/U=",
|
"narHash": "sha256-RRJyX0CUrs4uW4gMhd/X4rcDG8PTgaaCQM5rXEJOx6g=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bd836ac5e5a7358dea73cb74a013ca32864ccb86",
|
"rev": "011567f35433879aae5024fc6ec53f2a0568a6c4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -33,11 +33,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691015524,
|
"lastModified": 1691530010,
|
||||||
"narHash": "sha256-Qg6wYm/T3qmEiwuff3hBmOnCe8MoC6LhHuKQDs+7YRE=",
|
"narHash": "sha256-4xtMxEstoQ0iM/BOgGhla08xL/DFjS0+Q8nLOl9Gmls=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "73235cf0ab75d9823db99210ba8bdaf426e29714",
|
"rev": "f25dd9c99382fd4e945e4d0d034254fc552d9aca",
|
||||||
"revCount": 10,
|
"revCount": 14,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.ewanick.com/bill/sealPostGenerator.git"
|
"url": "https://git.ewanick.com/bill/sealPostGenerator.git"
|
||||||
},
|
},
|
||||||
|
|
26
flake.nix
26
flake.nix
|
@ -24,12 +24,32 @@
|
||||||
split
|
split
|
||||||
]);
|
]);
|
||||||
in
|
in
|
||||||
{
|
rec {
|
||||||
apps.generateSealPosts = {
|
apps.generateSealPosts = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${inputs.spg.packages.${system}.default}/bin/generateSealPosts";
|
program = "${inputs.spg.packages.${system}.default}/bin/generateSealPosts";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
apps.hakyll-site = {
|
||||||
|
type = "app";
|
||||||
|
program = "${packages.default}/bin/site";
|
||||||
|
};
|
||||||
|
|
||||||
|
apps.default = apps.hakyll-site;
|
||||||
|
|
||||||
|
packages.default = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "site";
|
||||||
|
src = self;
|
||||||
|
buildPhase = ''
|
||||||
|
${ghc'}/bin/ghc \
|
||||||
|
-O2 \
|
||||||
|
-static \
|
||||||
|
-o site \
|
||||||
|
site.hs
|
||||||
|
'';
|
||||||
|
installPhase = "mkdir -p $out/bin; install -t $out/bin site";
|
||||||
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
name = "hakyll-shell";
|
name = "hakyll-shell";
|
||||||
|
|
||||||
|
@ -37,10 +57,6 @@
|
||||||
ghc'
|
ghc'
|
||||||
hlint
|
hlint
|
||||||
haskell-language-server
|
haskell-language-server
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "build-site" ''
|
|
||||||
${ghc'}/bin/ghc --make website/site -outputdir dist -static -O2
|
|
||||||
'')
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue