From e19b78bcd339cd1e92cda69119a18e643dd78ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Feb 2023 15:39:45 +0100 Subject: [PATCH 1/4] move theme definition --- modules/config/theming/default.nix | 1 - modules/profiles/desktop.nix | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index deedad2..4feefe9 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -21,7 +21,6 @@ in options.my.theming = { enable = mkEnableOption "theming"; scheme = mkOption { - default = "catppuccin-macchiato"; type = types.enum [ "dracula" "catppuccin-latte" diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 1ba9353..4a9e5d8 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -8,7 +8,10 @@ with lib; { # config yubikey.enable = true; wallpapers.enable = true; - theming.enable = true; + theming = { + enable = true; + scheme = "catppuccin-macchiato"; + }; virtualisation = { podman.enable = true; libvirtd.enable = true; From b048f43152032e7c43c0fc73573b38e630d55716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Feb 2023 15:40:26 +0100 Subject: [PATCH 2/4] improve hyperland module output waybar on all monitors and make comments prettier --- modules/programs/hyprland/config.nix | 4 ++-- modules/programs/hyprland/default.nix | 23 ++++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 2135f17..38ef853 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -145,8 +145,8 @@ in bind = $mainMod, M, exec, hyprctl keyword general:layout master bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, Q, killactive, - bind = $mainMod, R, exec, rofi -x11 -show combi - bind = $mainMod, C, exec, rofi -x11 -show calc -modi calc -no-show-match -no-sort | wl-copy + bind = $mainMod, R, exec, rofi -show combi + bind = $mainMod, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | wl-copy bind = $mainMod, B, exec, rofi-bluetooth bind = $mainMod, RETURN, exec, kitty bind = $mainMod, T, togglesplit, # dwindle diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index b8758d0..26b1538 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -66,11 +66,6 @@ in layer = "top"; position = "top"; height = 30; - output = [ - "eDP-1" - "HDMI-A-1" - "HDMI-A-2" - ]; modules-left = [ "wlr/workspaces" ]; modules-center = [ "hyprland/window" ]; modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; @@ -151,18 +146,12 @@ in # add user packages for wayland and hyprland in particular users.users.moritz.packages = with pkgs; [ - # pulse audio cli - pamixer - # control media playback - playerctl - # control brightness - brightnessctl - # screenshot tool for hyprland - grimblast - # region select for wayland (for screensharing) - slurp - # clipboard tool for wayland - wl-clipboard + pamixer # pulse audio cli + playerctl # control media playback + brightnessctl # control brightness + grimblast # screenshot tool for hyprland + slurp # region select for wayland (for screensharing) + wl-clipboard # clipboard tool for wayland ]; From a197579c4dafc393157de79bc3568f17ab167245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 11 Feb 2023 15:45:05 +0100 Subject: [PATCH 3/4] update inputs --- flake.lock | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/flake.lock b/flake.lock index af3ec73..eb20aaa 100644 --- a/flake.lock +++ b/flake.lock @@ -24,11 +24,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1674781645, - "narHash": "sha256-NGp5BLOQmiXsUh9nrXP+PeVXyK1c8Ij5EnwtFXAkD9w=", + "lastModified": 1675728165, + "narHash": "sha256-ebSx6DaXoGKcCoK6UcDnWvdAW6J2X6pJRPD1Pw7UNOw=", "owner": "arkenfox", "repo": "user.js", - "rev": "b99dd27de828be13530ce2f48c9178d34f5f82ab", + "rev": "73884850632ffe284f76881786f7d5903b917f58", "type": "github" }, "original": { @@ -84,11 +84,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1675333319, - "narHash": "sha256-V7hcI+5hc/iPHxWrgdy3ip3aNgdWzpreE1C+cbRzlbo=", + "lastModified": 1676057905, + "narHash": "sha256-9uGgDgMTwspDQlR2laeYa4qwf3BoU04sKpOR1h6/bvM=", "ref": "main", - "rev": "cb0e0ad408f7fa8243713932abf7aa008147f2ff", - "revCount": 78, + "rev": "346600bd993ca400a493c9d9323a1caea267c650", + "revCount": 93, "type": "git", "url": "ssh://git@gitea.moritzboeh.me/moritz/emacs.git" }, @@ -104,11 +104,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1675309900, - "narHash": "sha256-liDBB8HjXkJZ/WJ1hGDKuCl5QkPPJko9XY/eyxKd7lg=", + "lastModified": 1676025076, + "narHash": "sha256-sdYhoZsLLwRXZebP6DYfIgQRjFA+itdNXaPuCWfJYkk=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "7276116feb26bf3fc2834709a2ea2f6ed738cc52", + "rev": "581072bb0d49768da9370056f7b6e7b761b5d8be", "type": "github" }, "original": { @@ -227,11 +227,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1675097212, - "narHash": "sha256-PGFYw7JbuYHOVycPlYcRItElcyuKEg2cGv4wn6In5Mo=", + "lastModified": 1676021219, + "narHash": "sha256-/cqDhHilbMSrzwip+2CGJ9Il4wsx5skyMbqC98hewdc=", "owner": "wfxr", "repo": "forgit", - "rev": "aa85792ec465ceee254be0e8e70d8703c7029f66", + "rev": "065f7841f334b8707a49ac30d19370aa859db2ed", "type": "github" }, "original": { @@ -291,11 +291,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1675303228, - "narHash": "sha256-dHJbFg7gTuTyEUdJoNDp6l2bac6HXAT/bz9cVEqL+Uw=", + "lastModified": 1675935446, + "narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a958524903e6019f5f69a23e0c0f16e5af01eb0", + "rev": "2dce7f1a55e785a22d61668516df62899278c9e4", "type": "github" }, "original": { @@ -352,11 +352,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1675285561, - "narHash": "sha256-0l239rdKHmtCf8xckssOk3bXf+gTXZa6gOEVVVeIfb0=", + "lastModified": 1676120405, + "narHash": "sha256-5DSaAh3ifx3tW7ZMF7GFy/Kw4uHs3ZUtt+cH9+YVOXY=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "32d56fec977b109aeecb06288a1b45cfe6b83117", + "rev": "97e0f02621829d011e08506c7361236b07f3f2b4", "type": "github" }, "original": { @@ -391,11 +391,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1675010546, - "narHash": "sha256-mx2WkCa2yUaZakioiLY7dHrU0fZS2szlqghbDbc34RE=", + "lastModified": 1676033584, + "narHash": "sha256-MeF1nR09cUdkCd1KNjzxImwhqsP2cbn/0M6z87fNJAk=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "0c2386861afbb10c8c5eb6de868fa2a519df2907", + "rev": "44a38bfedc009bcc05eed571e80a397a80075a9f", "type": "github" }, "original": { @@ -406,11 +406,11 @@ }, "master": { "locked": { - "lastModified": 1675333202, - "narHash": "sha256-ZcZqGz2K7V9/uIrWfdmKUfC5PkcuR29DKTqUTF5BURo=", + "lastModified": 1676126546, + "narHash": "sha256-LYDhE85B+MQMvIS3/SVnLSsKBC6aTeFrMRa6pN75mlg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a2780dc543d24f33d7a2d7fa5b2bf609ed8c1849", + "rev": "aebc76376ca2da5ee4524326e6f83a3a18587d54", "type": "github" }, "original": { @@ -469,11 +469,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1675249806, - "narHash": "sha256-u8Rcqekusl3pMZm68hZqr6zozI8Ug5IxqOiqDLAlu1k=", + "lastModified": 1675758091, + "narHash": "sha256-7gFSQbSVAFUHtGCNHPF7mPc5CcqDk9M2+inlVPZSneg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "79feedf38536de2a27d13fe2eaf200a9c05193ba", + "rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87", "type": "github" }, "original": { @@ -501,11 +501,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1673540789, - "narHash": "sha256-xqnxBOK3qctIeUVxecydrEDbEXjsvHCPGPbvsl63M/U=", + "lastModified": 1675273418, + "narHash": "sha256-tpYc4TEGvDzh9uRf44QemyQ4TpVuUbxb07b2P99XDbM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0f213d0fee84280d8c3a97f7469b988d6fe5fcdf", + "rev": "4d7c2644dbac9cf8282c0afe68fca8f0f3e7b2db", "type": "github" }, "original": { @@ -533,11 +533,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1675249806, - "narHash": "sha256-u8Rcqekusl3pMZm68hZqr6zozI8Ug5IxqOiqDLAlu1k=", + "lastModified": 1675940568, + "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "79feedf38536de2a27d13fe2eaf200a9c05193ba", + "rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71", "type": "github" }, "original": { @@ -578,11 +578,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1675169698, - "narHash": "sha256-C1wFiyJ+4SRvIsFkdMIN1Fa+58APmyTGKWpX9EKOehM=", + "lastModified": 1675688762, + "narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ce4efeec34c6eb35ba07b8fceaae87d6b46c1c5f", + "rev": "ab608394886fb04b8a5df3cb0bab2598400e3634", "type": "github" }, "original": { @@ -625,11 +625,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1675169698, - "narHash": "sha256-C1wFiyJ+4SRvIsFkdMIN1Fa+58APmyTGKWpX9EKOehM=", + "lastModified": 1675688762, + "narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ce4efeec34c6eb35ba07b8fceaae87d6b46c1c5f", + "rev": "ab608394886fb04b8a5df3cb0bab2598400e3634", "type": "github" }, "original": { @@ -659,11 +659,11 @@ }, "stable": { "locked": { - "lastModified": 1675237434, - "narHash": "sha256-YoFR0vyEa1HXufLNIFgOGhIFMRnY6aZ0IepZF5cYemo=", + "lastModified": 1675918889, + "narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "285b3ff0660640575186a4086e1f8dc0df2874b5", + "rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe", "type": "github" }, "original": { @@ -710,11 +710,11 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1672824257, - "narHash": "sha256-SbYoZj57VlopTzI+OSW9jlgYxN1gI1KLg/s/HV+87eE=", + "lastModified": 1675374853, + "narHash": "sha256-BSrjNcddYWhFUMtjGwxiEXw67MYRaIHGvLn19Mvm1NE=", "owner": "wlroots", "repo": "wlroots", - "rev": "5f264a7d6c8af27d41ff440c05262b022c055593", + "rev": "677a3f2f8847ed2de49dd60868f9d9487a546f58", "type": "gitlab" }, "original": { From e356b4fa8e02f839394910e7206dd8368c00b89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 16 Feb 2023 18:03:55 +0100 Subject: [PATCH 4/4] add nvim config --- flake.nix | 1 + modules/programs/default.nix | 2 +- .../programs/{vim.nix => nvim/default.nix} | 13 +++ modules/programs/nvim/init.lua | 88 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) rename modules/programs/{vim.nix => nvim/default.nix} (52%) create mode 100644 modules/programs/nvim/init.lua diff --git a/flake.nix b/flake.nix index 1157fa1..945aaf5 100644 --- a/flake.nix +++ b/flake.nix @@ -148,6 +148,7 @@ nixpkgs-fmt.enable = true; statix.enable = true; shellcheck.enable = true; + stylua.enable = true; }; }; diff --git a/modules/programs/default.nix b/modules/programs/default.nix index abc4c23..a588494 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -28,7 +28,7 @@ ./ssh.nix ./sway.nix ./thunar.nix - ./vim.nix + ./nvim ./xmonad ./zathura.nix ./zsh.nix diff --git a/modules/programs/vim.nix b/modules/programs/nvim/default.nix similarity index 52% rename from modules/programs/vim.nix rename to modules/programs/nvim/default.nix index 8e3759b..1c00cf5 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/nvim/default.nix @@ -24,6 +24,19 @@ in vimdiffAlias = true; withNodeJs = true; withPython3 = true; + extraLuaConfig = builtins.readFile ./init.lua; + plugins = with pkgs.vimPlugins; [ + catppuccin-nvim + dashboard-nvim + neogit + noice-nvim + nui-nvim # for noice-nvim + nvim-treesitter.withAllGrammars + nvim-web-devicons # for dashboard-nvim + plenary-nvim # for telescope, neogit + telescope-nvim + which-key-nvim + ]; }; }; } diff --git a/modules/programs/nvim/init.lua b/modules/programs/nvim/init.lua new file mode 100644 index 0000000..1cb5fce --- /dev/null +++ b/modules/programs/nvim/init.lua @@ -0,0 +1,88 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +-- FIX to create spell dir if not existent +local spelldir = vim.fn.stdpath("data") .. "/site/spell" +if not vim.loop.fs_stat(spelldir) then + vim.fn.mkdir(spelldir, "p") +end + +vim.opt.autoindent = true +vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup//" } -- don't store backup in files dir +vim.opt.clipboard = "unnamedplus" -- sync with system clipboard +vim.opt.conceallevel = 2 +vim.opt.expandtab = true -- spaces instead of tabs +vim.opt.guifont = "Fira Code Nerd Font:h1" +vim.opt.ignorecase = true +vim.opt.mouse = "a" -- mouse for all modes +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.scrolloff = 4 -- lines of context +vim.opt.shiftround = true -- round indent +vim.opt.shiftwidth = 0 -- use tabstop value +vim.opt.shortmess:append({ c = true }) +vim.opt.signcolumn = "yes" +vim.opt.smartcase = true +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.tabstop = 2 +vim.opt.termguicolors = true +vim.opt.undofile = true +vim.opt.undolevels = 10000 +vim.opt.updatetime = 300 +vim.opt_local.spell = true +vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling + +-- plugins +require("catppuccin").setup({ + flavour = "macchiato", +}) +vim.cmd.colorscheme("catppuccin") + +vim.o.timeout = true +vim.o.timeoutlen = 300 +local wk = require("which-key") + +require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, +}) + +wk.register({ + f = { + name="find", + f = { "Telescope find_files", "find file" }, + g = { "Telescope live_grep", "live grep" }, + b = { "Telescope buffers", "find buffer" }, + }, +}, { prefix = "" }) + +require("neogit").setup({ + disable_commit_confirmation = true, +}) +wk.register({ + g = { "Neogit", "git" } +}, { prefix = ""}) + +require("nvim-treesitter.configs").setup({ + sync_install = false, + auto_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + }, +})