This repository has been archived on 2022-09-16. You can view files and clone it, but cannot push or open issues or pull requests.
tlaternet-templates/flake.nix

81 lines
1.6 KiB
Nix
Raw Normal View History

2021-04-07 21:41:11 +01:00
{
description = "tlater.net web server contents";
inputs = {
2022-06-15 14:55:26 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
2022-07-30 17:42:07 +01:00
nix-filter.url = "github:numtide/nix-filter";
2022-06-15 19:50:50 +01:00
npmlock2nix = {
url = "github:nix-community/npmlock2nix";
flake = false;
};
2021-04-07 21:41:11 +01:00
};
2022-06-15 19:50:50 +01:00
outputs = {
self,
nixpkgs,
2022-07-30 17:42:07 +01:00
nix-filter,
2022-06-15 19:50:50 +01:00
npmlock2nix,
}: let
# At the moment, we only deploy to x86_64-linux. Update when we
# care about another platform.
system = "x86_64-linux";
overlays = [
(final: prev: {
npmlock2nix = import npmlock2nix {pkgs = prev;};
})
];
pkgs = import nixpkgs {inherit system overlays;};
in {
packages.${system} = rec {
tlaternet-templates = pkgs.npmlock2nix.build {
2022-07-30 17:42:07 +01:00
src = pkgs.lib.cleanSource self;
buildInputs = with pkgs; [
util-linux
];
2021-04-07 21:41:11 +01:00
2022-06-15 19:50:50 +01:00
installPhase = ''
cp -r dist $out/
'';
2021-04-07 21:41:11 +01:00
2022-06-15 19:50:50 +01:00
node_modules_attrs = {
buildInputs = with pkgs; [
pkg-config
python3
vips
glib
];
};
};
2022-06-15 19:50:50 +01:00
default = tlaternet-templates;
};
2022-06-15 19:50:50 +01:00
devShells.${system} = {
default = pkgs.npmlock2nix.shell {
2022-07-30 17:42:07 +01:00
src = nix-filter.lib {
root = self;
include = [
"package.json"
"package-lock.json"
];
};
buildInputs = with pkgs.nodePackages; [
npm-check-updates
prettier
];
2022-06-15 19:50:50 +01:00
node_modules_attrs = {
buildInputs = with pkgs; [
pkg-config
python3
vips
glib
];
2021-04-07 21:41:11 +01:00
};
};
};
2022-06-15 19:50:50 +01:00
};
2021-04-07 21:41:11 +01:00
}