This commit is contained in:
parent
4ecc61d7b9
commit
34c7b95ba1
8 changed files with 109 additions and 11 deletions
|
@ -16,15 +16,6 @@ jobs:
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
.venv/bin/python -m pip install git+https://git.jmsgrogan.com/jgrogan/dialann.git
|
.venv/bin/python -m pip install git+https://git.jmsgrogan.com/jgrogan/dialann.git
|
||||||
- name: Build site
|
- name: Build site
|
||||||
run: |
|
run: .venv/bin/dialann --source_dir src --build_dir build
|
||||||
pwd
|
|
||||||
ls
|
|
||||||
cd src
|
|
||||||
.venv/bin/dialann --build_dir=../build
|
|
||||||
- name: Deploy site
|
- name: Deploy site
|
||||||
run: |
|
run: rsync -aizv --delete build/ $1:/var/www/jmsgrogan/html/
|
||||||
pwd
|
|
||||||
cd ../build
|
|
||||||
tar -czvf ../personal_site.tar.gz *
|
|
||||||
cd ..
|
|
||||||
ssh $SERVER_ADDR "tar -C $SERVER_LOC -xz -f-" < personal_site.tar.gz
|
|
43
src/articles/guix.md
Normal file
43
src/articles/guix.md
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# Guix #
|
||||||
|
|
||||||
|
Guix is a package manager and derived Operating System based on the ideas of reproducible builds ands free software and the Guile Scheme language.
|
||||||
|
|
||||||
|
Using Guix an Operating System and user profiles can be defined declaratively in Scheme. This includes system services, using the GNU Shepherd init system and config file environment through the GNU Home module.
|
||||||
|
|
||||||
|
Thanks to the use of reproducible builds Guix is useful for setting up clean development environments with or without full container isolation.
|
||||||
|
|
||||||
|
## Setting up a minimal Sway environment ##
|
||||||
|
|
||||||
|
Guix allows the development of a minimal computing environment by allowing easy rollbacks to previous generations, allowing experimentation and through tooling like `guix graph` which can show where dependencies are coming from.
|
||||||
|
|
||||||
|
Sway is a reasonably minimal tiling window manager based on Wayland, with good support in Guix.
|
||||||
|
|
||||||
|
While a Sway session can be launched through the login shell, it can be nicer to use a login system. `greetd` is often used for this purpose, with a Sway based 'greeter'. To set this up it is neccessary to set up `greetd` as a system service in the operating system definition.
|
||||||
|
|
||||||
|
|
||||||
|
## Guix Shell ##
|
||||||
|
|
||||||
|
Guix Shell is a tool used to manage, amongst other things, development environments. You can invoke it with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
guix shell
|
||||||
|
```
|
||||||
|
|
||||||
|
to launch the environment.
|
||||||
|
|
||||||
|
Typically you will want some packages in the environment, for example for a gcc toolchain you can add:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
guix shell gcc-toolchain
|
||||||
|
```
|
||||||
|
|
||||||
|
You can manage the packages in the environment with a manifest file. To create an initial one do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
guix shell --export-manifest
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then append packages to the manifest list as needed.
|
||||||
|
|
||||||
|
|
||||||
|
|
64
src/articles/linux_mobile_apps.md
Normal file
64
src/articles/linux_mobile_apps.md
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
# Writing a Linux Mobile App #
|
||||||
|
|
||||||
|
I recently got my hands on a Linux mobile running Phosh and PostmarketOS and am pretty happy with it. However there are a bunch of apps and features that I'd like, particularly integrations with Immich for photos and Navidrome for music streaming.
|
||||||
|
|
||||||
|
The most common Linux mobile apps seem to be based in the GNOME ecosystem, using `gtk` as a base UI toolkit and `libadwaita` for combined desktop and mobile UI support. I've spent plenty of time working with Qt before - but this is a first dip into the world of GTK.
|
||||||
|
|
||||||
|
Apparently new native applications should consider Rust over C and C++ (which I'm pretty familiar with). So, this seems like a good time to try to pick up some Rust as well. This (old) intro for C++ people seems useful: https://fasterthanli.me/articles/a-half-hour-to-learn-rust
|
||||||
|
|
||||||
|
# Setting up the Development Environment #
|
||||||
|
|
||||||
|
First, I want to set up a development environment. I'm using Guix, which will make this reproducible - although I hear doesn't play so nicely with Rust.
|
||||||
|
|
||||||
|
Let's get a Rust environment going in Guix shell. First I use `guix search` to see if I can find something claiming to be a rust toolchain:
|
||||||
|
|
||||||
|
```
|
||||||
|
guix search rust
|
||||||
|
```
|
||||||
|
|
||||||
|
It looks like a package called `rust` will do the job:
|
||||||
|
|
||||||
|
```
|
||||||
|
guix shell rust
|
||||||
|
```
|
||||||
|
|
||||||
|
I'm aware of Rust bindings for GTK (there is even a [book](https://gtk-rs.org/gtk4-rs/git/book/)). It seems like `rust-gtk4` will do the job. As I build up shell packages it is time to start a manifest:
|
||||||
|
|
||||||
|
```
|
||||||
|
guix shell rust rust-gtk4 --export-manifest > manifest.scm
|
||||||
|
```
|
||||||
|
|
||||||
|
and load the shell with:
|
||||||
|
|
||||||
|
```
|
||||||
|
guix shell -m manifest.scm
|
||||||
|
```
|
||||||
|
|
||||||
|
I may later regret this, but I'm going to try to bundle the project with `meson` so will add `meson` and `pkg-config` to the environment.
|
||||||
|
|
||||||
|
Following the `gtk-rs` book I start with a hello-world:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk::{glib, Application};
|
||||||
|
|
||||||
|
const APP_ID: &str = "org.gtk_rs.HelloWorld1";
|
||||||
|
|
||||||
|
fn main() -> glib::ExitCode {
|
||||||
|
// Create a new application
|
||||||
|
let app = Application::builder().application_id(APP_ID).build();
|
||||||
|
|
||||||
|
// Run the application
|
||||||
|
app.run()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we hit some issues. First, I need some Rust support in my Emacs and second, unsurprisingly, this doesn't compile with `rustc` since it doesn't know the path to the `gtk` crate. The [emacs rustic](https://github.com/emacs-rustic/rustic#automatic-server-installation) package with [rust-analyzer](https://rust-analyzer.github.io/book/) seem to be the way to go.
|
||||||
|
|
||||||
|
So, how do I combine `gtk`, `rust` and `meson` - well it seems like some horrible mix of cargo and meson boilerplat: captured here https://gitlab.gnome.org/World/Rust/gtk-rust-template/-/tree/master with more background here: https://coaxion.net/blog/2023/04/building-a-gstreamer-plugin-in-rust-with-meson-instead-of-cargo/
|
||||||
|
|
||||||
|
Let's go for it.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue