Compare commits

..

5 commits

Author SHA1 Message Date
0a6d4c7c2f
pkg (desktop): Add ansible-lint 2025-09-30 11:27:15 -05:00
78b08e27ae
pkg (corianne): Switch R install to rig 2025-09-30 11:26:42 -05:00
59e72155f9
pkg (fedora): Switch R install to rig
Using the previously created rig install script, remove Fedora's
packaged R, and instead install via rig.
2025-09-30 11:25:45 -05:00
01ba07ea3a
script: add R install script via rig
R is really good at breaking things between versions. R is also really
difficult to install via Nix because it locks the packages installed and
RStudio can't find it. rig (R installation manager) can keep specific
and multiple R versions installed. As part of the system provisioning,
we want a stable version of R installed and marked as default by rig.
Write a script that checks if a version of R is installed by rig, and
install and mark as default if not.

On x86 systems, rig uses the full version number as the name of the
install, however on Apple silicon, the name and version number are
different. The name of the version is extracted via jq to work around
that.
2025-09-30 11:23:54 -05:00
89ce7f53d8
pkg (corianne): Remove Sourcegit 2025-09-29 10:07:30 -05:00
4 changed files with 44 additions and 5 deletions

15
bin/rig-install.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
rig list \
--json \
| jq \
--exit-status \
--arg v "${1}" \
'.[] | select(.version==$v)' \
> /dev/null \
|| rig add "${1}" \
&& rig default "$(rig list \
--json \
| jq \
--raw-output \
--arg v "${1}" \
'.[] | select(.version==$v) | .name')"

View file

@ -10,6 +10,7 @@
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
act act
ansible-lint
earthly earthly
ffmpeg ffmpeg
caladea caladea

View file

@ -55,6 +55,7 @@
- firefoxpwa - firefoxpwa
- ghostty - ghostty
- inkscape - inkscape
- jq
- kate - kate
- kdenlive - kdenlive
- kdiff3 - kdiff3
@ -78,13 +79,21 @@
- zed - zed
- zsh - zsh
- zotero - zotero
- R
state: present state: present
- name: Install Microsoft Core Fonts - name: Install Microsoft Core Fonts
ansible.builtin.dnf: ansible.builtin.dnf:
name: https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm name: https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
state: present state: present
disable_gpg_check: true disable_gpg_check: true
- name: Install rig (R installation manager)
ansible.builtin.dnf:
name: https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.{{ ansible_architecture }}.rpm
state: present
disable_gpg_check: true
- name: Install R via rig
ansible.builtin.script:
cmd: "{{ playbook_dir }}/../bin/rig-install.sh 4.4.3"
changed_when: false
# Allows me to run the playbook as a way to upgrade the system packages # Allows me to run the playbook as a way to upgrade the system packages
# This is a violation of ansible-lint's rules, but one of the key reasons I # This is a violation of ansible-lint's rules, but one of the key reasons I
# wrote this playbook in the first place # wrote this playbook in the first place

View file

@ -1,6 +1,10 @@
{ config, pkgs, pkgs-unstable, agenix, ... }: { config, pkgs, pkgs-unstable, agenix, ... }:
{ let
r-version = "4.4.3";
rig-install = pkgs.writeShellScriptBin "_rig-install"
(builtins.readFile ./../../bin/rig-install.sh);
in {
# imports = [ <home-manager/nix-darwin> ]; # imports = [ <home-manager/nix-darwin> ];
# List packages installed in system profile. To search by name, run: # List packages installed in system profile. To search by name, run:
@ -8,6 +12,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim vim
agenix.packages.aarch64-darwin.default agenix.packages.aarch64-darwin.default
rig-install
]; ];
# Use a custom configuration.nix location. # Use a custom configuration.nix location.
@ -124,6 +129,16 @@
&& xattr -vrd com.apple.quarantine "$0" \ && xattr -vrd com.apple.quarantine "$0" \
|| true' \ || true' \
/Applications/{} /Applications/{}
echo installing R v${r-version} via Rig...
PATH="/usr/local/bin:/usr/bin:${
pkgs.lib.makeBinPath [ pkgs.jq rig-install ]
}:$PATH" \
sudo \
--preserve-env=PATH \
--user=${config.system.primaryUser} \
--set-home \
_rig-install ${r-version}
''; '';
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
@ -154,12 +169,12 @@
}; };
taps = [ taps = [
"homebrew/services" "homebrew/services"
"ybeapps/sourcegit"
{ {
name = "millironx/millironx"; name = "millironx/millironx";
clone_target = clone_target =
"https://code.millironx.com/millironx/homebrew-millironx.git"; "https://code.millironx.com/millironx/homebrew-millironx.git";
} }
"r-lib/rig"
]; ];
brews = [ brews = [
"borgbackup/tap/borgbackup-fuse" "borgbackup/tap/borgbackup-fuse"
@ -173,7 +188,6 @@
"docker-credential-helper" "docker-credential-helper"
"firefoxpwa" "firefoxpwa"
"mpv" "mpv"
"r"
]; ];
casks = [ casks = [
"alt-tab" "alt-tab"
@ -196,6 +210,7 @@
"porting-kit" "porting-kit"
"qownnotes" "qownnotes"
"qt-creator" "qt-creator"
"rig"
"rstudio" "rstudio"
"signal" "signal"
"slack" "slack"
@ -207,7 +222,6 @@
"veracrypt" "veracrypt"
"vlc" "vlc"
"vorta" "vorta"
"ybeapps/sourcegit/sourcegit"
"zed" "zed"
"zotero" "zotero"
"zulip" "zulip"