GithubHelp home page GithubHelp logo

volllly / rotz Goto Github PK

View Code? Open in Web Editor NEW
313.0 4.0 9.0 1.97 MB

Fully cross platform dotfile manager and dev environment bootstrapper written in Rust.

Home Page: https://volllly.github.io/rotz/

License: MIT License

Rust 100.00%
dotfile-manager dotfiles-manager cross-platform dotfiles rust

rotz's People

Contributors

actions-bot avatar dependabot[bot] avatar escwxyz avatar kecrily avatar renovate[bot] avatar volllly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rotz's Issues

Provide install scripts

Provide simple install scripts to install rotz like this:

curl github.com/volllly/rotz/releases/download/latest/install.sh | sh
irm github.com/volllly/rotz/releases/download/latest/install.ps1 | iex

The script should be automatically published in the releases and download the correct binary into a folder that makes sense. Maybe there is a common way to do these things. For windows we could look at how scoop installs itsself.

Dotted vs Rotz

Hey there, I'm looking for a crossplatform dotfile managing solution, and stumbled across Dotted/Rotz. My main OS is Windows but I have several devices running several different Linux distros. I'm happy to keep using scoop/other package managers to managing installing/uninstalling/updating programs, but I was just wondering if Rotz was ready to use now purely as an alternative to stow for dotfile managing, or if I should use something else in the meantime?

Publish to package managers

I would like to add Rotz to some package managers to ease installation.

My initial thoughts are:

  • scoop and winget for windows
  • homebrew on macos
  • nix, snap or flatpak for linux.

but this is open for debate ๐Ÿ˜„

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

cargo
Cargo.toml
  • clap 4.5.4
  • serde_yaml 0.9.34
  • serde_toml 0.8.12
  • serde_json 1.0.116
  • figment 0.10.18
  • directories 5.0.1
  • once_cell 1.19.0
  • serde 1.0.198
  • crossterm 0.27.0
  • itertools 0.12.1
  • thiserror 1.0.58
  • baker 0.2.0
  • miette 7.2.0
  • indexmap 2.2.6
  • handlebars 5.1.2
  • handlebars_misc_helpers 0.15.0
  • shellwords 1.1.0
  • path-absolutize 3.1.1
  • walkdir 2.5.0
  • wax 0.6.0
  • whoami 1.5.1
  • path-slash 0.2.1
  • velcro 0.5.4
  • tap 1.0.1
  • tracing 0.1.40
  • tracing-tracy 0.11.0
  • tracing-subscriber 0.3.18
  • strum 0.26.2
  • fake 2.9.2
  • rand 0.8.5
  • rstest 0.19.0
  • speculoos 0.11.0
  • junction 1.0.0
  • openssl-sys 0.9.102
  • openssl-sys 0.9.102
  • openssl-sys 0.9.102
github-actions
.github/workflows/chat-ops-dispatch.yml
  • actions/checkout v4
  • peter-evans/slash-command-dispatch v4
  • peter-evans/create-or-update-comment v4
.github/workflows/ci.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/cache v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/cache v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/cache v4
  • actions/upload-artifact v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/cache v4
  • actions/download-artifact v4
  • antonyurchenko/git-release v6
.github/workflows/docs.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
.github/workflows/fmt-command.yml
  • actions/checkout v4
  • peter-evans/create-or-update-comment v4
npm
docs/package.json
  • @docusaurus/core 3.2.1
  • @docusaurus/preset-classic 3.2.1
  • @easyops-cn/docusaurus-search-local 0.40.1
  • @ltd/j-toml 1.38.0
  • @mdx-js/react 3.0.1
  • clsx 2.1.0
  • prism-react-renderer 1.3.5
  • react 18.2.0
  • react-dom 18.2.0
  • yaml 2.4.1
  • @docusaurus/module-type-aliases 3.2.1
  • @tsconfig/docusaurus 2.0.3
  • typescript 5.4.5

  • Check this box to trigger a request for Renovate to run again on this repository

