From 89ce7f53d822ce92387dbbdf2510bac48f2090dc Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 29 Sep 2025 10:07:30 -0500 Subject: [PATCH 1/5] pkg (corianne): Remove Sourcegit --- systems/darwin/corianne.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/systems/darwin/corianne.nix b/systems/darwin/corianne.nix index dff9085..1647adf 100644 --- a/systems/darwin/corianne.nix +++ b/systems/darwin/corianne.nix @@ -154,7 +154,6 @@ }; taps = [ "homebrew/services" - "ybeapps/sourcegit" { name = "millironx/millironx"; clone_target = @@ -207,7 +206,6 @@ "veracrypt" "vlc" "vorta" - "ybeapps/sourcegit/sourcegit" "zed" "zotero" "zulip" From 01ba07ea3a25dfd42f4e3849c4fcb27aea84cc93 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:23:54 -0500 Subject: [PATCH 2/5] 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. --- bin/rig-install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/rig-install.sh diff --git a/bin/rig-install.sh b/bin/rig-install.sh new file mode 100755 index 0000000..51c01bc --- /dev/null +++ b/bin/rig-install.sh @@ -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')" From 59e72155f906da8fa4a5e1cc5b44de5c49994b24 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:25:45 -0500 Subject: [PATCH 3/5] pkg (fedora): Switch R install to rig Using the previously created rig install script, remove Fedora's packaged R, and instead install via rig. --- playbooks/packages.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/playbooks/packages.yaml b/playbooks/packages.yaml index a5017dd..7d31ca4 100644 --- a/playbooks/packages.yaml +++ b/playbooks/packages.yaml @@ -55,6 +55,7 @@ - firefoxpwa - ghostty - inkscape + - jq - kate - kdenlive - kdiff3 @@ -78,13 +79,21 @@ - zed - zsh - zotero - - R state: present - name: Install Microsoft Core Fonts ansible.builtin.dnf: name: https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm state: present 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 # This is a violation of ansible-lint's rules, but one of the key reasons I # wrote this playbook in the first place From 78b08e27ae94f40689b0ff20a1d8b09affd4c771 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:26:42 -0500 Subject: [PATCH 4/5] pkg (corianne): Switch R install to rig --- systems/darwin/corianne.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/systems/darwin/corianne.nix b/systems/darwin/corianne.nix index 1647adf..27bd57c 100644 --- a/systems/darwin/corianne.nix +++ b/systems/darwin/corianne.nix @@ -1,6 +1,10 @@ { 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 = [ ]; # List packages installed in system profile. To search by name, run: @@ -8,6 +12,7 @@ environment.systemPackages = with pkgs; [ vim agenix.packages.aarch64-darwin.default + rig-install ]; # Use a custom configuration.nix location. @@ -124,6 +129,16 @@ && xattr -vrd com.apple.quarantine "$0" \ || true' \ /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" ]; @@ -159,6 +174,7 @@ clone_target = "https://code.millironx.com/millironx/homebrew-millironx.git"; } + "r-lib/rig" ]; brews = [ "borgbackup/tap/borgbackup-fuse" @@ -172,7 +188,6 @@ "docker-credential-helper" "firefoxpwa" "mpv" - "r" ]; casks = [ "alt-tab" @@ -195,6 +210,7 @@ "porting-kit" "qownnotes" "qt-creator" + "rig" "rstudio" "signal" "slack" From 0a6d4c7c2f5a17cf7f99df033a4071504edd208d Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:27:15 -0500 Subject: [PATCH 5/5] pkg (desktop): Add ansible-lint --- homes/desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homes/desktop.nix b/homes/desktop.nix index 1a7e7d9..6bd2945 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -10,6 +10,7 @@ home = { packages = with pkgs; [ act + ansible-lint earthly ffmpeg caladea