idimitrov.dev/flake.nix

74 lines
1.9 KiB
Nix
Raw Normal View History

2023-10-27 17:12:20 +02:00
{
description = ''
2023-11-10 16:24:33 +01:00
NextJS flake
2023-10-27 17:12:20 +02:00
'';
inputs = {
2023-11-19 07:06:47 +01:00
nixpkgs.url = "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
};
2023-11-15 13:25:12 +01:00
outputs = { self, nixpkgs, ide, ... }:
2023-10-27 17:12:20 +02:00
let
system = "x86_64-linux";
2023-10-27 18:21:25 +02:00
pkgs = nixpkgs.legacyPackages.${system};
2023-11-19 07:06:47 +01:00
nvim = ide.nvim.${system}.standalone {
plugins = {
lsp.servers = {
html.enable = true;
tsserver.enable = true;
jsonls.enable = true;
tailwindcss.enable = true;
2023-11-16 00:19:42 +01:00
cssls.enable = true;
efm.enable = true;
};
efmls-configs.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
];
tmuxConfig = ''
tmux new-session -s my_session -d
tmux new-window -t my_session:1
tmux new-window -t my_session:2
2023-11-11 15:21:23 +01:00
tmux new-window -t my_session:3
2023-11-16 09:12:15 +01:00
tmux send-keys -t my_session:1.0 'nvim' C-m
2023-11-11 15:21:23 +01:00
tmux send-keys -t my_session:3.0 'bun run dev' C-m
2023-10-27 17:12:20 +02:00
tmux attach-session -t my_session
'';
in
{
devShell.${system} = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
${tmuxConfig}
'';
};
Squashed commit of the following: commit f97a703e0da24e9c98caad7c48cb5882471abdb1 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Fri Dec 15 06:42:21 2023 +0200 fix build error commit dc759d9e3db46cb77cad34e72472c08553211c1c Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Thu Dec 14 18:05:53 2023 +0200 birthday easter egg maybe not working at all but whatever commit 60dbe3ffe9da67abdf3f1dc2bb3f5c0c5bf86643 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Fri Dec 8 17:47:33 2023 +0200 newlines commit 1a7230c4d784077e4156fba4cb017cdc24391e42 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Fri Dec 8 17:46:50 2023 +0200 links commit e1b9e5b00890f9b35e7052a8b5b12b711bfe0911 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Fri Dec 1 15:49:52 2023 +0200 add public key and some svg shadow commit b5dfb5bfab7d4fdd3bbbfe6457a776533f69730c Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Wed Nov 29 16:32:17 2023 +0200 make it lighter commit b065b62975af24de7fd89717ea55ea67984c1b0e Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Wed Nov 29 15:58:10 2023 +0200 formatting commit bb5bd2e5f16b637680075f89e85b0f6e99851734 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Wed Nov 29 15:57:22 2023 +0200 metadata and some optimizations commit 3d1fd8a2fa4882bbfefcf19d47df18b44d3962f9 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Wed Nov 29 15:38:28 2023 +0200 sitemap and robots commit 327f4b7f43b6936f4b0f9dce595837faeb1ac9bf Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Wed Nov 29 10:06:47 2023 +0200 flake update commit 16e08c84c691f8bc69b5e56a2efe37d384be943b Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Tue Nov 28 19:11:41 2023 +0200 flake update commit a7eb0513e6fb22eacaa365f37ad4482272e9bc4d Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Sun Nov 26 12:59:41 2023 +0200 set build inputs to only node commit 59776102f521e20dbede3edb022305d26e69c539 Author: Ivan Dimitrov <ivan@idimitrov.dev> Date: Sun Nov 26 12:55:12 2023 +0200 making the site run on nixos
2023-12-17 10:35:42 +01:00
packages.${system}.default = pkgs.buildNpmPackage rec {
buildInputs = with pkgs; [ nodejs_20 ];
pname = "idimitrov.dev";
version = "0.0.1";
src = ./.;
npmDepsHash = "sha256-DtnXn7/FP9Ccc5qXKQezi9StKOnhZnqVSbz0HJ3TQ0g=";
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
};
}