Advertisement
Guest User

Untitled

a guest
Nov 12th, 2023
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 6.83 KB | None | 0 0
  1. ;; ~/.system/nls/systems/base-system.scm
  2. (define-module (nls systems base-system)
  3.   #:use-module (srfi srfi-1)
  4.   ;;#:use-module (nls packages)
  5.   ;; #:use-module (nls services)
  6.   #:use-module (gnu)
  7.   #:use-module (gnu system)
  8.   #:use-module (gnu system nss)
  9.   #:use-module (gnu system setuid)
  10.   #:use-module (gnu packages linux)
  11.   #:use-module (gnu services)
  12.   )
  13.  
  14. (use-service-modules
  15.  ;; guix
  16.  ;; admin
  17.  ;; sysctl
  18.  pm
  19.  authentication
  20.  avahi
  21.  ;; dbus
  22.  cups
  23.  mcron
  24.  networking
  25.  ;; xorg
  26.  ssh
  27.  docker
  28.  ;; audio
  29.  virtualization
  30.  desktop
  31.  ;;base
  32.  )
  33.  
  34. (use-package-modules nfs certs shells ssh linux
  35.                      bash emacs gnome networking
  36.                      wm fonts libusb cups freedesktop
  37.                      file-systems version-control package-management)
  38.  
  39. ;; Indicate which modules to import to access the variables
  40. ;; used in this configuration.
  41. (use-modules (gnu)
  42.              (nls packages)
  43.                (gnu services sddm)
  44.              (gnu services)
  45.              (gnu services xorg)
  46.              ;; (gnu home services)          
  47.                (gnu packages linux)
  48.              (gnu system nss)
  49.              (gnu packages cups))
  50.  
  51. (define-public base-operating-system
  52.   (operating-system
  53.     (kernel linux-libre)
  54.     (host-name "nls-base")
  55.    
  56.     (locale "en_US.utf8")
  57.     (timezone "America/Chicago")
  58.     (keyboard-layout (keyboard-layout "us" #:options '("ctrl:swapcaps")))
  59.  
  60.  ;;;; PACKAGES
  61.     ;; Packages installed system-wide.  Users can also install packages
  62.     ;; under their own account: use 'guix search KEYWORD' to search
  63.     ;; for packages and 'guix install PACKAGE' to install a package.
  64.     ;;(packages (append my-packages %base-packages))
  65.     (packages %base-packages)
  66.  
  67.  ;;;; SERVICES
  68.     ;; Below is the list of system services.  To search for available
  69.     ;; services, run 'guix system search KEYWORD' in a terminal.
  70.     (services
  71.      (append
  72.       (list
  73.        (networking-services)
  74.        ;; (auth-services)
  75.        ;; (dbus-services)
  76.        ;; (power-services)
  77.        ;; (printing-services)
  78.        ;; (file-services)
  79.        ;; (display-services)
  80.        ;; (audio-services)
  81.        
  82.        ;; ;; The global fontconfig cache directory can sometimes contain
  83.        ;; ;; stale entries, possibly referencing fonts that have been GC'd,
  84.        ;; ;; so mount it read-only.
  85.        ;; fontconfig-file-system-service
  86.        
  87.        ;; ;; Add udev rules to give non-root access to MTP devices
  88.        ;; (simple-service 'mtp udev-service-type (list libmtp))
  89.  
  90.        ;; ;; Sync system clock with time servers
  91.        ;; (service ntp-service-type)
  92.  
  93.        ;; (service usb-modeswitch-service-type)
  94.        )
  95.  
  96.       %base-services
  97.       ))
  98.  
  99.     ;; Allow resolution of '.local' host names with mDNS
  100.     (name-service-switch %mdns-host-lookup-nss)
  101.  
  102.  ;;;; FILE-SYSTEMS
  103.     ;; Guix doesn't like it when there isn't a file-systems
  104.     ;; entry, so add one that is meant to be overridden
  105.     (file-systems (cons*
  106.                    (file-system
  107.                      (mount-point "/tmp")
  108.                      (device "none")
  109.                      (type "tmpfs")
  110.                      (needed-for-boot? #t)
  111.                      (check? #f))
  112.                    %base-file-systems))
  113.  
  114.  ;;;; BOOT
  115.     (bootloader (bootloader-configuration
  116.                  (bootloader grub-efi-bootloader)
  117.                  (targets (list "/boot/efi"))
  118.                  (keyboard-layout keyboard-layout)))
  119.  
  120.  ;;;; USERS
  121.     ;; The list of user accounts ('root' is implicit).
  122.     (users (cons* (user-account
  123.                    (name "nathan")
  124.                    (comment "Nathan Spaeth")
  125.                    (group "users")
  126.                    (home-directory "/home/nathan")
  127.                    (supplementary-groups
  128.                     '(
  129.                       ;; see https://wiki.debian.org/SystemGroups
  130.                       "wheel"    ;; sudo
  131.                       "netdev"   ;; network devices
  132.                       "audio"    ;; audio devices
  133.                       "video"    ;; video devices
  134.                       "lp"       ;; printers
  135.                       "scanner"  ;; scanners
  136.                       ;; "input" ;; full control over /dev/input devices
  137.                       ;;    see: https://www.reddit.com/r/linuxquestions/comments/bh4ex1/is_adding_a_user_to_input_group_secure/
  138.                       ;; "tty" ;; ability to write to terminals not owned by user
  139.                       "realtime" ;; realtime scheduling
  140.                       "kvm"
  141.                       ;; "libvirt"
  142.                       ;; "bluetooth"
  143.                       ;; "docker"
  144.                       )))
  145.                   %base-user-accounts))
  146.  
  147.     ;; Add the 'realtime' group
  148.     (groups (cons (user-group (system? #t) (name "realtime"))
  149.                   %base-groups))
  150.     )
  151.   )
  152.  
  153. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  154. ;; ~/.system/nls/systems/laptop.scm
  155. (define-module (nls systems laptop)
  156.   ;; #:use-module (nls systems base-system)
  157.   #:use-module (gnu home)
  158.   #:use-module (gnu packages file-systems)
  159.   #:use-module (gnu services)
  160.   #:use-module (gnu system)
  161.   #:use-module (gnu system uuid)
  162.   #:use-module (gnu system file-systems)
  163.   #:use-module (gnu system mapped-devices)
  164.   )
  165.  
  166. ;; (use-modules (nls systems base-system))
  167.  
  168. ;; (define home
  169. ;;   (home-environment
  170. ;;    (packages (gather-manifest-packages '('mail video games)))
  171. ;;    (services (cons* (service home-pipewire-service-type)
  172. ;;                     common-home-services))))
  173.  
  174. (define system
  175.   (operating-system
  176.     (inherit base-operating-system)
  177.     (host-name "deck")
  178.  
  179.     (swap-devices (list (swap-space
  180.                          (target (uuid
  181.                                   "6f9983af-e5c2-4d73-917b-8d81ad4afd2b")))))
  182.  
  183.     ;; The list of file systems that get "mounted".  The unique
  184.     ;; file system identifiers there ("UUIDs") can be obtained
  185.     ;; by running 'blkid' in a terminal.
  186.     (file-systems (cons* (file-system
  187.                            (mount-point "/")
  188.                            (device (uuid
  189.                                     "ce8a8c01-27e4-41a4-8537-b644fa1a296c"
  190.                                     'ext4))
  191.                            (type "ext4"))
  192.                          (file-system
  193.                            (mount-point "/boot/efi")
  194.                            (device (uuid "8056-FAF7"
  195.                                          'fat32))
  196.                            (type "vfat"))
  197.                          (file-system
  198.                            (mount-point "/home")
  199.                            (device (uuid
  200.                                     "c8a963fe-24d1-41b8-8b8a-8dcc06af1e4c"
  201.                                     'ext4))
  202.                            (type "ext4")) %base-file-systems))
  203.     ))
  204.  
  205. ;; Return home or system config based on environment variable
  206. ;; (if (getenv "RUNNING_GUIX_HOME") home system)
  207.  
  208.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement