summaryrefslogtreecommitdiffstats
path: root/guix/jd
diff options
context:
space:
mode:
Diffstat (limited to 'guix/jd')
-rw-r--r--guix/jd/desktops/base.scm142
-rwxr-xr-xguix/jd/desktops/berserker.scm37
-rw-r--r--guix/jd/home-services/polkit.scm31
-rw-r--r--guix/jd/services/polkit.scm21
4 files changed, 177 insertions, 54 deletions
diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm
index b9fc286..5f21c47 100644
--- a/guix/jd/desktops/base.scm
+++ b/guix/jd/desktops/base.scm
@@ -1,27 +1,66 @@
1(define-module (jd desktops base) 1(define-module (jd desktops base)
2 #:use-module (gnu)
3 #:use-module (jd packages vpn) 2 #:use-module (jd packages vpn)
3 #:use-module (jd home-services polkit)
4 #:use-module (jd services polkit)
5
6 #:use-module (gnu)
7 #:use-module (gnu home)
8 #:use-module (gnu home services)
9 #:use-module (gnu home services desktop)
10 #:use-module (gnu home services gnupg)
11 #:use-module (gnu services)
4 #:use-module (nongnu packages linux) 12 #:use-module (nongnu packages linux)
5 #:use-module (nongnu system linux-initrd)) 13 #:use-module (nongnu system linux-initrd))
6 14
7(use-package-modules wm gnome) 15(use-package-modules wm gnome gnupg)
8(use-service-modules cups desktop networking ssh xorg 16(use-service-modules cups desktop networking ssh xorg
9 docker virtualization pm sound) 17 docker virtualization pm sound)
10 18
19
20(define-public %jd-base-home-services
21 (list
22 (service home-redshift-service-type
23 (home-redshift-configuration
24 (location-provider 'manual)
25 (latitude 51.919438)
26 (longitude 19.145136))) ;; Poland
27
28 (simple-service 'some-useful-env-vars-service
29 home-environment-variables-service-type
30 `(("GTK_THEME" . "Adwaita:dark")
31 ("VISUAL" . "emacsclient -a \"emacs -Q\"")
32 ("EDITOR" . "emacsclient -a \"emacs -Q\"")
33 ("PATH" . "$HOME/.bin:$HOME/.npm-global/bin:$PATH")
34 ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share")))
35
36 (service home-gpg-agent-service-type
37 (home-gpg-agent-configuration
38 (ssh-support? #t)
39 (default-cache-ttl 28800)
40 (max-cache-ttl 28800)
41 (default-cache-ttl-ssh 28800)
42 (max-cache-ttl-ssh 28800)))
43
44 (service home-polkit-gnome-service-type)))
45
11(define-public %jd-base-user-accounts 46(define-public %jd-base-user-accounts
12 (cons* (user-account 47 (cons*
13 (name "jakub") 48 (user-account
14 (comment "Jakub Dlugosz") 49 (name "jakub")
15 (group "users") 50 (comment "Jakub Dlugosz")
16 (home-directory "/home/jakub") 51 (group "users")
17 (supplementary-groups '("wheel" 52 (home-directory "/home/jakub")
18 "netdev" 53 (supplementary-groups '("wheel" ;; sudo
19 "audio" 54 "netdev" ;; network devices
20 "docker" 55 "kvm"
21 "kvm" 56 "libvirt"
22 "libvirt" 57 "tty"
23 "video"))) 58 "input"
24 %base-user-accounts)) 59 "docker"
60 "audio" ;; control audio devices
61 "video" ;; access to webcam
62 )))
63 %base-user-accounts))
25 64
26(define-public %jd-base-packages 65(define-public %jd-base-packages
27 (append 66 (append
@@ -34,49 +73,44 @@
34 "git" 73 "git"
35 "xf86-input-libinput" 74 "xf86-input-libinput"
36 "intel-vaapi-driver" 75 "intel-vaapi-driver"
37 "libva-utils" 76 "libva-utils" ;; vainfo
38 "nss-certs")) 77 "nss-certs"))
39 %base-packages)) 78 %base-packages))
40 79
41(define-public %jd-base-services 80(define-public %jd-base-services
42 (append (list 81 (cons*
43 (service openssh-service-type) 82 (service openssh-service-type)
44 83
45 (service network-manager-service-type 84 (service network-manager-service-type
46 (network-manager-configuration 85 (network-manager-configuration
47 (vpn-plugins (list 86 (vpn-plugins (list
48 network-manager-pptp)))) 87 network-manager-pptp))))
49 88
50 (service bluetooth-service-type 89 (service bluetooth-service-type
51 (bluetooth-configuration 90 (bluetooth-configuration
52 (auto-enable? #t))) 91 (auto-enable? #t)))
53 92
54 (service docker-service-type) 93 (service docker-service-type)
55 (service libvirt-service-type 94 (service libvirt-service-type
56 (libvirt-configuration 95 (libvirt-configuration
57 (unix-sock-group "libvirt") 96 (unix-sock-group "libvirt")))
58 (tls-port "16555"))) 97
59 98 (service cups-service-type
60 (service sane-service-type) 99 (cups-configuration
61 (service cups-service-type 100 (web-interface? #t)))
62 (cups-configuration 101
63 (web-interface? #t))) 102 (service thermald-service-type)
64 103 (service tlp-service-type
65 (service thermald-service-type) 104 (tlp-configuration
66 (service tlp-service-type 105 (cpu-boost-on-ac? #t)
67 (tlp-configuration 106 (wifi-pwr-on-bat? #t)))
68 (cpu-boost-on-ac? #t) 107
69 (wifi-pwr-on-bat? #t))) 108 polkit-network-manager-service
70 109
71 (service slim-service-type (slim-configuration 110 (modify-services %desktop-services
72 (display ":0") 111 (delete network-manager-service-type))))
73 (vt "vt7")))) 112
74 113;; Odin is a base for my operating systems
75 (modify-services %desktop-services
76 (delete network-manager-service-type)
77 (delete gdm-service-type))))
78
79;; Odin is a base operating system
80(define-public odin-free 114(define-public odin-free
81 (operating-system 115 (operating-system
82 (locale "en_US.utf8") 116 (locale "en_US.utf8")
diff --git a/guix/jd/desktops/berserker.scm b/guix/jd/desktops/berserker.scm
new file mode 100755
index 0000000..37135dc
--- /dev/null
+++ b/guix/jd/desktops/berserker.scm
@@ -0,0 +1,37 @@
1(define-module (jd desktops berserker)
2 #:use-module (jd desktops base)
3 #:use-module (gnu)
4 #:use-module (gnu home))
5
6(define home
7 (home-environment
8 (services %jd-base-home-services)))
9
10(define system
11 (operating-system
12 (inherit odin-non-free)
13 (host-name "berserker")
14
15 (bootloader (bootloader-configuration
16 (bootloader grub-efi-bootloader)
17 (targets (list "/boot/efi"))))
18
19 (mapped-devices (list (mapped-device
20 (source (uuid
21 "ef754148-6f23-4d7e-92b4-7abbfe0ae201"))
22 (target "cryptroot")
23 (type luks-device-mapping))))
24
25 (file-systems (cons* (file-system
26 (mount-point "/boot/efi")
27 (device (uuid "695E-FE22"
28 'fat32))
29 (type "vfat"))
30 (file-system
31 (mount-point "/")
32 (device "/dev/mapper/cryptroot")
33 (type "ext4")
34 (dependencies mapped-devices)) %base-file-systems))))
35
36
37(if (getenv "JD_HOME") home system)
diff --git a/guix/jd/home-services/polkit.scm b/guix/jd/home-services/polkit.scm
new file mode 100644
index 0000000..699f2da
--- /dev/null
+++ b/guix/jd/home-services/polkit.scm
@@ -0,0 +1,31 @@
1(define-module (jd home-services polkit)
2 #:use-module (gnu packages)
3 #:use-module (gnu packages polkit)
4 #:use-module (gnu services)
5 #:use-module (gnu services configuration)
6 #:use-module (gnu home services)
7 #:use-module (gnu home services shepherd)
8 #:use-module (guix gexp))
9
10
11(define (polkit-gnome-profile-service config)
12 (specifications->packages '("polkit-gnome")))
13
14(define (polkit-gnome-shepherd-service config)
15 (list (shepherd-service
16 (documentation "Polkit gnome service.")
17 (provision '(polkit-gnome))
18 (start #~(make-forkexec-constructor
19 (list #$(file-append polkit-gnome
20 "/libexec/polkit-gnome-authentication-agent-1"))))
21 (stop #~(make-kill-destructor)))))
22
23(define-public home-polkit-gnome-service-type
24 (service-type (name 'home-polkit-gnome)
25 (extensions (list (service-extension home-profile-service-type
26 polkit-gnome-profile-service)
27 (service-extension home-shepherd-service-type
28 polkit-gnome-shepherd-service)))
29 (default-value #f)
30 (description "Runs the PolicyKit-gnome service.")))
31
diff --git a/guix/jd/services/polkit.scm b/guix/jd/services/polkit.scm
new file mode 100644
index 0000000..948500c
--- /dev/null
+++ b/guix/jd/services/polkit.scm
@@ -0,0 +1,21 @@
1(define-module (jd services polkit)
2 #:use-module (gnu services)
3 #:use-module (gnu services dbus)
4 #:use-module (gnu home services)
5 #:use-module (guix gexp))
6
7(define polkit-network-manager
8 (file-union
9 "polkit-wheel"
10 `(("share/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules"
11 ,(plain-file
12 "50-org.freedesktop.NetworkManager.rules"
13 "polkit.addRule(function(action, subject) {
14 if (action.id.indexOf(\"org.freedesktop.NetworkManager.\") == 0 &&
15 subject.isInGroup(\"netdev\")) {
16 return polkit.Result.YES;
17 }
18});")))))
19
20(define-public polkit-network-manager-service
21 (simple-service 'polkit-network-manager polkit-service-type (list polkit-network-manager)))