Merge branch 'main' of git.atlanticaweb.fr:alexandre/nixos-config

This commit is contained in:
Alexandre LUCAZEAU 2023-06-23 19:47:57 +02:00
commit c705573a0e
11 changed files with 142 additions and 100 deletions

View File

@ -119,8 +119,16 @@
enable = true; enable = true;
unmanaged = [ "interface-name:ve-*" ]; unmanaged = [ "interface-name:ve-*" ];
}; };
firewall.enable = true; firewall = {
firewall.allowedTCPPorts = [ 24800 6600 1194]; enable = true;
allowedTCPPorts = [ 24800 6600 1194 ];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
};
}; };
i18n.defaultLocale = "fr_FR.UTF-8"; i18n.defaultLocale = "fr_FR.UTF-8";
@ -153,10 +161,17 @@
# run garbage collector at 19h00 everyday # run garbage collector at 19h00 everyday
# and remove stuff older than 60 days # and remove stuff older than 60 days
nix.gc.automatic = true; # nix.gc.automatic = true;
nix.gc.dates = "19:00"; # nix.gc.dates = "19:00";
nix.gc.persistent = true; # nix.gc.persistent = true;
nix.gc.options = "--delete-older-than 60d"; # nix.gc.options = "--delete-older-than 60d";
nix.settings.auto-optimise-store = true;
nix.gc = {
automatic = true;
dates = "weekly";
persistent = true;
options = "--delete-older-than 10d";
};
# clean /tmp at boot # clean /tmp at boot
boot.cleanTmpDir = true; boot.cleanTmpDir = true;

View File

@ -145,6 +145,7 @@ exec --no-startup-id udiskie -t
exec --no-startup-id blueman-applet exec --no-startup-id blueman-applet
exec --no-startup-id vlc exec --no-startup-id vlc
exec --no-startup-id guake exec --no-startup-id guake
exec --no-startup-id kdeconnect-indicator
exec --no-startup-id i3-msg 'workspace $ws9; exec keepassxc;' exec --no-startup-id i3-msg 'workspace $ws9; exec keepassxc;'
#exec --no-startup-id i3-msg 'workspace $ws5; exec emacs;' #exec --no-startup-id i3-msg 'workspace $ws5; exec emacs;'
exec --no-startup-id i3-msg 'workspace $ws1; exec ferdi;' exec --no-startup-id i3-msg 'workspace $ws1; exec ferdi;'

View File

