Skip to content

Commit

Permalink
the big rename :)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishinthecalculator committed Apr 4, 2024
1 parent 907bb83 commit b1cdddb
Show file tree
Hide file tree
Showing 40 changed files with 239 additions and 239 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
(openpgp-fingerprint
"8D10 60B9 6BB8 292E 829B 7249 AED4 1CC1 93B7 01E2"))))
(channel
(name 'pot)
(url "https://github.com/fishinthecalculator/pot")
(name 'ocui)
(url "https://github.com/fishinthecalculator/ocui")
(branch "main")
(introduction
(make-channel-introduction
Expand All @@ -57,8 +57,8 @@ jobs:
"97A2 CB8F B066 F894 9928 CF80 DE9B E0AC E824 6F08"))))
%default-guix-channel)
- name: Build pot.git
run: guix build -L "${PWD}/.guix/modules" pot.git
- name: Build ocui.git
run: guix build -L "${PWD}/.guix/modules" ocui.git

- name: Lint pot.git
run: guix lint -L "${PWD}/.guix/modules" pot.git
- name: Lint ocui.git
run: guix lint -L "${PWD}/.guix/modules" ocui.git
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
(openpgp-fingerprint
"8D10 60B9 6BB8 292E 829B 7249 AED4 1CC1 93B7 01E2"))))
(channel
(name 'pot)
(url "https://github.com/fishinthecalculator/pot")
(name 'ocui)
(url "https://github.com/fishinthecalculator/ocui")
(branch "main")
(introduction
(make-channel-introduction
Expand All @@ -49,9 +49,9 @@ jobs:
%default-guix-channel)
- name: Build binary tarball
run: guix pack -L "${PWD}/.guix/modules" --save-provenance -r pot.tar.gz -RR -S /bin=bin pot.git
run: guix pack -L "${PWD}/.guix/modules" --save-provenance -r ocui.tar.gz -RR -S /bin=bin ocui.git

- name: Release
uses: softprops/action-gh-release@v1
with:
files: pot.tar.gz
files: ocui.tar.gz
120 changes: 120 additions & 0 deletions .guix/modules/ocui-service.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later

(define-module (ocui-service)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (gnu home services)
#:use-module (gnu services configuration)
#:use-module (ocui)
#:use-module (ice-9 string-fun)
#:export (ocui-oci-configuration
ocui-oci-configuration?
ocui-oci-configuration-fields
ocui-oci-configuration-runtime
ocui-oci-configuration-extra-content

ocui-ui-configuration
ocui-ui-configuration?
ocui-ui-configuration-fields
ocui-ui-configuration-refresh-timeout
ocui-ui-configuration-startup-mode
ocui-ui-configuration-extra-content

ocui-configuration
ocui-configuration?
ocui-configuration-fields
ocui-configuration-ocui
ocui-configuration-oci
ocui-configuration-ui
ocui-configuration-extra-content

home-ocui-service-type))

;; Turn field names, which are Scheme symbols into strings
(define (uglify-field-name field-name)
(string-replace-substring (symbol->string field-name) "-" "_"))

(define (serialize-toml-field field-name value)
#~(string-append #$(uglify-field-name field-name) " = " #$value "\n"))

(define (serialize-string field-name value)
(if (eq? field-name 'extra-content)
(string-append value "\n")
(serialize-toml-field field-name (string-append "\"" value "\""))))

(define (serialize-number field-name value)
(serialize-toml-field field-name (number->string value)))

(define (serialize-boolean field-name value)
(serialize-toml-field field-name (if value "true" "false")))

(define (serialize-record->toml name value fields)
#~(string-append
"[" #$name "]\n"
#$(serialize-configuration
value fields)))

(define ocui-serialize-string serialize-string)

(define (ocui-serialize-ocui-oci-configuration field-name value)
(serialize-record->toml "oci" value ocui-oci-configuration-fields))

(define (ocui-serialize-ocui-ui-configuration field-name value)
(serialize-record->toml "ui" value ocui-ui-configuration-fields))

(define (ocui-serialize-ocui-configuration configuration)
(mixed-text-file
"ocui.toml"
(serialize-configuration
configuration ocui-configuration-fields)))

(define-configuration ocui-oci-configuration
(runtime
(string "docker")
"The OCI runtime used by @{ocui} as a source of information.")
(extra-content
(string "")
"Everything you want to manually add to @code{[oci]}."))

(define-configuration ocui-ui-configuration
(refresh-timeout
(number 10)
"The number of seconds after which @code{ocui}'s will update its tables.")
(startup-mode
(string "containers")
"@{ocui}'s startup mode.")
(extra-content
(string "")
"Everything you want to manually add to @code{[ui]}."))

(define-configuration ocui-configuration
(ocui
(package ocui.git)
"The @code{ocui} package to use."
(serializer empty-serializer))
(oci
(ocui-oci-configuration (ocui-oci-configuration))
"@{ocui}'s OCI runtime configuration.")
(ui
(ocui-ui-configuration (ocui-ui-configuration))
"@{ocui}'s UI configuration.")
(extra-content
(string "")
"Everything you want to manually add to @code{ocui.toml}.")
(prefix ocui-))

(define (config->file-like config)
(list
(string-append "ocui/" (package-version (ocui-configuration-ocui config)) "/ocui.toml")
(ocui-serialize-ocui-configuration config)))

(define home-ocui-service-type
(service-type (name 'ocui)
(extensions (list (service-extension
home-xdg-configuration-files-service-type
(compose list config->file-like))
(service-extension home-profile-service-type
(compose list ocui-configuration-ocui))))
(default-value (ocui-configuration))
(description
"Installs code{ocui} in Guix Home's profile and creates a suitable configuration.")))
14 changes: 7 additions & 7 deletions .guix/modules/pot.scm → .guix/modules/ocui.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later

(define-module (pot)
(define-module (ocui)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz)
#:use-module (guix build-system pyproject)
Expand All @@ -23,12 +23,12 @@
(or (git-predicate %source-dir)
(const #t))) ;not in a Git checkout

(define-public pot.git
(define-public ocui.git
(package
(name "pot.git")
(name "ocui.git")
(version "0.0.7")
(source
(local-file "../.." "pot-checkout"
(local-file "../.." "ocui-checkout"
#:recursive? #t
#:select? vcs-file?))
(build-system pyproject-build-system)
Expand All @@ -44,11 +44,11 @@
python-textual-0.41
python-toml))
(home-page
"https://github.com/fishinthecalculator/pot")
"https://github.com/fishinthecalculator/ocui")
(synopsis
"Simple text based UI for managing containers")
(description "@code{pot} is a terminal user interface to
(description "@code{ocui} is a terminal user interface to
facilitate the most common tasks around OCI containers running on a single host.")
(license license:gpl3)))

pot.git
ocui.git
120 changes: 0 additions & 120 deletions .guix/modules/pot-service.scm

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
##
# pot
# ocui
#
# @file
# @version 0.1

# Introduction of the 'pot' channel.
# Introduction of the 'ocui' channel.
channel_intro_commit = 10ed759852825149eb4b08c9b75777111a92048e
channel_intro_signer = 97A2 CB8F B066 F894 9928 CF80 DE9B E0AC E824 6F08

authenticate:
echo "Authenticating Git checkout..." ; \
guix git authenticate \
--cache-key=channels/pot --stats \
--cache-key=channels/ocui --stats \
"$(channel_intro_commit)" "$(channel_intro_signer)"

# end
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# `pot`
# `ocui`

[![Python package](https://github.com/fishinthecalculator/pot/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/fishinthecalculator/pot/actions/workflows/python-package.yml)
![Python versions](https://raw.githubusercontent.com/fishinthecalculator/pot/main/.img/python.svg)
![License](https://raw.githubusercontent.com/fishinthecalculator/pot/main/.img/license.svg)
[![Python package](https://github.com/fishinthecalculator/ocui/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/fishinthecalculator/ocui/actions/workflows/python-package.yml)
![Python versions](https://raw.githubusercontent.com/fishinthecalculator/ocui/main/.img/python.svg)
![License](https://raw.githubusercontent.com/fishinthecalculator/ocui/main/.img/license.svg)

`pot` is a terminal user interface to facilitate the most common tasks around OCI containers running on a single host.
`ocui` is a terminal user interface to facilitate the most common tasks around OCI containers running on a single host.

![pot screenshot](https://raw.githubusercontent.com/fishinthecalculator/pot/main/.img/screenshot.png)
![ocui screenshot](https://raw.githubusercontent.com/fishinthecalculator/ocui/main/.img/screenshot.png)

## Contributing

Expand All @@ -22,6 +22,6 @@ Unless otherwise stated all the files in this repository are to be considered un

## Helpful initiatives

- This project started during SUSE's [Hack Week 23](https://hackweek.opensuse.org), where I had the time to participate [a project](https://hackweek.opensuse.org/23/projects/forklift-text-based-gui-utility-for-dealing-with-containers) to implement something like `pot`.
- This project is clearly strongly inspired from [K9s](https://k9scli.io/). Without it I would probably never had found the inspiration for `pot`.
- This project started during SUSE's [Hack Week 23](https://hackweek.opensuse.org), where I had the time to participate [a project](https://hackweek.opensuse.org/23/projects/forklift-text-based-gui-utility-for-dealing-with-containers) to implement something like `ocui`.
- This project is clearly strongly inspired from [K9s](https://k9scli.io/). Without it I would probably never had found the inspiration for `ocui`.
- The endless nice TUI managers from the community, starting from `top` to `htop`, `glances` and all the others.
File renamed without changes.
Loading

0 comments on commit b1cdddb

Please sign in to comment.