wiki/flake.nix

54 lines
1.5 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
];
};
2023-08-15 12:25:39 +05:30
packages.image = dockerTools.buildImage {
name = "wiki.adtya.xyz";
tag = "latest";
fromImage = dockerTools.pullImage {
imageName = "nginx";
imageDigest =
if stdenv.isAarch64
then "sha256:93e4bc3b0434bb3b6a7c0bb354aa78be9c23eb7d1853e329dde765e37f809d50"
else "sha256:785ed82af07602663e62d36f462b1f9a212f0587de8737189fff9f258801d7c0";
sha256 =
if stdenv.isAarch64
then "sha256-tFnQPV1SFU0sm2A+rV7xL9UAy7L2zbCzc/09Gu/BILU="
else "sha256-J7lQrYyBtqim54u1mAGgw6cve1AJlvew4tg4jjMjkWg=";
finalImageName = "nginx";
finalImageTag = "stable-alpine-slim";
};
copyToRoot = callPackage ./default.nix {};
config = {
Cmd = ["nginx" "-g" "daemon off;"];
ExposedPort = {
"80/tcp" = {};
2023-07-11 23:07:49 +05:30
};
};
2023-08-15 12:25:39 +05:30
};
2023-07-11 23:07:49 +05:30
}
2023-03-31 19:43:26 +05:30
);
}