Merge branch 'nixos' into nixos-work

This commit is contained in:
Moritz Böhme 2024-11-27 09:31:07 +01:00
commit cbe7a4a6ad
34 changed files with 440 additions and 303 deletions

2
.gitignore vendored
View file

@ -4,3 +4,5 @@
tmp/
.direnv/
.pre-commit-config.yaml
.aider*
.env

258
flake.lock generated
View file

@ -196,22 +196,6 @@
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_5": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@ -225,7 +209,7 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_6": {
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -301,27 +285,6 @@
"type": "indirect"
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": [
"nix-super",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
@ -376,6 +339,24 @@
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_6"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghostty": {
"inputs": {
"nixpkgs-stable": "nixpkgs-stable",
@ -423,37 +404,6 @@
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": [
"nix-super"
],
"gitignore": [
"nix-super"
],
"nixpkgs": [
"nix-super",
"nixpkgs"
],
"nixpkgs-stable": [
"nix-super",
"nixpkgs"
]
},
"locked": {
"lastModified": 1721042469,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"git-hooks_2": {
"inputs": {
"flake-compat": [
@ -857,20 +807,29 @@
"type": "github"
}
},
"libgit2": {
"flake": false,
"ixx_2": {
"inputs": {
"flake-utils": [
"search",
"flake-utils"
],
"nixpkgs": [
"search",
"nixpkgs"
]
},
"locked": {
"lastModified": 1715853528,
"narHash": "sha256-J2rCxTecyLbbDdsyBWn9w7r3pbKRMkI9E7RvRgAqBdY=",
"owner": "libgit2",
"repo": "libgit2",
"rev": "36f7e21ad757a3dacc58cf7944329da6bc1d6e96",
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "libgit2",
"ref": "v1.8.1",
"repo": "libgit2",
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
@ -1011,30 +970,6 @@
"type": "github"
}
},
"nix-super": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_4",
"git-hooks-nix": "git-hooks-nix",
"libgit2": "libgit2",
"nixpkgs": "nixpkgs_6",
"nixpkgs-23-11": "nixpkgs-23-11",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1723852416,
"narHash": "sha256-iEwS5PbPBk433xZ5/Ll5hzOU9K2MAE6iqYh8EYoaIgk=",
"owner": "privatevoid-net",
"repo": "nix-super",
"rev": "7bf3b90d4d67b18d4cbfe28fd5d786aab17d009b",
"type": "github"
},
"original": {
"owner": "privatevoid-net",
"repo": "nix-super",
"type": "github"
}
},
"nixos-facter-modules": {
"locked": {
"lastModified": 1728725827,
@ -1066,22 +1001,6 @@
"type": "github"
}
},
"nixpkgs-23-11": {
"locked": {
"lastModified": 1717159533,
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1727825735,
@ -1094,22 +1013,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1726062281,
@ -1255,22 +1158,6 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1723688146,
"narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c3d4ac725177c030b1e289015989da2ad9d56af0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1729788628,
"narHash": "sha256-3suayUinicnvE/4shMZwp9FHT5izUM8gMpdEO/NHBTo=",
@ -1286,7 +1173,7 @@
"type": "github"
}
},
"nixpkgs_8": {
"nixpkgs_7": {
"locked": {
"lastModified": 1729665710,
"narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=",
@ -1302,7 +1189,7 @@
"type": "github"
}
},
"nixpkgs_9": {
"nixpkgs_8": {
"locked": {
"lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
@ -1318,12 +1205,28 @@
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": [
"devshell"
],
"flake-compat": "flake-compat_5",
"flake-compat": "flake-compat_4",
"flake-parts": [
"flake-parts"
],
@ -1332,7 +1235,7 @@
"home-manager"
],
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_8",
"nixpkgs": "nixpkgs_7",
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
@ -1414,9 +1317,9 @@
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_6",
"flake-compat": "flake-compat_5",
"gitignore": "gitignore_4",
"nixpkgs": "nixpkgs_9",
"nixpkgs": "nixpkgs_8",
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
@ -1469,17 +1372,37 @@
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nix-index-database": "nix-index-database",
"nix-monitored": "nix-monitored",
"nix-super": "nix-super",
"nixos-facter-modules": "nixos-facter-modules",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_6",
"nixvim": "nixvim",
"nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_2",
"river": "river",
"search": "search",
"stable": "stable",
"timers": "timers"
}
},
"search": {
"inputs": {
"flake-utils": "flake-utils_4",
"ixx": "ixx_2",
"nixpkgs": "nixpkgs_9"
},
"locked": {
"lastModified": 1731874326,
"narHash": "sha256-FVodEap6GQT/1DSG5KOcpsrKXfG9gMNObQxW+HNJnW8=",
"owner": "NuschtOS",
"repo": "search",
"rev": "64832c4cf885350ad0e63a27fd7055bcfc7955f6",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"stable": {
"locked": {
"lastModified": 1729691686,
@ -1586,6 +1509,21 @@
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"timers": {
"inputs": {
"naersk": "naersk",
@ -1629,7 +1567,7 @@
},
"utils": {
"inputs": {
"systems": "systems_6"
"systems": "systems_7"
},
"locked": {
"lastModified": 1692799911,

View file

@ -5,25 +5,36 @@
# Nix
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
devshell.url = "github:numtide/devshell";
disko.url = "github:nix-community/disko";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-utils.url = "github:numtide/flake-utils";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
impermanence.url = "github:nix-community/impermanence";
master.url = "github:nixos/nixpkgs";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
stable.url = "github:nixos/nixpkgs/nixos-24.05";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
nur.url = "github:nix-community/NUR";
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
# Programs
nix-super.url = "github:privatevoid-net/nix-super";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
nix-monitored.url = "github:ners/nix-monitored";
nix-monitored.inputs.nixpkgs.follows = "nixpkgs";
# Programs
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
# Neovim
@ -54,10 +65,9 @@
arkenfox-userjs.url = "github:arkenfox/user.js";
arkenfox-userjs.flake = false;
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
# ghostty.url = "/home/moritz/Documents/ghostty";
search.url = "github:NuschtOS/search";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
};
outputs = inputs@{ self, flake-parts, ... }:
@ -80,29 +90,6 @@
sudo EDITOR="${pkgs.lib.getExe pkgs.vim}" ${pkgs.lib.getExe' inputs'.agenix.packages.default "agenix"} --identity /etc/ssh/ssh_host_ed25519_key "$@"
'';
}
{
name = "build";
help = "use nom to build system";
command =
''
nom build --no-link ".#nixosConfigurations.$(hostname).config.system.build.toplevel" $@
'';
}
{
name = "apply";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild switch --flake . $@";
}
{
name = "test";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild test --flake . $@";
}
{
name = "boot";
help = "wrapper for nixos-rebuild switch";
command = "sudo nixos-rebuild boot --flake . $@";
}
{
name = "vim-startuptime";
help = "test vim startup time";
@ -113,6 +100,7 @@
stylua
sumneko-lua-language-server
nixpkgs-fmt
nh
];
};
@ -129,7 +117,28 @@
};
legacyPackages = pkgs;
packages =
let
modules = [
{ name = "My stuff"; }
];
mkName = name: "${name} Search";
mkSearch = name: value: inputs'.search.packages.mkSearch {
urlPrefix = "file://${self}/flake.nix";
title = mkName name;
optionsJSON = "${(pkgs.nixosOptionsDoc { inherit (value) options; warningsAreErrors = false; }).optionsJSON}/share/doc/nixos/options.json";
};
serveSearch = name: value:
pkgs.writeShellApplication {
name = mkName name;
text = ''
xdg-open http://127.0.0.1:8080
static-web-server -p 8080 -d ${mkSearch name value}
'';
runtimeInputs = with pkgs; [ static-web-server xdg-utils ];
};
in
pkgs.lib.mapAttrs serveSearch self.nixosConfigurations;
};
flake = {
@ -181,16 +190,18 @@
nixConfig = {
extra-substituters = [
"https://hyprland.cachix.org"
# "https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://pre-commit-hooks.cachix.org"
"https://ghostty.cachix.org"
# "https://ghostty.cachix.org"
"https://cache.lix.systems"
];
extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
# "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
# "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
];
};
}

View file

@ -12,6 +12,7 @@
facter.reportPath = ./facter.json;
my = {
ai.enable = true;
virtualisation.libvirtd.enable = true;
yubikey.luksSupport.enable = false;
profiles = {
@ -20,12 +21,14 @@
webis.enable = true;
impermanence.enable = true;
};
terminal.package = pkgs.kitty;
programs.exercism.enable = true;
services.mullvad.enable = true;
};
users.users.moritz.packages = [ pkgs.poetry ];
users.users.moritz.packages = with pkgs; [
poetry
wl-clipboard
];
home-manager.users.moritz.services.kanshi.settings = [
{
@ -37,14 +40,14 @@
];
}
{
profile.name = "docked";
profile.name = "docked-scads";
profile.outputs = [
{
criteria = "eDP-1";
position = "640,1800"; # NOTE: 2160 / 1.2 = 1800
}
{
criteria = "DP-3";
criteria = "Dell Inc. DELL S2721QS DWTC513";
scale = 1.2;
position = "0,0";
}

View file

@ -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;
};

View file

@ -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
'';
}

View 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;
};
}

View file

@ -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"; }
];
};

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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" ];
};
}

View 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" ];
};
}

View 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" ]; }
];
};
}

View 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;
};
}

View file

@ -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;

View 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;
};
}

View 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;
};
};
}

View 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" ];
};
}

View 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;
};
}

View 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; }; };
};
};
};
};
}

View 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;
};
}

View file

@ -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" ];
}
];
};
}

View 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;
};
};
}

View file

@ -31,6 +31,10 @@ _:
action = "oldfiles";
options.desc = "Recent files";
};
"<leader>fc" = {
action = "commands";
options.desc = "Commands";
};
};
};
web-devicons.enable = true;

View 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";
};
};
}

View file

@ -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;
};
}

View 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;
};
}

View 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";
};
};
}

View 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;
};
}

View file

@ -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";

View file

@ -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 = {