Initial commit

This commit is contained in:
Charlotte Van Petegem 2022-11-04 10:32:25 +01:00
commit 9a5b3e282a
No known key found for this signature in database
GPG key ID: 019E764B7184435A
17 changed files with 490 additions and 0 deletions

55
flake.nix Normal file
View file

@ -0,0 +1,55 @@
{
description = "My personal website";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell = {
url = "github:numtide/devshell";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, devshell, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; overlays = [ devshell.overlay ]; };
pkg = pkgs.stdenv.mkDerivation {
pname = "www.chvp.be";
version = "unstable";
src = ./src;
buildPhase = ''
${pkgs.zola}/bin/zola build
'';
installPhase = ''
cp -r public $out
'';
};
shell = pkgs.devshell.mkShell {
name = "Website";
packages = with pkgs; [
nixpkgs-fmt
zola
];
};
in
{
packages = {
default = pkg;
"www.chvp.be" = pkg;
};
devShells = rec {
default = shell;
"www.chvp.be" = shell;
};
}
) // {
overlay = (curr: prev: {
"www.chvp.be" = self.packages.${curr.system}.default;
});
};
}