Merge branch 'main' of github.com:JulienMalka/nix-config

This commit is contained in:
Julien Malka 2023-11-22 18:13:33 +01:00
commit 1114f77bc9
Signed by: Luj
GPG key ID: 6FC74C847011FD83
15 changed files with 313 additions and 18 deletions

View file

@ -0,0 +1,44 @@
{ config, pkgs, lib, ... }:
let
cfg = config.luj.programs.dunst;
in
with lib;
{
options.luj.programs.dunst = {
enable = mkEnableOption "Enable Dunst";
};
config = mkIf cfg.enable {
services.dunst = {
enable = true;
settings = {
global = {
corner_radius = 5;
follow = "mouse";
frame_color = "#89B4FA";
frame_width = 0;
separator_color = "frame";
};
urgency_low = {
background = "#1E1E2E";
foreground = "#CDD6F4";
};
urgency_normal = {
background = "#1E1E2E";
foreground = "#CDD6F4";
};
urgency_critical = {
background = "#1E1E2E";
foreground = "#CDD6F4";
frame_color = "#FAB387";
};
};
};
};
}

View file

@ -17,7 +17,18 @@ with lib;
signByDefault = true;
key = "6FC74C847011FD83";
};
extraConfig.init.defaultBranch = "main";
delta.enable = true;
ignores = [
".direnv"
];
extraConfig = {
init.defaultBranch = "main";
diff.colorMoved = "zebra";
pull.rebase = true;
fetch.prune = true;
rebase.autoStash = true;
push.autoSetupRemote = true;
};
};
home.extraActivationPath = [ pkgs.gnupg ];

View file

