Create cosmic module to install cosmic components

This commit is contained in:
Gerald Pinder
2025-01-14 12:58:18 -05:00
parent 594035324e
commit df26495b81
4 changed files with 49 additions and 10 deletions

41
modules/cosmic/cosmic.nu Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env nu
def main [config: string]: nothing -> nothing {
let config = $config | from json
let debug = $config.debug? | default false | if $in { 1 } else { 0 }
let bin_dir = $config.debug? | default false | if $in { "debug" } else { "release" }
try {
echo "deb http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware" | save --append /etc/apt/sources.list
apt-get update
apt-get install -y git libudev-dev libseat-dev libxkbcommon-dev libinput-dev libgbm-dev libdisplay-info-dev
} catch {
print 'Failed to install dependencies'
exit 1
}
mkdir /tmp/src/
cd /tmp/src/
try {
git clone $'https://github.com/pop-os/($config.component).git'
cd $config.component
if ('ref' in $config) {
git checkout $config.ref
}
} catch {
print $'Failed to checkout cosmic component ($config.component)'
exit 1
}
try {
make vendor
make all $'DEBUG=($debug)' VENDOR=1
} catch {
print $'Failed to build component ($config.component)'
exit 1
}
mkdir /out/
mv $'target/($bin_dir)/($config.component)' /out/
}

View File

@@ -4,9 +4,10 @@ stages:
- name: cosmic-comp
from: rust
modules:
- type: script
scripts:
- install-cosmic-comp.sh
- type: cosmic
source: local
component: cosmic-comp
ref: db13eea91c15ca57d76454432d1fb9c09c51ba8c
modules:
- type: copy
from: cosmic-comp

View File

@@ -7,10 +7,10 @@ image-version: stable
description: The image of Wunker OS for JP's desktop gaming.
stages:
- from-file: common/helix.yml
# - from-file: common/cosmic-comp.yml
- from-file: common/cosmic-comp.yml
modules:
- from-file: common/jp-desktop.yml
- from-file: common/cosmic.yml
- from-file: common/helix.yml
# - from-file: common/cosmic-comp.yml
- from-file: common/cosmic-comp.yml
- from-file: common/post-build.yml

View File

@@ -1,11 +1,8 @@
---
# yaml-language-server: $schema=https://schema.blue-build.org/recipe-v1.json
name: test
base-image: ghcr.io/ublue-os/kinoite-main
base-image: ghcr.io/ublue-os/aurora-dx
image-version: 41
description: The image of Wunker OS for JP's desktop gaming.
modules:
- type: script
snippets:
- curl -L https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/autodesk_fusion_installer_x86-64.sh -o "autodesk_fusion_installer_x86-64.sh" && chmod +x autodesk_fusion_installer_x86-64.sh && ./autodesk_fusion_installer_x86-64.sh --install --default --full
modules: []