From 89fa2f60db2ce6b1c5ead0412fa071c0278e35d4 Mon Sep 17 00:00:00 2001 From: 0xhenrique Date: Fri, 5 Dec 2025 18:46:43 +0000 Subject: add npm post --- blog/rss.xml | 332 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 179 insertions(+), 153 deletions(-) (limited to 'blog/rss.xml') diff --git a/blog/rss.xml b/blog/rss.xml index 2e75b5c..d2347bd 100644 --- a/blog/rss.xml +++ b/blog/rss.xml @@ -4,14 +4,74 @@ <![CDATA[0xhenrique]]> https://blog.0xhenrique.org/ -Tue, 03 Jun 2025 12:04:48 +0100 +Fri, 05 Dec 2025 18:45:28 +0000 - <![CDATA[Managing Bookmarks the Emacs Way: Why I Built ESB]]> + <![CDATA[Global Install NPM Packages on GNU Guix]]> +This post is not exactly a tutorial, but rather a record for myself. I've already needed to configure npm on Guix a few times and, inevitably, I ended up forgetting the steps when I installed the system again. To avoid wasting time in the future, I leave here the procedure that always solves the problem for me. +

+ +

+When trying to install packages globally with npm, the error is usually this: +

+ +
+
home@user ~/workspace/dump$ npm i --global @volar/typescript
+npm error code ENOENT
+npm error syscall mkdir
+npm error path /gnu/store/7wn5cq17bjndjxqpzlp6icyyyfxz36bf-node-22.14.0/lib/node_modules/@volar
+npm error errno -2
+npm error enoent ENOENT: no such file or directory, mkdir '/gnu/store/...'
+npm error enoent This is related to npm not being able to find a file.
+npm error A complete log of this run can be found in: /home/user/.npm/_logs/2025-12-05T18_11_26_115Z-debug-0.log
+
+
+ +

+The problem happens because Guix, like NixOS, keeps the /gnu/store directory immutable. npm tries to write there and fails. The practical solution is to redirect global packages to a directory in $HOME. +

+
+

Step by step

+
+
+
# Create a directory for global packages:
+mkdir ~/.npm-global
+
+# Configure npm prefix:
+npm config set prefix '~/.npm-global'
+
+# Add the new path to PATH:
+export PATH="$HOME/.npm-global/bin:$PATH"
+
+# Confirm that the configuration has been applied:
+npm config get prefix
+/home/user/.npm-global
+
+# Install the desired package:
+npm install -g @volar/typescript
+added 5 packages in 1s
+
+
-
-

The Problem with Browser Bookmarks

-
+

+There are other ways around this limitation, but working with npm (and other package managers) in Guix can be a bit of a pain. This simple adjustment is often enough to avoid headaches in most cases. +

+
+
+]]> + + + https://blog.0xhenrique.org/2025-12-05-global-install-npm-packages-on-gnu-guix.html + https://blog.0xhenrique.org/2025-12-05-global-install-npm-packages-on-gnu-guix.html + Fri, 05 Dec 2025 18:21:00 +0000 + + + <![CDATA[Managing Bookmarks in Emacs: Why I Built ESB]]> + +

The Problem with Browser Bookmarks

+

If you are reading this, maybe you spend most of your day inside Emacs. You probably already use it for emails, RSS, file stuff, even browsing web pages. But then, why bookmarks are still stuck inside Firefox or Chrome?

@@ -25,10 +85,9 @@ But for us who like to own our data and keep things inside Emacs, I think there

- -
-

Enter ESB: Emacs Simple Bookmark

-
+
+

Enter ESB: Emacs Simple Bookmark

+

So I made ESB. It's a small and simple bookmark manager that works inside Emacs. It also encrypts bookmarks, and you can sync them in any way you want.

@@ -37,10 +96,9 @@ So I made ESB. It's a small and simple bookmark manager that works inside Emacs. Idea is very basic: bookmarks are your data, so they should stay in your system, not in someone else’s cloud. Want to sync with GitHub? Go ahead. Self-hosted GitLab? Sure. Your own server? Even better.

- -
-

Technical Implementation

-
+
+

Technical Implementation

+

Bookmarks are saved in JSON file. Each one has URL, maybe description, and some tags. The cool part is the storage backend. By default it uses GPG to encrypt before saving:

@@ -65,10 +123,9 @@ You can use prefix args to filter by tag. This helps a lot when you have many bo
- -
-

Why This Approach Makes Sense For Me

-
+
+

Why This Approach Makes Sense For Me

+

The nice thing about keeping bookmarks in Emacs is not only workflow. It’s also about owning your stuff and making it flexible. You can grep them, version control them, backup with dotfiles, or write scripts to do whatever you want.

@@ -82,10 +139,9 @@ And if you sync with Git, you get history. Deleted bookmarks by mistake? g

- -
-

The Limitations

-
+
+

The Limitations

+

But, let’s be honest. This setup is not for everyone. You need to set up GPG, Git repo, and remember to commit. If you just want bookmarks to work and don’t want to think too much, the browser way is easier.

@@ -99,10 +155,9 @@ GPG can also be tricky, especially when you use many computers with different co

- -
-

Should You Use It?

-
+
+

Should You Use It?

+

If you live inside Emacs and care more about control than convenience, I think ESB is good for you. If you keep dotfiles in Git, run your own stuff, and like tools that play nice together, maybe try it.

@@ -131,21 +186,19 @@ GitHub link: https://github.com/0xhe <![CDATA[Pluto Review]]> -

Summary

-
+
+

Summary

+

I would dare to say that Pluto is an anime carried almost entirely by its direction and art, while its story leaves something to be desired in many respects. I had difficulties with the way the author approached the problems inherent in the type of narrative he chose. In this review, I won't go into the technical aspects of animation and direction since I don't have enough knowledge to evaluate them. My focus will be on the writing and storytelling.

+
+

The premise

+
-
-

The premise

-
- -
+
oEU9QPZ.jpeg
@@ -163,12 +216,11 @@ I believe that the two biggest flaws in the narrative are exactly these: the att

+
+

Robots are not slaves

+
-
-

Robots are not slaves

-
- -
+
qV2kSo3.jpeg
@@ -182,12 +234,11 @@ However, there is a fundamental difference between the two cases: human emotions

+
+

Do robots have empathy?

+
-
-

Do robots have empathy?

-
- -
+
h64nW5I.jpeg
@@ -201,12 +252,11 @@ This scene completely breaks the idea that robots can really feel like humans do

+
+

The Best Part

+
-
-

The Best Part

-
- -
+
FAFafwr.jpeg
@@ -216,12 +266,11 @@ For me, the highlight of Pluto remains the first episode. The story of Sir Dunca

+
+

Conclusion

+
-
-

Conclusion

-
- -
+
lTmfFfr.jpeg
@@ -235,12 +284,11 @@ I also missed a more memorable soundtrack. There were several moments in the ani

+
+

Final considerations

+
-
-

Final considerations

-
- -
+
Gjtwhpn.jpeg
@@ -267,12 +315,11 @@ In the end, Pluto raises interesting questions, but fails to answer them reasona

I've been using NixOS for quite some time, but somehow I ended up with Guix. In this article I will try to write about the reasons why I don't use Nix anymore.

+
+

The Emacs > Elisp > SICP > Scheme pipeline

+
-
-

The Emacs > Elisp > SICP > Scheme pipeline

-
- -
+
ouSS2fe.png
@@ -292,10 +339,9 @@ That was when I finally decided to read the SICP and, consequently, learn Scheme

- -
-

The Nix Language is not easy to write

-
+
+

The Nix Language is not easy to write

+

