nixvim cleanup & fix gpg

This commit is contained in:
2026-02-27 14:58:29 +01:00
parent ce176d0022
commit 454ec27541
12 changed files with 297 additions and 201 deletions

View File

@@ -1,6 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [
./services
];
home = { home = {
username = "elias"; username = "elias";
homeDirectory = "/home/elias"; homeDirectory = "/home/elias";

View File

@@ -1,15 +1,52 @@
{ ... }: { lib, pkgs, ... }:
{ {
home.packages = with pkgs; [
nodejs_22
cz-cli
tig
];
programs.git = { programs.git = {
enable = true; enable = true;
settings.user = { settings = {
name = "4Lost"; init = {
defaultBranch = "main";
};
user = {
email = "elias.schroeter@e.email"; email = "elias.schroeter@e.email";
name = "Elias Schröter";
};
}; };
signing = { signing = {
key = "0x99D2EF975FE523CC"; key = "04F3A2ED4B33F254";
signByDefault = false; format = lib.mkForce "openpgp";
signByDefault = true;
};
};
programs.lazygit = {
enable = true;
# https://github.com/catppuccin/lazygit
settings = {
gui = {
theme = {
activeBorderColor = [
"#f4dbd6"
"bold"
];
inactiveBorderColor = [ "#a5adcb" ];
optionsTextColor = [ "#8aadf4" ];
selectedLineBgColor = [ "#363a4f" ];
cherryPickedCommitBgColor = [ "#494d64" ];
cherryPickedCommitFgColor = [ "#f4dbd6" ];
unstagedChangesColor = [ "#ed8796" ];
defaultFgColor = [ "#cad3f5" ];
searchingActiveBorderColor = [ "#eed49f" ];
};
authorColors = {
"*" = "#b7bdf8";
};
};
}; };
}; };
} }

View File

@@ -82,4 +82,3 @@
]; ];
}; };
} }

View File

@@ -9,7 +9,7 @@
which-key.settings.spec = [ which-key.settings.spec = [
{ {
__unkeyed-1 = "<leader>c"; __unkeyed-1 = "<leader>c";
group = "Boxes"; group = "Comment Boxes";
icon = " "; icon = " ";
} }
]; ];
@@ -53,4 +53,3 @@
]; ];
}; };
} }

View File

@@ -30,6 +30,7 @@
./peek.nix ./peek.nix
./markdown-preview.nix ./markdown-preview.nix
./smart-splits.nix ./smart-splits.nix
./snippets.nix
./sniprun.nix ./sniprun.nix
./startup.nix ./startup.nix
./surround.nix ./surround.nix
@@ -43,10 +44,9 @@
./typst-vim.nix ./typst-vim.nix
./undotree.nix ./undotree.nix
./vimtex.nix ./vimtex.nix
./web-devicons.nix
./which-key.nix ./which-key.nix
./yanky.nix ./yanky.nix
./zk.nix ./zk.nix
./snippets.nix
]; ];
} }

View File

@@ -19,7 +19,7 @@ in
dynomark-nvim dynomark-nvim
]; ];
extraConfigLua = ''require('dynomark').setup({})''; extraConfigLua = "require('dynomark').setup({})";
keymaps = [ keymaps = [
{ {
@@ -35,7 +35,7 @@ in
action = "<Plug>(DynomarkRun)"; action = "<Plug>(DynomarkRun)";
mode = [ "n" ]; mode = [ "n" ];
options = { options = {
desc = "Run dynomark query under cursor"; desc = "Run Dynomark query under cursor";
}; };
} }
]; ];

View File

