2022-07-25 16:08:01 +02:00
|
|
|
# Instalee
|
2022-02-08 15:46:50 +01:00
|
|
|
|
|
|
|
Inspired by [pass](passwordstore.org "The standard Unix password manager")
|
|
|
|
and the Unix philosophy
|
|
|
|
comes a small POSIX-compliant shell script
|
|
|
|
to aid in setting up and keeping installed packages on machines in sync.
|
|
|
|
Central feature is the modular directory structure
|
|
|
|
that can handle everything from native package managers
|
|
|
|
over installation from source
|
|
|
|
to copying or executing scripts from a URL.
|
2022-11-22 01:18:56 +01:00
|
|
|
Similar to [tldr](https://github.com/tldr-pages/tldr),
|
2022-02-08 15:46:50 +01:00
|
|
|
creating alternative frontends is easy and appreciated.
|
|
|
|
|
2022-07-25 15:59:16 +02:00
|
|
|
Instalee can install the same set of packages on any system
|
|
|
|
with graceful failure if any package is unavailable.
|
|
|
|
With appropriate setup and logging (TBD)
|
|
|
|
it can also keep the installed packages in sync.
|
|
|
|
Simply, Instalee can be used as a unified installation frontend,
|
|
|
|
both manual and automatic,
|
|
|
|
to any package manager or other method of installation
|
|
|
|
on any system with a POSIX Shell available
|
|
|
|
(and the basic logic is so simple
|
|
|
|
you could easily port it to another foundation,
|
|
|
|
preserving the file structure).
|
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
## Usage
|
2022-07-05 15:53:12 +02:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
### Installation
|
2022-07-05 15:53:12 +02:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
To try Instalee with some pre-configured options,
|
|
|
|
clone or download the repository and run the included script.
|
|
|
|
Currently this supports Debian- and Arch-based systems,
|
|
|
|
as well as a few packages via *snap*, *cargo* and custom scripts
|
|
|
|
usually imported from the original project site.
|
2022-07-05 15:53:12 +02:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
Alternatively, you can download just the [`instalee`](./instalee) script
|
|
|
|
and configure it yourself.
|
2023-08-21 22:04:49 +02:00
|
|
|
On Arch you can install the `instalee-git` AUR package
|
|
|
|
to get the man-page and copy the script into `/usr/bin`.
|
2022-07-25 16:08:01 +02:00
|
|
|
|
2023-04-15 13:29:53 +02:00
|
|
|
#### Windows
|
|
|
|
|
2023-08-12 10:56:57 +02:00
|
|
|
You can easily install instalee and its dependencies on Windows
|
|
|
|
by running the following in an administrative powershell:
|
2023-04-15 13:29:53 +02:00
|
|
|
``` powershell
|
|
|
|
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
|
|
|
choco feature enable -n allowGlobalConfirmation
|
|
|
|
choco install git
|
2023-08-12 10:56:57 +02:00
|
|
|
Start-Process -Wait "C:\Program Files\Git\git-bash.exe" -Verb runAs -ArgumentList "-c 'git clone https://github.com/xeruf/instalee; cd instalee && git pull && ./instalee win/office; sleep 10 || bash'"
|
2023-04-15 13:29:53 +02:00
|
|
|
```
|
2023-08-12 10:56:57 +02:00
|
|
|
This combines [the installation of chocolatey](https://chocolatey.org/install#install-step2)
|
|
|
|
with the helper script [i.ps1](./i.ps1).
|
|
|
|
|
|
|
|
It then installs the win/office group
|
|
|
|
made up of packages useful to almost anyone.
|
|
|
|
To install further packages,
|
|
|
|
open git bash in the created instalee directory
|
|
|
|
and run `./instalee PACKAGE`.
|
2023-04-15 13:29:53 +02:00
|
|
|
|
2023-08-12 10:56:57 +02:00
|
|
|
An offline version is possible as well
|
|
|
|
but I did not get around to publishing it yet, just ask :)
|
2022-02-08 15:46:50 +01:00
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
All configuration is stored in `INSTALEE_HOME`
|
2022-07-25 16:08:01 +02:00
|
|
|
which defaults to the first available of
|
|
|
|
`$XDG_CONFIG_HOME/instalee` or the current directory.
|
2022-02-08 15:46:50 +01:00
|
|
|
|
2022-07-04 15:27:11 +02:00
|
|
|
First, customize the _handlers_ available on your system
|
|
|
|
in `$INSTALEE_HOME/handlers.available`
|
2022-02-08 15:46:50 +01:00
|
|
|
which is a newline-separated list of values
|
|
|
|
that usually correspond to subdirectories of the `handlers` directory.
|
2022-07-04 15:27:11 +02:00
|
|
|
The _handlers_ are tried in the order they are listed.
|
2022-02-08 15:46:50 +01:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
Keep the following in mind when configuring Instalee:
|
2022-02-08 15:46:50 +01:00
|
|
|
- `handlers.available` is a system-specific file,
|
|
|
|
for sensible syncing across many different machines
|
|
|
|
a mechanism such as [yasm alternate files](https://yadm.io/docs/alternates)
|
|
|
|
can prove useful.
|
2022-07-04 19:13:34 +02:00
|
|
|
- `groups` are usually personal, but system-agnostic
|
2022-02-08 15:46:50 +01:00
|
|
|
- `handlers` and `packages` need to be attuned,
|
|
|
|
as the package entry format needs to fit the handler definitions.
|
|
|
|
These may be obtained from a trusted source
|
2022-07-25 15:59:16 +02:00
|
|
|
or configured personally.
|
2022-02-08 15:46:50 +01:00
|
|
|
|
2022-07-25 15:59:16 +02:00
|
|
|
This repository contains an example configuration as used by the author.
|
2022-02-08 15:46:50 +01:00
|
|
|
See the [man page](instalee.1) for more details.
|
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
### Installing Packages
|
2022-02-08 15:46:50 +01:00
|
|
|
|
|
|
|
`instalee <target>`
|
|
|
|
|
2022-07-04 19:13:34 +02:00
|
|
|
A _target_ may either be a _package_ or a _group_.
|
2022-07-25 16:08:01 +02:00
|
|
|
Instalee first checks for a `groups/<target>` file.
|
2022-07-04 19:13:34 +02:00
|
|
|
A _group_ is a newline-separated list of packages to install,
|
2022-07-25 16:08:01 +02:00
|
|
|
which instalee then resolves individually.
|
2022-07-04 19:13:34 +02:00
|
|
|
One difference here is that it will try the first handler for the package
|
|
|
|
if it has no associated definition.
|
2022-02-08 15:46:50 +01:00
|
|
|
|
2022-07-04 19:13:34 +02:00
|
|
|
When there is no corresponding _group_,
|
2022-07-25 16:08:01 +02:00
|
|
|
instalee searches for the first available _handler_
|
2022-02-08 15:46:50 +01:00
|
|
|
with a corresponding entry at `packages/<target>/<handler>`,
|
|
|
|
piping it into the _handler_ to install the package.
|
|
|
|
The package definition may be an empty file
|
|
|
|
(thus simply indicating the availability of a package for a _handler_),
|
|
|
|
in which case the name of the package is passed to the _handler_.
|
|
|
|
|
2022-07-04 19:13:34 +02:00
|
|
|
Note that both _groups_ and package entries can be executable files,
|
2022-07-25 16:08:01 +02:00
|
|
|
in which case instalee will execute them and use their output instead,
|
2022-02-08 15:46:50 +01:00
|
|
|
so watch the file permissions!
|
|
|
|
If an available _handler_ has no definition in `handlers`,
|
|
|
|
the package file _has to be_ executable,
|
2022-07-25 16:08:01 +02:00
|
|
|
as instalee will then simply execute it.
|
2022-02-08 15:46:50 +01:00
|
|
|
|
|
|
|
### Handlers
|
|
|
|
|
|
|
|
Though not required,
|
2022-07-25 16:08:01 +02:00
|
|
|
a typical handler will accept a list of packages to install as arguments,
|
2022-02-08 15:46:50 +01:00
|
|
|
enabling batching and the consolidation of interdependent packages into one unit.
|
|
|
|
|
2022-07-04 21:39:34 +02:00
|
|
|
When installing a package and there is no handler available,
|
|
|
|
but a package with the name of a handler of the package has an installable candidate,
|
|
|
|
the handler will be installed, made available and used.
|
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
When installing packages from groups without candidate,
|
|
|
|
the first available handler will be tried regardless
|
|
|
|
so default-named packages do not always need to setup explicitly
|
|
|
|
(TODO: Auto-update repo if that succeeds with flag to disable,
|
|
|
|
flag for manual installation).
|
2022-07-04 21:39:34 +02:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
## Guiding Principles
|
|
|
|
|
|
|
|
Instalee closely follows the UNIX philosophy with directory structures and files as configuration.
|
2023-11-08 13:25:04 +01:00
|
|
|
The goal is to be as generic as possible to accommodate any kind of setup.
|
2022-07-25 16:08:01 +02:00
|
|
|
|
|
|
|
However, it should be efficient while generic,
|
|
|
|
preventing repetition at every level (DRY).
|
|
|
|
|
|
|
|
### What Instalee is not
|
2022-02-08 15:46:50 +01:00
|
|
|
- a (central) package repository containing package sources
|
2022-07-25 15:59:16 +02:00
|
|
|
- a package manager to inspect or remove packages
|
2023-11-08 13:25:04 +01:00
|
|
|
- a tool to upgrade packages installed from diverse sources -
|
2022-07-25 15:59:16 +02:00
|
|
|
see `topgrade`
|
2022-02-08 15:46:50 +01:00
|
|
|
|
2022-07-25 16:08:01 +02:00
|
|
|
## Features
|
|
|
|
|
|
|
|
A loose list of undocumented features
|
|
|
|
and ideas that need to be fleshed out.
|
|
|
|
|
|
|
|
- Cross-handler dependencies (e.g. logcli script needs go)
|
2023-10-26 14:54:44 +02:00
|
|
|
-> currently implemented with `depends_HANDLER` files
|
2022-07-25 16:08:01 +02:00
|
|
|
|
2022-07-04 21:39:34 +02:00
|
|
|
### Planned
|
2022-02-08 15:46:50 +01:00
|
|
|
- detection mechanism for handlers and features
|
2023-11-08 13:25:04 +01:00
|
|
|
(e.g. batch-install support)
|
2022-10-13 12:46:58 +02:00
|
|
|
- Ability to use multiple repos, including remote ones
|
2023-11-08 13:25:04 +01:00
|
|
|
- Cope with missing versions in repositories of older OS versions
|
|
|
|
-> version handlers
|
2022-10-13 12:46:58 +02:00
|
|
|
|
2022-07-04 19:13:34 +02:00
|
|
|
- helper/hook for adding packages to groups upon install
|
2022-02-08 15:46:50 +01:00
|
|
|
(at least for `pacman`)
|
2022-07-25 16:08:01 +02:00
|
|
|
- Log Installs for reuse
|
2022-07-04 15:27:11 +02:00
|
|
|
|
2023-01-04 05:32:02 +01:00
|
|
|
### TODOs
|
|
|
|
- Somehow installing doom emacs has a dependency tree resolution issue
|
2023-03-15 23:01:19 +01:00
|
|
|
- Debug corner cases: Not working on Windows when run as Admin
|
2022-07-04 15:27:11 +02:00
|
|
|
- Handler preparation - update repos and cache last update time in /tmp
|
2022-07-10 19:31:13 +02:00
|
|
|
- Handler for downloaded scripts (e.g. passff-host, funkwhale)
|
2022-12-02 11:24:22 +01:00
|
|
|
- Enable services after install, e.g. syncthing and docker
|
2022-07-04 15:27:11 +02:00
|
|
|
|
2022-10-13 12:46:58 +02:00
|
|
|
#### Windows Flow
|
2022-07-04 15:27:11 +02:00
|
|
|
- Install choco and git offline
|
|
|
|
- Run in git bash
|
2022-10-13 12:46:58 +02:00
|
|
|
- TODO: Use choco-offline sources
|
2022-07-05 15:53:12 +02:00
|
|
|
|
|
|
|
### Flow
|
2022-07-25 16:08:01 +02:00
|
|
|
This is a revamped concept
|
|
|
|
that would ease setting up new devices with different systems
|
2022-07-25 15:59:16 +02:00
|
|
|
by adding a mapping of functions to applications
|
2022-07-25 16:08:01 +02:00
|
|
|
as well as handlers to providers
|
|
|
|
(e.g. different make mechanisms on Arch and Debian).
|
|
|
|
That way, the same functionality is available everywhere,
|
|
|
|
but can be provided by different packages
|
|
|
|
as different systems have different users.
|
2022-07-25 15:59:16 +02:00
|
|
|
The following tables lists some real-world examples to consider,
|
|
|
|
but the details still need to be fleshed out.
|
|
|
|
|
|
|
|
| Function | Package/Application | Handler | Provider | System |
|
|
|
|
|----------------|---------------------|----------------------|---------------|---------------|
|
|
|
|
| pdf | okular | chocolatey | chocolatey | Windows |
|
|
|
|
| | zathura | arch | pacman or yay | Arch |
|
|
|
|
| | timg poppler | apt | apt | Debian Server |
|
|
|
|
| loki | loki | arch | pacman or yay | Arch |
|
|
|
|
| | | make | checkinstall | Debian |
|
|
|
|
| | | make | wocka | Arch |
|
|
|
|
| logcli | loki-logcli | script (depends: go) | script | Debian |
|
|
|
|
| | | arch | pacman or yay | Arch |
|
|
|
|
| | logcli-bin | aur | yay | Arch |
|
|
|
|
| zoom | zoom | deb | apt | Debian |
|
|
|
|
| | | aur | yay | Arch |
|
|
|
|
| screen-capture | spectacle peek | arch | pac/yay | Arch |
|
|
|
|
| | screentogif | chocolatey | chocolatey | Windows |
|
|
|
|
| aur | yay | aur | makepkg | Arch |
|
|
|
|
| | | aur | yay | |
|
2022-07-05 15:53:12 +02:00
|
|
|
|
|
|
|
- Software and Provider are derived from Function and Handler but can change depending on the system
|
2022-07-09 20:46:13 +02:00
|
|
|
-> no way of declaring function so far, maybe via groups somehow?
|
2022-07-05 15:53:12 +02:00
|
|
|
- Idea: `providers/<provider>/<handler>[_<ext>]` rather than `handlers/<handler>/install[_<ext>]`
|
|
|
|
+ but then one might duplicate the handler script if one provider handles multiple equally,
|
|
|
|
such as `yay` for arch and aur
|
|
|
|
+ how about `providers/<handler>/<provider>[_<ext>]`?
|
|
|
|
Same duplication issue, now spread out...
|
|
|
|
+ underscore extension might be superfluous through that, since `ext` was somewhat a proxy for a proper `provider` configuraion
|
2022-07-25 16:08:01 +02:00
|
|
|
- Use system subdirectories for handlers and groups,
|
|
|
|
which are used by default when system is detected
|
2022-11-22 01:18:56 +01:00
|
|
|
|
2022-12-16 19:30:26 +01:00
|
|
|
## Notes on this Repository
|
|
|
|
|
|
|
|
### Groups
|
|
|
|
|
2023-03-09 02:37:59 +01:00
|
|
|
#### [./groups/shell](shell)
|
|
|
|
|
2022-12-16 19:30:26 +01:00
|
|
|
- shell/basics: without these a linux machine is hardly usable
|
2023-08-21 22:04:49 +02:00
|
|
|
- shell/tools: without these a linux computer is not productively usable for me
|
2022-12-16 19:30:26 +01:00
|
|
|
- shell/enhancements: replacements for commonly used, dated tools, such as `ls`->`exa` and `top`->`glances`
|
|
|
|
|
2023-03-09 02:37:59 +01:00
|
|
|
#### [./groups/arch](arch)
|
|
|
|
|
|
|
|
- tools: utilities required for my dotfiles and daily use
|
|
|
|
- base: opinionated (slightly bloated) base system
|
|
|
|
- full: normal install
|
|
|
|
- all: every package I use somewhat regularly
|
|
|
|
- portable: base but with packages for installations on removable media
|
|
|
|
|
|
|
|
|
2022-12-16 19:30:26 +01:00
|
|
|
### Handlers
|
|
|
|
|
2023-01-04 05:32:02 +01:00
|
|
|
...
|
2022-12-16 19:30:26 +01:00
|
|
|
|
2022-11-22 01:18:56 +01:00
|
|
|
## Notable Projects
|
|
|
|
|
|
|
|
- another universal package manager,
|
|
|
|
but without affecting the system:
|
|
|
|
https://github.com/teaxyz/cli
|
|
|
|
- universal package updater:
|
|
|
|
https://github.com/topgrade-rs/topgrade
|
2023-11-08 13:25:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
## Windows Issues
|
|
|
|
|
|
|
|
https://superuser.com/questions/55809/how-to-run-program-from-command-line-with-elevated-rights
|
|
|
|
|
|
|
|
- auto-elevation of choco
|
|
|
|
- post-choco-install check if launching git bash works
|
|
|
|
- add choco to handlers
|
|
|
|
|
|
|
|
Set-Location : Illegales Zeichen im Pfad.
|
|
|
|
In K:\instalee\packages\chocolatey\powershell.ps1:24 Zeichen:5
|
|
|
|
+ Set-Location $Loc.Substring(1,$Loc.Length-1)
|
|
|
|
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+ CategoryInfo : InvalidArgument: (K:\instalee":String) [Set-Location], ArgumentException
|
|
|
|
+ FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.SetLocationCommand
|
|
|
|
|
|
|
|
Set-Location : Der Pfad "K:\instalee"" kann nicht gefunden werden, da er nicht vorhanden ist.
|
|
|
|
In K:\instalee\packages\chocolatey\powershell.ps1:24 Zeichen:5
|
|
|
|
+ Set-Location $Loc.Substring(1,$Loc.Length-1)
|
|
|
|
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+ CategoryInfo : ObjectNotFound: (K:\instalee":String) [Set-Location], ItemNotFoundException
|
|
|
|
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
|
|
|
|
|
|
|
|
https://stackoverflow.com/questions/52223872/get-windows-version-from-git-bash
|
|
|
|
|
|
|
|
Windows 7: https://dotnet.microsoft.com/en-us/download/dotnet-framework
|
|
|
|
-> Unsupported Versions: 4.5
|