From 0400b67ac85fbcad4b1b2cb6d60a373f0c918dc8 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Mon, 28 Oct 2024 21:01:21 -0300 Subject: [PATCH] home-environments: radio: Rename home-environment to radio, minor changes --- home-environments/radio.scm | 76 ++++++++------------ home-environments/radio/files/.local/bin/dup | 14 ++++ 2 files changed, 42 insertions(+), 48 deletions(-) create mode 100755 home-environments/radio/files/.local/bin/dup diff --git a/home-environments/radio.scm b/home-environments/radio.scm index 82ad4cf..4abb91f 100644 --- a/home-environments/radio.scm +++ b/home-environments/radio.scm @@ -4,9 +4,7 @@ #|GNU|# #|•|# #:use-module (gnu) - #|H|# #:use-module ((gnu home) #:select (this-home-environment)) - #:use-module ((gnu home) #:hide (this-home-environment) - #:prefix user-) + #|H|# #:use-module (gnu home) #|GNU packages|# #|G|# #:use-module (gnu packages gnupg) @@ -43,26 +41,10 @@ #|S|# #:use-module (radix home services shells) #|X|# #:use-module (radix home services xdg) - #:export (home-environment + #:export (radio)) - application:browser - application:editor - application:pager - application:reader - application:shell - application:terminal - application:wm)) - -#|Default applications|# -(define application:browser "chromium") -(define application:editor "kak") -(define application:pager "less") -(define application:reader "sioyek") -(define application:terminal "foot") -(define application:wm "river") - -(define home-environment - (user-home-environment +(define radio + (home-environment (packages (append #|B|# packages:blogging #|C|# packages:calendar @@ -82,14 +64,14 @@ (list #|XDG services|# (service home-xdg-user-directories-service-type (home-xdg-user-directories-configuration - (desktop "$HOME/areas") - (documents "$HOME/areas/documents") - (download "$HOME/media/downloads") - (music "$HOME/media/music") - (pictures "$HOME/media/pictures") - (videos "$HOME/media/videos") + (desktop "$HOME/areas") + (documents "$HOME/areas/documents") + (download "$HOME/media/downloads") + (music "$HOME/media/music") + (pictures "$HOME/media/pictures") + (videos "$HOME/media/videos") (publicshare "") - (templates ""))) + (templates ""))) (service home-xdg-mime-applications-service-type (home-xdg-mime-applications-configuration @@ -194,21 +176,20 @@ ("TERMINFO" . "$XDG_DATA_HOME/terminfo"))) (aliases `(#|Common aliases|# - ("df" . "df -h") - ("du" . "du -h") + ("df" . "df -h") + ("du" . "du -h") ("diff" . "diff --color=auto") ("grep" . "grep --color=auto") - ("ip" . "ip --color=auto") - ("ls" . ,(format #f "ls --color=auto ~ - --group-directories-first ~ - --classify ~ - --human-readable ~ - -v")) + ("ip" . "ip --color=auto") + ("ls" . ,(format #f "ls --color=auto ~ + --group-directories-first ~ + --classify ~ + --human-readable ~ + -v")) #|Clear terminal screen without ncurses|# ("clear" . "printf \"\\033c\"") - #|Kakoune bindings for info|# ("info" . "info --init-file $XDG_CONFIG_HOME/info") #|Kakoune aliases for the shell|# @@ -233,7 +214,6 @@ (position 'anywhere) (expansion y)))) `(#|Guix|# - (!dgen . "guix % delete-generations 2w") (!repair . "doas guix build --repair") (!pull . "guix pull") (!repl . "guix repl -i ~/.config/guile/guilerc") @@ -301,7 +281,7 @@ #|Environment variables services|# (simple-service 'home-shell-environment-variables home-environment-variables-service-type - `(("PATH" . "$HOME/.local/bin:$PATH") + `(("PATH" . "$HOME/.local/bin:$PATH") ("INPUTRC" . "$XDG_CONFIG_HOME/readline/inputrc"))) (simple-service 'home-guile-environment-variables home-environment-variables-service-type @@ -335,15 +315,15 @@ `(("LANG" . "en_US.UTF-8") ("LANGUAGE" . "en_US.UTF-8") ("LC_COLLATE" . "C"))) + (simple-service 'home-default-applications-environment-variables home-environment-variables-service-type - `(("BROWSER" . ,application:browser) - ("EDITOR" . ,application:editor) - ("PAGER" . ,application:pager) - ("READER" . ,application:reader) - ("TERMINAL" . ,application:terminal) - ("VISUAL" . ,application:editor) - ("WM" . ,application:wm))) + `(("BROWSER" . "chromium") + ("EDITOR" . "kak") + ("PAGER" . "less") + ("TERMINAL" . "foot") + ("VISUAL" . "$EDITOR") + ("WM" . "river"))) (simple-service 'home-applications-environment-variables home-environment-variables-service-type `(("MINETEST_USER_PATH" . "$XDG_DATA_HOME/minetest"))) @@ -393,4 +373,4 @@ (full-message "Unplug the cable") (warning-message "You may want to plug the cable") (critical-message "Plug the cable"))))))) -home-environment +radio diff --git a/home-environments/radio/files/.local/bin/dup b/home-environments/radio/files/.local/bin/dup new file mode 100755 index 0000000..b1a740f --- /dev/null +++ b/home-environments/radio/files/.local/bin/dup @@ -0,0 +1,14 @@ +#!/usr/bin/env -S guile +!# + +(use-modules (ice-9 textual-ports) + (srfi srfi-197) + (radix utils)) + +(for-each (lambda (line) + (display line) + (newline)) + (chain (current-input-port) + (get-string-all _) + (string-split _ #\newline) + (duplicates _)))