diff --git a/.github/workflows/nix-build-albert-sourceos.yml b/.github/workflows/nix-build-albert-sourceos.yml new file mode 100644 index 0000000..cbe66b0 --- /dev/null +++ b/.github/workflows/nix-build-albert-sourceos.yml @@ -0,0 +1,33 @@ +name: nix-build-albert-sourceos + +on: + pull_request: + paths: + - 'flake.nix' + - 'flake.lock' + - '.github/workflows/nix-build-albert-sourceos.yml' + push: + branches: + - main + paths: + - 'flake.nix' + - 'flake.lock' + - '.github/workflows/nix-build-albert-sourceos.yml' + +jobs: + build-albert-sourceos: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install nix (apt) + run: sudo apt-get update && sudo apt-get install -y nix-bin + + - name: Build albert-sourceos + run: | + set -euo pipefail + # Ubuntu nix-bin is configured for daemon mode by default. + # GitHub runners do not run systemd; use local store mode for CI. + sudo nix --version + sudo env NIX_REMOTE=local nix build .#albert-sourceos --extra-experimental-features 'nix-command flakes' -L diff --git a/docs/workstation/RUNBOOK.md b/docs/workstation/RUNBOOK.md index 3d4707e..8ac388d 100644 --- a/docs/workstation/RUNBOOK.md +++ b/docs/workstation/RUNBOOK.md @@ -139,9 +139,11 @@ The SourceOS Albert plugin lives in `SociOS-Linux/albert` (dev branch) and is in - `SourceOS: doctor` → `sourceos doctor --open` - plus quick-launch actions (sesh/tmux/k9s/lazygit/lazydocker/yazi) -If you are using a distro-provided Albert package, it may not include this SourceOS plugin. In that case: -- build/install Albert from `SociOS-Linux/albert`, or -- package the plugin into your chosen distribution lane (future workstream). +If you are using a distro-provided Albert package, it may not include this SourceOS plugin. + +Nix lane: +- This repo provides a Nix package that builds Albert from the SourceOS fork (including `plugins/sourceos`). +- Install it with `nix profile install .#albert-sourceos` and restart Albert. --- diff --git a/flake.nix b/flake.nix index bc322e1..65b5bf4 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,16 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + # SourceOS fork of Albert (dev branch) including the `plugins/sourceos` action bus plugin. + # Use git fetcher with submodules enabled because Albert relies on many submodules. + albert_src = { + url = "git+https://github.com/SociOS-Linux/albert?ref=dev&submodules=1"; + flake = false; + }; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, albert_src }: let lib = nixpkgs.lib; systems = [ "x86_64-linux" "aarch64-linux" ]; @@ -19,6 +26,14 @@ meshd = pkgs.callPackage ./packages/mesh/meshd.nix { }; meshd-linkd = pkgs.callPackage ./packages/mesh/meshd-linkd.nix { }; meshd-exitd = pkgs.callPackage ./packages/mesh/meshd-exitd.nix { }; + + # Nix lane for Workstation v0: build Albert from our fork so the SourceOS plugin ships. + # This keeps clean installs from depending on distro packaging including our plugin. + albert-sourceos = pkgs.albert.overrideAttrs (old: { + src = albert_src; + version = "${old.version or "0.0.0"}-sourceos"; + }); + default = meshd; }); @@ -81,6 +96,7 @@ if [ -n "${missingStr}" ]; then echo "NOTE: missing nixpkgs attrs (not added): ${missingStr}" fi + echo "Nix lane: build/install Albert with SourceOS plugin via: nix profile install .#albert-sourceos" ''; }; });