setup flake

This commit is contained in:
Adithya 2023-10-28 05:01:42 +05:30
parent 0deb55c35a
commit f256679cbe
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
3 changed files with 11 additions and 37 deletions

View file

@ -11,10 +11,7 @@ stdenvNoCC.mkDerivation {
mdbook build
'';
installPhase = ''
mkdir -p $out/share/nginx
cp -r book $out/share/nginx/html
mkdir -p $out/etc/nginx/conf.d
cp nginx.conf $out/etc/nginx/conf.d/default.conf
sed -i "s@/usr@$out@" $out/etc/nginx/conf.d/default.conf
mkdir -p $out/share
cp -r book $out/share/web
'';
}

View file

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
@ -20,16 +20,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1688939073,
"narHash": "sha256-jYhYjeK5s6k8QS3i+ovq9VZqBJaWbxm7awTKNhHL9d0=",
"lastModified": 1698318101,
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8df7a67abaf8aefc8a2839e0b48f92fdcf69a38b",
"rev": "63678e9f3d3afecfeafa0acead6239cdb447574c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -2,7 +2,7 @@
description = "wiki.adtya.xyz";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
@ -24,30 +24,7 @@
mdbook
];
};
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" = {};
};
};
};
packages.default = callPackage ./default.nix {};
}
);
}