Merge branch 'nixos' into nixos-work
This commit is contained in:
commit
cbe7a4a6ad
34 changed files with 440 additions and 303 deletions
|
|
@ -6,6 +6,7 @@ with lib;
|
|||
{
|
||||
options.my.terminal = {
|
||||
package = mkOption {
|
||||
description = "Terminal emulator package to use. Gets converted to path of bin automatically.";
|
||||
type = types.package;
|
||||
apply = lib.getExe;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -311,10 +311,4 @@ in
|
|||
};
|
||||
xdg.userDirs.enable = true;
|
||||
};
|
||||
|
||||
system.activationScripts.diff = ''
|
||||
if [ -e /run/current-system ]; then
|
||||
${pkgs.nvd}/bin/nvd --nix-bin-dir ${pkgs.nix}/bin diff /run/current-system/ "$systemConfig"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
10
modules/programs/nvim/new_plugins/comment.nix
Normal file
10
modules/programs/nvim/new_plugins/comment.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.comment.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ in
|
|||
"conform.nvim"
|
||||
];
|
||||
keymaps = [
|
||||
{ key = "<leader>cf"; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; }
|
||||
{ key = "="; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
10
modules/programs/nvim/new_plugins/crates-nvim.nix
Normal file
10
modules/programs/nvim/new_plugins/crates-nvim.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.crates-nvim.enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/direnv.nix
Normal file
10
modules/programs/nvim/new_plugins/direnv.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.direnv.enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/friendly-snippets.nix
Normal file
10
modules/programs/nvim/new_plugins/friendly-snippets.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.friendly-snippets.enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/fugitive.nix
Normal file
10
modules/programs/nvim/new_plugins/fugitive.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.fugitive.enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/gitsigns.nix
Normal file
10
modules/programs/nvim/new_plugins/gitsigns.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.gitsigns.enable = true;
|
||||
};
|
||||
}
|
||||
11
modules/programs/nvim/new_plugins/helpview.nix
Normal file
11
modules/programs/nvim/new_plugins/helpview.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.helpview.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "helpview.nvim" ];
|
||||
};
|
||||
}
|
||||
11
modules/programs/nvim/new_plugins/hmts.nix
Normal file
11
modules/programs/nvim/new_plugins/hmts.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.hmts.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "hmts.nvim" ];
|
||||
};
|
||||
}
|
||||
15
modules/programs/nvim/new_plugins/keymaps.nix
Normal file
15
modules/programs/nvim/new_plugins/keymaps.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
keymaps = [
|
||||
{ key = "<esc>"; action = "<cmd>noh<cr><esc>"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; }
|
||||
{ key = "<"; action = "<gv"; options.desc = "Shift left"; mode = [ "v" ]; }
|
||||
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; }
|
||||
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; }
|
||||
];
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/lastplace.nix
Normal file
10
modules/programs/nvim/new_plugins/lastplace.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.lastplace.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -16,9 +16,9 @@ in
|
|||
keymapsOnEvents = {
|
||||
LspAttach = [
|
||||
{
|
||||
key = "<leader>cc";
|
||||
key = "<leader>q";
|
||||
action = "<cmd>Lspsaga code_action<cr>";
|
||||
options.desc = "Code Action";
|
||||
options.desc = "Quickfix";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ in
|
|||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
key = "<leader>cr";
|
||||
key = "<leader>r";
|
||||
action = "<cmd>Lspsaga rename<cr>";
|
||||
options.desc = "Rename";
|
||||
options.buffer = true;
|
||||
|
|
|
|||
10
modules/programs/nvim/new_plugins/markdown-preview.nix
Normal file
10
modules/programs/nvim/new_plugins/markdown-preview.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.markdown-preview.enable = true;
|
||||
};
|
||||
}
|
||||
13
modules/programs/nvim/new_plugins/marks.nix
Normal file
13
modules/programs/nvim/new_plugins/marks.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.marks = {
|
||||
enable = true;
|
||||
defaultMappings = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/programs/nvim/new_plugins/mini.nix
Normal file
16
modules/programs/nvim/new_plugins/mini.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
align = { };
|
||||
};
|
||||
};
|
||||
performance.combinePlugins.standalonePlugins = [ "mini.nvim" ];
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/nvim-autopairs.nix
Normal file
10
modules/programs/nvim/new_plugins/nvim-autopairs.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.nvim-autopairs.enable = true;
|
||||
};
|
||||
}
|
||||
36
modules/programs/nvim/new_plugins/obsidian.nix
Normal file
36
modules/programs/nvim/new_plugins/obsidian.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
_:
|
||||
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.obsidian = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ui.enable = false;
|
||||
dir = "~/Documents/Nextcloud/Notes/zettelkasten/";
|
||||
note_id_func.__raw = ''
|
||||
function(title)
|
||||
if title ~= nil then
|
||||
return title
|
||||
else
|
||||
suffix = ""
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
return tostring(os.date("%Y-%m-%d")) .. "-" .. suffix
|
||||
end
|
||||
end
|
||||
'';
|
||||
mappings = {
|
||||
"<localleader>n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; };
|
||||
"<localleader>q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; };
|
||||
"<localleader>b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; };
|
||||
"<localleader>l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; };
|
||||
"<localleader>e" = { action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; opts.desc = "Extract Note"; opts.buffer = true; };
|
||||
"<localleader>r" = { action.__raw = ''function() return vim.cmd("ObsidianRename") end''; opts.desc = "Rename"; opts.buffer = true; };
|
||||
"<cr>" = { action.__raw = ''function() return require("obsidian").util.smart_action() end''; opts.buffer = true; opts.expr = true; };
|
||||
"gf" = { action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; opts = { noremap = false; expr = true; buffer = true; }; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/oil.nix
Normal file
10
modules/programs/nvim/new_plugins/oil.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.oil.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz = {
|
||||
programs.nixvim = lib.mkMerge [
|
||||
{ plugins.which-key.enable = true; }
|
||||
{ plugins.lastplace.enable = true; }
|
||||
{ plugins.comment.enable = true; }
|
||||
{ plugins.ts-context-commentstring.enable = true; }
|
||||
{
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
settings.view_method = "zathura";
|
||||
};
|
||||
}
|
||||
{
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
keymaps.todoTelescope.key = "<leader>fc";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
keymaps = [
|
||||
{ key = "<esc>"; action = "<cmd>noh<cr><esc>"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; }
|
||||
{ key = "<"; action = "<gv"; options.desc = "Shift left"; mode = [ "v" ]; }
|
||||
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; }
|
||||
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; }
|
||||
];
|
||||
}
|
||||
{ plugins.oil.enable = true; }
|
||||
{ plugins.nvim-autopairs.enable = true; }
|
||||
{ plugins.vim-surround.enable = true; }
|
||||
|
||||
# TODO: add linters
|
||||
# {
|
||||
# plugins.lint.enable = true;
|
||||
# plugins.lint.lintersByFt = { };
|
||||
# }
|
||||
|
||||
{
|
||||
plugins.marks.enable = true;
|
||||
plugins.marks.defaultMappings = false;
|
||||
}
|
||||
{
|
||||
plugins.hmts.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "hmts.nvim" ];
|
||||
}
|
||||
{ plugins.gitsigns.enable = true; }
|
||||
{ plugins.fugitive.enable = true; }
|
||||
{ plugins.friendly-snippets.enable = true; }
|
||||
{ plugins.direnv.enable = true; }
|
||||
{ plugins.crates-nvim.enable = true; }
|
||||
{
|
||||
plugins.helpview.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "helpview.nvim" ];
|
||||
}
|
||||
{
|
||||
plugins.obsidian.enable = true;
|
||||
plugins.obsidian.settings = {
|
||||
dir = "~/Documents/Nextcloud/Notes/zettelkasten/";
|
||||
note_id_func.__raw = ''
|
||||
function(title)
|
||||
if title ~= nil then
|
||||
return title
|
||||
else
|
||||
suffix = ""
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
return tostring(os.date("%Y-%m-%d")) .. "-" .. suffix
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
{
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
align = { };
|
||||
};
|
||||
};
|
||||
performance.combinePlugins.standalonePlugins = [ "mini.nvim" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
13
modules/programs/nvim/new_plugins/render-markdown.nix
Normal file
13
modules/programs/nvim/new_plugins/render-markdown.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.render-markdown = {
|
||||
enable = true;
|
||||
settings.latex.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -31,6 +31,10 @@ _:
|
|||
action = "oldfiles";
|
||||
options.desc = "Recent files";
|
||||
};
|
||||
"<leader>fc" = {
|
||||
action = "commands";
|
||||
options.desc = "Commands";
|
||||
};
|
||||
};
|
||||
};
|
||||
web-devicons.enable = true;
|
||||
|
|
|
|||
13
modules/programs/nvim/new_plugins/todo-comments.nix
Normal file
13
modules/programs/nvim/new_plugins/todo-comments.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
keymaps.todoTelescope.key = "<leader>ft";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.ts-context-commentstring.enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/vim-surround.nix
Normal file
10
modules/programs/nvim/new_plugins/vim-surround.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.vim-surround.enable = true;
|
||||
};
|
||||
}
|
||||
13
modules/programs/nvim/new_plugins/vimtex.nix
Normal file
13
modules/programs/nvim/new_plugins/vimtex.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
settings.view_method = "zathura";
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/programs/nvim/new_plugins/which-key.nix
Normal file
10
modules/programs/nvim/new_plugins/which-key.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.which-key.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ let
|
|||
|
||||
cfg = config.my.programs.python;
|
||||
|
||||
pythonVersions = map (version: "3${toString version}") (range 8 13);
|
||||
pythonVersions = map (version: "3${toString version}") (range 9 13);
|
||||
enabledVersions = filterAttrs (_: value: value.enable) cfg.versions;
|
||||
|
||||
pythonPackages = version: attrNames pkgs."python${version}Packages";
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ in
|
|||
enable = mkEnableOption "river";
|
||||
keyboardLayouts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "list of keyboard layouts";
|
||||
description = "List of keyboard layouts.";
|
||||
default = [ "us" "de" ];
|
||||
};
|
||||
nvidiaSupport = mkEnableOption "nvidiaSupport";
|
||||
nvidiaSupport = mkEnableOption "nvidia gpu support";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -66,6 +66,9 @@ in
|
|||
open = "spawn 'wlr-randr --output eDP-1 --on'";
|
||||
};
|
||||
map = {
|
||||
passthrough = {
|
||||
"Super F11" = "enter-mode normal";
|
||||
};
|
||||
normal = {
|
||||
"Super Q" = "close";
|
||||
"Super Return" = "spawn '${config.my.terminal.package}'";
|
||||
|
|
@ -103,6 +106,8 @@ in
|
|||
"None XF86AudioNext" = "spawn 'playerctl -p spotifyd,firefox next'";
|
||||
"None XF86AudioPlay" = "spawn 'playerctl -p spotifyd,firefox play-pause'";
|
||||
"None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'";
|
||||
|
||||
"Super F11" = "enter-mode passthrough";
|
||||
} //
|
||||
# tags
|
||||
(
|
||||
|
|
@ -257,7 +262,6 @@ in
|
|||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
displayManager = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue