Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Release comtrya as a dynamic library #259

Open
svallory opened this issue Oct 27, 2022 · 5 comments
Open

Feature: Release comtrya as a dynamic library #259

svallory opened this issue Oct 27, 2022 · 5 comments

Comments

@svallory
Copy link

Description
I'm creating a home manager (more than just dotfiles) and I'll use Comtrya due to its excellent ability to run manifests. I'll actually make Comtrya a subcommand. But I would like to be able to call Comtrya functions via FFI so having releases of comtrya precompiled as a dynamic library would be very helpful.

Additional information
I'm using Deno and it has an official tool to simplify the creation of Deno "glue code"
https://deno.land/[email protected]/runtime/ffi_api#deno_bindgen

@rawkode
Copy link
Member

rawkode commented Dec 29, 2023

@svallory Apologies for the radio silence on this.

If this is still of interest to you, let me know and I'll prioritise this work.

@svallory
Copy link
Author

svallory commented Jan 5, 2024

Hey @rawkode, no worries, life happens!

Honestly, I don't even remember how far I went with the home manager, but I know I did not complete it.

What I'm using today is an approach of convention over configuration. Which basically means that placing files in certain folders has side effects.

That approach greatly reduced the amount and size of manifests I was writing with Comtrya and I think it would be pretty cool if it was facilitated. Comtrya could even come preconfigured with a side-effect tree structure under ~/.comtrya/.... That would be awesome!

Here's part of the structure I've set up:

~/.home
├── bin                    # binary utilities to move in to a new home and maintaining it
│   ├── catalog
│   ├── comtrya
│   ├── export-defaults.zsh
│   ├── get_os.zsh
│   ├── private-catalog
│   ├── ray
│   └── relink
├── docs/
│  ...
├── dotfiles/              # any direct child gets symlinked in ~/.[child]
│   ├── bashrc
│   ├── bin
│   ├── config
│   ├── cspell
│   ├── deno
│   ├── docker
│   ├── fac.yml
│   ├── finicky.js
│   ├── gitconfig
│   ├── homie
│   ├── lesshst
│   ├── local
│   ├── profile
│   ├── taskbook.json
│   ├── tmux
│   ├── vscode
│   ├── yarnrc
│   ├── zgen
│   ├── zlogout -> config/zsh/zlogout
│   ├── zprofile -> config/zsh/zprofile
│   ├── zshenv -> config/zsh/zshenv
│   └── zshrc -> config/zsh/zshrc
├── furniture/              # assets for the user home
│   ├── Brewfile
│   ├── apps
│   ├── defaults
│   ├── dev
│   ├── drivers
│   ├── eclipse-themes
│   ├── homebrew.png
│   ├── iterm2
│   ├── keylayouts
│   ├── obsidian-vaults
│   ├── raycast
│   ├── templates
│   └── vscode-themes
├── manifests/              # my comtrya configs
│   ├── common
│   ├── deprecated
│   ├── linux
│   ├── mac
│   ├── move-into-mac.yml
│   └── utils.koto
└── private/                # encrypted/decrypted on git push/pull using password
    ├── certificates
    ├── charm-keys-backup.tar
    ├── doppler
    ├── openvpn-connect.json
    └── ssh

This is the top-level view, but some deeper folders also have side-effects, like dotfiles/config/zsh

~/.home/dotfiles/config/zsh
├── aliases/
├── autocomplete/
├── bin/
├── functions/
├── modules/

@rawkode
Copy link
Member

rawkode commented Jan 5, 2024

I like the idea of reducing file.link boilerplate, I have an awful lot of it myself and everything goes to the same location: ~/.config

I think a file.auto_link action or something inside Contrya.yaml to configure linking rules would be a really good addition. Let me think about it and get a proposal over in the next couple of days

any ideas you have are welcome also

cc @comtrya/maintainers

@Lockszmith-GH
Copy link

sorry to butt in, Instead of symlinking, checkout chezmoi - it might be a 'cleaner' solution.
I'm looking at integrating comtrya into a workflow that makes sense to me - still nothing as elaborate as yours.

@svallory
Copy link
Author

sorry to butt in, Instead of symlinking, checkout chezmoi - it might be a 'cleaner' solution. I'm looking at integrating comtrya into a workflow that makes sense to me - still nothing as elaborate as yours.

No worries! I appreciate you trying to help. I do know of chezmoi and it looks like it got a lot of new features since I last used it. Still, for my case, it doesn't really make much sense because all I would use (add, edit, sync) I can easily do using ln -s, nvim, git push/pull, and I work on a single machine. I do have some helpful script though, like move in|out and catalog, that deals with the "furniture" and linking files

My main goal though was to have a simple convention that can be understood just by looking at the folder structure and that only depended on git and gpg.

That way I don't have to remember (sometimes years later) what tool or scripts I need to run. If I remember, great! If not, it's almost as easy to manually configure a new setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants