wiki/flake.nix

57 lines
1.6 KiB
Nix
Raw Normal View History

2023-03-31 19:43:26 +05:30
{
2023-07-11 23:07:49 +05:30
description = "wiki.adtya.xyz";
2023-03-31 19:43:26 +05:30
inputs = {
2023-07-11 23:07:49 +05:30
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
2023-03-31 19:43:26 +05:30
};
2023-07-11 23:07:49 +05:30
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
2023-03-31 19:43:26 +05:30
pkgs = import nixpkgs {
2023-07-11 23:07:49 +05:30
inherit system;
2023-03-31 19:43:26 +05:30
};
in
2023-07-11 23:07:49 +05:30
with pkgs; {
formatter = pkgs.alejandra;
devShells.default = mkShell {
buildInputs = [
mdbook
];
};
packages.dockerImage = let
book = callPackage ./default.nix {};
in
dockerTools.buildImage {
name = "wiki.adtya.xyz";
tag = "latest";
fromImage = dockerTools.pullImage {
imageName = "nginx";
imageDigest =
if stdenv.isAarch64
then "sha256:9956d05e8f945ae928901c985936953e93eeb20f1b612b9851f8a5b02ba07b19"
else "sha256:da86ecb516d88a5b0579cec8687a75f974712cb5091560c06ef6c393ea4936ee";
sha256 =
if stdenv.isAarch64
then "1mpy68r0vqkyb8ls2p8msarhsljjkv3pwvl23wbhipygjv1gmqa4"
else "003cpzhjn5myy7myw79gzy9x1mzb2h9b4q1jwwzlhhjv08db9bal";
finalImageName = "nginx";
finalImageTag = "alpine-slim";
};
copyToRoot = book;
config = {
Cmd = ["nginx" "-g" "daemon off;"];
ExposedPort = {
"80/tcp" = {};
};
};
};
}
2023-03-31 19:43:26 +05:30
);
}