And that alone is huge win for Guix. Configuring Nix packages was a pain in the ass. Not because you need to set everything up from scratch (that's not even a problem), but because the language is confusing as hell and the documentation doesn't help. It's not a secret, everywhere you go on the internet you will find people complaining about how the Nix language is hard to grasp, but no because it is complex, just because it lacks proper documentation. You can't be sure to find what you're looking for. All the information is fragmented on the internet, there is not a place where you can just find what you're looking for. At the end of the day you spend more time guessing "where the information is" rather "how to do X". @@ -303,7 +349,7 @@ For instance, here's a comparison between the figlet package ported to Nix and t

-
+
9epJ4qs.png
@@ -318,12 +364,11 @@ Guix solves that. It's not like you need to learn a complex language to start wi

+
+

The LISP way of life

+
-
-

The LISP way of life

-
- -
+
lisp_cycles.png
@@ -345,10 +390,9 @@ To be honest I don't see a point in learning such a complex language as Nix just

- -
-

Guix is Free (as in Freedom)

-
+
+

Guix is Free (as in Freedom)

+

Guix places more emphasis on software freedom and adheres to the FSF standards for ethical distros.

@@ -358,7 +402,7 @@ Yes, I do use some proprietary software, but that's something I want to change.

-
+
7ozal346p6kz.png?auto=webp&s=f1058e3a298c411182de3a9bd788f65cec5d1bc1
@@ -376,13 +420,10 @@ Yes, I do use some proprietary software, but that's something I want to change. <![CDATA[Guix Wallpapers]]> -I've been using Guix for quite some time now. It's been a great experience so far! +I've been using Guix for quite some time now. It's been a great experience so far. Here are some wallpapers I've been collecting for my Guix desktop.

-

-I think it goes without saying that Suika is the perfect candidate to be the Guix mascot . -

se5Qk6P.png @@ -410,10 +451,9 @@ I think it goes without saying that Suika is the perfect candidate to be the Gui Monogatari is a text editor built with Python using the Tkinter GUI library. shinobu.gif

- -
-

Installation and usage

-
+
+

Installation and usage

+

Assuming you already have Python installed in your machine:

@@ -437,10 +477,9 @@ $ sudo apt-get install tk
- -
-

Goals

-
+
+

Goals

+
  • Basic text editor functionalities (create file, open file, exit etc.)
  • Black background and a colorpicker option to choose another color
  • @@ -450,10 +489,9 @@ $ sudo apt-get install tk
- -
-

Contribute to MONOGATARI - Text Editor

-
+
+

Contribute to MONOGATARI - Text Editor

+
  • Click the fork button on top right
  • Git clone your fork
  • @@ -480,12 +518,11 @@ Then you can create a pull request right here on Github. Just go to the Pull Req

+
+

Screenshots

+
-
-

Screenshots

-
- -
+
print.png
@@ -523,10 +560,9 @@ I don't think parsing 12 thousand objects in JSON is efficient, but it's somethi But at least it helped me get better grasp of a Lisp language. I still intend to revisit this project sometime in the future, maybe even restructure it from scratch to fix the mistakes I made. For now, I don't think it can replace browser bookmarks, but it's something I'll focus on more in my next iteration with Lum.

- -
-

Running Lum

-
+
+

Running Lum

+

Although it is not really necessary to run this program, having fzf and xclip would be great if you want to integrate with other programs. A pretty useful command to fetch your bookmarks would be:

@@ -536,10 +572,9 @@ Although it is not really necessary to run this program, having fzf and xclip wo
- -
-

Integration with Emacs

-
+
+

Integration with Emacs

+

While I'm not deploying binary packages to Lum, I can check my bookmarks through Emacs with a very simple function:

@@ -569,10 +604,9 @@ While I'm not deploying binary packages to Lum, I can check my bookmarks through <![CDATA[Internet Lurk Compilation #1]]> -

General Findings

-
+
+

General Findings

+
- -
-

Neocities

-
+
+

Neocities

+
- -
-

Internet Archive Findings

-
+ - -
-

Websites I visit from time to time

-
+
+

Websites I visit from time to time

+
  • A ~modern~ Javascript approach to SICP: https://sicp.sourceacademy.org/
  • A blog by Sam Greydanus: https://greydanus.github.io/
  • @@ -640,10 +671,9 @@ While I'm not deploying binary packages to Lum, I can check my bookmarks through <![CDATA[About]]> -

    whoami

    -
    +
    +

    whoami

    +

    Hello there! You can call me Henrique. The main purpose of this website is to share some interesting things I find on the world wide web and the projects of mine. @@ -651,14 +681,13 @@ Some of the stuff I work on Github.

    - -
    -

    My Computers

    -
    +
    +

    My Computers

    +
    -
    -

    ThinkPad T480

    -
    +
    +

    ThinkPad T480

    +
    • OS: GNU Guix
    • DE: EXWM/XFCE4
    • @@ -668,10 +697,9 @@ Some of the stuff I work on Github.
    - -
    -

    Xeon PC

    -
    +
    +

    Xeon PC

    +
    • OS: GNU Guix
    • DE: EXWM/XFCE4
    • @@ -682,14 +710,13 @@ Some of the stuff I work on Github.
    - -
    -

    Keyboards

    -
    +
    +

    Keyboards

    +
    -
    -

    The Charybdis by Bastard Keyboards

    -
    +
    +

    The Charybdis by Bastard Keyboards

    +

    vqbSpXX.jpeg Right now I'm using the Charybdis. It simply feels "correct" to type with it. @@ -699,10 +726,9 @@ But at the end I think it's worth it, at least for me it is.

    - -
    -

    The Sofle V1 by Mechboards UK

    -
    +
    +

    The Sofle V1 by Mechboards UK

    +

    O4zYPni.jpeg The other one I have (although don't use very much anymore) is the Sofle V1 that I bought from Mechboards UK. @@ -728,7 +754,7 @@ Shame on me for not taking my camera with me that day. I'm not a fan of smartpho

    -
    +
    ATjnpyl.jpeg
    @@ -738,13 +764,13 @@ According to Wikipedia, Nazaré is one of the most traditional Portuguese fishin

    -
    +
    GwZIh3p.jpeg

    -I plan to go back there in the winter, but this time I will remember to take my camera with me. I have an 18-55 and a 200mm, but I believe I will get better photos with the 200mm, especially in the higher parts. Not to mention that I will be able to aim further without losing too much sharpness. +I plan to go back there in the winter, but this time I will remember to take my camera with me. I have an 18-55 and a 200mm, but I believe I will get better photos with the 200mm, especially in the higher parts. Not to mention that I will be able to aim further without losing sharpness.

    -- cgit v1.3