diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-05 13:59:28 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-05 13:59:28 +0200 |
commit | d85086ed10809cf9864ed0321285d31c0b1f93f0 (patch) | |
tree | 773b7336100281f9f1e1902a4d7006d2731e114e | |
parent | 49e0dc10749a34f66a0935c1ded8f6fa6c4b346c (diff) | |
download | dotfiles-d85086ed10809cf9864ed0321285d31c0b1f93f0.tar.gz dotfiles-d85086ed10809cf9864ed0321285d31c0b1f93f0.zip |
Add polkit rules and home services to my guix config.
-rw-r--r-- | .bash_profile | 3 | ||||
-rwxr-xr-x | .bin/home-reconfigure | 3 | ||||
-rw-r--r-- | .config/guix/manifests/emacs.scm | 5 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-ui.el | 2 | ||||
-rw-r--r-- | guix/jd/desktops/base.scm | 142 | ||||
-rwxr-xr-x | guix/jd/desktops/berserker.scm | 37 | ||||
-rw-r--r-- | guix/jd/home-services/polkit.scm | 31 | ||||
-rw-r--r-- | guix/jd/services/polkit.scm | 21 |
8 files changed, 186 insertions, 58 deletions
diff --git a/.bash_profile b/.bash_profile index 608f031..e81307b 100644 --- a/.bash_profile +++ b/.bash_profile | |||
@@ -1,7 +1,6 @@ | |||
1 | # Honor per-interactive-shell startup file | 1 | # Honor per-interactive-shell startup file |
2 | if [ -f ~/.bashrc ]; then . ~/.bashrc; fi | 2 | if [ -f ~/.bashrc ]; then . ~/.bashrc; fi |
3 | 3 | ||
4 | export PATH="$HOME/bin:$PATH | ||
5 | export GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles | 4 | export GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles |
6 | 5 | ||
7 | for i in $GUIX_EXTRA_PROFILES/*; do | 6 | for i in $GUIX_EXTRA_PROFILES/*; do |
@@ -12,3 +11,5 @@ for i in $GUIX_EXTRA_PROFILES/*; do | |||
12 | fi | 11 | fi |
13 | unset profile | 12 | unset profile |
14 | done | 13 | done |
14 | |||
15 | . .profile | ||
diff --git a/.bin/home-reconfigure b/.bin/home-reconfigure new file mode 100755 index 0000000..70d1797 --- /dev/null +++ b/.bin/home-reconfigure | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | JD_HOME=1 sudo -E guix home -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm \ No newline at end of file | ||
diff --git a/.config/guix/manifests/emacs.scm b/.config/guix/manifests/emacs.scm index 0668120..79325bd 100644 --- a/.config/guix/manifests/emacs.scm +++ b/.config/guix/manifests/emacs.scm | |||
@@ -1,7 +1,6 @@ | |||
1 | ;; This file is auto-generated by Emacs function: jd/manifest-generate-to-file | 1 | ;; This file is auto-generated by Emacs function: jd/manifest-generate-to-file |
2 | (specifications->manifest | 2 | (specifications->manifest |
3 | '("emacs-guix" | 3 | '("emacs-desktop-environment" |
4 | "emacs-desktop-environment" | ||
5 | "emacs-exwm" | 4 | "emacs-exwm" |
6 | "emacs-mu4e-alert" | 5 | "emacs-mu4e-alert" |
7 | "mu" | 6 | "mu" |
@@ -42,9 +41,11 @@ | |||
42 | "emacs-hl-todo" | 41 | "emacs-hl-todo" |
43 | "emacs-diminish" | 42 | "emacs-diminish" |
44 | "emacs-doom-themes" | 43 | "emacs-doom-themes" |
44 | "font-terminus" | ||
45 | "emacs-undo-tree" | 45 | "emacs-undo-tree" |
46 | "emacs-hydra" | 46 | "emacs-hydra" |
47 | "emacs-general" | 47 | "emacs-general" |
48 | "emacs-guix" | ||
48 | "emacs" | 49 | "emacs" |
49 | "emacs-use-package" | 50 | "emacs-use-package" |
50 | )) | 51 | )) |
diff --git a/.emacs.d/jd/jd-ui.el b/.emacs.d/jd/jd-ui.el index 4c8e04b..1c44a65 100755 --- a/.emacs.d/jd/jd-ui.el +++ b/.emacs.d/jd/jd-ui.el | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | ;; Dotfiles --- Jakub Dlugosz emacs config | 1 | ;; Dotfiles --- Jakub Dlugosz emacs config |
3 | ;;; Commentary: | 2 | ;;; Commentary: |
4 | 3 | ||
@@ -12,6 +11,7 @@ | |||
12 | (menu-bar-mode -1) | 11 | (menu-bar-mode -1) |
13 | (set-fringe-mode 10) | 12 | (set-fringe-mode 10) |
14 | 13 | ||
14 | (jd/add-package-to-manifest "font-terminus") | ||
15 | (set-face-attribute 'default nil :font "Terminus" :height 100) | 15 | (set-face-attribute 'default nil :font "Terminus" :height 100) |
16 | 16 | ||
17 | (add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) | 17 | (add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) |
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))) | ||