diff --git a/configuration.nix b/configuration.nix index 7ceda16..33ed5ea 100644 --- a/configuration.nix +++ b/configuration.nix @@ -68,6 +68,7 @@ in sound.enable = true; system.stateVersion = "19.03"; + home-manager.users.adrielus.home.stateVersion = "19.03"; # TODO: put nixpkgs stuff inside their own file nixpkgs.config.allowUnfree = true; diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index e343993..60f1fec 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -1,6 +1,6 @@ if status is-interactive and not set -q TMUX - exec tmux attach -t Welcome || tmux + exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux" end set fish_cursor_default block # Set the normal and visual mode cursors to a block diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index e03b941..a95f202 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -83,14 +83,10 @@ local abbreviations = { { "dhx", "h'(x)" }, -- Basic commands { "mangle", "\\measuredangle" }, { "aangle", "\\angle" }, - { "creq", "\\\\&=" }, - { "aeq", "&=" }, - { "leq", "\\leq" }, - { "geq", "\\geq" }, + { "sdiff", "\\setminus" }, { "sst", "\\subset" }, { "sseq", "\\subseteq" }, - { "neq", "\\neq" }, { "nin", "\\not\\in" }, { "iin", "\\in" }, { "tto", "\\to" }, @@ -135,7 +131,15 @@ local abolishAbbreviations = { { "dete{,s}", "determinant{}" }, { "bcla", "by contradiction let's assume" }, { "ort{n,g}", "orto{normal,gonal}" }, - { "l{in,de}", "linearly {independent,dependent}" } + { "l{in,de}", "linearly {independent,dependent}" }, + { "wlg", "without loss of generality" }, + + -- My own operator syntax: + -- - Any operator can be prefixed with "a" to + -- align in aligned mode + -- - Any operator can be prefixed with cr to + -- start a new line and align in aligned mode + { "{cr,a,}{eq,neq,leq,geq,lt,gt}", "{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}" } } A.manyLocalAbbr(abbreviations) diff --git a/dotfiles/neovim/lua/.luarc.json b/dotfiles/neovim/lua/.luarc.json new file mode 100644 index 0000000..e1b9d70 --- /dev/null +++ b/dotfiles/neovim/lua/.luarc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "Lua.workspace.checkThirdParty": false +} \ No newline at end of file diff --git a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua index 65da948..bf37704 100644 --- a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua +++ b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua @@ -1,14 +1,14 @@ local M = {} local function swap(key) - vim.keymap.set("n", key, "g" .. key, { buffer = true }) - vim.keymap.set("n", "g" .. key, key, { buffer = true }) + vim.keymap.set("nv", key, "g" .. key, { buffer = true }) + vim.keymap.set("nv", "g" .. key, key, { buffer = true }) end -- Same as swap, but the key is aprt of an arpeggio chord local function swapArpeggio(key) - vim.keymap.set("n", "(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true }) - vim.keymap.set("n", "g" .. key, key, { buffer = true }) + vim.keymap.set("nv", "(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true }) + vim.keymap.set("nv", "g" .. key, key, { buffer = true }) end function M.setup() diff --git a/dotfiles/neovim/lua/my/keymaps.lua b/dotfiles/neovim/lua/my/keymaps.lua index 044b583..3d4926a 100644 --- a/dotfiles/neovim/lua/my/keymaps.lua +++ b/dotfiles/neovim/lua/my/keymaps.lua @@ -34,25 +34,27 @@ function M.delimitedTextobject(from, to, name, perhapsOpts) end function M.setup() + -- I rarely use macro stuff M.move("q", "yq", { desc = "Record macro" }) M.move("Q", "yQ") + + -- Free these up for easymotion-style plugins + -- vim.keymap.set("n", "s", "") + -- vim.keymap.set("n", "S", "") + M.move("", "a", { desc = "Go to previous file" }) - vim.keymap.set({ "n", "v" }, "qn", function() + vim.keymap.set({ "n", "v" }, "q", function() local buf = vim.api.nvim_win_get_buf(0) -- Only save if file is writable - if vim.bo[buf].modifiable and not vim.bo[buf].readonly then - vim.cmd [[write]] - end + if vim.bo[buf].modifiable and not vim.bo[buf].readonly then vim.cmd [[write]] end vim.cmd "q" end, { desc = "Quit current buffer" }) vim.keymap.set("n", "Q", ":wqa", { desc = "Save all files and quit" }) - vim.keymap.set("n", "rw", ":%s//", { - desc = "Replace word in file" - }) + vim.keymap.set("n", "rw", ":%s//", { desc = "Replace word in file" }) M.delimitedTextobject("q", '"', "quotes") M.delimitedTextobject("a", "'", "'") @@ -70,18 +72,10 @@ function M.setup() if status then wk.register({ [""] = { - f = { - name = "Files" - }, - g = { - name = "Go to" - }, - r = { - name = "Rename / Replace / Reload" - }, - [""] = { - name = "Easymotion" - }, + f = { name = "Files" }, + g = { name = "Go to" }, + r = { name = "Rename / Replace / Reload" }, + l = { name = "Local" }, v = "which_key_ignore" } }) diff --git a/dotfiles/neovim/lua/my/paq.lua b/dotfiles/neovim/lua/my/paq.lua index 9950dc4..e43e69d 100644 --- a/dotfiles/neovim/lua/my/paq.lua +++ b/dotfiles/neovim/lua/my/paq.lua @@ -38,9 +38,10 @@ function M.setup() "saadparwaiz1/cmp_luasnip", -- snippet support for cmp "wakatime/vim-wakatime", -- track time usage "vmchale/dhall-vim", -- dhall syntax highlighting - -- "folke/which-key.nvim", -- shows what other keys I can press to finish a command + "folke/which-key.nvim", -- shows what other keys I can press to finish a command { "psliwka/vim-smoothie", opt = true }, -- smooth scrolling - "easymotion/vim-easymotion", -- removes the need for spamming w or e + -- "easymotion/vim-easymotion", -- removes the need for spamming w or e + "ggandor/leap.nvim", -- removes the need for spamming w or e "tpope/vim-surround", -- work with brackets, quotes, tags, etc "MunifTanjim/nui.nvim", -- ui stuff required by idris2 "ShinKage/idris2-nvim", -- idris2 support diff --git a/dotfiles/neovim/lua/my/plugins/easymotion.lua b/dotfiles/neovim/lua/my/plugins/easymotion.lua deleted file mode 100644 index a180958..0000000 --- a/dotfiles/neovim/lua/my/plugins/easymotion.lua +++ /dev/null @@ -1,20 +0,0 @@ -local M = {} - -function M.setup() - local opts = function(desc) - return { desc = desc, silent = true } - end - - local modes = { "n", "v", "o" } - - vim.keymap.set(modes, "qf", "(easymotion-bd-f)", opts("Hop to char")) - vim.keymap.set(modes, "qj", "(easymotion-overwin-f2)", opts("Hop to char pair")) - vim.keymap.set(modes, "qw", "(easymotion-bd-w)", opts("Hop to word")) - vim.keymap.set(modes, "qL", "(easymotion-bd-L)", opts("Hop to line (?)")) - - local status, wk = pcall(require, "which-key") - - if status then wk.register({ q = { name = "Easymotion" } }, { mode = "o" }) end -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua index 66abd22..3fa867a 100644 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ b/dotfiles/neovim/lua/my/plugins/init.lua @@ -6,7 +6,6 @@ function M.setup() require('fidget').setup() require('dressing').setup() - require("my.plugins.easymotion").setup() require("my.plugins.autopairs").setup() require("my.plugins.telescope").setup() require("my.plugins.surround").setup() @@ -49,6 +48,7 @@ function M.setup() require("my.plugins.paperplanes").setup() end + require("my.plugins.leap").setup() require("my.plugins.hydra").setup() require("my.plugins.clipboard-image").setup() require("my.plugins.mind").setup() diff --git a/dotfiles/neovim/lua/my/plugins/leap.lua b/dotfiles/neovim/lua/my/plugins/leap.lua new file mode 100644 index 0000000..ef48c55 --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/leap.lua @@ -0,0 +1,10 @@ +local M = {} + +function M.setup() + require("leap").add_default_mappings() +end + +-- (something) +-- something + +return M diff --git a/dotfiles/neovim/lua/my/plugins/neovide.lua b/dotfiles/neovim/lua/my/plugins/neovide.lua index f605aab..81b73d9 100644 --- a/dotfiles/neovim/lua/my/plugins/neovide.lua +++ b/dotfiles/neovim/lua/my/plugins/neovide.lua @@ -1,9 +1,18 @@ local M = {} function M.setup() - vim.g.neovide_floating_blur_amount_x = 2.0 - vim.g.neovide_floating_blur_amount_y = 2.0 - -- vim.g.neovide_transparency = 0.8 + -- vim.g.neovide_floating_blur_amount_x = 3.0 + -- vim.g.neovide_floating_blur_amount_y = 3.0 + -- vim.g.neovide_transparency = 1.0 + -- vim.g.pumblend = 30 + + -- vim.api.nvim_create_autocmd("WinEnter", { + -- group = vim.api.nvim_create_augroup("Setup transparency", {}), + -- pattern = "*", + -- callback = function() + -- vim.wo.winblend = 30 + -- end + -- }) end return M diff --git a/dotfiles/neovim/lua/my/plugins/telescope.lua b/dotfiles/neovim/lua/my/plugins/telescope.lua index 3fbd018..b5755a3 100644 --- a/dotfiles/neovim/lua/my/plugins/telescope.lua +++ b/dotfiles/neovim/lua/my/plugins/telescope.lua @@ -19,17 +19,13 @@ local keybinds = { { "fp", find_files_by_extension("purs"), "Find purescript files" }, { "d", "diagnostics", "Diagnostics" }, { "", "live_grep", "Search in project" }, - { "t", "builtin", "Show builtin pickers" }, + { "t", "builtin", "Show builtin pickers" } } -local chords = { - { "jp", "file_browser" } -} +local chords = { { "jp", "file_browser" } } local function mkAction(action) - if not string.find(action, "theme=") then - action = with_theme(action, defaultTheme) - end + if not string.find(action, "theme=") then action = with_theme(action, defaultTheme) end return ":Telescope " .. action .. "" end @@ -39,9 +35,7 @@ local function setupKeybinds() vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] }) end - for _, mapping in pairs(chords) do - arpeggio.chord("n", mapping[1], mkAction(mapping[2])) - end + for _, mapping in pairs(chords) do arpeggio.chord("n", mapping[1], mkAction(mapping[2])) end end function M.setup() @@ -50,11 +44,7 @@ function M.setup() local settings = { defaults = { mappings = { i = { [""] = "which_key" } } }, pickers = { find_files = { hidden = true } }, - extensions = { - file_browser = { - path = "%:p:h" - } - } + extensions = { file_browser = { path = "%:p:h" } } } require("telescope").setup(settings) diff --git a/dotfiles/neovim/lua/my/plugins/whichkey.lua b/dotfiles/neovim/lua/my/plugins/whichkey.lua index e9782f3..2b15daf 100644 --- a/dotfiles/neovim/lua/my/plugins/whichkey.lua +++ b/dotfiles/neovim/lua/my/plugins/whichkey.lua @@ -4,7 +4,8 @@ local M = {} function M.setup() wk.setup({ - triggers = { "", "d", "y", "q", "z", "g", "c" }, + -- triggers = { "", "d", "y", "q", "z", "g", "c" }, + triggers = {}, show_help = false, show_keys = false }) diff --git a/flake.lock b/flake.lock index a06a8e5..dd0000f 100644 --- a/flake.lock +++ b/flake.lock @@ -75,7 +75,7 @@ "stylix", "nixpkgs" ], - "utils": "utils" + "utils": "utils_2" }, "locked": { "lastModified": 1659649195, @@ -284,19 +284,20 @@ "inputs": { "nixpkgs": [ "nixpkgs" - ] + ], + "utils": "utils" }, "locked": { - "lastModified": 1667907331, - "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", + "lastModified": 1670253003, + "narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=", "owner": "nix-community", "repo": "home-manager", - "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", + "rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.05", + "ref": "release-22.11", "repo": "home-manager", "type": "github" } @@ -583,16 +584,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1669861251, - "narHash": "sha256-QyBI5QNT/nQRkCsZHnN3ImKCaxrtMArVqNioA7diwU4=", + "lastModified": 1670263920, + "narHash": "sha256-oR1rtMcWCvpGa81vvaHpONLFfZJpq1ijnHypujGA/lw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "af4d0d532f413ad2fbb3a13f47c98c9fca1948e1", + "rev": "29423d0cfac3baa05f804c399f1b043068b531f8", "type": "github" }, "original": { "owner": "nixos", - "ref": "release-22.05", + "ref": "release-22.11", "repo": "nixpkgs", "type": "github" } @@ -779,6 +780,21 @@ } }, "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", diff --git a/flake.nix b/flake.nix index 6e27af6..7ca3797 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,12 @@ description = "NixOS configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; + nixpkgs.url = "github:nixos/nixpkgs/release-22.11"; nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-22.05"; + url = "github:nix-community/home-manager/release-22.11"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/hardware/laptop.nix b/hardware/laptop.nix index ee36a3c..3207b2c 100644 --- a/hardware/laptop.nix +++ b/hardware/laptop.nix @@ -29,6 +29,6 @@ swapDevices = [ ]; - nix.maxJobs = lib.mkDefault 8; + nix.settings.max-jobs = lib.mkDefault 8; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/modules/applications/default.nix b/modules/applications/default.nix index 4e6869b..981f4ba 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -3,7 +3,6 @@ ./git ./shells # ./wakatime - ./xmonad ./rofi # ./xmodmap @@ -17,7 +16,7 @@ ./locale.nix # ./memes.nix ./alacritty.nix - ./postgres.nix + # ./postgres.nix ./neovim.nix ./tmux.nix ./kmonad.nix diff --git a/modules/applications/locale.nix b/modules/applications/locale.nix index 982d749..4437f8c 100644 --- a/modules/applications/locale.nix +++ b/modules/applications/locale.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ pkgs, ... }: { i18n.defaultLocale = "en_US.UTF-8"; # time.timeZone = "Europe/Bucharest"; time.timeZone = "Europe/Amsterdam"; @@ -8,6 +8,10 @@ # ibus.engines = with pkgs.ibus-engines; [ /* any engine you want, for example */ anthy ]; }; + environment.systemPackages = [ + pkgs.source-code-pro + ]; + console = { keyMap = "us"; font = "SourceCodePro"; diff --git a/modules/applications/tmux.nix b/modules/applications/tmux.nix index 5fec315..927f344 100644 --- a/modules/applications/tmux.nix +++ b/modules/applications/tmux.nix @@ -32,9 +32,6 @@ let in { home-manager.users.adrielus.programs = { - # Add tmux-navigator plugin to neovim - # neovim.extraPackages = [ pkgs.vimPlugins.vim-tmux-navigator ]; - tmux = { enable = true; diff --git a/modules/applications/xmonad/default.nix b/modules/applications/xmonad/default.nix deleted file mode 100644 index 220fd7c..0000000 --- a/modules/applications/xmonad/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - # xsession.windowManager.xmonad = { - # enable = true; - # enableContribAndExtras = true; - # config = ./Main.hs; - # }; - - home.packages = with pkgs; [ xwallpaper ]; - - # Tell KDE to use xmonad - # home.file.".config/plasma-workspace/env/set_window_manager.sh".text = - # "export KDEWM=/home/adrielus/.nix-profile/bin/xmonad"; - - services.picom = { - enable = false; - blur = true; - shadow = false; - extraOptions = '' - blur: - { - method = "gaussian"; - size = 10; - deviation = 5.0; - }; - ''; - }; - }; -} diff --git a/modules/themes/catppuccin/default.nix b/modules/themes/catppuccin/default.nix index c67bb1d..d609e33 100644 --- a/modules/themes/catppuccin/default.nix +++ b/modules/themes/catppuccin/default.nix @@ -85,8 +85,6 @@ in }; opacity = transparency; - - gtk_theme_variant = v "light" "dark"; }; }; }; diff --git a/modules/themes/wallpaper.nix b/modules/themes/wallpaper.nix index eb4f339..117dab7 100644 --- a/modules/themes/wallpaper.nix +++ b/modules/themes/wallpaper.nix @@ -2,6 +2,7 @@ # https://www.codyhiar.com/blog/how-to-set-desktop-wallpaper-on-nixos/ { pkgs, config, ... }: { home-manager.users.adrielus = { + home.packages = with pkgs; [ xwallpaper ]; xdg.configFile."wallpaper".source = pkgs.myThemes.current.wallpaper; xsession = { enable = true;