we've stupidly added font choice
This commit is contained in:
@@ -5,10 +5,13 @@
|
|||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (gnu packages commencement)
|
#:use-module (gnu packages commencement)
|
||||||
|
#:use-module (gnu packages curl)
|
||||||
#:use-module (gnu packages version-control)
|
#:use-module (gnu packages version-control)
|
||||||
|
#:use-module (gnu packages fontutils)
|
||||||
|
#:use-module (selected-guix-works packages fonts)
|
||||||
#:use-module (guix build-system copy)
|
#:use-module (guix build-system copy)
|
||||||
#:use-module (guix build copy-build-system)
|
#:use-module (guix build copy-build-system))
|
||||||
)
|
|
||||||
|
|
||||||
(define-public code-server
|
(define-public code-server
|
||||||
(package
|
(package
|
||||||
@@ -24,7 +27,10 @@
|
|||||||
|
|
||||||
(inputs
|
(inputs
|
||||||
(list
|
(list
|
||||||
gcc-toolchain))
|
gcc-toolchain
|
||||||
|
woff-tools
|
||||||
|
font-nerd-fonts-jetbrains-mono
|
||||||
|
))
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
#:tests? #f ; no check target
|
#:tests? #f ; no check target
|
||||||
@@ -36,13 +42,45 @@
|
|||||||
`("LD_LIBRARY_PATH" ":" prefix (
|
`("LD_LIBRARY_PATH" ":" prefix (
|
||||||
,(string-append #$(this-package-input "gcc-toolchain") "/lib")
|
,(string-append #$(this-package-input "gcc-toolchain") "/lib")
|
||||||
)))))
|
)))))
|
||||||
|
(add-after 'wrap 'enable-font-magic
|
||||||
|
(lambda _
|
||||||
|
(let ((font-package "font-nerd-fonts-jetbrains-mono")
|
||||||
|
(font-path "/share/fonts/truetype/")
|
||||||
|
(font-prefix "JetBrainsMonoNerdFontMono-")
|
||||||
|
)
|
||||||
|
(use-modules (ice-9 ftw)
|
||||||
|
(srfi srfi-1)) ; For list processing
|
||||||
|
(define (collect-files-with-prefix directory prefix)
|
||||||
|
(filter (lambda (str) (string-prefix? prefix str)) (cddr (scandir directory))))
|
||||||
|
(map (lambda (entry)
|
||||||
|
(let* ((source (car entry)) (file (cdr entry)))
|
||||||
|
(symlink (string-append (assoc-ref %build-inputs source) font-path file)
|
||||||
|
(string-append (assoc-ref %outputs "out") "/src/browser/pages/" (basename file)))
|
||||||
|
(system* "sfnt2woff" (string-append (assoc-ref %outputs "out") "/src/browser/pages/" (basename file)))
|
||||||
|
))
|
||||||
|
(append
|
||||||
|
(map (lambda (file) (cons font-package file))
|
||||||
|
(collect-files-with-prefix (string-append (assoc-ref %build-inputs font-package) font-path) font-prefix)
|
||||||
|
)))
|
||||||
|
(let ((font-files (string-join
|
||||||
|
(map
|
||||||
|
(lambda (x)
|
||||||
|
(string-append "url('_static/src/browser/pages/" (substring x 0 (- (string-length x) 4)) ".woff') format('woff')" ))
|
||||||
|
(collect-files-with-prefix (string-append (assoc-ref %build-inputs font-package) font-path) font-prefix))
|
||||||
|
","
|
||||||
|
)))
|
||||||
|
(system* "sed" "-i" (string-append "s|</head>|<style> @font-face {font-family: 'Personal';font-style: normal;src:" font-files ";}\\</style></head>|g") (string-append #$output "/lib/vscode/out/vs/code/browser/workbench/workbench.html"))
|
||||||
|
)
|
||||||
|
))
|
||||||
|
)
|
||||||
(delete 'validate-runpath)
|
(delete 'validate-runpath)
|
||||||
)))
|
)))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list git))
|
(list git curl))
|
||||||
(synopsis "Soup")
|
(synopsis "Soup")
|
||||||
(home-page "https://coder.com/")
|
(home-page "https://coder.com/")
|
||||||
(description "Free open source code server")
|
(description "Free open source code server")
|
||||||
(license license:agpl3)))
|
(license license:agpl3)))
|
||||||
|
|
||||||
code-server
|
code-server
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user