~hauleth/ptsd

File organiser in Rust

b50568d chore: remove unneeded Cargo.lock

~hauleth pushed to ~hauleth/ptsd git

5 months ago

02619a4 chore: update NixOS version used by builds.sr.ht

~hauleth pushed to ~hauleth/ptsd git

5 months ago

#PTSD

builds.sr.ht status

Simple tool for automatic file management. Basically find … -exec/fd … --exec with configuration file.

#Name

It stands for Python Tremendously Sucks Dicks and it was created in anger after I tried to package Organize for Nix. It was pain, even when I was working alongside of one of Poetry maintainers. So as that experience was quite suboptimal I come up with idea of writing such project on my own and I have gave it a name that relates to the experience I had with Python.

Hopefully this will be simpler to write and to package it as a Rust project rather than Python.

#Why Rust?

Why not? I was thinking also about using Zig that I am learning, but I know Rust better and the ecosystem of Rust is in better state. Maybe I will rewrite it later.

#Supported platforms

I develop it and maintain it mostly on macOS, so most *nixes should be ok. I will probably test it on Linux as well. I do not have Windows machine nor I care enough about that platform, so support for it may be wonky (unless someone, potentially You, will be willing to take care of it).

#Configuration

TBD, but current plan is to use JSON files.

But Hauleth, JSON sucks for configuration as it is quite verbose, lacks comments, etc. So why not use something like JSON5, TOML, Dhall, Nickel or other?

Good question. I was thinking about using either Dhall or Nickel, but in the end I come to the conclusion that I want to use it from Nix anyway, so just using plain JSON and generating it from Nix derivation will be much simpler than using some fancy pants configuration language. In the end you can also use Nickel or Dhall from CLI and pass the generated file to the ptsd. Also if there will be need other formats can be easily added as ptsd uses Rust's Serde, which allows us to easily add new formats in the future if needed.

#Similar tools

  • Organize - written in Python, was "inspiration" to write this tool as packaging this tool for Nixpkgs was a horror. So instead I come up with an idea to write my own.
  • Maid - written in Ruby, I wanted to use that, but it seems to be a little bit stalled. Also wanted something that would be easier to manage from Nixpkgs instead of separate DSL.
  • Hazel - commercial software for macOS, with GUI and stuff, but I am developer so instead of spending few minutes of my work (in USD) I prefer to waste few days of my life on writing tool on my own. Also see above about the Nixpkgs stuff.

#License

EUPL-1.2 or later