@ -114,72 +114,10 @@
org-image-actual-width '(300)) org-image-actual-width '(300))
;; files with ".org" open in org-mode ;; files with ".org" open in org-mode
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(setq org-agenda-files '("/home/alexandre/Nextcloud/PRIVE/13_Org/journal")) (setq org-agenda-files '("/home/alexandre/Nextcloud/PRIVE/13_Org/backlog.org" "/home/alexandre/Nextcloud/PRIVE/13_Org/notes"))
(setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/13_Org/notes")) (setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/13_Org/notes"))
(setq org-default-notes-file "~/Nextcloud/PRIVE/13_Org/backlog.org") (setq org-default-notes-file "~/Nextcloud/PRIVE/13_Org/backlog.org")
;;(setq org-capture-templates
;; '(("b" "Ajouter au backlog" entry
;; (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
;; "* TODO %?" :empty-lines 1))
(setq org-capture-templates
'(("t" "TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %? %^G \n %U" :empty-lines 1)
("s" "Scheduled TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %? %^G \nSCHEDULED: %^t\n %U" :empty-lines 1)
("l" "Link" entry (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* TODO %a %? %^G\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")
("n" "Note" entry (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* %? %^G\n%U" :empty-lines 1)
("j" "Journal" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
"* %? %^G\nEntered on %U\n")))
;; Org-Roam basic configuration
(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)
(org-roam-db-autosync-mode)
: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)
("C-c n o" . org-open-at-point)
("C-M-i" . completion-at-point)))))
;; (:map org-roam-dailies-map
;; (("Y" . org-roam-dailies-capture-yesterday)
;; ("T" . org-roam-dailies-capture-tomorrow))))
(setq org-roam-dailies-capture-templates
'(("d" "default" entry
"* %?"
;;:target (file+datetree "journal-2023.org" year))))
:target (file+head "journal-%<%Y>.org" "#+TITLE: %<%Y-%m-%d>\n"))))
;; :target (file+head "%<%Y-%m>.org" "#+TITLE: %<%Y-%m>\n"))))
;; 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-cg" 'gtd)
;; This seems like a good basic set of keywords to start out with:
(setq org-todo-keywords '((type "TODO" "En cours" "WAIT" "CANCELED" "DONE"))) (setq org-todo-keywords '((type "TODO" "En cours" "WAIT" "CANCELED" "DONE")))
(setf org-todo-keyword-faces '(("TODO" . (:foreground "cyan" :background "steelblue" :bold t :weight bold)) (setf org-todo-keyword-faces '(("TODO" . (:foreground "cyan" :background "steelblue" :bold t :weight bold))
("En cours" . (:foreground "yellow" :background "red" :bold t :weight bold)) ("En cours" . (:foreground "yellow" :background "red" :bold t :weight bold))
("En attente de réponse" . (:foreground "yellow" :background "magenta2" :bold t :weight bold)) ("En attente de réponse" . (:foreground "yellow" :background "magenta2" :bold t :weight bold))
@ -187,28 +125,92 @@
("DONE" . (:foreground "gray50" :background "gray30")))) ("DONE" . (:foreground "gray50" :background "gray30"))))
;; tags ;; tags
(setq org-tag-alist '(("DEVIS" . ?d) ("PROJETS" . ?p) ("CLIENT" . ?c) ("PROSPECT" . ?o) ("INTERNE" . ?i) ("AO" . ?a) ("PJ" . ?z) ("AVV" . ?v))) (setq org-tag-alist '(("DEVIS" . ?d) ("PROJETS" . ?p) ("CLIENT" . ?c) ("PROSPECT" . ?o) ("INTERNE" . ?i) ("AO" . ?a) ("PJ" . ?z) ("AVV" . ?v) ("LEGACY" . ?l) ("ROC" . ?r)))
(setq org-tag-faces (setq org-tag-faces
'( '(
("DEVIS" . (:foreground "OrangeRed" :weight bold)) ("DEVIS" . (:foreground "OrangeRed" :weight bold))
("ROC" . (:foreground "OrangeRed" :weight bold))
("PJ" . (:foreground "brightyellow" :weight bold)) ("PJ" . (:foreground "brightyellow" :weight bold))
("PROJET" . (:foreground "IndianRed1" :weight bold)) ("PROJET" . (:foreground "IndianRed1" :weight bold))
("INTERNE" . (:foreground "LimeGreen" :weight bold)) ("INTERNE" . (:foreground "LimeGreen" :weight bold))
("LEGACY" . (:foreground "LimeGreen" :weight bold))
("CLIENT" . (:foreground "Orange" :weight bold)) ("CLIENT" . (:foreground "Orange" :weight bold))
("PROSPECT" . (:foreground "MediumPurple3" :weight bold)) ("PROSPECT" . (:foreground "MediumPurple3" :weight bold))
("AO" . (:foreground "HotPink2" :weight bold)) ("AO" . (:foreground "HotPink2" :weight bold))
) )
) )
;;; Org-journal ;; org-capture use to add note to backlog file. At the end of day, use org-refile to dispatch to good note
;; https://github.com/bastibe/org-journal ;; https://sachachua.com/blog/2014/11/using-org-mode-keep-process-journal/
;; C-c C-j
(require 'org-journal) (setq org-capture-templates
(setq org-journal-date-prefix "#+TITLE: " '(("t" "TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
org-journal-carryover-items "-TODO=\"DONE\"" "* TODO %? %^G \n %U" :empty-lines 1)
org-journal-time-prefix "* " ("s" "Scheduled TODO" entry (file+datetree "~/Nextcloud/PRIVE/13_Org/backlog.org")
org-journal-date-format "%a, %Y-%m-%d" "* TODO %? %^G \nSCHEDULED: %^t\n %U" :empty-lines 1)
org-journal-file-format "%Y-%m-%d-journal.org" ("l" "Link" entry (file "~/Nextcloud/PRIVE/13_Org/backlog.org")
org-journal-dir "/home/alexandre/Nextcloud/PRIVE/13_Org/journal/") "* TODO %a %? %^G\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")
(global-set-key "\C-cnj" 'org-journal-new-entry) ("j" "Journal entry" plain
(file+datetree+prompt "~/Nextcloud/PRIVE/13_Org/journal.org")
"%K ****** %a\n%i\n%?\n")
("n" "Note dans le journal" entry (file "~/Nextcloud/PRIVE/13_Org/journal.org")
"* %? %^G\n%U" :empty-lines 1)))
;; Org-Roam basic configuration
(use-package org-roam
:after org
:init
(setq org-roam-v2-ack t) ;; Acknowledge V2 upgrade
:custom
(org-roam-directory (file-truename org-directory))
(org-roam-completion-everywhere t)
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n o" . org-open-at-point)
("C-c n j" . org-roam-dailies-capture-today)
("C-c n i" . org-roam-node-insert))
:config
(org-roam-setup)
(org-roam-db-autosync-mode)
)
;; caldav
;;(setq org-caldav-url "https://next20.produhost.net/remote.php/dav/alexandre")
;;(setq org-caldav-calendars
;; '((:calendar-id "alexandre-dri"
;; :files ("~/Nextcloud/PRIVE/13_Org/calendar/alexandre-dri.org")
;; :inbox "~/Nextcloud/PRIVE/13_Org/calendar/alexandre-dri-inbox.org")))
;;(setq org-icalendar-include-todo 'all
;; org-caldav-sync-todo t)
;;
(use-package org-journal
:ensure t
:defer t
:init
;; Change default prefix key; needs to be set before loading org-journal
(setq org-journal-prefix-key "C-c j ")
:config
(setq org-journal-file-type=weekly
org-journal-date-format "%A, %d %B %Y"))
;;;; Index org file and backlog file
(defvar org-gtd-file "~/Nextcloud/PRIVE/13_Org/DRI.org")
(defvar org-backlog-file "~/Nextcloud/PRIVE/13_Org/backlog.org")
;; Open DRI.org when I hit C-c g
(defun gtd ()
"Open the GTD file."
(interactive)
(find-file org-gtd-file))
;; Open backlog.org when I hit file hit C-c b
(defun gtb ()
"Open the backlog file."
(interactive)
(find-file org-backlog-file))
;; keybinding
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cg" 'gtd)
(global-set-key "\C-cb" 'gtb)

View File

@ -10,6 +10,7 @@
./mails.nix ./mails.nix
./dunst.nix ./dunst.nix
./bat.nix ./bat.nix
./kdeconnect.nix
# ./redshift.nix # ./redshift.nix
# ../../../modules/neovim.nix # ../../../modules/neovim.nix
../../../modules/rust.nix ../../../modules/rust.nix

View File

@ -72,11 +72,11 @@
interval = 60; interval = 60;
format = "%a %d/%m %R"; format = "%a %d/%m %R";
} }
{ # {
block = "pomodoro"; # block = "Kdeconnect";
message = "Break !"; # format = " $icon {$bat_icon $bat_charge |}{$notif_icon |}{$network_icon$network_strength $network_type |}";
break_message = "Reprise"; # bat_good = 101;
} # }
]; ];
icons = "material-nf"; icons = "material-nf";
theme = "nord-dark"; theme = "nord-dark";

