chezmoi
chezmoi copied to clipboard
Push RPM to Copr?
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.
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.
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.
- https://github.com/flathub/io.neovim.nvim
- https://github.com/flathub/io.mpv.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.
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:
- The flatpak documentation states that flatpak is targeted at GUI applications, not CLIs.
- To run chezmoi with flatpak you'd have to use the verbose command
flatpak run io.chezmoi.Chezmoi
. - Just building a simple flatpak requires downloading over half a gigabyte of runtime, which is a little heavy.
I'll add support for flatpak if/when it gets added to goreleaser/nfpm.
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.
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.
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.
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.
@anthr76, is there an update on this?