Compare commits

..

5 commits

Author SHA1 Message Date
a1d30ad8f3
refactor installer, add curiass system 2024-10-22 21:02:08 -04:00
26b671600e
port cow store from guix internal 2024-10-22 20:57:13 -04:00
c114be4ebd
gamescope 2024-10-22 20:56:38 -04:00
49cac9e6fd
dbus for hyprland 2024-10-22 08:33:13 -04:00
56e22e6d25
add ja_JP locale 2024-10-22 08:33:01 -04:00
9 changed files with 471 additions and 267 deletions

View file

@ -89,7 +89,7 @@ while true; do
"h") "h")
echo "Launching Hyprland..." echo "Launching Hyprland..."
export XDG_CURRENT_DESKTOP=Hyprland export XDG_CURRENT_DESKTOP=Hyprland
exec Hyprland &> $HOME/.log/Hyprland exec dbus-run-session Hyprland &> $HOME/.log/Hyprland
;; ;;
"t") "t")
exec cage -s kitty -- -o font_size=14 &> $HOME/.log/kitty exec cage -s kitty -- -o font_size=14 &> $HOME/.log/kitty

View file

@ -124,6 +124,7 @@
easyeffects easyeffects
firefox-wayland-new firefox-wayland-new
librewolf-new librewolf-new
gamescope
; gtk ; gtk
lavanda-gtk-theme lavanda-gtk-theme

View file