Support lists for "installs"

Hey,
I really like the idea of rotz. I saw the example for installs and was missing the ability to install a list of tools.

Let me outline my idea:

  • I have config.yaml with variables
variables:
  packages:
    darwin:
      - visual-studio-code
      - vim
      - rustup
    linux:
      - vscode
      - emacs
      - golang
  • I have a dot.yaml where I want to install a set of packages
darwin:
  installs:
    cmd: brew install {{ <package> }}
    # packages: {{ variables.darwin }}
    depends:
      - brew
linux:
  installs:
    cmd: yay install {{ <package> }}
    # packages: {{ variables.darwin }}
    depends:
      - yay
  • As rotz supports arrays, there could be a packages property for installs to install more than one package with cmd

Does this make any sense?

I'm happy to discuss the idea or answer any follow-up questions :)

Cheers
Stefan

Sync error under Windows

Hi there. As the title says i'm getting this error when i try to run the sync command under Windows.

Error: glob::set::parse

x Could not build GlobSet
`-> failed to parse glob expression

I don't know if i'm doing something wrong but i just initialize rotz with rotz init, then add things into the .dotfiles folder and then i've tried the sync command and got this error.

Subdirectory {{ name }} includes path โ€” creates issue for `defaults.yaml` in subdirectories

First off, fantastic package! My dotfiles are sooo much cleaner than when my old dotbot iteration, zero regrets on making the jump, thanks for your hard work on this ๐Ÿ’—โœจ.

One thing I just encountered in trying to refactor from using a giant Brewfile to relying on Rotz for my brew installs: it seems that the {{ name }} of a subdirectory within a subdirectory includes the parent subdirectory. This makes it impossible (? or tricky at least) to use a defaults.yaml with a package manager to install using the suggested pattern:

# defaults.yaml
installs:
  cmd: brew install {{ name }}
  depends:
    - brew

For example, with the below setup (tools dir is in the root of my dotfiles), the above pattern attempts to do this brew install tools/yazi, brew install tools/atuin...etc.

tools
โ”œโ”€โ”€ atuin
โ”‚ย ย  โ”œโ”€โ”€ atuin.toml
โ”‚ย ย  โ””โ”€โ”€ dot.yaml
โ”œโ”€โ”€ dbt
โ”‚ย ย  โ””โ”€โ”€ dot.yaml
โ”œโ”€โ”€ defaults.yaml
โ”œโ”€โ”€ dust
โ”‚ย ย  โ””โ”€โ”€ dot.yaml
โ”œโ”€โ”€ karabiner
โ”‚ย ย  โ”œโ”€โ”€ dot.yaml
โ”‚ย ย  โ””โ”€โ”€ karabiner.json
โ”œโ”€โ”€ sunbeam
โ”‚ย ย  โ”œโ”€โ”€ dot.yaml
โ”‚ย ย  โ””โ”€โ”€ xn.py
โ””โ”€โ”€ yazi
    โ”œโ”€โ”€ Catppuccin-frappe.tmTheme
    โ”œโ”€โ”€ dot.yaml
    โ”œโ”€โ”€ keymap.toml
    โ”œโ”€โ”€ theme.toml
    โ””โ”€โ”€ yazi.toml

This is on MacOS Sonoma 14.4.1, Rotz version 0.10.0. Let me know if you need other details. Thanks again!

add init command

Add an init command to initialize a new dotfiles repository and config file.

Rotz is unable to create directories

A simple dot.yaml config like this fails:

links:
    Microsoft.PowerShell_profile.ps1: ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
> rotz link powershell
Linking powershell

  Microsoft.PowerShell_profile.ps1 -> ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

 Error: link::linking

  ร— Could not create link from "C:
  โ”‚ \Users\Michael\.dotfiles\powershell\Microsoft.PowerShell_profile.ps1" to "C:
  โ”‚ \Users\Michael\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"
  โ•ฐโ”€โ–ถ The system cannot find the path specified. (os error 3)
  help: You may need to run rotz from an admin shell to create file links

Creating the directory Powershell manually fixes the issue. It would be nice if Rotz was able to create the missing directories, because with installs not working yet I can't even run a script that creates the directory.

Better instructions for using defaults

I've been trying to get defaults to work, but so far i cant seem to get it working the way i would like to.
My default.toml file is just
[linux] [linux.installs] cmd: sudo pacman --needed --noconfirm -S {{ name }}
But how do i actually get a dot for a particular application to use it?
Assuming i just want to install something, without any other actions (no linking etc.)
Do i just put in an empty file in the respective folder, or do i put something in it?

Support per-distribution install commands

(Just migrated over to rotz, really nice - thanks!)

We can set install commands per OS (eg, Darwin vs Linux), but there's no way to set different install commands per distro.

In my case, I use Darwin, Ubuntu and Arch Linux. I can have different commands in defaults.yml for darwin and linux, but my linux command can be either apt or pacman which means install will only work on 1 of those distributions.

Current

linux:
  installs: sudo apt install -y {{ name }}

darwin:
  installs:
    cmd: brew install {{ name }}
    depends:
      - brew

Desired (Suggestion)

Reading /etc/os-release (if available) could let us define keys based on the value of ID perhaps:

linux:
  ubuntu:
    installs: sudo apt install -y {{ name }}
  arch:
    installs: sudo pacman -S --noconfirm {{ name }}

darwin:
  installs:
    cmd: brew install {{ name }}
    depends:
      - brew

edit command to add, remove and update dot.* files

It would be nice to add an existing folder/file to be tracked by rotz.

E.g. something like rotz edit vscode add --windows ~/AppData/Roaming/Code/User/snippets/ snippets would add this folder to the vscode/dot.yaml file windows links, copy the folder to vscode/snippets in the repo and create the symlink.

Recurse into subdirectories to find dot.yaml

Discussed in #52

Recurse nested folders and treat dot names as paths. If the folders contain a defaults file merge it with the parent defaults and use it for child dots.

Dot names in the cli and the depends sections are glob patterns.

rotz install devtools/* installs all dots in the devtools folder.

rotz install **/vim installs all dots named vim in any folder.

rotz install * installs all dots in the root folder (like before).

rotz install ** installs all dots in any folder.

depends: [ ../package-managers/scoop ] uses a path relative to the current dot.

Add check on links

rotz is missing a sanity check on links.

PEBKAC from your servitor here happened:
I have a file named config declared as :

links:
  condig:~/.gitconfig

As you can see, there is a typo in the name.
rotz then created a dead link.

i don't think rotz should create deadlinks, it should error, telling the file condig does not exists (and optionally, telling me i am stupid :) ).

PS: Thanks for the tool!

Binary in releases

First of all... Why did I not find this earlier??? Such a great tool! Rust and cross platform, best combo!

I know this project is in its early steps and also only you, @volllly , develop it, so I guess you dont have the time to package it to all platforms. As a temporary solution can you add a step to github actions to build binaries for several platforms? Also add some example one-liner to curl / wget / Invoke-WebRequest them to ~/.bin or something. It would be much easier to not install rust on every computer.

Allow `links` section to take a list instead of a mapping

My dotfiles repo mirrors my $HOME (like a lot of dotfiles repos i guess), so my dot.yaml currently consists of:

links:
     filename: ~/filename

And it's just a bunch of thing: ~/thing for every file or folder that exists in the repo.

Would it be possible to do

copy to: ~/
links:
    - filename
    - other filename

maybe with a different key than links to avoid parsing complexity (idk if rust is like Go where decoding YAML into a data structure imposes somewhat strict requirements on the shape of the input yaml data)

I can whip up a PR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.