@@ -105,66 +105,66 @@
}; };
}; };
mappings = { mappings = {
MkdnEnter = { MkdnEnter = [
key = "<CR>"; [
modes = [
"n" "n"
"v" "v"
"i" "i"
]
"<CR>"
]; ];
}; MkdnGoBack = [
MkdnGoBack = { "n"
key = "<BS>"; "<BS>"
modes = "n"; ];
}; MkdnDecreaseHeading = [
MkdnDecreaseHeading = { "n"
key = "-"; "-"
modes = "n"; ];
}; MkdnIncreaseHeading = [
MkdnIncreaseHeading = { "n"
key = "+"; "+"
modes = "n"; ];
}; MkdnNewListItemAboveInsert = [
MkdnNewListItemAboveInsert = { "n"
key = "O"; "O"
modes = "n"; ];
}; MkdnNewListItemBelowInsert = [
MkdnNewListItemBelowInsert = { "n"
key = "o"; "o"
modes = "n"; ];
}; MkdnTableNewColAfter = [
MkdnTableNewColAfter = { "n"
key = "<leader>ic"; "<leader>ic"
modes = "n"; ];
}; MkdnTableNewColBefore = [
MkdnTableNewColBefore = { "n"
key = "<leader>iC"; "<leader>iC"
modes = "n"; ];
}; MkdnTableNewRowAbove = [
MkdnTableNewRowAbove = { "n"
key = "<leader>iR"; "<leader>iR"
modes = "n"; ];
}; MkdnTableNewRowBelow = [
MkdnTableNewRowBelow = { "n"
key = "<leader>ir"; "<leader>ir"
modes = "n"; ];
}; MkdnTableNextCell = [
MkdnTableNextCell = { "i"
key = "<Tab>"; "<Tab>"
modes = "i"; ];
}; MkdnTablePrevCell = [
MkdnTablePrevCell = { "i"
key = "<S-Tab>"; "<S-Tab>"
modes = "i"; ];
}; MkdnToggleToDo = [
MkdnToggleToDo = { [
key = "<C-Space>";
modes = [
"n" "n"
"v" "v"
]
"<C-Space>"
]; ];
}; };
};
create_dirs = true; create_dirs = true;
new_file_template = { new_file_template = {
use_template = true; use_template = true;

View File

@@ -0,0 +1,9 @@
{ ... }:
{
programs.nixvim = {
plugins = {
web-devicons.enable = true;
};
};
}

View File

@@ -15,17 +15,20 @@
source = ./src; source = ./src;
}; };
wayland.windowManager.river = let wayland.windowManager.river =
let
all_tags = "$(((1 << 32) - 1))"; all_tags = "$(((1 << 32) - 1))";
scratch_tag = "$((1 << 20 ))"; scratch_tag = "$((1 << 20 ))";
all_but_scratch_tag = "$(( ((1 << 32) - 1) ^ ${scratch_tag} ))"; all_but_scratch_tag = "$(( ((1 << 32) - 1) ^ ${scratch_tag} ))";
tags = i: "$((1 << (${i} - 1)))"; tags = i: "$((1 << (${i} - 1)))";
genTagMappings = key: command: genTagMappings =
lib.attrsets.mergeAttrsList key: command:
(map (i: { "${key (toString i)}" = "${command (toString i)}"; }) lib.attrsets.mergeAttrsList (
(lib.lists.range 1 9)); map (i: { "${key (toString i)}" = "${command (toString i)}"; }) (lib.lists.range 1 9)
in { );
in
{
enable = true; enable = true;
extraSessionVariables = { extraSessionVariables = {
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
@@ -33,11 +36,11 @@
}; };
systemd.enable = true; systemd.enable = true;
xwayland.enable = true; xwayland.enable = true;
extraConfig = ''rivertile -view-padding 0 -outer-padding 0 &''; extraConfig = "rivertile -view-padding 0 -outer-padding 0 &";
settings = { settings = {
spawn = [ spawn = [
"/home/elias/.config/helperscripts/startEww.sh" "/home/elias/.config/helperscripts/startEww.sh"
"nextcloud" # "nextcloud"
]; ];
spawn-tagmask = "${all_but_scratch_tag}"; spawn-tagmask = "${all_but_scratch_tag}";
keyboard-layout = "de"; keyboard-layout = "de";
@@ -45,7 +48,11 @@
rule-add = { rule-add = {
"-app-id" = { "-app-id" = {
"'bar'" = "csd"; "'bar'" = "csd";
"'float*'" = { "-title" = { "'foo'" = "float"; }; }; "'float*'" = {
"-title" = {
"'foo'" = "float";
};
};
}; };
}; };
map-pointer = { map-pointer = {
@@ -64,12 +71,18 @@
"Super P" = "spawn 'rofi -show drun'"; "Super P" = "spawn 'rofi -show drun'";
"Super+Shift C" = "close"; "Super+Shift C" = "close";
# Screenshots # Screenshots
"None Print" = "spawn 'grim ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Whole Screen to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Whole Screen to File "None Print" =
"Super Print" = "spawn 'grim -g \"$(slurp)\" ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Selection to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Selection to File "spawn 'grim ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Whole Screen to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Whole Screen to File
"Shift Print" = "spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" ~/Pictures/active_window_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Active Window to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Active Window to File "Super Print" =
"Control Print" = "spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Whole Screen to Clipboard\"'"; # Whole Screen to Clipboard "spawn 'grim -g \"$(slurp)\" ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Selection to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Selection to File
"Control+Super Print" = "spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Selection to Clipboard\"'"; # Selection to Clipboard "Shift Print" =
"Control+Shift Print" = "spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" - | wl-copy --type image/png; yad --text=\"Screenshot - Active Window to Clipboard\"'"; # Active Window to Clipboard "spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" ~/Pictures/active_window_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Active Window to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Active Window to File
"Control Print" =
"spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Whole Screen to Clipboard\"'"; # Whole Screen to Clipboard
"Control+Super Print" =
"spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Selection to Clipboard\"'"; # Selection to Clipboard
"Control+Shift Print" =
"spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" - | wl-copy --type image/png; yad --text=\"Screenshot - Active Window to Clipboard\"'"; # Active Window to Clipboard
# Window Control # Window Control
"Super J" = "focus-view next"; "Super J" = "focus-view next";
"Super K" = "focus-view previous"; "Super K" = "focus-view previous";
@@ -121,13 +134,11 @@
"Super Y" = "spawn 'signal-desktop'"; "Super Y" = "spawn 'signal-desktop'";
"Super X" = "spawn 'telegram-desktop'"; "Super X" = "spawn 'telegram-desktop'";
"Super V" = "spawn 'thunderbird'"; "Super V" = "spawn 'thunderbird'";
} // genTagMappings (i: "Super ${i}") (i: "set-focused-tags ${tags i}") }
// genTagMappings (i: "Super+Shift ${i}") // genTagMappings (i: "Super ${i}") (i: "set-focused-tags ${tags i}")
(i: "set-view-tags ${tags i}") // genTagMappings (i: "Super+Shift ${i}") (i: "set-view-tags ${tags i}")
// genTagMappings (i: "Super+Control ${i}") // genTagMappings (i: "Super+Control ${i}") (i: "toggle-focused-tags ${tags i}")
(i: "toggle-focused-tags ${tags i}") // genTagMappings (i: "Super+Shift+Control ${i}") (i: "toggle-view-tags ${tags i}");
// genTagMappings (i: "Super+Shift+Control ${i}")
(i: "toggle-view-tags ${tags i}");
}; };
}; };
}; };

View File

@@ -2,8 +2,8 @@
{ {
imports = [ imports = [
./ssh-agent ./ssh-agent.nix
./gpg-agent ./gpg-agent.nix
./hypridle.nix ./hypridle.nix
./nextcloud.nix ./nextcloud.nix
]; ];

View File

@@ -1,18 +1,64 @@
{ pkgs, ... }: { pkgs, ... }:
# See https://github.com/nix-community/home-manager/issues/3095
let
pinentryRofi = pkgs.writeShellApplication {
name = "pinentry-rofi-with-env";
text = ''
PATH="$PATH:${pkgs.coreutils}/bin:${pkgs.rofi}/bin"
"${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@"
'';
};
in
{ {
home.packages = with pkgs; [ pinentry-rofi pinentry-gnome3 ]; home.packages = with pkgs; [
pinentry-rofi
pinentry-gnome3
];
programs.gpg = {
enable = true;
scdaemonSettings = {
disable-ccid = true;
};
settings = {
personal-cipher-preferences = "AES256 AES192 AES";
personal-digest-preferences = "SHA512 SHA384 SHA256";
personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed";
cert-digest-algo = "SHA512";
s2k-digest-algo = "SHA512";
s2k-cipher-algo = "AES256";
charset = "utf-8";
no-comments = true;
no-emit-version = true;
no-greeting = true;
keyid-format = "0xlong";
list-options = "show-uid-validity";
verify-options = "show-uid-validity";
with-fingerprint = true;
require-cross-certification = true;
no-symkey-cache = true;
armor = true;
use-agent = true;
throw-keyids = true;
keyserver = "hkps://keyserver.ubuntu.com:443";
};
};
programs.gpg.enable = true;
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
enableZshIntegration = true; enableZshIntegration = true;
defaultCacheTtl = 7200; # 2h enableNushellIntegration = true;
maxCacheTtl = 28800; # 8h defaultCacheTtl = 60;
maxCacheTtl = 120;
enableSshSupport = true;
sshKeys = [ "8E42E6C65D5F9894CFFF294851AB0CEB5F0B1FAA" ];
pinentry.package = pkgs.pinentry-gnome3;
# under extraConfig
# pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env
extraConfig = '' extraConfig = ''
ttyname $GPG_TTY ttyname $GPG_TTY
''; '';
}; };
} }

View File

@@ -1,17 +1,8 @@
{ pkgs, ... }: { ... }:
{ {
systemd.user.services.nextcloud = { services.nextcloud-client = {
description = "Nextcloud Desktop Client"; enable = true;
after = [ "graphical-session.target" ]; # started nach der grafischen Sitzung startInBackground = true;
serviceConfig = {
ExecStart = "${pkgs.nextcloud}/bin/nextcloud";
Restart = "on-failure";
Environment = ''
MOZ_ENABLE_WAYLAND=1
GDK_BACKEND=wayland
'';
};
wantedBy = [ "default.target" ];
}; };
} }