From 34f4d58e3ef266619d898057062230d0361645ae Mon Sep 17 00:00:00 2001 From: muon Date: Wed, 30 Jul 2025 22:13:52 +0000 Subject: [PATCH] Initialze repository --- home/dotfiles/.bash_profile | 2 ++ home/dotfiles/.bashrc | 37 ++++++++++++++++++++++++++++ home/home-configuration.scm | 34 +++++++++++++++++++++++++ home/muix.scm | 42 +++++++++++++++++++++++++++++++ home/old.scm | 30 +++++++++++++++++++++++ systems/base.scm | 38 ++++++++++++++++++++++++++++ systems/muix.scm | 49 +++++++++++++++++++++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 home/dotfiles/.bash_profile create mode 100644 home/dotfiles/.bashrc create mode 100644 home/home-configuration.scm create mode 100644 home/muix.scm create mode 100644 home/old.scm create mode 100644 systems/base.scm create mode 100644 systems/muix.scm diff --git a/home/dotfiles/.bash_profile b/home/dotfiles/.bash_profile new file mode 100644 index 0000000..37ea25c --- /dev/null +++ b/home/dotfiles/.bash_profile @@ -0,0 +1,2 @@ +# Honor per-interactive-shell startup file +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi diff --git a/home/dotfiles/.bashrc b/home/dotfiles/.bashrc new file mode 100644 index 0000000..cdac4ef --- /dev/null +++ b/home/dotfiles/.bashrc @@ -0,0 +1,37 @@ +# Bash initialization for interactive non-login shells and +# for remote shells (info "(bash) Bash Startup Files"). + +# Export 'SHELL' to child processes. Programs such as 'screen' +# honor it and otherwise use /bin/sh. +export SHELL + +if [[ $- != *i* ]] +then + # We are being invoked from a non-interactive shell. If this + # is an SSH session (as in "ssh host command"), source + # /etc/profile so we get PATH and other essential variables. + [[ -n "$SSH_CLIENT" ]] && source /etc/profile + + # Don't do anything else. + return +fi + +# Source the system-wide file. +source /etc/bashrc + +# Adjust the prompt depending on whether we're in 'guix environment'. +if [ -n "$GUIX_ENVIRONMENT" ] +then + PS1='\u@\h \w [env]\$ ' +else + PS1='\u@\h \w\$ ' +fi +alias ls='ls -p --color=auto' +alias ll='ls -l' +alias la='ls -lah --color=auto' +alias grep='grep --color=auto' + +force_color_prompt=yes +PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] ' + +set -o vi diff --git a/home/home-configuration.scm b/home/home-configuration.scm new file mode 100644 index 0000000..ddebec1 --- /dev/null +++ b/home/home-configuration.scm @@ -0,0 +1,34 @@ +;; This "home-environment" file can be passed to 'guix home reconfigure' +;; to reproduce the content of your profile. This is "symbolic": it only +;; specifies package names. To reproduce the exact same profile, you also +;; need to capture the channels being used, as returned by "guix describe". +;; See the "Replicating Guix" section in the manual. + +(use-modules (gnu home) + (gnu packages) + (gnu services) + (guix gexp) + (gnu home services shells)) + +(home-environment + ;; Below is the list of packages that will show up in your + ;; Home profile, under ~/.guix-home/profile. + (packages (specifications->packages (list "nss-certs" "git" + "gcc-toolchain@14" "helix"))) + + ;; Below is the list of Home services. To search for available + ;; services, run 'guix home search KEYWORD' in a terminal. + (services + (append (list (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("la" . "ls -lah --color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto"))) + (bashrc (list (local-file + "/home/muon/src/guix-config/home/dotfiles/.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "/home/muon/src/guix-config/home/dotfiles/.bash_profile" + "bash_profile")))))) + %base-home-services))) diff --git a/home/muix.scm b/home/muix.scm new file mode 100644 index 0000000..3fdfd8d --- /dev/null +++ b/home/muix.scm @@ -0,0 +1,42 @@ +(use-modules (gnu home) + (gnu home services) + (gnu packages) + (gnu services) + (guix gexp) + (gnu home services shells)) + +(home-environment + (packages (specifications->packages + (list + "helix"))) + + (services (append (list + (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("la" . "ls -lah --color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto"))) + (bashrc (list (local-file + "/home/muon/src/guix-config/home/dotfiles/.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "/home/muon/src/guix-config/home/dotfiles/.bash_profile" + "bash_profile"))))) + + (service home-inputrc-service-type + (home-inputrc-configuration + (variables + '(("editing-mode" . "vi") + ("keymap" . "vi-insert") + ("show-mode-in-prompt" . "on") + ("keyseq-timeout" . "50") + ("vi-cmd-mode-string" . "\\1\\e[2 q\\2") + ("vi-ins-mode-string" . "\\1\\e[6 q\\2"))))) + + (simple-service 'my-env-vars home-environment-variables-service-type + '(("SSL_CERT_DIR" . "$HOME/.guix-profile/etc/ssl/certs") + ("SSL_CERT_FILE" . "$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt") + ("GIT_SSL_CAINFO" . "$SSL_CERT_FILE")))) + + %base-home-services))) diff --git a/home/old.scm b/home/old.scm new file mode 100644 index 0000000..7f65ac2 --- /dev/null +++ b/home/old.scm @@ -0,0 +1,30 @@ +(use-modules (gnu home) + (gnu packages) + (gnu services) + (guix gexp) + (gnu home services shells)) + +(home-environment + + (packages (specifications->packages (list "nss-certs" "git" + "gcc-toolchain@14" "helix"))) + + (services (append + (list (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("la" . "ls -lah --color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto"))) + (bashrc (list (local-file + "/home/muon/src/guix-config//.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "/home/muon/src/guix-config//.bash_profile" + "bash_profile")))))) + (list + (simple-service 'my-env-vars home-environment-variables-service-type + `(("SSL_CERT_DIR" . "$HOME/.guix-profile/etc/ssl/certs") + ("SSL_CERT_FILE" . "$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt") + ("GIT_SSL_CAINFO" . "$SSL_CERT_FILE"))))) + %base-home-services))) diff --git a/systems/base.scm b/systems/base.scm new file mode 100644 index 0000000..5e6c2c4 --- /dev/null +++ b/systems/base.scm @@ -0,0 +1,38 @@ +(define-module (systems base) + #:use-module (gnu) + #:use-module (guix) + #:export (system-config)) + +(use-service-modules networking ssh) + +(define (system-config system) + (operating-system + (inherit system) + (timezone "Etc/UTC") + (locale "en_DK.utf8") + + (users (cons (user-account + (name "muon") + (group "users") + (home-directory "/home/muon") + (supplementary-groups + '("wheel" "netdev" "kvm" "tty" "input" "audio" "video"))) + %base-user-accounts)) + + (packages (append (map specification->package + '("git" + "glibc-locales" + "nss-certs" + "gnupg" + "curl" + "cryptsetup" + "openssl" + "polkit" + "vim")) + %base-packages)) + + (services (append (list (service dhcpcd-service-type) + (service openssh-service-type)) + %base-services)))) + + diff --git a/systems/muix.scm b/systems/muix.scm new file mode 100644 index 0000000..a687257 --- /dev/null +++ b/systems/muix.scm @@ -0,0 +1,49 @@ +(define-module (systems muix) + #:use-module (gnu) + #:use-module (guix) + #:use-module (systems base)) + +;; /dev/sda1 +(define %device-uuid-efi "AC4A-082E") +;; /dev/sda2 +(define %device-uuid-root "d1efd870-c9d9-47f5-bed5-3209e95b4f16") + +(system-config (operating-system + (host-name "muix") + + (keyboard-layout (keyboard-layout "us" "altgr-intl" #:model "thinkpad")) + + (mapped-devices (list (mapped-device + (source (uuid %device-uuid-root)) + (target "guixvm") + (type luks-device-mapping)))) + + (file-systems (append (map + (lambda (item) (file-system + (device "/dev/mapper/guixvm") + (mount-point (car item)) + (type "btrfs") + (options (car (cdr item))) + (dependencies mapped-devices))) + '(("/" "subvol=root") + ("/swap" "subvol=swap") + ("/boot" "subvol=boot") + ("/gnu" "subvol=gnu") + ("/home" "subvol=home") + ("/var/log" "subvol=log"))) + (list (file-system + (mount-point "/boot/efi") + (device (uuid %device-uuid-efi 'fat32)) + (type "vfat"))) + %base-file-systems)) + + (swap-devices (list (swap-space + (target "/swap/swapfile") + (dependencies file-systems)))) + + (bootloader (bootloader-configuration + (bootloader grub-efi-removable-bootloader) + (targets '("/boot/efi")) + (timeout 1) + (keyboard-layout keyboard-layout))))) +