View File

@ -0,0 +1,15 @@
{ pkgs, ... }: {
services.kdeconnect = {
enable = true;
};
}
# networking.firewall = {
# enable = true;
# allowedTCPPortRanges = [
# { from = 1714; to = 1764; } # KDE Connect
# ];
# allowedUDPPortRanges = [
# { from = 1714; to = 1764; } # KDE Connect
# ];
# }

View File

@ -2,14 +2,16 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./firewall-services.nix ./firewall-services.nix
./VPN.nix
../modules/users.nix ../modules/users.nix
../modules/common.nix ../modules/common.nix
../modules/smtp.nix ../modules/smtp.nix
../modules/grafana.nix ../modules/grafana.nix
../docker/podman.nix
]; ];
system.stateVersion = "22.05"; system.stateVersion = "22.05";
boot.cleanTmpDir = true; boot.tmp.cleanOnBoot = true;
zramSwap.enable = true; zramSwap.enable = true;
networking.hostName = "sup"; networking.hostName = "sup";
services.openssh.enable = true; services.openssh.enable = true;

View File

@ -14,14 +14,16 @@
system.stateVersion = "21.11"; system.stateVersion = "21.11";
boot.cleanTmpDir = true; boot.tmp.cleanOnBoot = true;
zramSwap.enable = false; zramSwap.enable = false;
networking.hostName = "web"; networking.hostName = "web";
services.openssh = { services.openssh = {
enable = true; enable = true;
permitRootLogin = "no"; settings = {
passwordAuthentication = false; PermitRootLogin = "no";
kbdInteractiveAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
}; };
} }

View File

@ -8,13 +8,15 @@
database = { database = {
type = "sqlite3"; # Database type type = "sqlite3"; # Database type
}; };
domain = "git.atlanticaweb.fr"; # Domain name settings.server = {
rootUrl = "https://git.atlanticaweb.fr/"; # Root web URL ROOT_URL = "https://git.atlanticaweb.fr/"; # Root web URL
httpPort = 3001; # Provided unique port HTTP_PORT = 3001; # Provided unique port
DOMAIN = "git.atlanticaweb.fr"; # Domain name
};
dump.enable = true; dump.enable = true;
dump.backupDir = "/srv/backup/gitea"; dump.backupDir = "/srv/backup/gitea";
lfs.enable = true; lfs.enable = true;
disableRegistration = true; # comment this line for the first user admin settings.service.DISABLEREGISTRATION = true; # comment this line for the first user admin
}; };
} }

View File

@ -5,9 +5,11 @@
{ {
services.grafana = { services.grafana = {
enable = true; enable = true;
domain = "sup.atlanticaweb.fr"; settings.server = {
port = 2342; domain = "sup.atlanticaweb.fr";
addr = "192.168.10.108"; http_port = 2342;
http_addr = "192.168.10.108";
};
}; };
services.prometheus = { services.prometheus = {
enable = true; enable = true;

View File

@ -10,7 +10,7 @@
createHome = true; createHome = true;
home = "/home/alexandre"; home = "/home/alexandre";
description = "Alexandre LUCAZEAU"; description = "Alexandre LUCAZEAU";
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" "docker" "plocate" ];
group = "alexandre"; group = "alexandre";
shell = pkgs.fish; shell = pkgs.fish;
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUA1RW6JwZasspAp8qmFRFnlV5WXjhLfStAAkM+KYLv lucazeau.alexandre@gmail.com" ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUA1RW6JwZasspAp8qmFRFnlV5WXjhLfStAAkM+KYLv lucazeau.alexandre@gmail.com" ];