Compare commits
10 Commits
9950a7195c
...
5680cf7316
Author | SHA1 | Date | |
---|---|---|---|
5680cf7316 | |||
2644a7a8f7 | |||
be5218af0f | |||
359576766b | |||
e5869eb236 | |||
bca680b0a7 | |||
62e32e62fa | |||
8653fd926b | |||
e158d735ce | |||
cf7462c374 |
139
_content/cases/tomcat-monitoring.md
Normal file
139
_content/cases/tomcat-monitoring.md
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
---
|
||||||
|
title: Remotely profiling a Tomcat process serving a Java app
|
||||||
|
goal: To enable Java profiling on a Tomcat server running on CentOS and then optimize the process using VM options.
|
||||||
|
role:
|
||||||
|
date: Nov 2023
|
||||||
|
z: 8
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
[VisualVM](https://visualvm.github.io/) is a FOSS Java profiler used to monitor the resource usage of an app.
|
||||||
|
It can be very useful when you want to diagnose problems with your program and/or optimize it.
|
||||||
|
|
||||||
|
For Java VM optimizations, please have a look [here](https://stackoverflow.com/questions/564039/jvm-performance-tuning-for-large-applications).
|
||||||
|
|
||||||
|
### Technical details
|
||||||
|
|
||||||
|
Remote Java profiling is natively supported through the use of [JMX technology](https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html).
|
||||||
|
To use it, you tell the JVM to start with JMX enabled by adding some startup options to your application.
|
||||||
|
|
||||||
|
By default, this is a localhost only solution which lets you profile while developing an app.
|
||||||
|
Using this over the network requires extra steps of securing the connection as it's not encrypted and it doesn't have a password.
|
||||||
|
|
||||||
|
To encrypt the connection you need to create 2 pairs of keystores and truststores for both Tomcat and VisualVM and then make sure that they trust each other (using -import).
|
||||||
|
|
||||||
|
At the end you'll end up with something like this for the JAVA_OPTS definition
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ... your catalina.sh
|
||||||
|
add_opt() {
|
||||||
|
export JAVA_OPTS="$JAVA_OPTS $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_dir="/path/to/tomcat/conf"
|
||||||
|
my_pass="changeme"
|
||||||
|
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.port=9090"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.rmi.port=9090"
|
||||||
|
add_opt "-Djava.rmi.server.hostname=example.com"
|
||||||
|
add_opt "-Djava.net.preferIPv4Stack=true"
|
||||||
|
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.authenticate=true"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.password.file=$conf_dir/jmxremote.password"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.access.file=$conf_dir/jmxremote.access"
|
||||||
|
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.ssl=true"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.registry.ssl=true"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.ssl.need.client.auth=true"
|
||||||
|
add_opt "-Djavax.net.ssl.keyStore=$conf_dir/tomcat.keystore"
|
||||||
|
add_opt "-Djavax.net.ssl.keyStorePassword=$my_pass"
|
||||||
|
add_opt "-Djavax.net.ssl.trustStore=$conf_dir/tomcat.truststore"
|
||||||
|
add_opt "-Djavax.net.ssl.trustStorePassword=$my_pass"
|
||||||
|
# ... your catalina.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
and you'll have something like this for the keystore and truststore generation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
dname="cn=myname, ou=mygroup, o=mycompany, c=mycountry"
|
||||||
|
pass="changeme"
|
||||||
|
|
||||||
|
keytool -genkey -alias tomcat -keyalg RSA -validity 365 -keystore tomcat.keystore -storepass "$pass" -keypass "$pass" -dname "$dname"
|
||||||
|
keytool -genkey -alias tomcat -keyalg RSA -validity 365 -keystore tomcat.truststore -storepass "$pass" -keypass "$pass" -dname "$dname"
|
||||||
|
|
||||||
|
keytool -genkey -alias vvm -keyalg RSA -validity 365 -keystore vvm.keystore -storepass "$pass" -keypass "$pass" -dname "$dname"
|
||||||
|
keytool -genkey -alias vvm -keyalg RSA -validity 365 -keystore vvm.truststore -storepass "$pass" -keypass "$pass" -dname "$dname"
|
||||||
|
|
||||||
|
keytool -export -alias tomcat -keystore tomcat.keystore -file tomcat.cer -storepass "$pass"
|
||||||
|
keytool -export -alias vvm -keystore vvm.keystore -file vvm.cer -storepass "$pass"
|
||||||
|
|
||||||
|
keytool -import -alias jconsole -file vvm.cer -keystore tomcat.truststore -storepass "$pass" -noprompt
|
||||||
|
keytool -import -alias tomcat -file tomcat.cer -keystore vvm.truststore -storepass "$pass" -noprompt
|
||||||
|
```
|
||||||
|
|
||||||
|
This last script will generate 6 files 2 of which are temporary and can be deleted (the .cer files).
|
||||||
|
|
||||||
|
|
||||||
|
To later use these files and make a connection you need to restart your Tomcat server and run VisualVM like so:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
pass="whatever_you_set_as_password_for_the_keystore_in_the_script"
|
||||||
|
visualvm -J-Djavax.net.ssl.keyStore=/path/to/vvm.keystore -J-Djavax.net.ssl.keyStorePassword=$pass -J-Djavax.net.ssl.trustStore=/path/to/vvm.truststore -J-Djavax.net.ssl.trustStorePassword=$pass
|
||||||
|
```
|
||||||
|
|
||||||
|
As for the actual VisualVM UI - I'm sure you'll figure it out since you already found your way here.
|
||||||
|
|
||||||
|
### Explanation
|
||||||
|
|
||||||
|
This enables JMX on port 9090 together with the RMI option. RMI is required for the remote connection.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.port=9090"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.rmi.port=9090"
|
||||||
|
add_opt "-Djava.rmi.server.hostname=example.com" # Optional - sometimes it works without this and sometimes it doesn't
|
||||||
|
add_opt "-Djava.net.preferIPv4Stack=true" # Uses IPv4 instead of IPv6
|
||||||
|
```
|
||||||
|
|
||||||
|
This adds a username/password authentication to the JMX connection.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.authenticate=true"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.password.file=$conf_dir/jmxremote.password"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.access.file=$conf_dir/jmxremote.access"
|
||||||
|
```
|
||||||
|
|
||||||
|
The jmxremote.password file is in this format:
|
||||||
|
|
||||||
|
```
|
||||||
|
role1 pass1
|
||||||
|
role2 pass2
|
||||||
|
role3 pass3
|
||||||
|
```
|
||||||
|
|
||||||
|
And the jmxremote.access file is in this format:
|
||||||
|
|
||||||
|
```
|
||||||
|
role1 readonly
|
||||||
|
role2 readwrite
|
||||||
|
role3 readwrite
|
||||||
|
```
|
||||||
|
|
||||||
|
`readonly` can only monitor the program whereas `readwrite` can also issue commands like "Perform GC" etc.
|
||||||
|
|
||||||
|
This enables and makes SSL a requirement for the connection.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.ssl=true"
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.registry.ssl=true" # Very important line - doesn't work without it. Don't know why.
|
||||||
|
add_opt "-Dcom.sun.management.jmxremote.ssl.need.client.auth=true"
|
||||||
|
add_opt "-Djavax.net.ssl.keyStore=$conf_dir/tomcat.keystore" # The tomcat.keystore file generated through the script above.
|
||||||
|
add_opt "-Djavax.net.ssl.keyStorePassword=$my_pass" # Whatever you set the keystore password to in the script.
|
||||||
|
add_opt "-Djavax.net.ssl.trustStore=$conf_dir/tomcat.truststore" # Same but truststore
|
||||||
|
add_opt "-Djavax.net.ssl.trustStorePassword=$my_pass" # Same
|
||||||
|
```
|
14
_content/links.md
Normal file
14
_content/links.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
title: Links
|
||||||
|
goal: Links to notable things
|
||||||
|
role:
|
||||||
|
date:
|
||||||
|
z: 9
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
* [My firm registration (IDimitrov Ltd.)](https://portal.registryagency.bg/CR/en/Reports/ActiveConditionTabResult?uic=207693833)
|
||||||
|
|
||||||
|
* [-novid -console +con_enable 1 +map_enable_background_maps 0 -map dota -nojoy -autoconfig](https://afkgaming.com/dota2/news/7715-dota-2-launch-options-how-to-boost-fps-and-increase-performance)
|
||||||
|
|
328
flake.lock
328
flake.lock
@ -1,13 +1,66 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"devshell": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"ide",
|
||||||
|
"nixvim",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713532798,
|
||||||
|
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673956053,
|
"lastModified": 1696426674,
|
||||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"revCount": 57,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_3": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -20,16 +73,16 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"ide",
|
"ide",
|
||||||
"nixvim",
|
"neovim-nightly-overlay",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704152458,
|
"lastModified": 1714641030,
|
||||||
"narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=",
|
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "88a2cd8166694ba0b6cb374700799cec53aef527",
|
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -38,6 +91,65 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-parts_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"ide",
|
||||||
|
"neovim-nightly-overlay",
|
||||||
|
"hercules-ci-effects",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712014858,
|
||||||
|
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "flake-parts",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_3": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"ide",
|
||||||
|
"nixvim",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1715865404,
|
||||||
|
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-root": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713493429,
|
||||||
|
"narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=",
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "flake-root",
|
||||||
|
"rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "flake-root",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": [
|
"systems": [
|
||||||
@ -46,11 +158,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701680307,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -64,11 +176,29 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685518550,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_3": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1701680307,
|
||||||
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -87,11 +217,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660459072,
|
"lastModified": 1709087332,
|
||||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "gitignore.nix",
|
"repo": "gitignore.nix",
|
||||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -100,6 +230,29 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hercules-ci-effects": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"ide",
|
||||||
|
"neovim-nightly-overlay",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713898448,
|
||||||
|
"narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "hercules-ci-effects",
|
||||||
|
"rev": "c0302ec12d569532a6b6bd218f698bc402e93adc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "hercules-ci-effects",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -109,11 +262,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704498488,
|
"lastModified": 1715930644,
|
||||||
"narHash": "sha256-yINKdShHrtjdiJhov+q0s3Y3B830ujRoSbHduUNyKag=",
|
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "51e44a13acea71b36245e8bd8c7db53e0a3e61ee",
|
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -125,18 +278,19 @@
|
|||||||
"ide": {
|
"ide": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"systems": "systems_2"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703277278,
|
"lastModified": 1716893760,
|
||||||
"narHash": "sha256-5jd20XohKDc+GEtNiyIL5C+Hj5g1fhAY/ADkSZrzuEo=",
|
"narHash": "sha256-fI3Q8DpkSerjQ37pXBW9ZHKDQQVYfG5stDMw7n9No10=",
|
||||||
"owner": "ivandimitrov8080",
|
"owner": "ivandimitrov8080",
|
||||||
"repo": "flake-ide",
|
"repo": "flake-ide",
|
||||||
"rev": "5ed5ccc63037342cf9d535ea3f1a814da224ec6a",
|
"rev": "eb5e62023fcf8ccab169a313a66ccdc7ff8a3319",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -145,6 +299,56 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"neovim-flake": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"ide",
|
||||||
|
"neovim-nightly-overlay",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"dir": "contrib",
|
||||||
|
"lastModified": 1715815279,
|
||||||
|
"narHash": "sha256-Pf7ZlqPnr195NZb5ADzMVsXurPMjRZ+JMXf6JxvXArE=",
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "neovim",
|
||||||
|
"rev": "9ca81b025990911c2a0dbda92af39ba84983bac3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "contrib",
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "neovim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neovim-nightly-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"hercules-ci-effects": "hercules-ci-effects",
|
||||||
|
"neovim-flake": "neovim-flake",
|
||||||
|
"nixpkgs": [
|
||||||
|
"ide",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1715817852,
|
||||||
|
"narHash": "sha256-UH5o7hT72oAavJTG2NxlpMyQe3BQMniQAsgTugWtlc4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "neovim-nightly-overlay",
|
||||||
|
"rev": "7b5ca2486bba58cac80b9229209239740b67cf90",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "neovim-nightly-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-darwin": {
|
"nix-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -154,11 +358,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704277720,
|
"lastModified": 1715901937,
|
||||||
"narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=",
|
"narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4",
|
"rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -169,35 +373,41 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704161960,
|
"lastModified": 1717144377,
|
||||||
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
|
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "63143ac2c9186be6d9da6035fa22620018c85932",
|
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "NixOS",
|
||||||
"type": "indirect"
|
"ref": "nixos-24.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixvim": {
|
"nixvim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"devshell": "devshell",
|
||||||
|
"flake-compat": "flake-compat_2",
|
||||||
|
"flake-parts": "flake-parts_3",
|
||||||
|
"flake-root": "flake-root",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"ide",
|
"ide",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704716895,
|
"lastModified": 1716326274,
|
||||||
"narHash": "sha256-j3MwWzaOX32v5RIYu2zSSnWFc6NheWNN1p6ngEDu0sA=",
|
"narHash": "sha256-1LyTvpjb8Cmlg3TRnP56rvqK1WSNa518pD6F0tjgM+U=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "0f1c0bda6dad29b2609cafcea512866b86aa2be5",
|
"rev": "5d2e01495944dcf7cf7ee53a7074c4010165d756",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -208,8 +418,7 @@
|
|||||||
},
|
},
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_3",
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"ide",
|
"ide",
|
||||||
@ -223,11 +432,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704668415,
|
"lastModified": 1715870890,
|
||||||
"narHash": "sha256-BMzNHFod53iiU4lkR5WHwqQCFmaCLq85sUCskXneXlA=",
|
"narHash": "sha256-nacSOeXtUEM77Gn0G4bTdEOeFIrkCBXiyyFZtdGwuH0=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "44493e2b3c3ebcd39a9947e9ed9f2c2af164ec4c",
|
"rev": "fa606cccd7b0ccebe2880051208e4a0f61bfc8c1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -258,6 +467,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems_2": {
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1680978846,
|
"lastModified": 1680978846,
|
||||||
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||||
@ -271,6 +495,28 @@
|
|||||||
"repo": "x86_64-linux",
|
"repo": "x86_64-linux",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"ide",
|
||||||
|
"nixvim",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1715940852,
|
||||||
|
"narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "2fba33a182602b9d49f0b2440513e5ee091d838b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
55
flake.nix
55
flake.nix
@ -1,32 +1,32 @@
|
|||||||
{
|
{
|
||||||
description = ''
|
|
||||||
NextJS flake
|
|
||||||
'';
|
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
ide = {
|
ide = {
|
||||||
url = "github:ivandimitrov8080/flake-ide";
|
url = "github:ivandimitrov8080/flake-ide";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ide, ... }:
|
outputs = { nixpkgs, ide, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = import nixpkgs {
|
||||||
nvim = ide.nvim.${system}.standalone {
|
inherit system;
|
||||||
plugins = {
|
overlays = [
|
||||||
lsp.servers = {
|
(final: prev: {
|
||||||
html.enable = true;
|
nvim = ide.nvim.${system}.standalone {
|
||||||
tsserver.enable = true;
|
plugins = {
|
||||||
jsonls.enable = true;
|
lsp.servers = {
|
||||||
tailwindcss.enable = true;
|
html.enable = true;
|
||||||
cssls.enable = true;
|
tsserver.enable = true;
|
||||||
efm.enable = true;
|
jsonls.enable = true;
|
||||||
};
|
tailwindcss.enable = true;
|
||||||
efmls-configs.enable = true;
|
cssls.enable = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
coreutils-full
|
coreutils-full
|
||||||
@ -34,29 +34,17 @@
|
|||||||
bun
|
bun
|
||||||
nvim
|
nvim
|
||||||
];
|
];
|
||||||
tmuxConfig = ''
|
|
||||||
tmux new-session -s my_session -d
|
|
||||||
tmux new-window -t my_session:1
|
|
||||||
tmux new-window -t my_session:2
|
|
||||||
tmux new-window -t my_session:3
|
|
||||||
tmux send-keys -t my_session:1.0 'nvim' C-m
|
|
||||||
tmux send-keys -t my_session:3.0 'bun run dev' C-m
|
|
||||||
tmux attach-session -t my_session
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShell.${system} = pkgs.mkShell {
|
devShell.${system} = pkgs.mkShell {
|
||||||
inherit buildInputs;
|
inherit buildInputs;
|
||||||
shellHook = ''
|
|
||||||
${tmuxConfig}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
packages.${system}.default = pkgs.buildNpmPackage rec {
|
packages.${system}.default = pkgs.buildNpmPackage {
|
||||||
buildInputs = with pkgs; [ nodejs_20 ];
|
buildInputs = with pkgs; [ nodejs_20 ];
|
||||||
pname = "idimitrov.dev";
|
pname = "idimitrov.dev";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
npmDepsHash = "sha256-dG/RcPV0VIkxS/+SGxsg9lVoyf9bYU8WXJusmsO7MY8=";
|
npmDepsHash = "sha256-vYksYHkjuVeqOD4BwS18nygod/2H6Be2Cia3/p6Psek=";
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/bin/
|
mkdir -p $out/bin/
|
||||||
cp -r ./.next/standalone/* $out/
|
cp -r ./.next/standalone/* $out/
|
||||||
@ -70,4 +58,3 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1780
package-lock.json
generated
1780
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@
|
|||||||
"new": "bun new.ts"
|
"new": "bun new.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@catppuccin/tailwindcss": "latest",
|
||||||
"@fortawesome/fontawesome-svg-core": "latest",
|
"@fortawesome/fontawesome-svg-core": "latest",
|
||||||
"@fortawesome/free-brands-svg-icons": "latest",
|
"@fortawesome/free-brands-svg-icons": "latest",
|
||||||
"@fortawesome/free-regular-svg-icons": "latest",
|
"@fortawesome/free-regular-svg-icons": "latest",
|
||||||
|
2
public/quotes.txt
Normal file
2
public/quotes.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"The certainty of religious people is proof of their ignorance."
|
||||||
|
- Dr. Hermit Singh
|
@ -1,8 +1,6 @@
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import Navbar from "$components/navbar";
|
import Navbar from "$components/navbar";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { faCakeCandles, faSquareFull } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Ivan Dimitrov",
|
title: "Ivan Dimitrov",
|
||||||
@ -10,7 +8,6 @@ export const metadata: Metadata = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||||
let today = new Date();
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
|
Loading…
Reference in New Issue
Block a user