1
0
Fork 0

wip: flake

This commit is contained in:
saji 2024-07-07 12:00:34 -05:00
parent 07d0be04ae
commit c1eb71b9ec
5 changed files with 2078 additions and 4 deletions

1
.gitignore vendored
View file

@ -1,4 +1,3 @@
_site/
node_modules/
package-lock.json
.cache

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1720244366,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

65
flake.nix Normal file
View file

@ -0,0 +1,65 @@
{
description = "Bloggy time!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }: let
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = function:
nixpkgs.lib.genAttrs systems (system: function (
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
));
env = pkgs: pkgs.callPackage ({ mkYarnModules }:
mkYarnModules {
pname = "blog-env";
version = "2.2.2";
yarnLock = ./yarn.lock;
packageJSON = ./package.json;
}) { };
in {
packages = forAllSystems (pkgs: rec {
eleventyEnv = (env pkgs);
blog = pkgs.callPackage (
{ stdenvNoCC, eleventyEnv, lib, nodejs, vips}:
stdenvNoCC.mkDerivation {
pname = "blog";
version = "2.2.2";
src = ./.;
nativeBuildInputs = [
eleventyEnv
nodejs
vips
];
ELEVENTY_ENVIRONMENT = "prod";
configurePhase = ''
ln -s ${eleventyEnv}/node_modules ./node_modules
'';
buildPhase = ''
npx eleventy
'';
installPhase = ''
cp -ar _site $out
'';
}) { inherit eleventyEnv; };
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
yarn
(env pkgs)
];
};
});
};
}

View file

@ -18,14 +18,17 @@
"engines": {
"node": ">=14"
},
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"dependencies": {
"@11ty/eleventy-img": "^3.1.1",
"@11ty/eleventy": "^2.0.1"
},
"devDependencies": {
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.4",
"@11ty/eleventy-plugin-rss": "^1.2.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"luxon": "^3.3.0",
"markdown-it-anchor": "^8.6.7"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

1980
yarn.lock Normal file

File diff suppressed because it is too large Load diff