diff --git a/hosts/d2nix/README.md b/hosts/d2nix/README.md new file mode 100644 index 0000000..168826b --- /dev/null +++ b/hosts/d2nix/README.md @@ -0,0 +1,2 @@ +* Installation + diff --git a/hosts/d2nix/home-manager/colorschemes/nord.theme b/hosts/d2nix/home-manager/colorschemes/nord.theme new file mode 100644 index 0000000..5bdd426 --- /dev/null +++ b/hosts/d2nix/home-manager/colorschemes/nord.theme @@ -0,0 +1,9 @@ +[Scheme] +Name=Nord +ColorCursor=#D8DEE9 +ColorForeground=#D8DEE9 +ColorBackground=#2E3440 +TabActivityColor=#88C0D0 +ColorPalette=#3B4252;#BF616A;#A3BE8C;#EBCB8B;#81A1C1;#B48EAD;#88C0D0;#E5E9F0;#4C566A;#BF616A;#A3BE8C;#EBCB8B;#81A1C1;#B48EAD;#8FBCBB;#ECEFF4 +ColorBold=#D8DEE9 +ColorBoldUseDefault=FALSE diff --git a/hosts/d2nix/home-manager/configs/i3config b/hosts/d2nix/home-manager/configs/i3config new file mode 100644 index 0000000..a4b0d82 --- /dev/null +++ b/hosts/d2nix/home-manager/configs/i3config @@ -0,0 +1,146 @@ +# version : 20220121 + +set $mod Mod4 +set $ALT Mod1 + +# Couleurs barre de titre et contour des fenetres +set $blue #005588 +set $gray1 #484848 +set $gray2 #333333 + +set $ws1 "1: console" +set $ws2 "2: office" +set $ws3 "3: web" + +# Couleur des fenetres avec et sans focus +client.focused $gray1 $gray1 #FFFFFF #333333 +client.focused_inactive $gray2 $gray2 #FFFFFF #000000 +client.unfocused $gray2 $gray2 #FFFFFF #000000 + +# Police de caracteres pour les titres des fenetres. ISO 10646 = Unicode +font pango:Hack 10 + +# wallpaper +exec --no-startup-id feh --bg-scale /home/alexandre/images/SF.jpg + +# Redimensionnement de fenetres +mode "resize" { + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + # Retour au mode normal: Enter ou Escape ou q ou ^[ + bindsym Return mode "default" + bindsym q mode "default" + bindsym Escape mode "default" + bindcode Control+34 mode "default" +} +bindsym $mod+s mode "resize" + +# Tue la fenetre avec le focus +bindsym $mod+Shift+A kill + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+p layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle +# +# # change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle +# +# # focus the parent container +bindsym $mod+a focus parent +# +# Change la fenetre ayant le focus +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# Met la fenetre avec le focus en mode plein écran +bindsym $mod+f fullscreen + +# Deplacement entre les bureaux +bindsym $mod+ampersand workspace $ws1 +bindsym $mod+eacute workspace $ws2 +bindsym $mod+quotedbl workspace $ws3 +bindsym $mod+apostrophe workspace 4 +bindsym $mod+parenleft workspace 5 +bindsym $mod+minus workspace 6 +bindsym $mod+egrave workspace 7 +bindsym $mod+underscore workspace 8 +bindsym $mod+ccedilla workspace 9 +bindsym $mod+agrave workspace 10 + +# Déplacement de la fenetre ayant le focus d'un bureau à l'autre +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# Recharge le fichier de configuration +bindsym $mod+Shift+C reload + +# Redemarre i3 mais concerve ce qui est lancé. Utilisable pour les MAJ +bindsym $mod+Shift+R restart + +# sort d'i3 +bindsym $mod+Shift+E exit + +# lance dmenu (le lanceur de pgm. la barre de dmenu est noir) +bindsym $mod+d exec rofi -show drun -show-icons -modi drun + +# status bar +bar { + font pango:DejaVu Sans Mono, FontAwesome 12 + position top + status_command i3status-rs ~/.config/i3status-rust/config-bottom.toml + colors { + separator #666666 + background #222222 + statusline #dddddd + focused_workspace #0088CC #0088CC #ffffff + active_workspace #333333 #333333 #ffffff + inactive_workspace #333333 #333333 #888888 + urgent_workspace #2f343a #900000 #ffffff + } +} + +# alt+win+l : verouille la session, image de : +bindsym $mod+$ALT+l exec i3lock -ti ~/images/coffee_time.png + +# blocage automatique de l'ecran en cas d'inactivité +exec xautolock -detectsleep -locker 'i3lock -ti ~/images/coffee_time.png' + +# Capture d'ecran +bindsym Print exec scrot -u '%Y-%m-%d-%T_$wx$h_scrot.png' -e 'mv $f ~/Screenshots/' + +# start a terminal +bindsym $mod+Return exec "LIBGL_ALWAYS_SOFTWARE=1 alacritty" +bindsym $mod+m exec "i3-sensible-terminal -e ncmpcpp" + +# Assigne les applications aux workspaces +assign [class="firefox"] $ws3 +assign [class="emacs"] $ws2 + +# programmes au démarrage +exec --no-startup-id nm-applet +exec --no-startup-id nextcloud +exec --no-startup-id vlc +exec --no-startup-id guake diff --git a/hosts/d2nix/home-manager/configs/init.el b/hosts/d2nix/home-manager/configs/init.el new file mode 100644 index 0000000..c6ed879 --- /dev/null +++ b/hosts/d2nix/home-manager/configs/init.el @@ -0,0 +1,391 @@ +;; Keyboard-centric user interface +(setq inhibit-startup-message t) +(scroll-bar-mode -1) +(tool-bar-mode -1) +(menu-bar-mode -1) + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities` +;; and `package-pinned-packages`. Most users will not need or want to do this. +;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) +(package-initialize) + + +(column-number-mode 't) ; show current column in status bar +(set-fringe-mode 10) + +;;;; Indent 4 spaces by default. Use the "BSD" style for C-like languages. +;;(setq c-default-style +;; (quote ((java-mode . "java") +;; (awk-mode . "awk") +;; (other . "bsd"))) +;; c-basic-offset 4) + +;; Use 4 spaces for one tab visually. +(setq tab-width 4) + +(show-paren-mode t) ; highlight matching open and close parentheses +(global-hl-line-mode) ; highlight current line +(global-visual-line-mode t) ; wrap long lines +(setq split-window-preferred-function + 'visual-fill-column-split-window-sensibly) ; wrap at window boundary + +(global-whitespace-mode) ; enable whitespace handling by default +(setq + whitespace-style ; see (apropos 'whitespace-style) + '(face ; viz via faces + trailing ; trailing blanks visualized + lines-tail ; lines beyond whitespace-line-column visualized + space-before-tab + space-after-tab + newline ; lines with only blanks visualized + indentation ; spaces used for indent when config wants tabs + empty ; empty lines at beginning or end or buffer + ) + whitespace-line-column 100) ; column at which whitespace-mode says the line is too long +;;(set-face-attribute 'default nil :font "JetBrains Mono" :height 150) + +;; themes +(use-package doom-themes + :init (load-theme 'doom-nord t) + :init (doom-themes-org-config)) +(setq disabled-command-function nil) +(setq inhibit-startup-screen t) +(setq visible-bell t) + +;; Only y/n answers +(defalias 'yes-or-no-p 'y-or-n-p) + + +;; Backup + +(setq version-control t ;; Use version numbers for backups. + kept-new-versions 10 ;; Number of newest versions to keep. + kept-old-versions 0 ;; Number of oldest versions to keep. + delete-old-versions t ;; Don't ask to delete excess backup versions. + backup-by-copying t) ;; Copy all files, don't rename them. +(setq vc-make-backup-files t) +(setq backup-directory-alist '(("" . "~/.emacs.d/backup"))) +(defvar emacs-autosave-directory + (concat user-emacs-directory "autosaves/") + "This variable dictates where to put auto saves. It is set to a + directory called autosaves located wherever your .emacs.d/ is + located.") + +;; Sets all files to be backed up and auto saved in a single directory. +(setq backup-directory-alist + `((".*" . ,emacs-autosave-directory)) + auto-save-file-name-transforms + `((".*" ,emacs-autosave-directory t))) + + +(setq calendar-week-start-day 1) + +(setq user-full-name "Alexandre LUCAZEAU") +(setq user-mail-address "alexandre@dri.fr") +(setq mail-user-agent 'gnus-user-agent) + +;;(setq gnus-select-method +;; '(nnimap "dri" +;; (nnimap-address "dri.fr") +;; (nnimap-server-port 143) +;; (nnimap-stream starttls) +;; (nnimap-authinfo-file "~/.authinfo.gpg"))) +;; +;;(setq gnus-message-archive-group "nnimap+dri:Sent") +;;(setq gnus-gcc-mark-as-read t) +;;(setq nnmail-expiry-target "nnimap+dri:Trash") +;;(setq nnmail-expiry-wait 'immediate) +;;(setq send-mail-function 'smtpmail-send-it) +;;(setq message-send-mail-function 'smtpmail-send-it) +;;(setq smtpmail-smtp-server "dri.fr") +;;(setq smtpmail-smtp-service 587) +;;(setq message-citation-line-function 'message-insert-formatted-citation-line) +;;(setq message-citation-line-format "On %d/%m/%Y %H:%M, %N wrote:") + +;;(defun default-web-indent-mode () +;; (setq indent-tabs-mode nil) +;; (setq tab-width 2) +;; (setq web-mode-markup-indent-offset 2) +;; (setq web-mode-css-indent-offset 2) +;; (setq web-mode-code-indent-offset 2)) + + +(use-package direnv + :config (direnv-mode)) + +;; (use-package lsp-mode +;; :config (setq lsp-keymap-prefix "C-c l") +;; :config (setq lsp-signature-auto-activate t) +;; :config (setq lsp-enable-on-type-formatting nil) +;; :config (lsp-enable-which-key-integration t) +;; :hook (lsp-mode . electric-pair-mode)) + +;;(use-package web-mode +;; :mode ("\\.json\\'" . web-mode) +;; :mode ("\\.html?\\'" . web-mode) +;; :mode ("\\.s?css\\'" . web-mode) +;; :mode ("\\.[jt]sx?\\'" . web-mode) +;; :hook (web-mode . lsp-deferred) +;; :hook (web-mode . default-web-indent-mode)) + +(use-package nix-mode + :mode ("\\.nix\\'" . nix-mode) + :hook (nix-mode . lsp-deferred)) + +;;(use-package rust-mode +;; :hook (rust-mode . lsp-deferred) +;; :config (setq rust-format-on-save t)) + +(use-package company + :config (setq company-idle-delay 0.25) + :config (setq company-minimum-prefix-length 1) + :bind (:map company-active-map ("" . company-select-next)) + :bind (:map company-active-map ("" . company-select-previous))) + +(use-package yasnippet + :hook (lsp-mode . yas-minor-mode) + :hook (yas-minor-mode . yas-reload-all) + :config (setq yas-snippet-dirs '("/etc/nixos/programs/emacs/snippets"))) + +;;(use-package prettier-js +;; :after (web-mode) +;; :hook (web-mode . prettier-js-mode)) +;; +;;(use-package smartparens +;; :bind ("C-c s s" . sp-splice-sexp) +;; :bind ("C-c s r" . sp-rewrap-sexp)) +;; +;;(use-package bbdb +;; :init (bbdb-initialize 'gnus 'message) +;; :init (bbdb-mua-auto-update-init 'gnus 'message) +;; :config (setq bbdb-file "~/Nextcloud/PRIVE/13_Org/contacts/bbdb") +;; :config (setq bbdb-mua-auto-update-p 'create)) + +;;(use-package org +;; (setq org-startup-folded t) +;; (setq org-refile-use-outline-path 'file) +;; (setq org-refile-targets +;; '(("~/Nextcloud/PRIVE/13_Org/DRI.org" :maxlevel . 3) +;; ("~/Nextcloud/PRIVE/13_Org/perso.org" :level . 1) +;; ("~/Nextcloud/PRIVE/13_Org/pizajoffre.org" :level . 1))) +;; (setq org-todo-keywords +;; '((sequence "TODO(t)" "PENDING(p)" "|" "CANCELLED(c)" "DONE(d)"))) +;; (setq org-todo-keyword-faces +;; '(("TODO" . (:foreground "#c678dd" :weight bold)) +;; ("PENDING" . (:background "#3f444a" :foreground "#ff6c6b" :weight bold)))) +;; (setq org-capture-templates +;; '(("i" "Inbox" entry (file "~/Nextcloud/PRIVE/13_Org/DRI.org") "* TODO %i%?") +;; ("a" "Agenda" entry (file "~/Nextcloud/PRIVE/13_Org/agenda-DRI.org") "* TODO %i%?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))"))) +;; (setq org-agenda-custom-commands +;; '(("t" "Today" tags-todo "+LEVEL=1+CATEGORY=\"tasks\"|+SCHEDULED<=\"\"|+DEADLINE<=\"\"")))) +;; +(use-package org-caldav + :ensure t + :config + (setq org-caldav-url "https://next20.produhost.net/remote.php/dav/calendars/alexandre") + (setq org-caldav-calendars + '((:calendar-id "alexandre-dri" :files ("~/Nextcloud/PRIVE/13_Org/agenda.org") + :inbox "~/Nextcloud/PRIVE/13_Org/agenda-DRI.org") + ) + ) + (setq org-caldav-delete-org-entries 'never) + (setq org-caldav-delete-calenda-entries 'never) + (setq org-icalendar-timezone "Europe/Paris") +) +(use-package magit) +(setq magit-fetch-modules-jobs 16); fetch 16 modules in parallel + +(use-package ledger-mode) + +(use-package projectile + :init (projectile-global-mode) + :config (setq projectile-enable-caching nil) + :config (setq projectile-project-search-path (cddr (directory-files "~/code" t))) + :custom (projectile-completion-system 'ivy) + :bind-keymap ("C-c p" . projectile-command-map)) + +(use-package counsel-projectile + :after (counsel projectile) + :init (counsel-projectile-mode)) + +(require 'yasnippet) +(yas-global-mode 1) + +(use-package which-key + :init (which-key-mode) + :config (setq which-key-idle-delay 0.5)) + +(setq TeX-PDF-mode t) + +(require 'mu4e) +;;store org-mode links to messages +(require 'org-mu4e) +;;store link to message if in header view, not to header query +(setq org-mu4e-link-query-in-headers-mode nil) + +(setq mail-user-agent 'mu4e-user-agent) + (setq org-mu4e-link-query-in-headers-mode t) + (setq mu4e-maildir (expand-file-name "~/Maildir/dri/INBOX")) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-sent-folder "/Sent") + (setq mu4e-drafts-folder "/Drafts") + (setq mu4e-trash-folder "/Junk") + (setq mu4e-refile-folder "/INBOX/archives") + (setq mu4e-context-policy 'pick-first) + (setq mu4e-change-filenames-when-moving t) + (setq starttls-use-gnutls t) + (setq message-send-mail-function 'smtpmail-send-it) + (setq mu4e-update-interval 300) + (setq mu4e-use-fancy-chars t) + (setq mu4e-view-show-addresses t) + (setq mu4e-headers-show-threads t) + (setq mu4e-headers-skip-duplicates t) + (setq mail-user-agent 'mu4e-user-agent) + (defvaralias 'mu4e-compose-signature 'message-signature) + (setq-default mu4e-save-multiple-attachments-without-asking t) + (setq-default mu4e-view-show-addresses t) + (setq-default mu4e-confirm-quit nil) + (setq-default mu4e-hide-index-messages t) + (setq-default mu4e-index-update-in-background t) + (setq mu4e-compose-in-new-frame nil) + ;;rename files when moving + ;;NEEDED FOR MBSYNC + (setq mu4e-change-filenames-when-moving t) + (setq mu4e-html2text-command "iconv -c -t utf-8 | ${pkgs.pandoc}/bin/pandoc -f html -t plain") + (setq mu4e-view-show-images t) + (when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) + (setq message-kill-buffer-on-exit t) + +(require 'org-msg) + (setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" + org-msg-startup "hidestars indent inlineimages" + org-msg-greeting-fmt "\nHi%s,\n\n" + org-msg-recipient-names '(("alexandre@dri.fr" . "Alexandre")) + org-msg-greeting-name-limit 3 + org-msg-default-alternatives '((new . (text html)) + (reply-to-html . (text html)) + (reply-to-text . (text))) + org-msg-convert-citation t + org-msg-signature " + + Regards, + + #+begin_signature + -- + *Alexandre + /One Emacs to rule them all/ + #+end_signature") + (org-msg-mode) +(autoload 'markdown-mode "markdown-mode" + "Major mode for editing Markdown files" t) +(add-to-list 'auto-mode-alist + '("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode)) + +(autoload 'gfm-mode "markdown-mode" + "Major mode for editing GitHub Flavored Markdown files" t) +(add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode)) + +;; Org-Roam basic configuration + (setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/13_Org")) + + (use-package org-roam + :after org + :init (setq org-roam-v2-ack t) ;; Acknowledge V2 upgrade + :custom + (org-roam-directory (file-truename org-directory)) + :config + (org-roam-setup) + :bind (("C-c n f" . org-roam-node-find) + ("C-c n r" . org-roam-node-random) + (:map org-mode-map + (("C-c n i" . org-roam-node-insert) + ("C-c n o" . org-id-get-create) + ("C-c n t" . org-roam-tag-add) + ("C-c n a" . org-roam-alias-add) + ("C-c n l" . org-roam-buffer-toggle))))) + +;; org-mode +(require 'org) +(require 'remember) +(require 'org-mouse) +(setq org-startup-folded t + org-pretty-entities t + org-hide-emphasis-markers t + org-startup-with-inline-images t + org-image-actual-width '(300)) +;; files with ".org" open in org-mode +(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) + +(setq org-agenda-files '("~/Nextcloud/PRIVE/13_Org/agenda-DRI.org" "~/Nextcloud/PRIVE/13_Org/perso.org")) +;; one file org +(defvar org-gtd-file "~/Nextcloud/PRIVE/13_Org/DRI.org") + +;; Open DRI.org when I hit C-c g +(defun gtd () + "Open the GTD file." + (interactive) + (find-file org-gtd-file)) +;; keybinding +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-ca" 'org-agenda) +(global-set-key "\C-cr" 'org-remember) +(global-set-key "\C-cg" 'gtd) + +;; This seems like a good basic set of keywords to start out with: + +(setq org-todo-keywords '((type "TODO" "SCHEDULED" "NEXT" "WAITING" "DONE"))) + +(setf org-todo-keyword-faces '(("NEXT" . (:foreground "yellow" :background "red" :bold t :weight bold)) + ("TODO" . (:foreground "cyan" :background "steelblue" :bold t :weight bold)) + ("WAITING" . (:foreground "yellow" :background "magenta2" :bold t :weight bold)) + ("DONE" . (:foreground "gray50" :background "gray30")))) + +;; tags +(setq org-tag-alist '(("@devis" . ?w) ("@projet" . ?h) ("@client" . ?h) ("@prospect" . ?h) ("interne" . ?l))) + + +(setq org-tag-faces + '( + ("DEVIS" . (:foreground "OrangeRed" :weight bold)) + ("@projet" . (:foreground "IndianRed1" :weight bold)) + ("interne" . (:foreground "LimeGreen" :weight bold)) + ) +) + + +;; Remember support. This creates several files: +;; +;; ~/todo.org Where remembered TODO's are stored. +;; ~/journal.org Timestamped journal entries. +;; ~/remember.org All other notes + +;; and a keybinding of "C-c r" for making quick notes from any buffer. + +;; These bits of Remembered information must eventually be reviewed +;; and filed somewhere (perhaps in gtd.org, or in a project-specific +;; org file.) The out-of-sight, out-of-mind rule applies here---if I +;; don't review these auxiliary org-files, I'll probably forget what's +;; in them. +(setq org-reverse-note-order t) ;; note at beginning of file by default. +(setq org-default-notes-file "~/remember.org") +(setq remember-annotation-functions '(org-remember-annotation)) +(setq remember-handler-functions '(org-remember-handler)) +(add-hook 'remember-mode-hook 'org-remember-apply-template) + +(setq org-remember-templates + '((?t "* TODO %?\n %i\n %a" "~/Nextcloud/PRIVE/13_Org/todo.org") + (?j "* %U %?\n\n %i\n %a" "~/Nextcloud/PRIVE/13_Org/journal.org") + (?i "* %^{Title}\n %i\n %a" "~/Nextcloud/PRIVE/13_Org/remember.org" "New Ideas"))) + +(global-set-key "\C-cr" 'org-remember) +(global-set-key [(f12)] 'org-remember) + + +;; widen category field a little +(setq org-agenda-prefix-format " %-17:c%?-12t% s") + +;; https://gist.github.com/dandrews/4644693 +(setq org-ellipsis "⤵") diff --git a/hosts/d2nix/home-manager/configs/starship.toml b/hosts/d2nix/home-manager/configs/starship.toml new file mode 100644 index 0000000..3147666 --- /dev/null +++ b/hosts/d2nix/home-manager/configs/starship.toml @@ -0,0 +1,103 @@ +# _____ __ __ _ +# / ___// /_____ ___________/ /_ (_)___ +# \__ \/ __/ __ `/ ___/ ___/ __ \/ / __ \ +# ___/ / /_/ /_/ / / (__ ) / / / / /_/ / +# /____/\__/\__,_/_/ /____/_/ /_/_/ .___/ +# /_/ + +[directory] +truncation_length = 8 +truncation_symbol = "…/" + +[cmd_duration] +show_milliseconds = true +# format = "took [$duration](bold yellow) " + +[status] +style = "red" +symbol = "💥 " +format = '[\[$symbol$status\]]($style) ' +disabled = false + +[git_branch] +symbol = "🌱 " + +[git_status] +ahead = "⇡🏎💨${count}" +diverged = "⇕⇡😵${ahead_count}⇣${behind_count}" +behind = "⇣😰${count}" +conflicted = "🏳" +untracked = "🤷‍" +stashed = "📦" +modified = "📝" +staged = '[++\($count\)](green)' +renamed = "👅" +deleted = "🗑" + +[battery] +full_symbol = "🔋" +charging_symbol = "⚡️" +discharging_symbol = "💀" + +[[battery.display]] # "bold red" style when capacity is between 0% and 10% +threshold = 10 +style = "bold red" + +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% +threshold = 30 +style = "bold yellow" + +[[battery.display]] +threshold = 100 +style = "bold green" + +# __ +# / / ____ _____ ____ ___ ______ _____ ____ _____ +# / / / __ `/ __ \/ __ `/ / / / __ `/ __ `/ _ \/ ___/ +# / /___/ /_/ / / / / /_/ / /_/ / /_/ / /_/ / __(__ ) +# /_____/\__,_/_/ /_/\__, /\__,_/\__,_/\__, /\___/____/ +# /____/ /____/ + +[cmake] +#symbol = "C " +symbol = " " + +[dotnet] +format = "[$symbol($version )]($style)" +symbol = "•NET " +#symbol = " " + +[golang] +symbol = "GO " +#symbol = "ﳑ " + +[java] +symbol = "Java " +#symbol = " " + +[nodejs] +format = "via [$symbol]($style)" +#symbol = "NodeJS " +symbol = "JS " +#symbol = " " + +[lua] +symbol = "Lua " +#symbol = " " + +[perl] +symbol = "Perl " + +[python] +symbol = "Py " +#symbol = " " +#symbol = " " + +[ruby] +symbol = "Ruby " +#symbol = " " +#symbol = " " + +[rust] +symbol = "Rs " +#symbol = " " diff --git a/modules/emacs.nix b/hosts/d2nix/home-manager/emacs.nix similarity index 78% rename from modules/emacs.nix rename to hosts/d2nix/home-manager/emacs.nix index 83fb028..0588fca 100644 --- a/modules/emacs.nix +++ b/hosts/d2nix/home-manager/emacs.nix @@ -1,16 +1,12 @@ -{ pkgs, ... }: +{ ... }: { -home.packages = with pkgs; [ - multimarkdown - ]; services.emacs.enable = true; programs.emacs = { enable = true; extraPackages = (epkgs: (with epkgs; [ use-package - dash doom-themes lsp-mode web-mode @@ -23,23 +19,18 @@ home.packages = with pkgs; [ prettier-js smartparens org - org-journal - org-roam - org-msg - org-caldav + org-roam magit - evil bbdb projectile - flycheck ivy counsel counsel-projectile lsp-ivy which-key elpaPackages.org - markdown-mode ])); + }; home.file = { diff --git a/hosts/d2nix/home-manager/git.nix b/hosts/d2nix/home-manager/git.nix new file mode 100644 index 0000000..aafe0a3 --- /dev/null +++ b/hosts/d2nix/home-manager/git.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: +{ + programs.git = { + enable = true; + userEmail = "lucazeau.alexandre@gmail.com"; + userName = "Alexandre LUCAZEAU"; + aliases = { + ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"; + }; + extraConfig = { + "color" = { + "ui" = true; + }; + "init" = { + defaultBranch = "main"; + }; + "color \"diff-highlight\"" = { + oldNormal = "red bold"; + oldHighlight = "red bold 52"; + newNormal = "green bold"; + newHighlight = "green bold 22"; + }; + "color \"diff\"" = { + meta = 11; + frag = "magenta bold"; + commit = "yellow bold"; + old = "red bold"; + new = "green bold"; + whitespace = "red reverse"; + }; + }; + #signing.key = "GPG-KEY-ID"; + #signing.signByDefault = true; + }; +} diff --git a/hosts/d2nix/home-manager/gnupg.nix b/hosts/d2nix/home-manager/gnupg.nix new file mode 100644 index 0000000..7af5dcb --- /dev/null +++ b/hosts/d2nix/home-manager/gnupg.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }:{ + home.packages = with pkgs; [ + pass + gnupg + pinentry-curses + ]; + services = { + # lorri.enable = true; + gpg-agent = { + enable = true; + enableSshSupport = true; + pinentryFlavor = "curses"; + }; + }; +} diff --git a/hosts/d2nix/home-manager/himalaya.nix b/hosts/d2nix/home-manager/himalaya.nix new file mode 100644 index 0000000..8114e92 --- /dev/null +++ b/hosts/d2nix/home-manager/himalaya.nix @@ -0,0 +1,25 @@ +{ + programs.himalaya = { + enable = true; + }; + accounts.email.accounts = { + zimbra = { + primary = true; + himalaya.enable = true; + address = "alexandre.lucazeau@free.fr"; + realName = "Alexandre LUCAZEAU"; + userName = "alexandre.lucazeau"; + passwordCommand = "keepassxc-cli show -a Password --no-password -k $HOME/keyx/emails.key $HOME/keys/emails.kbx zimbra"; + imap = { + host = "imap.free.fr"; + port = 993; + tls.enable = true; + }; + smtp = { + host = "smtp.free.fr"; + port = 587; + tls.enable = false; + }; + }; + }; +} diff --git a/hosts/d2nix/home-manager/home.nix b/hosts/d2nix/home-manager/home.nix new file mode 100644 index 0000000..b2fbfe7 --- /dev/null +++ b/hosts/d2nix/home-manager/home.nix @@ -0,0 +1,29 @@ +{ pkgs, config, ... }: { + imports = [ + ./packages.nix + ./gnupg.nix + ./git.nix + ./variables.nix + ./starship.nix + #./mails.nix + ./mpd.nix +# ./emacs.nix + ./i3status.nix + ./himalaya.nix + ../../../modules/tmux.nix + ../../../modules/emacs.nix + ]; + home.stateVersion = "21.11"; + home.username = "alexandre"; + home.homeDirectory = "/home/alexandre"; + home.keyboard = { + layout = "fr"; + variant = "bepo"; + }; + xdg.configFile = { + "i3/config".source = ./configs/i3config; + }; +} + +# https://git.0xee.eu/0xee/nix-home/src/commit/b1bffdd8e56e093480c3ba7ed12b0141a4c6f9b1/desktop/polybar-config +#https://raw.githubusercontent.com/Litarvan/nix-litarvan/master/kilin/polybar.nix diff --git a/hosts/d2nix/home-manager/i3status.nix b/hosts/d2nix/home-manager/i3status.nix new file mode 100644 index 0000000..95f644a --- /dev/null +++ b/hosts/d2nix/home-manager/i3status.nix @@ -0,0 +1,55 @@ + +{ config, pkgs, ... }:{ + + programs.i3status-rust = { + enable = true; + bars = { + bottom = { + blocks = [ + { + block = "disk_space"; + path = "/"; + format = "$icon $percentage"; + format_alt = " $icon $available / $total "; + info_type = "used"; + interval = 60; + warning = 20.0; + alert = 10.0; + } + { + block = "memory"; + format = " $icon $mem_avail.eng(prefix:M)/$mem_total.eng(prefix:M)($mem_total_used_percents.eng(w:2)) "; + } + { + block = "cpu"; + interval = 1; + } + { + block = "load"; + interval = 1; + format = "{1m}"; + } + { block = "sound"; } + { + block = "backlight"; + } + { + block = "battery"; + } + { + block = "kdeconnect"; + format = " $icon {$bat_icon $bat_charge |}{$notif_icon |}{$network_icon$network_strength $network_type |}"; + bat_good = 101; + } + { + block = "time"; + interval = 60; + format = " $icon $timestamp.datetime(f:'%d/%m %R', l:fr_FR) "; + } + ]; + icons = "material-nf"; + theme = "nord-dark"; + }; + }; + }; +} diff --git a/hosts/d2nix/home-manager/mails.nix b/hosts/d2nix/home-manager/mails.nix new file mode 100644 index 0000000..f4e6b1a --- /dev/null +++ b/hosts/d2nix/home-manager/mails.nix @@ -0,0 +1,51 @@ +{ pkgs, ... }: +{ + programs.mbsync.enable = true; + programs.msmtp.enable = true; + programs.notmuch = { + enable = true; + hooks = { + preNew = "mbsync --all"; + }; + }; + accounts.email = { + accounts.dri = { + address = "alexandre@dri.fr"; + gpg = { + key = "464CAA7A718D4CE84F03DFFE8B2EB421411BF613"; + signByDefault = true ; + }; + imap = { + host = "imap.dri.fr"; + tls = { + enable = false; + }; + }; + folders = { + inbox = "INBOX"; + }; + mbsync = { + enable = true; + create = "maildir"; + + }; + msmtp.enable = true; + notmuch.enable = true; + primary = true; + realName = "LUCAZEAU Alexandre"; + userName = "1847_alexandre"; + signature = { + text = '' + Avant Vente + ''; + showsignature = "append"; + }; + password = "JNdMKb05ndM5:\)"; + #passwordCommand = "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.password-store/mails.gpg"; + smtp = { + host = "smtp.dri.fr"; + port = 587; + }; + }; + }; +} diff --git a/hosts/d2nix/home-manager/mpd.nix b/hosts/d2nix/home-manager/mpd.nix new file mode 100644 index 0000000..851fd1f --- /dev/null +++ b/hosts/d2nix/home-manager/mpd.nix @@ -0,0 +1,66 @@ +{ config, pkgs, ... }: + +{ + services.mpd = { + enable = true; + musicDirectory = "~/Nextcloud/Musique"; + network.listenAddress = "any"; + extraConfig = '' + zeroconf_enabled "no" + + restore_paused "yes" + replaygain "track" + + audio_output { + type "pulse" + name "pulse" + } + + audio_output { + type "fifo" + name "fifo" + path "${config.services.mpd.dataDir}/fifo" + format "44100:16:2" + } + ''; + }; + + programs.ncmpcpp = { + enable = true; + package = pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; }; + mpdMusicDir = null; # does not work (not of type `null or path') + settings = { + # Visualizer + visualizer_fifo_path = "${config.services.mpd.dataDir}/fifo"; + visualizer_in_stereo = "yes"; + visualizer_look = "+|"; + visualizer_output_name = "fifo"; + visualizer_sync_interval = "15"; + visualizer_type = "spectrum"; + + # Song list formatting + song_columns_list_format = builtins.concatStringsSep " " [ + "(6f)[green]{NE}" + "(45)[white]{t|f:Title}" + "(20)[]{a}" + "(25)[cyan]{b}" + "(5f)[blue]{P}" + "(7f)[magenta]{l}" + ]; + + # Display lists in column mode by default + browser_display_mode = "columns"; + search_engine_display_mode = "columns"; + + # Faster seeking + seek_time = 5; + + # More modern UI + user_interface = "alternative"; + }; + }; + + home.packages = with pkgs; [ + mpc_cli + ]; +} diff --git a/hosts/d2nix/home-manager/nixpkgs b/hosts/d2nix/home-manager/nixpkgs new file mode 120000 index 0000000..da8a3d7 --- /dev/null +++ b/hosts/d2nix/home-manager/nixpkgs @@ -0,0 +1 @@ +.config/nixpkgs \ No newline at end of file diff --git a/hosts/d2nix/home-manager/packages.nix b/hosts/d2nix/home-manager/packages.nix new file mode 100644 index 0000000..56d4dc8 --- /dev/null +++ b/hosts/d2nix/home-manager/packages.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + jq + nextcloud-client + libreoffice + btop + neomutt + notmuch + isync + zathura + rofi + rofi-pass + simple-scan + brightnessctl + gimp + scrot + papirus-icon-theme + audio-recorder + starship + inkscape + firefox + poppler_utils + texlive.combined.scheme-full + hugo + eww + alacritty + youtube-dl + zola + keepassxc + zlib + python3 + nodejs + vlc + guake + graphviz + kdeconnect + ]; +} diff --git a/hosts/d2nix/home-manager/polybar.nix b/hosts/d2nix/home-manager/polybar.nix new file mode 100644 index 0000000..0304a81 --- /dev/null +++ b/hosts/d2nix/home-manager/polybar.nix @@ -0,0 +1,341 @@ +{ pkgs, ... }: + +# Created By Aditya Shakya @adi1090x +# Edited and ported to Nix by Litarvan + +let + bg = "#272727"; + fg = "#CACACA"; + ac = "#1E88E5"; + mf = "#383838"; +in + { +# enable = true; + + package = pkgs.polybar.override { + i3GapsSupport = true; + alsaSupport = true; + }; + +# script = '' +# ${pkgs.xorg.xrandr}/bin/xrandr --listactivemonitors | \ +# ${pkgs.gnugrep}/bin/grep -oP '(HDMI\-\d+|eDP\-\d+)' | \ +# ${pkgs.findutils}/bin/xargs -P1 -I{} ${pkgs.bash}/bin/bash -c "MONITOR={} polybar -q -r main" +# ''; + + script = "polybar -q -r main &"; + + config = { + "global/wm" = { + margin-bottom = 0; + margin-top = 0; + }; + + "bar/main" = { +# monitor = "$\{env:MONITOR:}"; + + monitor-strict = false; + override-redirect = false; + + bottom = true; + fixed-center = true; + + width = "100%"; + height = 36; + + offset-x = "0%"; + offset-y = "0%"; + + background = bg; + foreground = fg; + + radius-top = "0.0"; + radius-bottom = "0.0"; + + overline-size = 6; + underline-size = 6; + overline-color = bg; + underline-color = bg; + + border-top-size = 4; + border-color = ac; + + padding = 0; + + module-margin-left = 0; + module-margin-right = 0; + + font-0 = "Termsyn:size=12;2"; + font-1 = "Siji:size=12;2"; + font-2 = "xos4 Terminus:size = 12;1"; + + modules-left = "i3 cpu"; + modules-center = "memory alsa battery backlight"; + modules-right = "network date"; + + spacing = 0; + + dim-value = "1."; + + tray-position = "right"; + tray-detached = false; + tray-maxsize = 16; + tray-background = bg; + tray-offset-x = 0; + tray-offset-y = 0; + tray-padding = 0; + tray-scale = "1.0"; + + enable-ipc = true; + }; + + "settings" = { + throttle-output = 5; + throttle-output-for = 10; + throttle-input-for = 30; + + screenchange-reload = false; + + compositing-background = "source"; + compositing-foreground = "over"; + compositing-overline = "over"; + comppositing-underline = "over"; + compositing-border = "over"; + + pseudo-transparency = "false"; + }; + + "module/alsa" = { + type = "internal/alsa"; + + format-volume = "VOL "; + format-volume-background = mf; + format-volume-underline = bg; + format-volume-overline = bg; + format-volume-padding = 2; + format-volume-margin = 2; + + label-volume = "%percentage%%"; + + format-muted-background = mf; + format-muted-underline = bg; + format-muted-overline = bg; + format-muted-padding = 2; + format-muted-margin = 2; + + label-muted = "MUTED"; + label-muted-foreground = ac; + }; + + "module/backlight" = { + type = "internal/xbacklight"; + + card = "intel_backlight"; # TODO: Better way to fill this + + format = "LGT