@ -1,12 +1,30 @@
(define-module (freya packages wm) (define-module (freya packages wm)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages gl)
#:use-module (gnu packages wm) #:use-module (gnu packages wm)
#:use-module (gnu packages stb)
#:use-module (gnu packages gcc)
#:use-module (gnu packages sdl)
#:use-module (gnu packages xorg)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages maths)
#:use-module (gnu packages image)
#:use-module (gnu packages cmake)
#:use-module (gnu packages linux)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages python)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages benchmark)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages version-control)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build utils) #:use-module (guix build utils)
#:use-module (guix build-system meson)
#:use-module (guix utils)) #:use-module (guix utils))
@ -44,23 +62,163 @@
#:configure-flags #~(list "--wrap-mode=nodownload" "-Dexperimental=true"))))) #:configure-flags #~(list "--wrap-mode=nodownload" "-Dexperimental=true")))))
;(define-public libliftoff (define-public vkroots
; (package (let ((commit "d5ef31abc7cb5c69aee4bcb67b10dd543c1ff7ac"))
; (name "libliftoff") (package
; (version "0.1.0") (name "vkroots")
; (source (origin (version (git-version "" "0" commit))
; (method url-fetch) (source
; (uri (string-append "https://github.com/emersion/libliftoff" (origin
; "/archive/refs/tags/v" version ".tar.gz")) (method git-fetch)
; (sha256 (uri (git-reference
; (base32 (url "https://github.com/misyltoad/vkroots")
; "17ssbjbv8njgvfha8zsx4nixpi5xxl1rwvk0lcacgqk0nmjyb23s")))) (commit commit)))
; (build-system meson-build-system) (sha256
; (native-inputs (list gcc-13 (base32
; pkg-config "0g2mh8l0xzxzr4yjyafzv76n7jk9043dcbf5mpqwpwmjx88m5nc0"))
; cmake-minimal-3.30.0 (file-name (git-file-name name version))))
; libdrm)) (arguments (list
; (home-page "https://github.com/emersion/libliftoff") #:phases #~(modify-phases %standard-phases
; (synopsis "Lightweight KMS plane library") (add-after 'unpack 'patch-vulkan
; (description "") (lambda _
; (license license:expat))) (substitute* "gen/make_vkroots"
(("\\.\\.") (getcwd)))))
(add-before 'install 'gen-vkroots
(lambda _
(invoke "python3"
"../source/gen/make_vkroots"
"-x"
(string-append
#$(this-package-native-input "vulkan-headers")
"/share/vulkan/registry/vk.xml")))))))
(build-system meson-build-system)
(native-inputs (list python vulkan-headers))
(home-page "https://github.com/misyltoad/vkroots")
(description "A stupid simple method of making Vulkan layers, at home! ")
(synopsis "A stupid simple method of making Vulkan layers, at home! ")
(license license:expat))))
(define-public libliftoff-0.4
(package
(inherit libliftoff)
(name "libliftoff")
(version "0.4.1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.freedesktop.org/emersion/libliftoff")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1ikjp638d655ycaqkdnzhb12d29kkbb3a46lqhbhsfc8vsqj3z1l"))))))
(define reshade-for-gamescope
(let ((commit "4245743a8c41abbe3dc73980c1810fe449359bf1"))
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Joshua-Ashton/reshade")
(commit commit)))
(file-name (git-file-name "reshade" commit))
(sha256
(base32 "1bb5392dfiri8nrxvck1w2jxva8m9xzrgi16rvnvg96l493a538y")))))
(define-public gamescope
(package
(name "gamescope")
(version "3.14.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ValveSoftware/gamescope")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0x7gh1rr2ismqfkaa4wm7025acjpgmims41iwzdcps5pg8nxmmhh"))))
(build-system meson-build-system)
(arguments
(list #:configure-flags #~(list "-Dpipewire=enabled"
"-Denable_openvr_support=false"
"-Dforce_fallback_for=[]"
(string-append "-Dc_args=-DHWDATA_PNP_IDS=\""
#$(this-package-native-input "hwdata")
"/share/hwdata/pnp.ids\""))
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-deps
(lambda _
; copy reshade
(delete-file-recursively "src/reshade")
(copy-recursively #$reshade-for-gamescope "src/reshade")
; path /usr
(substitute* "src/reshade_effect_manager.cpp"
(("/usr") #$output))
; path meson.build
(substitute* "src/meson.build"
;; patch stb
(("dependency\\('stb'\\)")
(format #f "declare_dependency(include_directories: ['~a'])"
(string-join
'#$(map (lambda (label) (this-package-native-input label))
(list "stb-image"
"stb-image-resize"
"stb-image-write"))
"','")))
;; patch libdisplay-info
(("< 0.2.0")
(string-append "<= " #$(package-version (this-package-input "libdisplay-info"))))
;(("reshade/") (string-append #$reshade-for-gamescope "/"))
(("../thirdparty/SPIRV-Headers") #$(this-package-native-input "spirv-headers")))
;; include <limits> and <cstdint>
(substitute* (find-files "src" "\\.hpp$")
(("#pragma once" pragma)
(string-append pragma
"\n#include <limits>"
"\n#include <cstdint>")))
)))))
(native-inputs (list gcc-13
benchmark
glslang
hwdata
pkg-config
stb-image
stb-image-resize
stb-image-write
spirv-headers
vkroots
vulkan-headers
wayland-protocols))
(inputs (list gcc-13
glm
libavif
libcap
libdisplay-info
libdrm
libinput
libliftoff-0.4
libx11
libxcomposite
libxcursor
libxdamage
libxext
libxkbcommon
libxmu
libxrender
libxres
libxt
libxtst
pipewire
sdl2
vulkan-loader
wayland
wlroots))
(home-page "https://github.com/ValveSoftware/gamescope")
(description "SteamOS session compositing window manager")
(synopsis "SteamOS session compositing window manager")
(license license:bsd-2)))

View file

@ -0,0 +1,62 @@
(define-module (freya services cow)
#:use-module (gnu services shepherd)
#:use-module (guix modules)
#:use-module (gnu))
; guix doesnt export the cow store
; bruch >:(
(define %backing-directory
;; Sub-directory used as the backing store for copy-on-write.
"/tmp/guix-inst")
(define cow-store-service-type
(shepherd-service-type
'cow-store
(lambda _
(define (import-module? module)
;; Since we don't use deduplication support in 'populate-store', don't
;; import (guix store deduplication) and its dependencies, which
;; includes Guile-Gcrypt.
(and (guix-module-name? module)
(not (equal? module '(guix store deduplication)))))
(shepherd-service
(requirement '(root-file-system user-processes))
(provision '(cow-store))
(documentation
"Make the store copy-on-write, with writes going to \
the given target.")
;; This is meant to be explicitly started by the user.
(auto-start? #f)
(modules `((gnu build install)
,@%default-modules))
(start
(with-imported-modules (source-module-closure
'((gnu build install))
#:select? import-module?)
#~(case-lambda
((target)
(mount-cow-store target #$%backing-directory)
target)
(else
;; Do nothing, and mark the service as stopped.
#f))))
(stop #~(lambda (target)
;; Delete the temporary directory, but leave everything
;; mounted as there may still be processes using it since
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
;; service will unmount TARGET eventually.
(delete-file-recursively
(string-append target #$%backing-directory))))))
(description "Make the store copy-on-write, with writes going to \
the given target.")))
(define-public (cow-store-service)
"Return a service that makes the store copy-on-write, such that writes go to
the user's target storage device rather than on the RAM disk."
;; See <http://bugs.gnu.org/18061> for the initial report.
(service cow-store-service-type 'mooooh!))

View file

@ -1,82 +1,109 @@
(define-module (freya system) (define-module (freya system)
#:use-module (srfi srfi-1)
#:use-module (gnu) #:use-module (gnu)
#:use-module (gnu system setuid)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages admin) #:use-module (gnu packages linux)
#:use-module (gnu packages avahi) #:use-module (gnu packages libusb)
#:use-module (gnu packages shells) #:use-module (gnu packages shells)
#:use-module (gnu packages tls)
#:use-module (gnu packages gtk)
#:use-module (gnu packages gl)
#:use-module (gnu packages vpn)
#:use-module (gnu packages security-token) #:use-module (gnu packages security-token)
#:use-module (gnu packages virtualization)
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services linux)
#:use-module (gnu services authentication)
#:use-module (gnu services security-token)
#:use-module (gnu services cups)
#:use-module (gnu services desktop)
#:use-module (gnu services networking)
#:use-module (gnu services xorg)
#:use-module (gnu services ssh) #:use-module (gnu services ssh)
#:use-module (gnu services nix) #:use-module (gnu services nix)
#:use-module (gnu services sound) #:use-module (gnu services cups)
#:use-module (gnu services docker) #:use-module (gnu services dbus)
#:use-module (gnu services avahi) #:use-module (gnu services avahi)
#:use-module (gnu services linux)
#:use-module (gnu services spice) #:use-module (gnu services spice)
#:use-module (gnu services docker)
#:use-module (gnu services desktop)
#:use-module (gnu services networking)
#:use-module (gnu services security-token)
#:use-module (gnu services virtualization) #:use-module (gnu services virtualization)
#:use-module (gnu system locale)
#:use-module (gnu system setuid)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (nongnu packages linux) #:use-module (nongnu packages linux)
#:use-module (srfi srfi-1) #:use-module (freya packages qt)
#:use-module (freya bootloader uki)
#:use-module (freya packages certs) #:use-module (freya packages certs)
#:use-module (freya packages linux) #:use-module (freya packages linux)
#:use-module (freya packages qt)
#:use-module (freya packages wm)
#:use-module (freya packages pulseaudio) #:use-module (freya packages pulseaudio)
#:use-module (freya packages networking) #:use-module (freya packages virtualization)
#:use-module (freya packages virtualization)) #:use-module (freya bootloader uki))
;; locale
(define-public %freya-user-accounts (define-public %base-freya-locale
(cons* (user-account (list (locale-definition
(name "freya") (name "en_US.utf8")
(comment "Freya Murphy") (source "en_US")
(group "users") (charset "UTF-8"))
(home-directory "/home/freya") (locale-definition
(shell (file-append zsh "/bin/zsh")) (name "ja_JP.utf8")
(supplementary-groups '("wheel" (source "ja_JP")
(charset "UTF-8"))))
;; user groups
(define %base-freya-user-groups (list "wheel"
"audio" "audio"
"lp" "video"
"netdev"
"tty"))
(define %desktop-freya-user-groups
(append
;; append desktop freya groups
(list "lp"
"docker" "docker"
"plugdev" "plugdev"
"libvirt" "libvirt"
"kvm" "kvm")
"netdev" ;; append base freya groups
"video" %base-freya-user-groups))
"tty")))
%base-user-accounts))
;; user accounts
(define-public %freya-base-packages (define freya-user-accounts
(lambda (groups)
(cons* (user-account
(name "freya")
(comment "Freya Murphy")
(uid 1000)
(group "users")
(shell (file-append zsh "/bin/zsh"))
(home-directory "/home/freya")
(create-home-directory? #t)
(supplementary-groups groups))
%base-user-accounts)))
(define-public %base-freya-user-accounts
(freya-user-accounts %base-freya-user-groups))
(define-public %desktop-freya-user-accounts
(freya-user-accounts %desktop-freya-user-groups))
;; packages
(define-public %virt-freya-packages
(append (append
;; append needed virt packages
;; append guix and nonguix base packages
(specifications->packages (list ; video audio (specifications->packages (list ; video audio
"mesa" "mesa"
"mesa-utils" "mesa-utils"
; firmware
"sof-firmware"
"amd-microcode"
"v4l2loopback-linux-module"
; terrminal ; terrminal
"alsa-utils" "alsa-utils"
"vim" "vim"
"neovim" "neovim"
; file sys
"parted"
"gptfdisk"
"ddrescue"
"cryptsetup"
"dosfstools"
"btrfs-progs"
"e2fsprogs"
"f2fs-tools"
; basic utils ; basic utils
"curl" "curl"
"htop" "htop"
@ -95,18 +122,26 @@
"ncurses" "ncurses"
"jq" "jq"
"openssl")) "openssl"))
;; append freyanet certs
;; append certs
(list freya-ca-certs) (list freya-ca-certs)
;; append guix base packages ;; append guix base packages
%base-packages)) %base-packages))
(define-public %freya-packages (define-public %base-freya-packages
(append (append
;; append needed base packages
(specifications->packages (list ; firmware
"sof-firmware"
"amd-microcode"
"v4l2loopback-linux-module"))
;; apend virt freya packages
%virt-freya-packages))
;; append guix and nonguix packages
(define-public %desktop-freya-packages
(append
;; append needed desktop packages
(specifications->packages (list ; gtk (specifications->packages (list ; gtk
"wxwidgets" "wxwidgets"
"gtk+" "gtk+"
@ -114,13 +149,11 @@
"gnome-themes-extra" "gnome-themes-extra"
"adwaita-icon-theme" "adwaita-icon-theme"
"hicolor-icon-theme" "hicolor-icon-theme"
; wayland x11 ; wayland x11
"wl-clipboard" "wl-clipboard"
"libx11" "libx11"
"xorg-server-xwayland" "xorg-server-xwayland"
"xf86-video-qxl" "xf86-video-qxl"
; video audio ; video audio
"glu" "glu"
"libglvnd" "libglvnd"
@ -133,11 +166,9 @@
"sdl2" "sdl2"
"openal" "openal"
"freealut" "freealut"
; xdg ; xdg
"xdg-utils" "xdg-utils"
"xdg-desktop-portal" "xdg-desktop-portal"
; system daemons ; system daemons
"docker" "docker"
"containerd" "containerd"
@ -147,74 +178,63 @@
"brightnessctl" "brightnessctl"
"wireguard-tools" "wireguard-tools"
"libpcap" "libpcap"
; fonts ; fonts
"font-fira-mono" "font-fira-mono"
"font-google-noto-sans-cjk" "font-google-noto-sans-cjk"
"font-jetbrains-mono" "font-jetbrains-mono"
"font-dejavu" "font-dejavu"
; misc ; misc
"qemu")) "qemu"))
;; append custom packages ;; append custom packages
(list ; qt (list ; qt
qt5-styleplugins qt5-styleplugins
qt6gtk2 qt6gtk2
; bluetooth ; bluetooth
bluez-new bluez-new
; pactl ; pactl
pulseaudio-new pulseaudio-new
; system ; system
virt-manager-ovmf) virt-manager-ovmf)
;; append base freya backages
%base-freya-packages))
;; append freya base backages ;; services
%freya-base-packages))
(define-public %base-freya-services
(define-public %freya-base-services
(append (append
;; append needed base services
(list ; pam (list ; mtp
(simple-service 'mtp udev-service-type (list libmtp))
; polkit
polkit-wheel-service
; font config
fontconfig-file-system-service
; networking
(service ntp-service-type)
(service network-manager-service-type)
(service wpa-supplicant-service-type)
(service modem-manager-service-type)
(service usb-modeswitch-service-type)
; dbus
(service upower-service-type)
(service polkit-service-type)
(service pam-limits-service-type) (service pam-limits-service-type)
(service elogind-service-type)
(service dbus-root-service-type)
; openssh ; openssh
(service openssh-service-type)) (service openssh-service-type))
;; append guix base services
%base-services))
; base guix desktop services (define-public %desktop-freya-services
(modify-services %desktop-services
(guix-service-type config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "../../certs/non-guix.pub"))
%default-authorized-guix-keys))))
(udev-service-type config =>
(udev-configuration
(inherit config)))
(delete pulseaudio-service-type)
(delete gdm-service-type)
(delete avahi-service-type)
(delete alsa-service-type)
(delete screen-locker-service-type))))
(define-public %freya-services
(append (append
%freya-base-services ;; append needed desktop services
(list ; nix (list ; nix
(service nix-service-type) (service nix-service-type)
; wirerguard ; wirerguard
(simple-service 'wireguard-module (simple-service 'wireguard-module
kernel-module-loader-service-type kernel-module-loader-service-type
'("wireguard")) '("wireguard"))
; printing ; printing
(service cups-service-type (service cups-service-type
(cups-configuration (cups-configuration
@ -223,11 +243,9 @@
(avahi-configuration (avahi-configuration
(publish? #f) (publish? #f)
(publish-workstation? #f))) (publish-workstation? #f)))
; docker ; docker
(service docker-service-type) (service docker-service-type)
(service containerd-service-type) (service containerd-service-type)
; libvirt ; libvirt
(service libvirt-service-type (service libvirt-service-type
(libvirt-configuration (libvirt-configuration
@ -236,57 +254,89 @@
(tls-port "16555"))) (tls-port "16555")))
(service virtlog-service-type) (service virtlog-service-type)
(service spice-vdagent-service-type) (service spice-vdagent-service-type)
; bluetooth
; audio
(service bluetooth-service-type (service bluetooth-service-type
(bluetooth-configuration (bluetooth-configuration
(bluez bluez-new) (bluez bluez-new)
(experimental #t) (experimental #t)
(fast-connectable? #t))) (fast-connectable? #t)))
; yubikey ; yubikey
(service pcscd-service-type) (service pcscd-service-type)
(udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))))) (udev-rules-service 'fido2 libfido2 #:groups '("plugdev")))
;; append freya base services
%base-freya-services))
;; setuid programs
(define-public %freya-setuid-programs (define-public %base-freya-setuid-programs
(append (list ; doas (append
;; append needed setuid programs
(list ; doas
(file-like->setuid-program (file-like->setuid-program
(file-append (file-append
(specification->package "opendoas") (specification->package "opendoas")
"/bin/doas"))) "/bin/doas")))
; base setuid programs ;; append guix setuid programs
%setuid-programs)) %setuid-programs))
;; file systems
(define-public %freya-file-systems (define-public %base-freya-file-systems
(cons* (cons*
; /tmp ;; /tmp
(file-system (file-system
(mount-point "/tmp") (mount-point "/tmp")
(device "none") (device "none")
(type "tmpfs") (type "tmpfs")
(check? #f)) (check? #f))
;; append guix base file systems
%base-file-systems)) %base-file-systems))
;; firmware
(define-public base-operating-system (define-public %base-freya-firmware
(append
;; append needed base firmware
(list linux-firmware
sof-firmware
amd-microcode)
;; append guix base firmware
%base-firmware))
;; operating system
(define-public %base-freya-operating-system
(operating-system (operating-system
(kernel linux-6.11) (kernel linux-6.11)
(firmware (list linux-firmware (firmware %base-freya-firmware)
amd-microcode (locale "en_US.UTF-8")
sof-firmware)) (locale-definitions %base-freya-locale)
(locale "en_US.utf8")
(timezone "America/New_York") (timezone "America/New_York")
(keyboard-layout (keyboard-layout "us")) (keyboard-layout (keyboard-layout "us"))
(host-name "ThisWillChange") (host-name "guix")
(users %freya-user-accounts) (users %base-freya-user-accounts)
(packages %freya-packages) (packages %base-freya-packages)
(services %freya-services) (services %base-freya-services)
(name-service-switch %mdns-host-lookup-nss) (name-service-switch %mdns-host-lookup-nss)
(setuid-programs %freya-setuid-programs) (setuid-programs %base-freya-setuid-programs)
(file-systems %freya-file-systems) (file-systems %base-freya-file-systems)
(bootloader (bootloader-configuration (bootloader (bootloader-configuration
(bootloader uefi-uki-bootloader) (bootloader uefi-uki-bootloader)
(targets (list "/boot/efi")) (targets (list "/boot/efi"))
(keyboard-layout keyboard-layout))))) (keyboard-layout keyboard-layout)))))
(define-public %virt-freya-operating-system
(operating-system
(inherit %base-freya-operating-system)
(kernel linux-libre-lts)
(firmware %base-firmware)
(packages %virt-freya-packages)))
(define-public %desktop-freya-operating-system
(operating-system
(inherit %base-freya-operating-system)
(users %desktop-freya-user-accounts)
(packages %desktop-freya-packages)
(services %desktop-freya-services)))

24
systems/curiass.scm Normal file
View file

@ -0,0 +1,24 @@
(use-modules (freya system)
(gnu))
(operating-system
(inherit %virt-freya-operating-system)
(host-name "curiass")
(initrd-modules (cons* "virtio_scsi"
"mptspi"
(operating-system-initrd-modules
%virt-freya-operating-system)))
(file-systems (cons* (file-system
(mount-point "/")
(device (uuid "be5f9a76-8295-4710-95b1-370ae3eb0d95"))
(type "btrfs"))
(file-system
(mount-point "/boot")
(device (uuid "ACB1-EE58"
'fat32))
(type "vfat"))
(operating-system-file-systems
%virt-freya-operating-system)))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda"))))

View file

@ -1,110 +1,22 @@
; base system for creating installer images ; base system for creating installer images
(use-modules (freya system) (use-modules (freya system)
(gnu packages disk) (freya services cow)
(gnu packages linux)
(gnu packages cryptsetup)
(gnu packages file-systems)
(gnu services shepherd)
(guix modules)
(gnu)) (gnu))
; copy over installer disk utilites
(define %installer-disk-utilities
(list parted gptfdisk ddrescue
lvm2-static
cryptsetup mdadm
dosfstools
btrfs-progs
e2fsprogs
f2fs-tools
jfsutils
xfsprogs))
; copy over cow store
(define %backing-directory
;; Sub-directory used as the backing store for copy-on-write.
"/tmp/guix-inst")
(define cow-store-service-type
(shepherd-service-type
'cow-store
(lambda _
(define (import-module? module)
;; Since we don't use deduplication support in 'populate-store', don't
;; import (guix store deduplication) and its dependencies, which
;; includes Guile-Gcrypt.
(and (guix-module-name? module)
(not (equal? module '(guix store deduplication)))))
(shepherd-service
(requirement '(root-file-system user-processes))
(provision '(cow-store))
(documentation
"Make the store copy-on-write, with writes going to \
the given target.")
;; This is meant to be explicitly started by the user.
(auto-start? #f)
(modules `((gnu build install)
,@%default-modules))
(start
(with-imported-modules (source-module-closure
'((gnu build install))
#:select? import-module?)
#~(case-lambda
((target)
(mount-cow-store target #$%backing-directory)
target)
(else
;; Do nothing, and mark the service as stopped.
#f))))
(stop #~(lambda (target)
;; Delete the temporary directory, but leave everything
;; mounted as there may still be processes using it since
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
;; service will unmount TARGET eventually.
(delete-file-recursively
(string-append target #$%backing-directory))))))
(description "Make the store copy-on-write, with writes going to \
the given target.")))
(define (cow-store-service)
"Return a service that makes the store copy-on-write, such that writes go to
the user's target storage device rather than on the RAM disk."
;; See <http://bugs.gnu.org/18061> for the initial report.
(service cow-store-service-type 'mooooh!))
; installer system ; installer system
(operating-system (operating-system
(inherit base-operating-system) (inherit %base-freya-operating-system)
(host-name "installer") (host-name "installer")
(file-systems (append %base-live-file-systems
(file-systems
(append %base-live-file-systems
%base-file-systems)) %base-file-systems))
(users (list (user-account
(name "root")
(group "root")
(supplementary-groups '("wheel")) ; allow use of sudo
(password "")
(comment "root"))))
(pam-services (pam-services
;; Explicitly allow for empty passwords. ;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t)) (base-pam-services #:allow-empty-passwords? #t))
(services (cons* (cow-store-service)
(packages (append %installer-disk-utilities (operating-system-services
%freya-base-packages)) %base-freya-operating-system)))
(services (append %freya-base-services
(list (cow-store-service))))
(bootloader (bootloader-configuration (bootloader (bootloader-configuration
(bootloader grub-bootloader) (bootloader grub-bootloader)
(targets '("/dev/sda"))))) (targets '("/dev/sda")))))

View file

@ -2,15 +2,13 @@
(gnu)) (gnu))
(operating-system (operating-system
(inherit base-operating-system) (inherit %desktop-freya-operating-system)
(host-name "kaworu") (host-name "kaworu")
(mapped-devices (list (mapped-device (mapped-devices (list (mapped-device
(source (uuid (source (uuid
"89257280-202b-4565-b832-89f160d5e4e2")) "89257280-202b-4565-b832-89f160d5e4e2"))
(target "cryptroot") (target "cryptroot")
(type luks-device-mapping)))) (type luks-device-mapping))))
(file-systems (cons* (file-system (file-systems (cons* (file-system
(mount-point "/") (mount-point "/")
(device "/dev/mapper/cryptroot") (device "/dev/mapper/cryptroot")
@ -21,4 +19,5 @@
(device (uuid "099A-D668" (device (uuid "099A-D668"
'fat32)) 'fat32))
(type "vfat")) (type "vfat"))
%freya-file-systems))) (operating-system-file-systems
%desktop-freya-operating-system))))

View file

@ -2,19 +2,16 @@
(gnu)) (gnu))
(operating-system (operating-system
(inherit base-operating-system) (inherit %desktop-freya-operating-system)
(host-name "shinji") (host-name "shinji")
(mapped-devices (list (mapped-device (mapped-devices (list (mapped-device
(source (uuid (source (uuid
"ad489bfa-4280-44ea-8ad2-60347b516d60")) "ad489bfa-4280-44ea-8ad2-60347b516d60"))
(target "root") (target "root")
(type luks-device-mapping)))) (type luks-device-mapping))))
(swap-devices (list (swap-space (swap-devices (list (swap-space
(target (uuid (target (uuid
"57caa02d-8569-43e3-8bf9-09dd6f02b191"))))) "57caa02d-8569-43e3-8bf9-09dd6f02b191")))))
(file-systems (cons* (file-system (file-systems (cons* (file-system
(mount-point "/") (mount-point "/")
(device "/dev/mapper/root") (device "/dev/mapper/root")
@ -25,4 +22,5 @@
(device (uuid "6F93-6A0B" (device (uuid "6F93-6A0B"
'fat32)) 'fat32))
(type "vfat")) (type "vfat"))
%freya-file-systems))) (operating-system-file-systems
%desktop-freya-operating-system))))