Submitted for issue tracking

This commit is contained in:
Jacob Hrbek 2021-11-02 04:34:48 +01:00
commit 93ec4dbe77
51 changed files with 1250 additions and 0 deletions

5
.woodpecker.yml Normal file
View File

@ -0,0 +1,5 @@
pipeline:
build:
image: debian
commands:
- echo "This is the build step"

View File

@ -0,0 +1,19 @@
;;; Standard GNU Guix file defining packages for guix-shell environment
(use-modules
(guix channels))
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"f1bfd9f1948a5ff336d737c0614b9a30c2bb3097")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
(specifications->manifest
(list "emacs@27.2"
"emacs-treemacs"))

View File

@ -0,0 +1,19 @@
;;; Standard GNU Guix file defining packages for guix-shell environment
(use-modules
(guix channels))
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"f1bfd9f1948a5ff336d737c0614b9a30c2bb3097")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
(specifications->manifest
(list "emacs@27.2"
"emacs-dired-sidebar"))

1
20-editors/vscodium Submodule

@ -0,0 +1 @@
Subproject commit 1a53778deccc77ebe495b241c00a61ea7651923c

1
20-editors/zz-README.md Normal file
View File

@ -0,0 +1 @@
Directory handling standardized editor configuration separated by solution

View File

@ -0,0 +1,69 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright (C) 2021 Jacob Hrbek <rsa4096/0x3E0E1A60C82873AD>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages cargo-make)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system cargo)
#:use-module ((guix licenses) #:prefix license:))
(define-public rust-cargo-make-0.35
(package
(name "rust-cargo-make")
(version "0.35.5")
(source
(origin
(method url-fetch)
(uri (crate-uri "cargo-make" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32 "0vi0i7l01dck1swzjrj0z9033nnszisr34xdw94vnbmjjy6yvg71"))))
(build-system cargo-build-system)
(arguments
`(#:cargo-inputs
(("rust-ansi-term" ,rust-ansi-term-0.12)
("rust-cargo-metadata" ,rust-cargo-metadata-0.14)
("rust-ci-info" ,rust-ci-info-0.14)
("rust-clap" ,rust-clap-2)
("rust-colored" ,rust-colored-2)
("rust-dirs-next" ,rust-dirs-next-2)
("rust-duckscript" ,rust-duckscript-0.7)
("rust-duckscriptsdk" ,rust-duckscriptsdk-0.8)
("rust-envmnt" ,rust-envmnt-0.9)
("rust-fern" ,rust-fern-0.6)
("rust-fsio" ,rust-fsio-0.3)
("rust-git-info" ,rust-git-info-0.1)
("rust-glob" ,rust-glob-0.3)
("rust-home" ,rust-home-0.5)
("rust-ignore" ,rust-ignore-0.4)
("rust-indexmap" ,rust-indexmap-1)
("rust-log" ,rust-log-0.4)
("rust-regex" ,rust-regex-1)
("rust-run-script" ,rust-run-script-0.9)
("rust-rust-info" ,rust-rust-info-0.3)
("rust-semver" ,rust-semver-1)
("rust-serde" ,rust-serde-1)
("rust-serde-derive" ,rust-serde-derive-1)
("rust-serde-ignored" ,rust-serde-ignored-0.1)
("rust-shell2batch" ,rust-shell2batch-0.4)
("rust-toml" ,rust-toml-0.5))))
(home-page "https://sagiegurari.github.io/cargo-make")
(synopsis "Rust task runner and build tool.")
(description "Rust task runner and build tool.")
(license license:asl1.0)))

View File

@ -0,0 +1,22 @@
;;; Standard GNU Guix file defining packages for guix-shell environment
;; NOTE(Krey): For development of 'cargo-make' package, remove once merged
(load "cargo-make.scm")
(use-modules
(guix channels))
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"f1bfd9f1948a5ff336d737c0614b9a30c2bb3097")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
(specifications->manifest
;; BLOCKER(Krey): Cargo-make is not defined
(list "rust-cargo-make"))

View File

@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
# NixOS shell configuration to bootstrap the required dependencies to work with the source code
{
nixpkgs ? builtins.fetchGit {
url = "ssh://git@github.com:NixOS/nixpkgs.git";
ref = "nixos-21.05";
rev = "66d6ec6ed2ddc77d08cf677cc8230db39f051793"; # 29/10/2021-EU 21:21:40 CEST
}:
with nixpkgs;
stdenv.mkDerivation {
name = "RiXotStudio";
buildInputs = [
cargo-make # Used to interpret `Makefile.toml` to interact with the repository
hadolint # Used to lint dockerfiles
docker # Used to run the dockerfiles
];
}

View File

@ -0,0 +1 @@
Directory defining deployment of the development environment using Nix package manager <https://en.wikipedia.org/wiki/Nix_package_manager>

View File

@ -0,0 +1 @@
Directory dedicated to solutions providing a development environment

View File

@ -0,0 +1,52 @@
# Inspired by https://github.com/bmpvieira/Dockerfiles credit Bruno Viera <https://github.com/bmpvieira>
#@ All rights reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 01:22:40 UTC
###! REMOVE(Krey): Scheduled for removal as alpine doesn't have `groupadd` for the script to work
# 30/10/2021-EU 01:25:30 UTC
FROM alpine:3.14.2
LABEL Description="Minimal Alpine Linux Image with GUIX package manager designed for testing"
# 30/10/2021-EU 01:24:54 UTC
LABEL Version="30102021012454"
# OUTSOURCED: Guix's official way to install the package manager on non-GUIX system is using https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
ENV guixInstall_commit="e4ed0b3969ddbe44347c468c96ccfa057b2dd256"
RUN true \
&& wget "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh?id=$guixInstall_commit" -o guix-install.sh \
# Add guix-install dependencies
&& apk add \
bash \
gnupg \
# DEPRECATED(Krey): alpine doesn't have groupadd
groupadd \
xz \
&& chmod +x guix-install.sh \
&& exec guix-install.sh
# ENV guixVersion="0.8.3"
# # Get GUIX on the system
# RUN true \
# && wget "ftp://alpha.gnu.org/gnu/guix/guix-binary-$guixVersion.x86_64-linux.tar.xz" \
# && tar xpf guix-binary-$guixVersion.x86_64-linux.tar.xz -C guix-binary-0.8.3.x86_64-linux.tar.xz
# # Add guix
# ENV PATH /root/.guix-profile/bin:$PATH
# RUN cd /tmp
# RUN wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.8.3.x86_64-linux.tar.xz
# RUN tar xJf guix-binary-0.8.3.x86_64-linux.tar.xz
# RUN mv var/guix /var/ && mv gnu /
# RUN ln -sf /var/guix/profiles/per-user/root/guix-profile ~root/.guix-profile
# RUN guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub
# RUN addgroup guixbuild
# RUN addgroup guix-builder
# RUN chgrp guix-builder -R /gnu/store
# RUN chmod 1775 /gnu/store
# RUN builders=10 ;\
# for i in `seq 1 $builders` ; do \
# adduser -S guix-builder$i guix-builder ;\
# adduser guix-builder$i guix-builder ;\
# done
# CMD guix-daemon --build-users-group=guix-builder
# # RUN guix-daemon --build-users-group=guix-builder & guix pull

View File

@ -0,0 +1,38 @@
#@ All rights reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 01:22:40 UTC
#@ Copyright (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 13:27:17 UTC released under the GPLv3 license <https://www.gnu.org/licenses/gpl-3.0.en.html>
### HOTFIX(Krey): The guix-install.sh requires an interactive shell blocking the deployment, this is a hotfix that requires used to invoke `./guix-install.sh` on the environment and go through with the installation
# 30/10/2021-EU 01:44:14 UTC
FROM debian:bullseye-20211011-slim
LABEL Description="Minimal Debian Linux Image with GUIX package manager designed for testing"
# 30/10/2021-EU 01:24:54 UTC
LABEL Version="30102021012454"
ENV DEBIAN_FRONTEND="noninteractive"
# OUTSOURCED(Krey): Guix's official way to install the package manager on non-GUIX system is using https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
# 30/10/2021-EU 01:24:54 UTC
ENV guixInstall_commit="e4ed0b3969ddbe44347c468c96ccfa057b2dd256"
RUN true \
&& apt-get update \
&& apt-get install --yes --quiet --no-install-recommends \
wget \
gnupg \
xz-utils \
# NOTE(Krey): We need this otherwise wget will fail with `ERROR: The certificate of '' is not trusted`
ca-certificates \
&& wget "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh?id=$guixInstall_commit" -O guix-install.sh \
# Add guix-install dependencies
&& chmod +x guix-install.sh \
&& apt-get remove --yes \
wget \
gnupg \
xz-utils \
&& apt-get autoremove --yes \
&& apt-get clean --yes \
&& rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

View File

@ -0,0 +1,38 @@
#@ All rights reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 01:22:40 UTC
### HALTED(Krey): The guix-install.sh requires an interactive shell blocking the deployment
# 30/10/2021-EU 01:44:14 UTC
FROM debian:bullseye-20211011-slim
LABEL Description="Minimal Debian Linux Image with GUIX package manager designed for testing"
# 30/10/2021-EU 01:24:54 UTC
LABEL Version="30102021012454"
ENV DEBIAN_FRONTEND="noninteractive"
# OUTSOURCED(Krey): Guix's official way to install the package manager on non-GUIX system is using https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
# 30/10/2021-EU 01:24:54 UTC
ENV guixInstall_commit="e4ed0b3969ddbe44347c468c96ccfa057b2dd256"
RUN true \
&& apt-get update \
&& apt-get install --yes --quiet --no-install-recommends \
wget \
gnupg \
xz-utils \
# NOTE(Krey): We need this otherwise wget will fail with `ERROR: The certificate of '' is not trusted`
ca-certificates \
&& wget "https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh?id=$guixInstall_commit" -O guix-install.sh \
# Add guix-install dependencies
&& chmod +x guix-install.sh \
&& sh guix-install.sh \
&& apt-get remove --yes \
wget \
gnupg \
xz-utils \
&& apt-get autoremove --yes \
&& apt-get clean --yes \
&& rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

View File

@ -0,0 +1,25 @@
#@ All rights reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 01:22:40 UTC
#@ Copyright (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 30/10/2021-EU 13:27:17 UTC released under the GPLv3 license <https://www.gnu.org/licenses/gpl-3.0.en.html>
###! REMOVE(Krey): The provided tarball is not the whole system so this is futile design
# 30/10/2021-EU 01:25:30 UTC
FROM alpine:3.14.2
LABEL Description="Fetcher to fetch the tarball from GNU Guix website"
# 30/10/2021-EU 01:24:54 UTC
LABEL Version="30102021012454"
ENV guixBinaryVersion="1.3.0"
RUN true \
&& wget "https://ftp.gnu.org/gnu/guix/guix-binary-$guixBinaryVersion.x86_64-linux.tar.xz" -O guix-binary.x86_64-linux.tar.xz \
&& mkdir result \
&& tar xpf guix-binary.x86_64-linux.tar.xz -C result \
&& rm -r guix-binary.x86_64-linux.tar.xz
FROM scratch
# 30/10/2021-EU 01:24:54 UTC
LABEL Version="30102021012454"
COPY --from=fetcher /result/ /
ENTRYPOINT [ "executable" ]

View File

@ -0,0 +1 @@
Directory dedicated for solutions that provide a testing environment

1
25-env/zz-README.md Normal file
View File

@ -0,0 +1 @@
Directory dedicated to files used for environment definitions

37
Makefile.toml Normal file
View File

@ -0,0 +1,37 @@
# The Cargo-Make <https://github.com/sagiegurari/cargo-make> file used to interact with the repository
# DNM(Krey): UNTESTED!!
[tasks.deploy]
description = "Command used to deploy the environment on system defined in environment variables `$HOSTNAME` and `$DOMAIN`"
category = "deployment"
# FIXME-QA(Krey): Convert this on `command` and `args`
script = '''
#!@shell
guix system reconfigure \
src/default.scm
'''
[tasks.test]
description = "Test the current configuration without deploying it"
category = "deployment"
# FIXME-QA(Krey): Convert this on `command` and `args`
script = '''
#!@shell
guix system build \
--dry-run ./src/default.scm
'''
### EDITORS ###
[tasks.editors-emacs]
description = "Opens emacs in the standardized environment on supported Operating Systems"
category = "editors"
script = '''
#!@shell
# DNR(Krey): Check for the system
guix shell \
-m "$projectEditorsDir/emacs/guix/manifest.scm"
'''

85
proposal.md Normal file
View File

@ -0,0 +1,85 @@
# Proposal to make guix system deployment more flexible
TLDR: Make `(operating-system)` into a "derivation capable of storing data" that can be triggered using a function `(guix-build-system)` to enable more flexible system management
### Context and end-goal
I am trying to port my NixOS managing system (https://git.dotya.ml/OpenVolt/nyxtumops) on guix to manage my systems where the expected goal is to be able to use public git repository to manage +200 systems at once through Continuous Integration and Delivery transparently to the user to provide https://snopyta.org -like libre service provider on a federated network to which new members can be added.
To do this i've defined a programming logic that separates the configuration per hostname and domain with file hierarchy applying configuration further by defining:
1. Global -- Configuration is applies to all systems using the solution
e.g. /users/kreyren.scm is expected to set user kreyren to all systems
2. Domain-wide -- Configuration applied only to the defined domain
e.g. /domains/<domain>/default.scm is expected to define configuration for the defined domain
3. Specific to the system -- Applied only to specified system
e.g. domains/<domain>/machines/<system>/default.scm is expected to define configuration only for the defined system
See the repository on https://git.dotya.ml/RiXotStudio/grilumops
### The issue
The currently used `(operating-system)` is basically a function with a lot of inputs with hard dependency on:
- bootloaders
- host-name
- file-systems
- timezone
Making it impossible to define a modular and expression independent solution through `(load)`-ing the files e.g.
Using command `guix system build src/default.scm` to execute following instructions:
```
────────────────────────────────────
│ File: src/default.scm
────────────────────────────────────
...
4 │ ;;; This file is the gateway in the system managing solution
,,,
16 │ (load "users/kreyren.scm")
17 │ (load "domains/rixotstudio.cz/default.scm")
18 │
19 │ (display "Finished")(newline)
```
Where the `(load "users/kreyren.scm") is important as the file is expected to define a `kreyren` user across all systems which is not possible on the current handling to do in modular and expression independent way as:
#### 1. Requires hard-written definition
```scm
;; First file
(define-public kreyren (name "kreyren")...)
;; Second file
(operating-system (users (user-account (source kreyren))))
```
Which breaks modularity as one file can't be used in different parts of the source code and is expression-dependent as it requires hard-written `(source kreyren)`
#### 2. Requires variable-driven layer
```scm
;; First file
(define-public my-username "kreyren")
...
;; Second file
(operating-system (users (user-account (name my-username)))))
```
which increases the complexity to the point where it significantly influences maintenance
#### 3. Defining a solution that constructs the (operating-system)
```scm
<code that generates (operating-system) declaration from it's standardized translation layer>
```
which increases the complexity to the point where the managing solution is unmaintainable and impossible to expand on in terms of features
### Proposed solution
Define `(operating-system)` into a "data-type capable of manipulating it's stored data" e.g. list, structure, etc.. and a function e.g. `(guix-build-system)` that reads the data from `(operating-system)` and applies it into a system build

0
proposal.md~ Normal file
View File

55
src/#generated.scm# Normal file
View File

@ -0,0 +1,55 @@
;; This is an operating system configuration generated
;; by the graphical installer.
(use-modules (gnu))
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(locale "en_US.utf8")
(timezone "Europe/Prague")
(keyboard-layout (keyboard-layout "us"))
(host-name "leonid")
(users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(home-directory "/home/kreyren")
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sda"))
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source
(uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems
(cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems)))

19
src/default.scm Normal file
View File

@ -0,0 +1,19 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; TODO(Krey): Release under FLOSS once finished
;;; This file is the gateway in the system managing solution
(use-modules (gnu))
;; FIXME(Krey): Process DOMAIN
;; FIXME(Krey): getenv returns #f if it's variable is unassigned.. i don't know how to check for false
;(if (false? (getenv "HOSTNAME"))
; (throw 1 "Environment variable 'HOSTNAME' is not set, unable to apply sufficient configuration"))
;(define system-hostname (getenv "HOSTNAME"))
(load "users/kreyren.scm")
(load "domains/rixotstudio.cz/default.scm")
(display "Finished")(newline)

19
src/default.scm~ Normal file
View File

@ -0,0 +1,19 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; TODO(Krey): Release under FLOSS once finished
;;; This file is the gateway in the system managing solution
(use-modules (gnu))
;; FIXME(Krey): Process DOMAIN
;; FIXME(Krey): getenv returns #f if it's variable is unassigned.. i don't know how to check for false
;(if (false? (getenv "HOSTNAME"))
; (throw 1 "Environment variable 'HOSTNAME' is not set, unable to apply sufficient configuration"))
;(define system-hostname (getenv "HOSTNAME"))
(load "domains/rixotstudio.cz/default.scm")
(load "users/kreyren.scm")
(display "Finished")(newline)

View File

@ -0,0 +1 @@
(load "machines/personal/leonid/default.scm")

View File

@ -0,0 +1,4 @@
;; DND(Krey): Figure out how to source all `*.\.scm` files in the directory
(load "users/kreyren.scm")
(load (string-append "machines/" system-hostname "/default.scm"))

View File

@ -0,0 +1,30 @@
;;; This file defines a configuration for the Dreamon system
;;; Expected:
;;; - [ ] Submit Guile API to Hetzner <https://github.com/hetznercloud/awesome-hcloud>
;;; - [ ] A. Integrate the API
;;; - [ ] B. Set up the server manually like a pleb
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Bind9
;;; - [ ] Authoritative DNS for RiXotStudio.cz domain
;;; - [ ] Tor Relay
;;; - [ ] Fira fonts
;;; - [ ] Git Repository Frontend
;;; - [ ] Gitea?
;;; - [ ] cgit?
;;; - [ ] Smithy <https://git.pokorny.ca/smithy>?
;;; - [ ] Define our own?
;;; - [ ] PrivateBin
;;; - [ ] Mastodon
;;; - [ ] Matrix Homeserver
;;; - [ ] Decide on the homeserver
;;; - [ ] Discourse
;;; - [ ] NextCloud
;;; - [ ] Invidious
;;; - [ ] Etherdoc
;;; - [ ] Hedgedoc
;;; - [ ] NextCloud
;;; - [ ] SearX
;;; - [ ] Jisi
;;; - [ ] Nitter
;;; - [ ] Bibliogram

View File

@ -0,0 +1,11 @@
;;; This file defines a configuration for the Dreamon system
;;; Expected:
;;; - [ ] XFCE4
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Bind9
;;; - [ ] Docker
;;; - [ ] Tor Private Bridge
;;; - [ ] Xen
;;; - [ ] Fira fonts
;;; - [ ] Set `load-module module-echo-cancel` for pulseaudio

View File

@ -0,0 +1,9 @@
;;; This file defines a configuration for the Dreamon system
;;; Expected:
;;; - [ ] XFCE4
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Bind9
;;; - [ ] Tor Private Bridge
;;; - [ ] Fira fonts
;;; - [ ] Set `load-module module-echo-cancel` for pulseaudio

View File

@ -0,0 +1,62 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; TODO(Krey): Release under FLOSS once finished
;;; This file defines a configuration for the Leonid system
;;; Expected:
;;; - [ ] XFCE4
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Bind9
;;; - [ ] Docker
;;; - [ ] Tor Private Bridge
;;; - [ ] Xen
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(host-name "leonid")
(timezone "Europe/Prague")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us"))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets "/dev/sda")
;; SECURITY(Krey): Our bootloader is encrypted so we can allow timeout higher than 0
(timeout 5)
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source (uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems))
(users %base-user-accounts)
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services)))

View File

@ -0,0 +1,86 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; TODO(Krey): Release under FLOSS once finished
;;; This file defines a configuration for the Leonid system
;;; Expected:
;;; - [ ] XFCE4
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Bind9
;;; - [ ] Docker
;;; - [ ] Tor Private Bridge
;;; - [ ] Xen
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(host-name "leonid")
(timezone "Europe/Prague")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us"))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")
;; SECURITY(Krey): Our bootloader is encrypted so we can allow timeout higher than 0
(timeout 5))
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source (uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping)))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems))
(users (cons %base-user-accounts))
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services)))
;(services (cons
; (service tor-service-type
; (tor-configuration
; (config-file (plain-file "tor-config"
; "HTTPTunnelPort 127.0.0.1:9250"))))
; (modify-services %base-services
; (guix-service-type
; config => (guix-configuration
; (inherit config)
; ;; ci.guix.gnu.org's Onion service
; (substitute-urls "https://bp7o7ckwlewr4slm.onion")
; (http-proxy "http://localhost:9250"))))))
; (services (cons*
; (service dhcp-client-service-type)
; (service openssh-service-type
; (openssh-configuration
; (openssh openssh-sans-x)
; (password-authentication? #false)
; (authorized-keys
; `(("janedoe" ,(local-file "janedoe_rsa.pub"))
; ("root" ,(local-file "janedoe_rsa.pub"))))))
;%base-services)))

View File

@ -0,0 +1,8 @@
;;; This file defines a configuration for the Plusik system
;;; Expected:
;;; - [ ] Figure out how to install it on it
;;; - [ ] Boots?
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Tor Private Bridge
;;; - [ ] Fira fonts

View File

@ -0,0 +1,6 @@
;;; This file defines a configuration for the Schutr64 system
;;; Expected:
;;; - [ ] SSH
;;; - [ ] SSH+TOR
;;; - [ ] Tor Private Bridge
;;; - [ ] Fira fonts

View File

@ -0,0 +1 @@
for domain-specific users

55
src/fallback.scm~ Normal file
View File

@ -0,0 +1,55 @@
;; This is an operating system configuration generated
;; by the graphical installer.
(use-modules (gnu))
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(locale "en_US.utf8")
(timezone "Europe/Prague")
(keyboard-layout (keyboard-layout "us"))
(host-name "leonid")
(users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(home-directory "/home/kreyren")
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sda"))
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source
(uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems
(cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems)))

55
src/generated.scm~ Normal file
View File

@ -0,0 +1,55 @@
;; This is an operating system configuration generated
;; by the graphical installer.
(use-modules (gnu))
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(locale "en_US.utf8")
(timezone "Europe/Prague")
(keyboard-layout (keyboard-layout "us"))
(host-name "leonid")
(users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(home-directory "/home/kreyren")
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sda"))
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source
(uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems
(cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems)))

55
src/tools/fallback.scm Normal file
View File

@ -0,0 +1,55 @@
;;; Fallback system build
;;; used to fallback to a working system until the presented configuration is finished
(use-modules (gnu))
(use-service-modules
cups
desktop
networking
ssh
xorg)
(operating-system
(locale "en_US.utf8")
(timezone "Europe/Prague")
(keyboard-layout (keyboard-layout "us"))
(host-name "leonid")
(users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(home-directory "/home/kreyren")
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(list (specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service xfce-desktop-service-type)
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sda"))
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source
(uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems
(cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems)))

View File

@ -0,0 +1,37 @@
;;; # Minimal GUIX
;;; configuration used for development and testing
(operating-system
(host-name "guix")
(timezone "UTC")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "altgr-intl"))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")
(timeout 10))
(file-systems (append
(list (file-system
(mount-point "/")
(device (file-system-label "GUIX"))
(type "btrfs"))
%base-file-systems))
(users (cons
(user-account
(name "guix")
(group "users")
(password "guix")
(supplementary-groups '(
"wheel")))
%base-user-accounts))
(packages (append (list
nss-certs)
%base-packages))
(services (append (list
(service openssh-service-type))
%desktop-services))

View File

@ -0,0 +1 @@
Minimal system build designed for development and testing

View File

View File

@ -0,0 +1 @@
System build designed for portable storage media (e.g. flash disk) to access the system for recovery or administrative tasks

View File

1
src/tools/zz-README.md Normal file
View File

@ -0,0 +1 @@
Standalone purpose-designed system builds

0
src/tools/zz-README.md~ Normal file
View File

67
src/users/kreyren.scm Normal file
View File

@ -0,0 +1,67 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; The user account of RiXotStudio's Headmaster
;;; REPRODUCIBILITY CHECKLIST
;;; - [ ] IceCat
;;; - [ ] Extensions
;;; - [ ] DarkReader
;;; - [ ] Ublock origin
;;; - [ ] Decentraleyes
;;; - [ ] LocalCND
;;; - [ ] SponsorBlock
;;; - [ ] Don't track me Google
;;; - [ ] I don't care about cookies
;;; - [ ] ClearURLs
;;; - [ ] NoScript
;;; - [ ] Forget Me Not
;;; - [ ] Metastream Remote
;;; - [ ] Read Aloud
;;; - [ ] KeepAssXC
;;; - [ ] Theme: Dark
;;; - [ ] Privacy & Security > Delete cookies and site data when IceCat is closed
;;; - [ ] Privacy & Security > History > Always use private browsing mode
;;; - [ ] Set SOCKS5 proxy on 9050 with deployed tor
;;; - [ ] Alacritty
;;; - [ ] XFCE4
;;; - [ ] Wallpaper: Solid Black Color
;;; - [ ] Window Manager style: Daloa
;;; - [ ] Focus follows mouse
;;; - [ ] Keybinds
;;; - [ ] Super_L + Enter = exo-open --launch TerminalEmulator
;;; - [ ] Super_L + Key_T = exo-open --launch WebBrowser
;;; - [ ] Super_L + Key_H = Hide focused window
;;; - [ ] Super_L + Key_D = dmenu_run
;;; - [ ] Super_L + Key_L = xflock4
;;; - [ ] Alt_L + Shift_L + PrintScreen = flameshot gui
;;; - [ ] KeepAssXC
;;; - [ ] Configured to open Kreyren.kdbx by default
;;; - [ ] Enable browser integration
;;; - [ ] dmenu
;;; - [ ] Nextcloud
;;; - [ ] Credentials pre-set to open on user login and start sync
;;; - [ ] Flameshot
;;; - [ ] Sync all required dirs
;;; - [ ] Pulseaudio
;;; - [ ] Set 'load-module module-echo-cancel' to do active noise filtering
;;; - [ ] Vim
;;; - [ ] Tor
;;; - [ ] element-desktop
;;; - [ ] htop
;;; - [ ] xclip
;; When this file is `(load)`-ed set user kreyren
(operating-system (users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(shell (file-append bash "/bin/bash"))
;; DND(Krey): Figure out how to do the password
;(password (crypt "InitialPassword!" "$6$abc"))
(supplementary-groups '(
"wheel"
"netdev"
"audio"
"video"))))))
;; DND(Krey): Handle SSH access

44
src/users/kreyren.scm~ Normal file
View File

@ -0,0 +1,44 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; The user account of RiXotStudio's Headmaster
;;; REPRODUCIBILITY CHECKLIST
;;; - [ ] IceCat
;;; - [ ] Extension: DarkReader
;;; - [ ] Theme: Dark
;;; - [ ] Alacritty
;;; - [ ] XFCE4
;;; - [ ] Wallpaper: Solid Black Color
;;; - [ ] Window Manager style: Daloa
;;; - [ ] Focus follows mouse
;;; - [ ] Keybinds
;;; - [ ] Super_L + Enter = exo-open --launch TerminalEmulator
;;; - [ ] Super_L + Key_T = exo-open --launch WebBrowser
;;; - [ ] Super_L + Key_H = Hide focused window
;;; - [ ] Super_L + Key_D = dmenu_run
;;; - [ ] Super_L + Key_L = xflock4
;;; - [ ] Alt_L + Shift_L + PrintScreen = flameshot gui
;;; - [ ] KeepAssXC
;;; - [ ] Configured to open Kreyren.kdbx by default
;;; - [ ] dmenu
;;; - [ ] Nextcloud
;;; - [ ] Credentials pre-set to open on user login and start sync
;;; - [ ] Flameshot
;;; - [ ] Sync all required dirs
;;; - [ ] Pulseaudio
;;; - [ ] Set 'load-module module-echo-cancel' to do active noise filtering
(operating-system (users (cons* (user-account
(name "kreyren")
(comment "Jacob Hrbek")
(group "users")
(shell (file-append bash "/bin/bash"))
;; DND(Krey): Figure out how to do the password
(password (crypt "InitialPassword!" "$6$abc"))
(supplementary-groups '(
"wheel"
"netdev"
"audio"
"video"))))))
;; DND(Krey): Handle SSH access

1
src/users/zz-README.md Normal file
View File

@ -0,0 +1 @@
Directory dedicated to users that are shared across all domains

1
src/zz-README.md Normal file
View File

@ -0,0 +1 @@
Reference: https://guix.gnu.org/manual/en/guix.html#User-Accounts

19
test Normal file
View File

@ -0,0 +1,19 @@
;;; All Rights Reserved (C) Jacob Hrbek <rsa4096/0x31AE4020956E0A9A> in 29/10/2021-EU 21:27:26 UTC
;;; TODO(Krey): Release under FLOSS once finished
;;; This file is the gateway in the system managing solution
(use-modules (gnu))
;; FIXME(Krey): Process DOMAIN
;; FIXME(Krey): getenv returns #f if it's variable is unassigned.. i don't know how to check for false
;(if (false? (getenv "HOSTNAME"))
; (throw 1 "Environment variable 'HOSTNAME' is not set, unable to apply sufficient configuration"))
;(define system-hostname (getenv "HOSTNAME"))
(load "domains/rixotstudio.cz/default.scm")
(load "users/kreyren.scm")
(display "Finished")(newline)

150
workspace.code-workspace Normal file
View File

@ -0,0 +1,150 @@
{
"folders": [
{
"path": "."
},
],
"extensions": {
"recommendations": [
"aaron-bond.better-comments",
"2gua.rainbow-brackets",
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"markwylde.vscode-filesize",
"eamodio.gitlens",
"oderwat.indent-rainbow",
"formulahendry.code-runner",
"rubymaniac.vscode-direnv",
"huka.blogging-tool",
"jnoortheen.nix-ide",
"cweijan.vscode-office",
"luxcium.pop-n-lock-theme-vscode",
"stephen-riley.regexworkbench",
"medo64.render-crlf",
"gruntfuggly.todo-tree",
"yzhang.markdown-all-in-one",
// Used to work with guile files
"rebornix.scheme",
// Docker-relevant
"exiasr.hadolint",
"ms-azuretools.vscode-docker"
]
},
"settings": {
// Enable liguratures
"editor.fontLigatures": true,
"editor.fontFamily": "'Fira Code'",
"terminal.integrated.fontFamily": "'Fira Code'",
"[jsonc]": {
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
},
"[rust]": {
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.wordWrap": "on",
"editor.renderWhitespace": "all",
},
"[scheme]": {
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.wordWrap": "on",
"editor.renderWhitespace": "all",
},
"[nix]": {
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.wordWrap": "on",
"editor.renderWhitespace": "all",
},
"[shellscript]": {
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.wordWrap": "on",
"editor.renderWhitespace": "all",
},
// cSpell
"cSpell.diagnosticLevel": "Error",
"cSpell.allowCompoundWords": true,
"cSpell.flagWords": [
// DO
"kreyen",
// NOT
"kyren",
// MANGLE
"keyren",
// MY
"keren",
// NAME
"kreyn",
],
"cSpell.ignoreWords": [
"Krey",
"Hrbek",
"kreyren",
"FSFE",
"Cydia"
],
// Task tree
"todo-tree.general.tags": [
"FIXME",
"TODO",
"DNM", // Do Not Merge
"DNC", // Do Not Contribute
"DNR" // Do Not Release
],
// NOTE: Icons has to be valid codicons (https://microsoft.github.io/vscode-codicons/dist/codicon.html)
"todo-tree.highlights.customHighlight": {
"FIXME": {
"foreground": "orange",
"icon": "report",
"fontWeight": "bold"
},
"TODO": {
"foreground": "turquoise",
"icon": "tasklist",
"fontWeight": "bold"
},
"DOCS": {
"foreground:": "blue",
"icon": "repo",
"fontWeight": "bold"
},
"DNM": {
"foreground": "red",
"icon": "alert",
"fontWeight": "bold"
},
"DNR": {
"foreground": "red",
"icon": "alert",
"fontWeight": "bold"
},
"DNC": {
"foreground": "red",
"icon": "alert",
"fontWeight": "bold"
}
},
"todo-tree.regex.regex": "($TAGS)((\\-.*|)\\(.*\\)):",
// Code-eol
"code-eol.highlightExtraWhitespace": true,
"code-eol.newlineCharacter": "↵",
"code-eol.crlfCharacter": "↓",
"shellcheck.run": "onSave",
"editor.wordWrap": "on",
"editor.mouseWheelZoom": true,
// To Be Sorted
"cSpell.words": [
"favicon"
],
},
}

9
xx-LICENSE.md Normal file
View File

@ -0,0 +1,9 @@
START OF LICENSE
All rights reserved (C) by Jacob "Kreyren" Hrbek in 11/08/2010 the holder of the public gpg identifier `rsa4096/0x3E0E1A60C82873AD`
END OF LICENSE
---
WIP-LICENSE(Krey): TBD

10
zz-README.md Normal file
View File

@ -0,0 +1,10 @@
# Grilumops
Fork adaptation of RiXotStudio's Nixumops into a Guile scheme used in e.g. Guix GNU/Linux
### Origin of the name
Grile was a typo by @kreyren when converting the name from Nixumops to guile scheme
### Credit
CRE1. Inspired by Julien Lepiller's configuration in https://framagit.org/tyreunom/system-configuration