@ -132,13 +132,19 @@ with lib;
#julien.malka@telecom-paris.fr
notmuch tag +telecom-inbox path:telecom/Inbox/**
notmuch tag +telecom-inbox -- folder:telecom/Inbox
notmuch tag +telecom-gdr-gpl -- folder:telecom/Inbox/gdr-gpl
notmuch tag +telecom-gdr-sec -- folder:telecom/Inbox/gdr-sec
notmuch tag +telecom-infres-tous -- folder:telecom/Inbox/infres-tous
notmuch tag +telecom-tous -- folder:telecom/Inbox/telecom-tous
#luj@dgnum.eu
notmuch tag +dgnum-inbox path:dgnum/Inbox/**
notmuch tag +dgnum-bureau -dgnum-inbox -- path:dgnum/Inbox/Bureau/**
notmuch tag +dgnum-nixcon -dgnum-inbox -- path:dgnum/Inbox/NixCon/**
${pkgs.notifymuch}/bin/notifymuch
'';
};
@ -150,6 +156,7 @@ with lib;
"neomutt/work.profile".source = lib.mkForce ./work.profile;
"neomutt/discourse.profile".source = lib.mkForce ./discourse.profile;
"neomutt/dgnum.profile".source = lib.mkForce ./dgnum.profile;
"notifymuch/notifymuch.cfg".source = lib.mkForce ./notifymuch;
};

View file

@ -45,6 +45,10 @@ virtual-mailboxes "kfet" "notmuch://?query=tag:ens-kfet
named-mailboxes "---telecom---" =sep3
virtual-mailboxes "inbox" "notmuch://?query=tag:telecom-inbox
virtual-mailboxes "gdr-gpl" "notmuch://?query=tag:telecom-gdr-gpl
virtual-mailboxes "gdr-sec" "notmuch://?query=tag:telecom-gdr-sec
virtual-mailboxes "tous" "notmuch://?query=tag:telecom-tous
virtual-mailboxes "infres-tous" "notmuch://?query=tag:telecom-infres-tous
named-mailboxes "----dgnum----" =sep4
virtual-mailboxes "inbox" "notmuch://?query=tag:dgnum-inbox
@ -92,6 +96,10 @@ folder-hook "ens-dg" 'source ~/.config/neomutt/ens.profile'
folder-hook "ens-kfet" 'source ~/.config/neomutt/ens.profile'
folder-hook "telecom-inbox" 'source ~/.config/neomutt/telecom.profile'
folder-hook "telecom-gdr-gpl" 'source ~/.config/neomutt/telecom.profile'
folder-hook "telecom-gdr-sec" 'source ~/.config/neomutt/telecom.profile'
folder-hook "telecom-infres-tous" 'source ~/.config/neomutt/telecom.profile'
folder-hook "telecom-tous" 'source ~/.config/neomutt/telecom.profile'
folder-hook "work-nixos-discourse" 'source ~/.config/neomutt/discourse.profile'
folder-hook "work-dn42" 'source ~/.config/neomutt/work.profile'

View file

@ -0,0 +1,6 @@
[notifymuch]
query = is:unread and (tag:work-inbox or tag:ens-inbox or tag:telecom-inbox or tag:dgnum-inbox or tag:dgnum-bureau)
mail_client = kitty -x neomutt -y
recency_interval_hours = 48
hidden_tags = inbox unread attachment replied sent encrypted signed

View file

@ -20,7 +20,7 @@ with lib;
layer = "top";
modules-left = [ "custom/nixos" "sway/workspaces" ];
modules-center = [ "clock" ];
modules-right = [ "network" "battery" ];
modules-right = [ "custom/mails" "network" "battery" ];
"custom/nixos" = {
format = " ";
tooltip = false;
@ -67,6 +67,11 @@ with lib;
format-charging = "<span color='#cba6f7'></span> {capacity}%";
tooltip = false;
};
"custom/mails" = {
format = "<span color='#cba6f7'></span> {}";
exec = "${pkgs.notmuch}/bin/notmuch count 'tag:unread and (tag:dgnum-inbox or tag:ens-inbox or tag:work-inbox or tag:telecom-inbox or tag:dgnum-bureau)'";
interval = 10;
};
};
};
style = ''
@ -114,7 +119,7 @@ with lib;
color: #cba6f7;
}
#clock, #backlight, #pulseaudio, #bluetooth, #network, #battery{
#clock, #backlight, #pulseaudio, #bluetooth, #network, #battery, #custom-mails{
border-radius: 10px;
background-color: #11111b;
color: #cdd6f4;

View file

@ -0,0 +1,183 @@
{ config, pkgs, lib, ... }:
let
cfg = config.luj.programs.zsh;
fetchFromGitHub = pkgs.fetchFromGitHub;
in
with lib;
{
options.luj.programs.zsh = {
enable = mkEnableOption "Enable Zsh";
};
config = mkIf cfg.enable {
programs.zsh = {
enable = true;
enableCompletion = true;
enableAutosuggestions = true;
history = { save = 1000000; extended = true; ignoreDups = true; };
initExtra = ''
setopt notify autopushd
unsetopt autocd beep
ZSH_AUTOSUGGEST_STRATEGY=(completion history)
'';
shellAliases = {
ka = "killall";
mkd = "mkdir -pv";
ca = "khal interactive";
sync_ca = "vsync sync";
dnd = "dunstctl set-paused true";
nodnd = "dunstctl set-paused false";
lg = "lazygit";
g = "git";
gua = "git remote | xargs -L1 git push --all";
v = "$EDITOR";
sdn = "shutdown now";
SU = "systemctl --user";
SS = "sudo systemctl";
weather = "curl wttr.in";
v6 = "curl api6.ipify.org";
v4 = "curl api.ipify.org";
clbin = "curl -F'clbin=<-' https://clbin.com";
_0x0 = "curl -F'file=@-' https://0x0.st";
phs = "python -m http.server";
ls = "eza";
rtmv = "rsync -avP";
archive = "rsync --remove-source-files -avPzz";
luks_integrity_check = "gocryptfs -fsck -extpass 'pass Private/LUKS' /boot/luks";
fetch-emails = "mbsync --all && notmuch new && afew -t -n -v";
nsp = "nix-shell -p";
ns = "nix-shell";
ncg = "sudo nix-collect-garbage --delete-older-than 30d";
ncga = "sudo nix-collect-garbage -d";
nso = "sudo nix-store --optimise";
lln = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\"";
# Local build
lnb = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nom-build '<nixpkgs>' --no-out-link -A $1";
# Local shell
lns = "NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nix-shell -p $1";
# Local test
ltt = ''NIX_PATH=\"nixpkgs=$LOCAL_NIXPKGS_CHECKOUT\" nom-build --no-out-link "$LOCAL_NIXPKGS_CHECKOUT/nixos/tests/$1"'';
};
dirHashes = {
config = "/home/julien/dev/nix-config";
};
plugins = [
{
name = "history-search-multi-word";
src = fetchFromGitHub {
repo = "history-search-multi-word";
owner = "zdharma-continuum";
rev = "458e75c16db72596e4d7c6a45619dec285ebdcd7";
sha256 = "sha256-6B8uoKJm3gWmufsnLJzLEdSm1tQasrs2fUmS0pDsdMw=";
};
}
{
name = "git-aliases";
src = fetchFromGitHub {
repo = "git-aliases";
owner = "mdumitru";
rev = "c4cfe2cf5cf59a3da6bf3b735a20921a2c06c58d";
sha256 = "sha256-640qGgVeFaTIQBgYGY05/4wzMCxni0uWLWtByEFM2tE=";
};
}
{
name = "zsh-bitwarden";
src = fetchFromGitHub {
repo = "zsh-bitwarden";
owner = "Game4Move78";
rev = "8b32434d18765fe95ffc2191f5fb68100d913de7";
sha256 = "sha256-3zuutTUSdf218+jcn2z7yEGMYkg5VewXm9zO43aIYdI=";
};
}
{
name = "alias-tips";
src = fetchFromGitHub {
repo = "alias-tips";
owner = "djui";
rev = "4d2cf6f10e5080f3273be06b9801e1fd1f25d28d";
sha256 = "sha256-0N2DCpMraIXtEc7hMp0OBANNuYhHPLqzJ/hrAFcLma8=";
};
}
{
name = "auto-notify";
src = fetchFromGitHub {
repo = "zsh-auto-notify";
owner = "MichaelAquilina";
rev = "fb38802d331408e2ebc8e6745fb8e50356344aa4";
sha256 = "sha256-bY0qLX5Kpt2x4KnfvXjYK2+BhR3zKBgGsCvIxSzApws=";
};
}
{
name = "nix-shell";
src = fetchFromGitHub {
repo = "zsh-nix-shell";
owner = "chisui";
rev = "f8574f27e1d7772629c9509b2116d504798fe30a";
sha256 = "sha256-WNa8RljYhkOWk7AZbdTOvYhWw1fR8PjFxH/tnUCbems=";
};
}
{
name = "syntax-highlighting";
src = fetchFromGitHub {
repo = "zsh-syntax-highlighting";
owner = "zsh-users";
rev = "bb27265aeeb0a22fb77f1275118a5edba260ec47";
sha256 = "sha256-bD0oKXSw9lucJR+6/O16m7prwA1cP36C0Tvh5mklapw=";
};
}
{
name = "jq";
src = fetchFromGitHub {
repo = "jq-zsh-plugin";
owner = "reegnz";
rev = "98650d6eac46b5f87aa19f0a3dd321b0105643b8";
sha256 = "sha256-L2+PW39BZTy8h4yxxZxbKCVVKlfPruM12gRZ9FJ8YD8=";
};
}
];
};
# Broot
programs.broot = {
enable = true;
enableZshIntegration = true;
};
# Direnv: must have.
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.oh-my-posh = {
enable = true;
enableZshIntegration = true;
useTheme = "catppuccin_mocha";
};
# Misc
programs.lesspipe.enable = true;
home.packages = with pkgs; [ eza python3 libnotify ];
};
}

View file

@ -37,7 +37,7 @@
};
networking.hostName = "telecom";
networking.hostName = "fischer";
networking.wireless.enable = false;
@ -128,6 +128,26 @@
hardware.bluetooth.enable = true;
services.syncthing = {
enable = true;
user = "julien";
group = "users";
settings.options.urAccepted = -1;
overrideDevices = true;
overrideFolders = true;
devices = {
"tower" = { id = "XEPZZIP-GX73OKE-KNGZA47-XWWGI5G-LNXPU57-BMLXK5M-VNGS5UQ-ZFIZSAK"; };
};
folders = {
"dev" = {
path = "/home/julien/dev";
devices = [ "tower" ];
};
};
};
systemd.services.syncthing.serviceConfig.StateDirectory = "syncthing";
environment.systemPackages = with pkgs; [
tailscale
brightnessctl
@ -137,7 +157,25 @@
texlive.combined.scheme-full
];
services.printing.enable = true;
services.printing = {
enable = true;
extraConf = ''
JobPrivateAccess all
JobPrivateValues none
'';
clientConf = ''
ServerName localhost
Encryption Required
User jmalka
'';
};
environment.variables =
{
CUPS_USER = "jmalka";
};
services.avahi.enable = true;
services.avahi.nssmdns = true;
# for a WiFi printer

View file

@ -13,6 +13,8 @@
luj.programs.waybar.enable = true;
luj.programs.waybar.interfaceName = "enp0s13f0u1u4u4";
luj.programs.kitty.enable = true;
luj.programs.dunst.enable = true;
luj.programs.zsh.enable = true;
luj.emails.enable = true;
programs.rofi = {
@ -22,11 +24,6 @@
theme = "DarkBlue";
};
programs.direnv = {
enable = true;
enableFishIntegration = true;
nix-direnv.enable = true;
};
home.pointerCursor = {
name = "Adwaita";
@ -93,9 +90,6 @@
layout = "fr";
};
services.dunst = {
enable = true;
};
programs.chromium = {
enable = true;

View file

Before

Width:  |  Height:  |  Size: 467 KiB

After

Width:  |  Height:  |  Size: 467 KiB

View file

@ -1,10 +1,10 @@
{ config, pkgs, lib, ... }: {
users.mutableUsers = false;
users.defaultUserShell = pkgs.fish;
users.defaultUserShell = pkgs.zsh;
sops.secrets.user-root-password.neededForUsers = true;
programs.fish.enable = true;
programs.zsh.enable = true;
users.users.root = {
uid = config.ids.uids.root;

View file

@ -6,7 +6,7 @@
isNormalUser = true;
home = "/home/julien";
extraGroups = [ "wheel" config.users.groups.keys.name "filerun" "networkmanager" "davfs2" "adbusers" "audio" ];
shell = pkgs.fish;
shell = pkgs.zsh;
passwordFile = config.sops.secrets.user-julien-password.path;
};

View file

@ -4,7 +4,6 @@
isNormalUser = true;
home = "/home/status";
extraGroups = [ "wheel" ];
shell = pkgs.fish;
openssh.authorizedKeys.keyFiles = [
(pkgs.fetchurl {
url = "https://github.com/JulienMalka.keys";