diff options
| author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-10-15 14:03:46 +0200 |
|---|---|---|
| committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-10-15 14:03:46 +0200 |
| commit | e43f3c403ff49e87641bb6c745080760f272446f (patch) | |
| tree | c964d54e79c87ec466658e289e10303c861be5cd /Guix.org | |
| parent | e62c8a78ec0b8727d138fbe4144cf718b7da867d (diff) | |
| download | dotfiles-e43f3c403ff49e87641bb6c745080760f272446f.tar.gz dotfiles-e43f3c403ff49e87641bb6c745080760f272446f.zip | |
Update dotfiles
Diffstat (limited to 'Guix.org')
| -rw-r--r-- | Guix.org | 276 |
1 files changed, 0 insertions, 276 deletions
diff --git a/Guix.org b/Guix.org deleted file mode 100644 index e2c9ef8..0000000 --- a/Guix.org +++ /dev/null | |||
| @@ -1,276 +0,0 @@ | |||
| 1 | #+TITLE: Guix Configuration file | ||
| 2 | |||
| 3 | * Resources | ||
| 4 | [[https://guix.gnu.org/manual/en/html_node/index.html][guix]] | ||
| 5 | [[https://github.com/daviwil/dotfiles/blob/master/Systems.org][daviwil/dotfiles]] | ||
| 6 | |||
| 7 | * Managing profiles | ||
| 8 | Source: [[https://github.com/daviwil/dotfiles/blob/master/Systems.org#profile-management][daviwil/dotfiles]] | ||
| 9 | ** Activate profiles | ||
| 10 | |||
| 11 | #+begin_src sh :tangle bin/activate-profiles :shebang #!/bin/sh | ||
| 12 | # Source: https://github.com/daviwil/dotfiles/blob/master/Systems.org#profile-management | ||
| 13 | |||
| 14 | GREEN='\033[1;32m' | ||
| 15 | RED='\033[1;30m' | ||
| 16 | NC='\033[0m' | ||
| 17 | GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles | ||
| 18 | |||
| 19 | profiles=$* | ||
| 20 | if [[ $# -eq 0 ]]; then | ||
| 21 | profiles="$HOME/.config/guix/manifests/*.scm"; | ||
| 22 | fi | ||
| 23 | |||
| 24 | for profile in $profiles; do | ||
| 25 | # Remove the path and file extension, if any | ||
| 26 | profileName=$(basename $profile) | ||
| 27 | profileName="${profileName%.*}" | ||
| 28 | profilePath="$GUIX_EXTRA_PROFILES/$profileName" | ||
| 29 | manifestPath=$HOME/.config/guix/manifests/$profileName.scm | ||
| 30 | |||
| 31 | if [ -f $manifestPath ]; then | ||
| 32 | echo | ||
| 33 | echo -e "${GREEN}Activating profile:" $manifestPath "${NC}" | ||
| 34 | echo | ||
| 35 | |||
| 36 | mkdir -p $profilePath | ||
| 37 | guix package --manifest=$manifestPath --profile="$profilePath/$profileName" | ||
| 38 | |||
| 39 | # Source the new profile | ||
| 40 | GUIX_PROFILE="$profilePath/$profileName" | ||
| 41 | if [ -f $GUIX_PROFILE/etc/profile ]; then | ||
| 42 | . "$GUIX_PROFILE"/etc/profile | ||
| 43 | else | ||
| 44 | echo -e "${RED}Couldn't find profile:" $GUIX_PROFILE/etc/profile "${NC}" | ||
| 45 | fi | ||
| 46 | else | ||
| 47 | echo "No profile found at path" $profilePath | ||
| 48 | fi | ||
| 49 | done | ||
| 50 | |||
| 51 | #+end_src | ||
| 52 | |||
| 53 | ** Update profiles | ||
| 54 | |||
| 55 | #+begin_src sh :tangle bin/update-profiles :shebang #!/bin/sh | ||
| 56 | # Source: https://github.com/daviwil/dotfiles/blob/master/Systems.org#profile-management | ||
| 57 | |||
| 58 | GREEN='\033[1;32m' | ||
| 59 | NC='\033[0m' | ||
| 60 | GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles | ||
| 61 | |||
| 62 | profiles=$* | ||
| 63 | if [[ $# -eq 0 ]]; then | ||
| 64 | profiles="$GUIX_EXTRA_PROFILES/*"; | ||
| 65 | fi | ||
| 66 | |||
| 67 | for profile in $profiles; do | ||
| 68 | profileName=$(basename $profile) | ||
| 69 | profilePath=$GUIX_EXTRA_PROFILES/$profileName | ||
| 70 | |||
| 71 | echo | ||
| 72 | echo -e "${GREEN}Updating profile:" $profilePath "${NC}" | ||
| 73 | echo | ||
| 74 | |||
| 75 | guix package --profile="$profilePath/$profileName" --manifest="$HOME/.config/guix/manifests/$profileName.scm" | ||
| 76 | done | ||
| 77 | |||
| 78 | #+end_src | ||
| 79 | |||
| 80 | * Channels | ||
| 81 | #+begin_src scheme :tangle .config/guix/channels.scm | ||
| 82 | (list | ||
| 83 | (channel | ||
| 84 | (name 'guix) | ||
| 85 | (url "https://git.savannah.gnu.org/git/guix.git") | ||
| 86 | ;; (url "file:///home/daviwil/Projects/Code/guix")) | ||
| 87 | (introduction | ||
| 88 | (make-channel-introduction | ||
| 89 | "9edb3f66fd807b096b48283debdcddccfea34bad" | ||
| 90 | (openpgp-fingerprint | ||
| 91 | "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))) | ||
| 92 | (channel | ||
| 93 | (name 'nonguix) | ||
| 94 | (url "https://gitlab.com/nonguix/nonguix") | ||
| 95 | ;; Enable signature verification: | ||
| 96 | (introduction | ||
| 97 | (make-channel-introduction | ||
| 98 | "897c1a470da759236cc11798f4e0a5f7d4d59fbc" | ||
| 99 | (openpgp-fingerprint | ||
| 100 | "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))) | ||
| 101 | #+end_src | ||
| 102 | |||
| 103 | * Systems | ||
| 104 | ** Base | ||
| 105 | |||
| 106 | #+begin_src scheme :tangle .config/guix/systems/base-system.scm | ||
| 107 | |||
| 108 | (define-module (base-system) | ||
| 109 | #:use-module (gnu) | ||
| 110 | #:use-module (gnu services pm) | ||
| 111 | #:use-module (gnu services docker) | ||
| 112 | #:use-module (gnu services networking) | ||
| 113 | #:use-module (gnu services virtualization) ; todo make | ||
| 114 | #:use-module (gnu packages vim) | ||
| 115 | #:use-module (gnu services desktop) | ||
| 116 | #:use-module (gnu packages xorg) | ||
| 117 | #:use-module (gnu packages emacs) | ||
| 118 | #:use-module (gnu packages file-systems) | ||
| 119 | #:use-module (gnu packages linux) | ||
| 120 | #:use-module (gnu packages audio) | ||
| 121 | #:use-module (gnu packages pulseaudio) | ||
| 122 | #:use-module (gnu packages version-control) | ||
| 123 | #:use-module (gnu packages package-management)) | ||
| 124 | ; #:use-module (nongnu packages linux) | ||
| 125 | ; #:use-module (nongnu system linux-initrd)) | ||
| 126 | |||
| 127 | (use-service-modules ssh) | ||
| 128 | (use-package-modules certs) | ||
| 129 | (use-service-modules desktop xorg) | ||
| 130 | #+end_src | ||
| 131 | |||
| 132 | *Packages* | ||
| 133 | #+begin_src scheme :noweb-ref packages :noweb yes | ||
| 134 | |||
| 135 | ;; Packages | ||
| 136 | (packages (append (list | ||
| 137 | git | ||
| 138 | exfat-utils | ||
| 139 | fuse-exfat | ||
| 140 | stow | ||
| 141 | vim | ||
| 142 | emacs | ||
| 143 | bluez | ||
| 144 | bluez-alsa | ||
| 145 | pulseaudio | ||
| 146 | tlp | ||
| 147 | ncurses | ||
| 148 | xf86-input-libinput | ||
| 149 | nss-certs) ;; For https connection | ||
| 150 | %base-packages)) | ||
| 151 | |||
| 152 | #+end_src | ||
| 153 | |||
| 154 | *Services* | ||
| 155 | #+begin_src scheme :noweb-ref services :noweb yes | ||
| 156 | |||
| 157 | ;; Services | ||
| 158 | (services | ||
| 159 | (append | ||
| 160 | (list | ||
| 161 | |||
| 162 | (service elogind-service-type) | ||
| 163 | (service openssh-service-type) | ||
| 164 | (service network-manager-service-type) | ||
| 165 | (service slim-service-type) | ||
| 166 | (service tlp-service-type | ||
| 167 | (tlp-configuration | ||
| 168 | (cpu-boost-on-ac? #t) | ||
| 169 | (wifi-pwr-on-bat? #t))) | ||
| 170 | (bluetooth-service #:auto-enable? #t) | ||
| 171 | (service docker-service-type) | ||
| 172 | (service wpa-supplicant-service-type)) | ||
| 173 | (service libvirt-service-type | ||
| 174 | (libvirt-configuration | ||
| 175 | (unix-sock-group "libvirt") | ||
| 176 | (tls-port "16555"))) | ||
| 177 | (set-xorg-configuration | ||
| 178 | (xorg-configuration | ||
| 179 | (keyboard-layout keyboard-layout))) | ||
| 180 | |||
| 181 | %base-services)) | ||
| 182 | |||
| 183 | #+end_src | ||
| 184 | |||
| 185 | *Users Accounts* | ||
| 186 | #+begin_src scheme :noweb-ref users :noweb yes | ||
| 187 | |||
| 188 | ;; Users | ||
| 189 | (users (cons (user-account | ||
| 190 | (name "jakub") | ||
| 191 | (comment "Jakub Dlugosz") | ||
| 192 | (group "users") | ||
| 193 | (home-directory "/home/jakub") | ||
| 194 | (supplementary-groups '( | ||
| 195 | "wheel" | ||
| 196 | "netdev" | ||
| 197 | "kvm" | ||
| 198 | "tty" | ||
| 199 | "input" | ||
| 200 | "docker" | ||
| 201 | "lp" | ||
| 202 | "audio" | ||
| 203 | "video"))) | ||
| 204 | %base-user-accounts)) | ||
| 205 | |||
| 206 | #+end_src | ||
| 207 | |||
| 208 | *Base operating system* | ||
| 209 | #+begin_src scheme :tangle .config/guix/systems/base-system.scm :noweb yes | ||
| 210 | |||
| 211 | (define-public base-operating-system | ||
| 212 | (operating-system | ||
| 213 | (host-name "base") | ||
| 214 | (timezone "Europe/Warsaw") | ||
| 215 | (locale "en_US.utf8") | ||
| 216 | (keyboard-layout (keyboard-layout "pl")) | ||
| 217 | |||
| 218 | ;; Use non-free Linux and firmware | ||
| 219 | ;; (kernel linux) | ||
| 220 | ;; (firmware (list linux-firmware)) | ||
| 221 | ;; (initrd microcode-initrd) | ||
| 222 | |||
| 223 | (bootloader (bootloader-configuration | ||
| 224 | (bootloader grub-efi-bootloader) | ||
| 225 | (targets "/boot/efi"))) | ||
| 226 | ;; (keyboard-layout keyboard-layout))) | ||
| 227 | |||
| 228 | ;; Guix doesn't like it when there isn't a file-systems | ||
| 229 | ;; entry, so add one that is meant to be overridden | ||
| 230 | (file-systems (cons* | ||
| 231 | (file-system | ||
| 232 | (mount-point "/tmp") | ||
| 233 | (device "none") | ||
| 234 | (type "tmpfs") | ||
| 235 | (check? #f)) | ||
| 236 | %base-file-systems)) | ||
| 237 | <<users>> | ||
| 238 | <<packages>> | ||
| 239 | <<services>> | ||
| 240 | ;; Allow resolution of '.local' host names with mDNS | ||
| 241 | (name-service-switch %mdns-host-lookup-nss))) | ||
| 242 | |||
| 243 | #+end_src | ||
| 244 | |||
| 245 | ** Systems | ||
| 246 | *** Viking | ||
| 247 | |||
| 248 | #+begin_src scheme :tangle .config/guix/systems/viking.scm | ||
| 249 | (define-module (viking) | ||
| 250 | #:use-module (base-system) | ||
| 251 | #:use-module (gnu)) | ||
| 252 | |||
| 253 | (operating-system | ||
| 254 | (inherit base-operating-system) | ||
| 255 | (host-name "viking") | ||
| 256 | |||
| 257 | (bootloader | ||
| 258 | (bootloader-configuration | ||
| 259 | (bootloader grub-bootloader) | ||
| 260 | (target "/dev/sda"))) | ||
| 261 | |||
| 262 | (mapped-devices | ||
| 263 | (list (mapped-device | ||
| 264 | (source | ||
| 265 | (uuid "75a1ebd7-13c2-442f-80ff-1b5e59522e29")) | ||
| 266 | (target "cryptroot") | ||
| 267 | (type luks-device-mapping)))) | ||
| 268 | |||
| 269 | (file-systems | ||
| 270 | (cons* (file-system | ||
| 271 | (mount-point "/") | ||
| 272 | (device "/dev/mapper/cryptroot") | ||
| 273 | (type "ext4") | ||
| 274 | (dependencies mapped-devices)) | ||
| 275 | %base-file-systems))) | ||
| 276 | #+end_src | ||
