diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/jd/desktops/base.scm | 90 | ||||
-rw-r--r-- | guix/jd/desktops/mimir.scm | 30 | ||||
-rw-r--r-- | guix/jd/desktops/viking.scm | 29 | ||||
-rwxr-xr-x | guix/jd/packages/patches/nm-pptp-autogen.patch | 15 | ||||
-rw-r--r-- | guix/jd/packages/vpn.scm | 144 | ||||
-rw-r--r-- | guix/jd/utils.scm | 25 |
6 files changed, 333 insertions, 0 deletions
diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm new file mode 100644 index 0000000..7618257 --- /dev/null +++ b/guix/jd/desktops/base.scm | |||
@@ -0,0 +1,90 @@ | |||
1 | (define-module (jd desktops base) | ||
2 | #:use-module (gnu) | ||
3 | #:use-module (jd packages vpn) | ||
4 | #:use-module (nongnu packages linux) | ||
5 | #:use-module (nongnu system linux-initrd)) | ||
6 | |||
7 | (use-package-modules wm gnome) | ||
8 | (use-service-modules cups desktop networking ssh xorg | ||
9 | docker virtualization pm sound) | ||
10 | |||
11 | ;; Odin is a base operating system | ||
12 | (define-public odin | ||
13 | (operating-system | ||
14 | (kernel linux) | ||
15 | (initrd microcode-initrd) | ||
16 | (firmware (list linux-firmware)) | ||
17 | |||
18 | (locale "en_US.utf8") | ||
19 | (timezone "Europe/Warsaw") | ||
20 | (keyboard-layout (keyboard-layout "pl")) | ||
21 | (host-name "odin") | ||
22 | |||
23 | (users (cons* (user-account | ||
24 | (name "jakub") | ||
25 | (comment "Jakub Dlugosz") | ||
26 | (group "users") | ||
27 | (home-directory "/home/jakub") | ||
28 | (supplementary-groups '("wheel" "netdev" "audio" "video"))) | ||
29 | %base-user-accounts)) | ||
30 | |||
31 | (packages (append (specifications->packages '("emacs" | ||
32 | "emacs-exwm" | ||
33 | |||
34 | "brightnessctl" | ||
35 | |||
36 | "bluez" | ||
37 | "bluez-alsa" | ||
38 | |||
39 | "xf86-input-libinput" | ||
40 | |||
41 | "nss-certs")) | ||
42 | |||
43 | %base-packages)) | ||
44 | |||
45 | (services | ||
46 | (append (list | ||
47 | (service xfce-desktop-service-type) | ||
48 | (service openssh-service-type) | ||
49 | (set-xorg-configuration | ||
50 | (xorg-configuration (keyboard-layout keyboard-layout))) | ||
51 | |||
52 | (service network-manager-service-type | ||
53 | (network-manager-configuration | ||
54 | (vpn-plugins (list | ||
55 | network-manager-pptp)))) | ||
56 | |||
57 | (service bluetooth-service-type | ||
58 | (bluetooth-configuration | ||
59 | (auto-enable? #t))) | ||
60 | |||
61 | (service docker-service-type) | ||
62 | (service libvirt-service-type | ||
63 | (libvirt-configuration | ||
64 | (unix-sock-group "libvirt") | ||
65 | (tls-port "16555"))) | ||
66 | |||
67 | (service sane-service-type) | ||
68 | (service cups-service-type | ||
69 | (cups-configuration | ||
70 | (web-interface? #t))) | ||
71 | |||
72 | (service thermald-service-type) | ||
73 | (service tlp-service-type | ||
74 | (tlp-configuration | ||
75 | (cpu-boost-on-ac? #t) | ||
76 | (wifi-pwr-on-bat? #t)))) | ||
77 | |||
78 | (modify-services %desktop-services | ||
79 | (delete network-manager-service-type)))) | ||
80 | (bootloader (bootloader-configuration | ||
81 | (bootloader grub-bootloader) | ||
82 | (targets (list "/boot/efi")) | ||
83 | (keyboard-layout keyboard-layout))) | ||
84 | |||
85 | (file-systems (cons* (file-system | ||
86 | (mount-point "/tmp") | ||
87 | (device "none") | ||
88 | (type "tmpfs") | ||
89 | (check? #f)) | ||
90 | %base-file-systems)))) | ||
diff --git a/guix/jd/desktops/mimir.scm b/guix/jd/desktops/mimir.scm new file mode 100644 index 0000000..a635831 --- /dev/null +++ b/guix/jd/desktops/mimir.scm | |||
@@ -0,0 +1,30 @@ | |||
1 | (define-module (jd desktops mimir) | ||
2 | #:use-module (jd desktops base) | ||
3 | #:use-module (gnu)) | ||
4 | |||
5 | |||
6 | (operating-system | ||
7 | (inherit odin) | ||
8 | (host-name "mimir") | ||
9 | |||
10 | (bootloader (bootloader-configuration | ||
11 | (bootloader grub-efi-bootloader) | ||
12 | (targets (list "/boot/efi")))) | ||
13 | |||
14 | |||
15 | (swap-devices (list (swap-space | ||
16 | (target (uuid | ||
17 | "658793cb-d374-426e-bcd5-00d032b003a0"))))) | ||
18 | |||
19 | (file-systems (cons* (file-system | ||
20 | (mount-point "/boot/efi") | ||
21 | (device (uuid "64D8-134F" | ||
22 | 'fat32)) | ||
23 | (type "vfat")) | ||
24 | (file-system | ||
25 | (mount-point "/") | ||
26 | (device (uuid | ||
27 | "1f9304b0-5623-4248-ab66-534b5ac85876" | ||
28 | 'ext4)) | ||
29 | (type "ext4")) %base-file-systems))) | ||
30 | |||
diff --git a/guix/jd/desktops/viking.scm b/guix/jd/desktops/viking.scm new file mode 100644 index 0000000..80ddb88 --- /dev/null +++ b/guix/jd/desktops/viking.scm | |||
@@ -0,0 +1,29 @@ | |||
1 | (define-module (jd desktops mimir) | ||
2 | #:use-module (jd desktops base) | ||
3 | #:use-module (gnu)) | ||
4 | |||
5 | (operating-system | ||
6 | (inherit odin) | ||
7 | (host-name "mimir") | ||
8 | |||
9 | (bootloader (bootloader-configuration | ||
10 | (bootloader grub-efi-bootloader) | ||
11 | (targets (list "/boot/efi")))) | ||
12 | |||
13 | |||
14 | (swap-devices (list (swap-space | ||
15 | (target (uuid | ||
16 | "658793cb-d374-426e-bcd5-00d032b003a0"))))) | ||
17 | |||
18 | (file-systems (cons* (file-system | ||
19 | (mount-point "/boot/efi") | ||
20 | (device (uuid "64D8-134F" | ||
21 | 'fat32)) | ||
22 | (type "vfat")) | ||
23 | (file-system | ||
24 | (mount-point "/") | ||
25 | (device (uuid | ||
26 | "1f9304b0-5623-4248-ab66-534b5ac85876" | ||
27 | 'ext4)) | ||
28 | (type "ext4")) %base-file-systems))) | ||
29 | |||
diff --git a/guix/jd/packages/patches/nm-pptp-autogen.patch b/guix/jd/packages/patches/nm-pptp-autogen.patch new file mode 100755 index 0000000..ef5c731 --- /dev/null +++ b/guix/jd/packages/patches/nm-pptp-autogen.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | diff --git a/autogen.sh b/autogen.sh | ||
2 | index 4ed20c6..34834a6 100755 | ||
3 | --- a/autogen.sh | ||
4 | +++ b/autogen.sh | ||
5 | @@ -13,8 +13,6 @@ PKG_NAME=NetworkManager-pptp | ||
6 | exit 1 | ||
7 | } | ||
8 | |||
9 | -(cd $srcdir; | ||
10 | - autoreconf --install --symlink && | ||
11 | - ./configure --enable-maintainer-mode --enable-more-warnings=error $@ | ||
12 | -) | ||
13 | +cd $srcdir | ||
14 | +autoreconf --install --symlink | ||
15 | |||
diff --git a/guix/jd/packages/vpn.scm b/guix/jd/packages/vpn.scm new file mode 100644 index 0000000..2542bae --- /dev/null +++ b/guix/jd/packages/vpn.scm | |||
@@ -0,0 +1,144 @@ | |||
1 | (define-module (jd packages vpn) | ||
2 | #:use-module (jd utils) | ||
3 | |||
4 | #:use-module (gnu packages) | ||
5 | #:use-module (gnu packages samba) ;; PPP | ||
6 | #:use-module (gnu packages perl) | ||
7 | #:use-module (gnu packages linux) | ||
8 | #:use-module (gnu packages gnome) | ||
9 | #:use-module (gnu packages glib) | ||
10 | #:use-module (gnu packages pkg-config) | ||
11 | #:use-module (gnu packages build-tools) | ||
12 | #:use-module (gnu packages gettext) | ||
13 | #:use-module (gnu packages autotools) | ||
14 | #:use-module (gnu packages gtk) | ||
15 | |||
16 | #:use-module (guix gexp) | ||
17 | #:use-module (guix git-download) | ||
18 | #:use-module ((guix licenses) #:prefix license:) | ||
19 | #:use-module (guix build-system) | ||
20 | #:use-module (guix build-system gnu) | ||
21 | #:use-module (guix utils) | ||
22 | #:use-module (guix packages) | ||
23 | #:use-module (guix download)) | ||
24 | |||
25 | |||
26 | |||
27 | (define-public pptp-client | ||
28 | (package | ||
29 | (name "pptp-client") | ||
30 | (version "1.10.0") | ||
31 | (source | ||
32 | (origin | ||
33 | (method git-fetch) | ||
34 | (uri (git-reference | ||
35 | (url "https://git.code.sf.net/p/pptpclient/git") | ||
36 | (commit version))) | ||
37 | (sha256 | ||
38 | (base32 "0qixs1dxrr1x4sgi22250231p9kqi8l8ifawxn6ws1d3p7mc6ggh")))) | ||
39 | |||
40 | (build-system gnu-build-system) | ||
41 | (arguments | ||
42 | '(#:phases | ||
43 | (modify-phases %standard-phases | ||
44 | (delete 'configure) | ||
45 | (delete 'check) | ||
46 | (add-before 'build 'change-location-of-pppd | ||
47 | (lambda* (#:key outputs #:allow-other-keys) | ||
48 | (substitute* "Makefile" | ||
49 | (("^PPPD.=.*$") | ||
50 | (string-append "PPPD = " | ||
51 | (which "pppd"))) | ||
52 | (("^IP.=.*$") | ||
53 | (string-append "IP = " | ||
54 | (which "ip")))))) | ||
55 | (replace 'install | ||
56 | (lambda* (#:key outputs #:allow-other-keys) | ||
57 | (let* ((out (assoc-ref outputs "out")) | ||
58 | (sbin (string-append out "/sbin"))) | ||
59 | (mkdir-p sbin) | ||
60 | (install-file "pptp" sbin) | ||
61 | #t)))))) | ||
62 | (inputs | ||
63 | (list perl)) | ||
64 | (native-inputs | ||
65 | (list ppp | ||
66 | iproute)) | ||
67 | (home-page "https://sourceforge.net/projects/pptpclient/") | ||
68 | (synopsis "PPTP-Client") | ||
69 | (description | ||
70 | "pptp is an implementation of the PPTP protocol for Linux and | ||
71 | other Unix systems.") | ||
72 | (license license:gpl2+) | ||
73 | (properties `((upstream-name . "NetworkManager-pptp"))))) | ||
74 | |||
75 | |||
76 | ;; ================================ | ||
77 | |||
78 | (define-public network-manager-pptp | ||
79 | (package | ||
80 | (name "network-manager-pptp") | ||
81 | (version "1.2.12") | ||
82 | (source | ||
83 | (origin | ||
84 | (method git-fetch) | ||
85 | (uri (git-reference | ||
86 | (url "https://gitlab.gnome.org/GNOME/NetworkManager-pptp.git") | ||
87 | (commit version))) | ||
88 | (file-name (git-file-name name version)) | ||
89 | |||
90 | (sha256 | ||
91 | (base32 "1prl14106kfl5x56v9adwi4wqwrh6k3chkimjpd0clwy3drywhcr")) | ||
92 | (patches (jd-search-patches "nm-pptp-autogen.patch")))) | ||
93 | |||
94 | (build-system gnu-build-system) | ||
95 | (arguments | ||
96 | '(#:configure-flags '("--enable-absolute-paths" | ||
97 | ; "--localstatedir=/var" | ||
98 | "--with-gtk4=yes") | ||
99 | #:phases | ||
100 | (modify-phases %standard-phases | ||
101 | (add-after 'configure 'patch-path | ||
102 | (lambda* (#:key inputs #:allow-other-keys #:rest args) | ||
103 | (let* ((pppd (search-input-file inputs "/sbin/pppd")) | ||
104 | (pptp (search-input-file inputs "/sbin/pptp")) | ||
105 | (modprobe (search-input-file inputs "/bin/modprobe")) | ||
106 | (pretty-pppd (string-append "\"" pppd "\"")) | ||
107 | (pretty-pptp (string-append "\"" pptp "\""))) | ||
108 | |||
109 | (substitute* "src/nm-pptp-service.c" | ||
110 | (("\"/usr/local/sbin/pppd\"") pretty-pppd) | ||
111 | (("\"/usr/sbin/pppd\"") pretty-pppd) | ||
112 | (("\"/sbin/pppd\"") pretty-pppd) | ||
113 | (("\"/usr/local/sbin/pptp\"") pretty-pptp) | ||
114 | (("\"/usr/sbin/pptp\"") pretty-pptp) | ||
115 | (("\"/sbin/pptp\"") pretty-pptp) | ||
116 | (("/sbin/modprobe") modprobe)))))))) | ||
117 | (native-inputs | ||
118 | (list intltool | ||
119 | `(,glib "bin") | ||
120 | glib | ||
121 | `(,gtk "bin") | ||
122 | pkg-config)) | ||
123 | (inputs | ||
124 | (list autoconf | ||
125 | autoconf-archive | ||
126 | gnulib | ||
127 | gnu-gettext | ||
128 | automake | ||
129 | gtk+ | ||
130 | gtk | ||
131 | kmod | ||
132 | libtool | ||
133 | network-manager | ||
134 | libnma | ||
135 | libsecret | ||
136 | ppp | ||
137 | pptp-client)) | ||
138 | (home-page "https://wiki.gnome.org/Projects/NetworkManager/VPN") | ||
139 | (synopsis "PPTP plug-in for NetworkManager") | ||
140 | (description | ||
141 | "This extension of NetworkManager allows it to take care of connections | ||
142 | to virtual private networks (VPNs) via pptp.") | ||
143 | (license license:gpl2+) | ||
144 | (properties `((upstream-name . "NetworkManager-pptp"))))) | ||
diff --git a/guix/jd/utils.scm b/guix/jd/utils.scm new file mode 100644 index 0000000..5be7fa9 --- /dev/null +++ b/guix/jd/utils.scm | |||
@@ -0,0 +1,25 @@ | |||
1 | (define-module (jd utils) | ||
2 | #:export (jd-search-patches)) | ||
3 | |||
4 | ;; This code is copied and modified from (gnu packages) module. | ||
5 | |||
6 | (define %jd-patch-path | ||
7 | (make-parameter | ||
8 | (map (lambda (directory) | ||
9 | (let ((jd-patch-dir (string-append directory "/jd/packages/patches"))) | ||
10 | (if (and (file-exists? jd-patch-dir) | ||
11 | (file-is-directory? jd-patch-dir)) | ||
12 | jd-patch-dir | ||
13 | directory))) | ||
14 | %load-path))) | ||
15 | |||
16 | (define (jd-search-patch file-name) | ||
17 | "Search the patch FILE-NAME. Raise an error if not found." | ||
18 | (or (search-path (%jd-patch-path) file-name) | ||
19 | (raise (string-append file-name | ||
20 | ": patch not found")))) | ||
21 | |||
22 | (define-syntax-rule (jd-search-patches file-name ...) | ||
23 | "Return the list of absolute file names corresponding to each | ||
24 | FILE-NAME found in %JD-PATCH-PATH." | ||
25 | (list (jd-search-patch file-name) ...)) | ||