63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{
|
|
description = "Professional website";
|
|
|
|
inputs = {
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
};
|
|
resume-flake = {
|
|
#url = "git+file:///home/greg/code/active/resume";
|
|
url = "git+ssh://gitea@code.everydayimshuflin.com/greg/resume.git";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, resume-flake }:
|
|
{
|
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
|
} //
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
resume = resume-flake.packages.x86_64-linux.default;
|
|
website = pkgs.stdenv.mkDerivation {
|
|
name = "greg.everydayimshuflin.com-website";
|
|
src = ./.;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/resume
|
|
|
|
|
|
cp index.html $out
|
|
cp style.css $out
|
|
cp self.jpg $out
|
|
cp favicon.png $out
|
|
|
|
cp philosophy-test.html $out
|
|
cp -r images $out
|
|
|
|
cp ${resume}/*.pdf $out/resume
|
|
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
packages.default = website;
|
|
|
|
apps.serve = {
|
|
type = "app";
|
|
program = toString (pkgs.writeShellScript "serve-website" ''
|
|
PORT=''${PORT:-8080}
|
|
echo "Building website..."
|
|
echo "Serving website on http://localhost:$PORT"
|
|
cd ${website} && exec ${pkgs.python3}/bin/python -m http.server $PORT
|
|
'');
|
|
};
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|