twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.48k stars 475 forks source link

Push RPM to Copr? #1800

Open dngray opened 2 years ago

dngray commented 2 years ago

Is your feature request related to a problem? Please describe.

Redhat has a service called Copr https://copr.fedorainfracloud.org/coprs/ (they are like Ubuntu PPAs).

Describe the solution you'd like

It would be nice if there was an official repository. The Neomutt project has one for example.

This would mean Redhat users would automatically have the latest Chezmoi instead of manually having to download the RPM or make their own repository.

twpayne commented 2 years ago

This is a great idea, but I would prefer to add support for this to the build tool that chezmoi uses so that other projects can benefit. See https://github.com/goreleaser/goreleaser/issues/2804 for details.

dngray commented 2 years ago

Another solution to this might be to create a flatpak, that way it could be installed on any distribution, that has flatpak.

It's not uncommon for commandline tools to have flatpaks, two examples being NeoVim and MPV.

One of the things I like about flatpaks is they can be installed "per user". ie flatpak install flathub --user io.chezmoi.Chezmoi for example.

twpayne commented 2 years ago

This would mean Redhat users would automatically have the latest Chezmoi instead of manually having to download the RPM or make their own repository.

Note that if you have installed chezmoi using an rpm package then the chezmoi upgrade command will download and install the latest version also using an rpm:

$ sudo rpm -i https://github.com/twpayne/chezmoi/releases/download/v2.9.4/chezmoi-2.9.4-x86_64.rpm
$ rpm -q chezmoi
chezmoi-2.9.4-1.x86_64
$ chezmoi upgrade
chezmoi version v2.9.5, commit af9290311e64e9f34b090c350be84070d1845863, built at 2022-01-05T22:11:53Z, built by goreleaser
$ rpm -q chezmoi
chezmoi-2.9.5-1.x86_64

Another solution to this might be to create a flatpak, that way it could be installed on any distribution, that has flatpak.

I had a look at build at flatpak of chezmoi, but:

I'll add support for flatpak if/when it gets added to goreleaser/nfpm.

dngray commented 2 years ago

Note that if you have installed chezmoi using an rpm package then the chezmoi upgrade command will download and install the latest version also using an rpm:

That generally won't work though for immutable operating systems like Silverblue, microos. For Silverblue you want to do rpm-ostree install chezmoi-x.x.x.rpm which will layer the package as a local package.

In this case I thought about using Toolbox, but the issue seems to be changing the hostname from "toolbox" to that of the host https://github.com/containers/toolbox/issues/98. I thought about using a podman container, but had other issues doing that https://github.com/containers/podman-compose/issues/395

I suppose an alternative solution might be to not use .chezmoi.hostname and instead use a variable set to the hostname - a bit like what you did with your MacOS definition https://github.com/twpayne/dotfiles/blob/master/home/.chezmoi.toml.tmpl#L16

To run chezmoi with flatpak you'd have to use the verbose command flatpak run io.chezmoi.Chezmoi.

People generally have aliases so they don't need to write flatpak run all the time.

Just building a simple flatpak requires downloading over half a gigabyte of runtime, which is a little heavy. With distributions like Fedora, Silverblue, etc you already have Flatpak for other reasons.

skyfaller commented 2 years ago

This is slightly off-topic, but I'm on Fedora and I'm using Homebrew to install Chezmoi, so I want to mention that as a workaround. https://docs.brew.sh/Homebrew-on-Linux

It's slightly annoying to bootstrap your Chezmoi setup if you have to install Homebrew first, but I'm not sure how much more annoying it is than adding an additional Copr repo.

twpayne commented 1 year ago

If you know anything about writing source RPMs and .spec files, I'd love to get your input on https://github.com/goreleaser/goreleaser/pull/3412, which is the key step to resolving this issue.

anthr76 commented 1 year ago

FWIW I have recently submitted the package review for Chezmoi into Fedora here: https://bugzilla.redhat.com/show_bug.cgi?id=2130734

This is still at least a few weeks away as there's a couple more deps needed to be packaged.

mirenradia commented 1 year ago

@anthr76, is there an update on this?