From 390375cd8a0c745eb6b4df93f3f6f3e5f2985c90 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 20 Mar 2018 15:17:36 +0100 Subject: j: dirty merge again --- jeschli/2configs/virtualbox.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/virtualbox.nix b/jeschli/2configs/virtualbox.nix index b2cb851a1..c9bb8c41f 100644 --- a/jeschli/2configs/virtualbox.nix +++ b/jeschli/2configs/virtualbox.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let - mainUser = config.users.extraUsers.markus; + mainUser = config.users.extraUsers.jeschli; in { #services.virtualboxHost.enable = true; -- cgit v1.2.3 From 86cb23a682b6453544942646080c6c62d488e617 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 20 Mar 2018 17:38:26 +0100 Subject: j: add my-emacs --- jeschli/2configs/emacs.nix | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 jeschli/2configs/emacs.nix (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix new file mode 100644 index 000000000..3c1d6ba06 --- /dev/null +++ b/jeschli/2configs/emacs.nix @@ -0,0 +1,58 @@ +{ config, pkgs, ... }: + +let + emacsFile = '' +(require 'package) ;; You might already have this line +(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) + (not (gnutls-available-p)))) + (url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) + (add-to-list 'package-archives (cons "melpa" url) t) + (add-to-list 'package-archives + '("org" . "http://orgmode.org/elpa/") t) +) +(when (< emacs-major-version 24) + ;; For important compatibility libraries like cl-lib + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) + +(package-initialize) + +;; Evil Mode +(add-to-list 'load-path "~/.emacs.d/evil") +(require 'evil) +(evil-mode 1) +(require 'evil-org) + + + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(inhibit-startup-screen t) + '(org-agenda-files nil) + '(package-selected-packages + (quote + (smex ox-jira org-plus-contrib org-mime org-jira neotree molokai-theme let-alist helm-fuzzy-find go-guru go-autocomplete flymake-go exec-path-from-shell evil-org cl-lib-highlight bbdb atom-one-dark-theme)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) + +(tool-bar-mode -1) ; Disable the button bar atop screen +(scroll-bar-mode -1) ; Disable scroll bar +(setq inhibit-startup-screen t) ; Disable startup screen with graphics +(setq-default indent-tabs-mode nil) ; Use spaces instead of tabs +(setq tab-width 2) ; Four spaces is a tab +(setq visible-bell nil) ; Disable annoying visual bell graphic +(setq ring-bell-function 'ignore) ; Disable super annoying audio bell + ''; + dotEmacs = pkgs.writeText "dot-emacs" emacsFile; + myEmacs = pkgs.writeDashBin "my-emacs" ''emacs -q -l ${dotEmacs}''; +in { + environment.systemPackages = [ + myEmacs + ]; +} -- cgit v1.2.3 From a94da8573103f3a7ccaf836c6126041dc351b623 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 20 Mar 2018 20:16:12 +0100 Subject: j brauerei: *emacs with magit --- jeschli/2configs/emacs.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 3c1d6ba06..b616acfae 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -50,7 +50,12 @@ let (setq ring-bell-function 'ignore) ; Disable super annoying audio bell ''; dotEmacs = pkgs.writeText "dot-emacs" emacsFile; - myEmacs = pkgs.writeDashBin "my-emacs" ''emacs -q -l ${dotEmacs}''; + emacs = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ + magit + ])); + myEmacs = pkgs.writeDashBin "my-emacs" '' + exec ${emacs}/bin/emacs -q -l ${dotEmacs} "$@" + ''; in { environment.systemPackages = [ myEmacs -- cgit v1.2.3 From 87528e2ab6085a1a0fadcd1aa00870834c878c27 Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 21 Mar 2018 08:59:35 +0100 Subject: j emacs: cosmetics --- jeschli/2configs/emacs.nix | 103 ++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 49 deletions(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index b616acfae..05e977844 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -1,58 +1,63 @@ { config, pkgs, ... }: let + packageRepos = '' + (require 'package) ;; You might already have this line + (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) + (not (gnutls-available-p)))) + (url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) + (add-to-list 'package-archives (cons "melpa" url) t) + (add-to-list 'package-archives + '("org" . "http://orgmode.org/elpa/") t) + ) + (when (< emacs-major-version 24) + ;; For important compatibility libraries like cl-lib + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) + (package-initialize) + ''; + evilMode = '' + ;; Evil Mode + (add-to-list 'load-path "~/.emacs.d/evil") + (require 'evil) + (evil-mode 1) + (require 'evil-org) + ''; + windowCosmetics = '' + (tool-bar-mode -1) ; Disable the button bar atop screen + (scroll-bar-mode -1) ; Disable scroll bar + (setq inhibit-startup-screen t) ; Disable startup screen with graphics + (setq-default indent-tabs-mode nil) ; Use spaces instead of tabs + (setq tab-width 2) ; Four spaces is a tab + (setq visible-bell nil) ; Disable annoying visual bell graphic + (setq ring-bell-function 'ignore) ; Disable super annoying audio bell + ''; emacsFile = '' -(require 'package) ;; You might already have this line -(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) - (not (gnutls-available-p)))) - (url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) - (add-to-list 'package-archives (cons "melpa" url) t) - (add-to-list 'package-archives - '("org" . "http://orgmode.org/elpa/") t) -) -(when (< emacs-major-version 24) - ;; For important compatibility libraries like cl-lib - (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) - -(package-initialize) - -;; Evil Mode -(add-to-list 'load-path "~/.emacs.d/evil") -(require 'evil) -(evil-mode 1) -(require 'evil-org) - - - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(inhibit-startup-screen t) - '(org-agenda-files nil) - '(package-selected-packages - (quote - (smex ox-jira org-plus-contrib org-mime org-jira neotree molokai-theme let-alist helm-fuzzy-find go-guru go-autocomplete flymake-go exec-path-from-shell evil-org cl-lib-highlight bbdb atom-one-dark-theme)))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) - -(tool-bar-mode -1) ; Disable the button bar atop screen -(scroll-bar-mode -1) ; Disable scroll bar -(setq inhibit-startup-screen t) ; Disable startup screen with graphics -(setq-default indent-tabs-mode nil) ; Use spaces instead of tabs -(setq tab-width 2) ; Four spaces is a tab -(setq visible-bell nil) ; Disable annoying visual bell graphic -(setq ring-bell-function 'ignore) ; Disable super annoying audio bell + ${packageRepos} + ${evilMode} + ${windowCosmetics} + (custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(inhibit-startup-screen t) + '(org-agenda-files nil) + '(package-selected-packages + (quote + (smex ox-jira org-plus-contrib org-mime org-jira neotree molokai-theme let-alist helm-fuzzy-find go-guru go-autocomplete flymake-go exec-path-from-shell evil-org cl-lib-highlight bbdb atom-one-dark-theme)))) + (custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) ''; dotEmacs = pkgs.writeText "dot-emacs" emacsFile; - emacs = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ - magit - ])); + emacs = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ + epkgs.melpaStablePackages.magit + epkgs.melpaPackages.mmm-mode + epkgs.melpaPackages.nix-mode + ]); myEmacs = pkgs.writeDashBin "my-emacs" '' exec ${emacs}/bin/emacs -q -l ${dotEmacs} "$@" ''; -- cgit v1.2.3 From 7303238443b3a76af6d12df1992ee499d98a7902 Mon Sep 17 00:00:00 2001 From: jeschli Date: Thu, 22 Mar 2018 16:19:29 +0100 Subject: j emacs: +orgMode +evil-org --- jeschli/2configs/emacs.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 05e977844..3eced793c 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -21,6 +21,10 @@ let (require 'evil) (evil-mode 1) (require 'evil-org) + (add-hook 'org-mode-hook 'evil-org-mode) + (evil-org-set-key-theme '(navigation insert textobjects additional calendar)) + (require 'evil-org-agenda) + (evil-org-agenda-set-keys) ''; windowCosmetics = '' (tool-bar-mode -1) ; Disable the button bar atop screen @@ -31,6 +35,16 @@ let (setq visible-bell nil) ; Disable annoying visual bell graphic (setq ring-bell-function 'ignore) ; Disable super annoying audio bell ''; + orgMode = '' + (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode)) + (global-set-key "\C-cl" 'org-store-link) + (global-set-key "\C-ca" 'org-agenda) + (global-set-key "\C-cb" 'org-iswitchb) + (if (boundp 'org-user-agenda-files) + (setq org-agenda-files org-user-agenda-files) + (setq org-agenda-files (quote ("~/projects/notes"))) + ) + ''; emacsFile = '' ${packageRepos} ${evilMode} @@ -45,12 +59,7 @@ let '(package-selected-packages (quote (smex ox-jira org-plus-contrib org-mime org-jira neotree molokai-theme let-alist helm-fuzzy-find go-guru go-autocomplete flymake-go exec-path-from-shell evil-org cl-lib-highlight bbdb atom-one-dark-theme)))) - (custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) + ${orgMode} ''; dotEmacs = pkgs.writeText "dot-emacs" emacsFile; emacs = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ -- cgit v1.2.3 From e80c081eb7d720fb5584f24b0f38b5d6e61ac41e Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 24 Mar 2018 10:30:30 +0000 Subject: j emacs: +go-mode -evil-mode --- jeschli/2configs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 3eced793c..d9e6c854a 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -47,7 +47,6 @@ let ''; emacsFile = '' ${packageRepos} - ${evilMode} ${windowCosmetics} (custom-set-variables ;; custom-set-variables was added by Custom. @@ -66,6 +65,7 @@ let epkgs.melpaStablePackages.magit epkgs.melpaPackages.mmm-mode epkgs.melpaPackages.nix-mode + epkgs.melpaPackages.go-mode ]); myEmacs = pkgs.writeDashBin "my-emacs" '' exec ${emacs}/bin/emacs -q -l ${dotEmacs} "$@" -- cgit v1.2.3 From 2d511ecb4d8a3e75df19e59962a8cee6a8448c8b Mon Sep 17 00:00:00 2001 From: jeschli Date: Mon, 26 Mar 2018 10:15:29 +0200 Subject: j emacs: default-wdith=2 --- jeschli/2configs/emacs.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index d9e6c854a..2fea47229 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -31,6 +31,7 @@ let (scroll-bar-mode -1) ; Disable scroll bar (setq inhibit-startup-screen t) ; Disable startup screen with graphics (setq-default indent-tabs-mode nil) ; Use spaces instead of tabs + (setq default-tab-width 2) ; Two spaces is a tab (setq tab-width 2) ; Four spaces is a tab (setq visible-bell nil) ; Disable annoying visual bell graphic (setq ring-bell-function 'ignore) ; Disable super annoying audio bell -- cgit v1.2.3 From e3445be6dafe4f16e150549baee34055a6b04fef Mon Sep 17 00:00:00 2001 From: jeschli Date: Mon, 26 Mar 2018 10:16:09 +0200 Subject: j emacs: cosmetics; +recentFiles mode --- jeschli/2configs/emacs.nix | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 2fea47229..2286baae3 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -46,30 +46,26 @@ let (setq org-agenda-files (quote ("~/projects/notes"))) ) ''; - emacsFile = '' + recentFiles = '' + (recentf-mode 1) + (setq recentf-max-menu-items 25) + (global-set-key "\C-x\ \C-r" 'recentf-open-files) + ''; + dotEmacs = pkgs.writeText "dot-emacs" '' ${packageRepos} ${windowCosmetics} - (custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(inhibit-startup-screen t) - '(org-agenda-files nil) - '(package-selected-packages - (quote - (smex ox-jira org-plus-contrib org-mime org-jira neotree molokai-theme let-alist helm-fuzzy-find go-guru go-autocomplete flymake-go exec-path-from-shell evil-org cl-lib-highlight bbdb atom-one-dark-theme)))) - ${orgMode} + ${orgMode} + ${recentFiles} ''; - dotEmacs = pkgs.writeText "dot-emacs" emacsFile; - emacs = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ + emacsWithCustomPackages = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ epkgs.melpaStablePackages.magit epkgs.melpaPackages.mmm-mode epkgs.melpaPackages.nix-mode epkgs.melpaPackages.go-mode + epkgs.melpaPackages.google-this ]); myEmacs = pkgs.writeDashBin "my-emacs" '' - exec ${emacs}/bin/emacs -q -l ${dotEmacs} "$@" + exec ${emacsWithCustomPackages}/bin/emacs -q -l ${dotEmacs} "$@" ''; in { environment.systemPackages = [ -- cgit v1.2.3 From a3b0361fd29ab5e8b972ddb29af15a2e249ca3d4 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 17 Apr 2018 18:43:09 +0200 Subject: emacs file sorting --- jeschli/2configs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 2286baae3..4c52432d3 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -53,9 +53,9 @@ let ''; dotEmacs = pkgs.writeText "dot-emacs" '' ${packageRepos} - ${windowCosmetics} ${orgMode} ${recentFiles} + ${windowCosmetics} ''; emacsWithCustomPackages = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ epkgs.melpaStablePackages.magit -- cgit v1.2.3 From 3871554d1935bcdc5d8ed6b82c847bee03a6d6bf Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 18 Apr 2018 08:20:48 +0200 Subject: j: xserver, xdg from tv; updated brauerei --- jeschli/2configs/xdg.nix | 14 +++ jeschli/2configs/xserver/Xmodmap.nix | 27 ++++++ jeschli/2configs/xserver/Xresources.nix | 52 +++++++++++ jeschli/2configs/xserver/default.nix | 141 ++++++++++++++++++++++++++++++ jeschli/2configs/xserver/xserver.conf.nix | 40 +++++++++ 5 files changed, 274 insertions(+) create mode 100644 jeschli/2configs/xdg.nix create mode 100644 jeschli/2configs/xserver/Xmodmap.nix create mode 100644 jeschli/2configs/xserver/Xresources.nix create mode 100644 jeschli/2configs/xserver/default.nix create mode 100644 jeschli/2configs/xserver/xserver.conf.nix (limited to 'jeschli/2configs') diff --git a/jeschli/2configs/xdg.nix b/jeschli/2configs/xdg.nix new file mode 100644 index 000000000..18bac9b38 --- /dev/null +++ b/jeschli/2configs/xdg.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME"; + + systemd.tmpfiles.rules = let + forUsers = flip map users; + isUser = { name, group, ... }: + name == "root" || hasSuffix "users" group; + users = filter isUser (mapAttrsToList (_: id) config.users.users); + in forUsers (u: "d /run/xdg/${u.name} 0700 ${u.name} ${u.group} -"); +} diff --git a/jeschli/2configs/xserver/Xmodmap.nix b/jeschli/2configs/xserver/Xmodmap.nix new file mode 100644 index 000000000..d2b1b2604 --- /dev/null +++ b/jeschli/2configs/xserver/Xmodmap.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +with import ; + +pkgs.writeText "Xmodmap" '' + !keycode 66 = Caps_Lock + !remove Lock = Caps_Lock + clear Lock + + ! caps lock + keycode 66 = Mode_switch + + keycode 13 = 4 dollar EuroSign cent + keycode 30 = u U udiaeresis Udiaeresis + keycode 32 = o O odiaeresis Odiaeresis + keycode 38 = a A adiaeresis Adiaeresis + keycode 39 = s S ssharp + + keycode 33 = p P Greek_pi Greek_PI + keycode 46 = l L Greek_lambda Greek_LAMBDA + + keycode 54 = c C cacute Cacute + + ! BULLET OPERATOR + keycode 17 = 8 asterisk U2219 + keycode 27 = r R r U211D +'' diff --git a/jeschli/2configs/xserver/Xresources.nix b/jeschli/2configs/xserver/Xresources.nix new file mode 100644 index 000000000..e433a855e --- /dev/null +++ b/jeschli/2configs/xserver/Xresources.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +with import ; + +pkgs.writeText "Xresources" /* xdefaults */ '' + URxvt*cutchars: "\\`\"'&()*,;<=>?@[]^{|}‘’" + URxvt*eightBitInput: false + URxvt*font: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 + URxvt*boldFont: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 + URxvt*scrollBar: false + URxvt*background: #050505 + URxvt*foreground: #d0d7d0 + URxvt*cursorColor: #f042b0 + URxvt*cursorColor2: #f0b000 + URxvt*cursorBlink: off + URxvt*jumpScroll: true + URxvt*allowSendEvents: false + URxvt*charClass: 33:48,37:48,45-47:48,64:48,38:48,61:48,63:48 + URxvt*cutNewline: False + URxvt*cutToBeginningOfLine: False + + URxvt*color0: #232342 + URxvt*color3: #c07000 + URxvt*color4: #4040c0 + URxvt*color7: #c0c0c0 + URxvt*color8: #707070 + URxvt*color9: #ff6060 + URxvt*color10: #70ff70 + URxvt*color11: #ffff70 + URxvt*color12: #7070ff + URxvt*color13: #ff50ff + URxvt*color14: #70ffff + URxvt*color15: #ffffff + + URxvt*iso14755: False + + URxvt*urgentOnBell: True + URxvt*visualBell: True + + ! ref https://github.com/muennich/urxvt-perls + URxvt*perl-ext: default,url-select + URxvt*keysym.M-u: perl:url-select:select_next + URxvt*url-select.underline: true + URxvt*colorUL: #4682B4 + URxvt.perl-lib: ${pkgs.urxvt_perls}/lib/urxvt/perl + URxvt*saveLines: 10000 + + root-urxvt*background: #230000 + root-urxvt*foreground: #e0c0c0 + root-urxvt*BorderColor: #400000 + root-urxvt*color0: #800000 +'' diff --git a/jeschli/2configs/xserver/default.nix b/jeschli/2configs/xserver/default.nix new file mode 100644 index 000000000..df06000f3 --- /dev/null +++ b/jeschli/2configs/xserver/default.nix @@ -0,0 +1,141 @@ +{ config, pkgs, ... }@args: +with import ; +let + cfg = { + cacheDir = cfg.dataDir; + configDir = "/var/empty"; + dataDir = "/run/xdg/${cfg.user.name}/xmonad"; + user = config.krebs.users.jeschli; + }; +in { + + environment.systemPackages = [ + pkgs.font-size + pkgs.gitAndTools.qgit + pkgs.mpv + pkgs.sxiv + pkgs.xdotool + pkgs.xsel + pkgs.zathura + ]; + + fonts.fonts = [ + pkgs.xlibs.fontschumachermisc + ]; + + # TODO dedicated group, i.e. with a single user [per-user-setuid] + # TODO krebs.setuid.slock.path vs /run/wrappers/bin + krebs.setuid.slock = { + filename = "${pkgs.slock}/bin/slock"; + group = "wheel"; + envp = { + DISPLAY = ":${toString config.services.xserver.display}"; + USER = cfg.user.name; + }; + }; + + services.xserver = { + + # Don't install feh into systemPackages + # refs + desktopManager.session = mkForce []; + + enable = true; + display = 11; + tty = 11; + + synaptics = { + enable = true; + twoFingerScroll = true; + accelFactor = "0.035"; + }; + }; + + systemd.services.display-manager.enable = false; + + systemd.services.xmonad = { + wantedBy = [ "multi-user.target" ]; + requires = [ "xserver.service" ]; + environment = { + DISPLAY = ":${toString config.services.xserver.display}"; + + XMONAD_CACHE_DIR = cfg.cacheDir; + XMONAD_CONFIG_DIR = cfg.configDir; + XMONAD_DATA_DIR = cfg.dataDir; + + XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" '' + ${pkgs.xorg.xhost}/bin/xhost +LOCAL: & + ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} & + ${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} & + ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' & + wait + ''; + + # XXX JSON is close enough :) + XMONAD_WORKSPACES0_FILE = pkgs.writeText "xmonad.workspaces0" (toJSON [ + "dashboard" # we start here + "stockholm" + "pycharm" + "chromium" + "iRC" + "git" + "hipbird" + ]); + }; + serviceConfig = { + SyslogIdentifier = "xmonad"; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [ + "\${XMONAD_CACHE_DIR}" + "\${XMONAD_CONFIG_DIR}" + "\${XMONAD_DATA_DIR}" + ]}"; + ExecStart = "${pkgs.xmonad-jeschli}/bin/xmonad"; + ExecStop = "${pkgs.xmonad-jeschli}/bin/xmonad --shutdown"; + User = cfg.user.name; + WorkingDirectory = cfg.user.home; + }; + }; + + systemd.services.xserver = { + after = [ + "systemd-udev-settle.service" + "local-fs.target" + "acpid.service" + ]; + reloadIfChanged = true; + environment = { + XKB_BINDIR = "${pkgs.xorg.xkbcomp}/bin"; # Needed for the Xkb extension. + XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime. + LD_LIBRARY_PATH = concatStringsSep ":" ( + [ "${pkgs.xorg.libX11}/lib" "${pkgs.xorg.libXext}/lib" ] + ++ concatLists (catAttrs "libPath" config.services.xserver.drivers)); + }; + serviceConfig = { + SyslogIdentifier = "xserver"; + ExecReload = "${pkgs.coreutils}/bin/echo NOP"; + ExecStart = toString [ + "${pkgs.xorg.xorgserver}/bin/X" + ":${toString config.services.xserver.display}" + "vt${toString config.services.xserver.tty}" + "-config ${import ./xserver.conf.nix args}" + "-logfile /dev/null -logverbose 0 -verbose 3" + "-nolisten tcp" + "-xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb" + ]; + }; + }; + + systemd.services.urxvtd = { + wantedBy = [ "multi-user.target" ]; + reloadIfChanged = true; + serviceConfig = { + SyslogIdentifier = "urxvtd"; + ExecReload = "${pkgs.coreutils}/bin/echo NOP"; + ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd"; + Restart = "always"; + RestartSec = "2s"; + StartLimitBurst = 0; + User = cfg.user.name; + }; + }; +} diff --git a/jeschli/2configs/xserver/xserver.conf.nix b/jeschli/2configs/xserver/xserver.conf.nix new file mode 100644 index 000000000..6f34e0150 --- /dev/null +++ b/jeschli/2configs/xserver/xserver.conf.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: + +with import ; + +let + cfg = config.services.xserver; +in + +pkgs.stdenv.mkDerivation { + name = "xserver.conf"; + + xfs = optionalString (cfg.useXFS != false) + ''FontPath "${toString cfg.useXFS}"''; + + inherit (cfg) config; + + buildCommand = + '' + echo 'Section "Files"' >> $out + echo $xfs >> $out + + for i in ${toString config.fonts.fonts}; do + if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then + for j in $(find $i -name fonts.dir); do + echo " FontPath \"$(dirname $j)\"" >> $out + done + fi + done + + for i in $(find ${toString cfg.modules} -type d); do + if test $(echo $i/*.so* | wc -w) -ne 0; then + echo " ModulePath \"$i\"" >> $out + fi + done + + echo 'EndSection' >> $out + + echo "$config" >> $out + ''; +} -- cgit v1.2.3