2023-10-27 17:12:20 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-05-22 15:48:54 +02:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
2023-11-15 13:25:12 +01:00
|
|
|
ide = {
|
2023-11-18 07:49:38 +01:00
|
|
|
url = "github:ivandimitrov8080/flake-ide";
|
2023-11-15 13:25:12 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-10-27 17:12:20 +02:00
|
|
|
};
|
|
|
|
|
2024-05-22 15:48:54 +02:00
|
|
|
outputs = { nixpkgs, ide, ... }:
|
2023-10-27 17:12:20 +02:00
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
2024-05-22 15:48:54 +02:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
nvim = ide.nvim.${system}.standalone {
|
|
|
|
plugins = {
|
|
|
|
lsp.servers = {
|
|
|
|
html.enable = true;
|
|
|
|
tsserver.enable = true;
|
|
|
|
jsonls.enable = true;
|
|
|
|
tailwindcss.enable = true;
|
|
|
|
cssls.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
2023-11-15 13:25:12 +01:00
|
|
|
};
|
2023-10-27 17:12:20 +02:00
|
|
|
buildInputs = with pkgs; [
|
|
|
|
coreutils-full
|
|
|
|
nodejs_20
|
|
|
|
bun
|
2023-11-15 13:25:12 +01:00
|
|
|
nvim
|
2023-10-27 17:12:20 +02:00
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShell.${system} = pkgs.mkShell {
|
|
|
|
inherit buildInputs;
|
|
|
|
};
|
2024-05-22 15:48:54 +02:00
|
|
|
packages.${system}.default = pkgs.buildNpmPackage {
|
2023-12-17 10:35:42 +01:00
|
|
|
buildInputs = with pkgs; [ nodejs_20 ];
|
|
|
|
pname = "idimitrov.dev";
|
|
|
|
version = "0.0.1";
|
|
|
|
src = ./.;
|
2024-04-18 11:31:34 +02:00
|
|
|
npmDepsHash = "sha256-JcCM8EygjCKq5qDA2g+Oe8wpm2kYH3x1DSp712I/d08=";
|
2023-12-17 10:35:42 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin/
|
|
|
|
cp -r ./.next/standalone/* $out/
|
|
|
|
cp -r ./.next/standalone/.* $out/
|
|
|
|
cp -r ./.next/static $out/.next/
|
|
|
|
cp -r ./public $out/
|
|
|
|
rm -rf $out/lib
|
|
|
|
echo "${pkgs.nodejs_20}/bin/node $out/server.js" > $out/bin/$pname
|
|
|
|
chmod +x $out/bin/$pname
|
|
|
|
'';
|
|
|
|
};
|
2023-10-27 17:12:20 +02:00
|
|
|
};
|
|
|
|
}
|