diff --git a/README.md b/README.md new file mode 100644 index 0000000..0ee4808 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Bonfire + +***Lit another Nix derivation*** + +> This is a private configuration and experiment with Nix and NixOS. Formally +> it's a more than just a dotfiles in cause of packages, modules, templates and +> etc. Discover the current repository on your own risk. diff --git a/config/nvim/.neoconf.json b/config/nvim/.neoconf.json new file mode 100644 index 0000000..6e89f00 --- /dev/null +++ b/config/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/config/nvim/ginit.vim b/config/nvim/ginit.vim new file mode 100644 index 0000000..cc27af7 --- /dev/null +++ b/config/nvim/ginit.vim @@ -0,0 +1,29 @@ +" Enable Mouse +set mouse=a + +" Set Editor Font +if exists(':GuiFont') + " Use GuiFont! to ignore font errors + GuiFont MesloLGS Nerd Font Mono:h10 +endif + +" Disable GUI Tabline +if exists(':GuiTabline') + GuiTabline 0 +endif + +" Disable GUI Popupmenu +if exists(':GuiPopupmenu') + GuiPopupmenu 0 +endif + +" Enable GUI ScrollBar +if exists(':GuiScrollBar') + GuiScrollBar 0 +endif + +" Right Click Context Menu (Copy-Cut-Paste) +nnoremap :call GuiShowContextMenu() +inoremap :call GuiShowContextMenu() +xnoremap :call GuiShowContextMenu()gv +snoremap :call GuiShowContextMenu()gv diff --git a/config/nvim/init.lua b/config/nvim/init.lua new file mode 100644 index 0000000..98952e4 --- /dev/null +++ b/config/nvim/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/config/nvim/lua/config/autocmds.lua b/config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..d9ea6db --- /dev/null +++ b/config/nvim/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..5756b96 --- /dev/null +++ b/config/nvim/lua/config/keymaps.lua @@ -0,0 +1,15 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here + +-- Move to window +vim.keymap.set("n", "", "h", { desc = "Go to left window", remap = true }) +vim.keymap.set("n", "", "j", { desc = "Go to lower window", remap = true }) +vim.keymap.set("n", "", "k", { desc = "Go to upper window", remap = true }) +vim.keymap.set("n", "", "l", { desc = "Go to right window", remap = true }) + +-- Resize window using arrow keys +vim.keymap.set("n", "", "resize +2", { desc = "Increase window height" }) +vim.keymap.set("n", "", "resize -2", { desc = "Decrease window height" }) +vim.keymap.set("n", "", "vertical resize -2", { desc = "Decrease window width" }) +vim.keymap.set("n", "", "vertical resize +2", { desc = "Increase window width" }) diff --git a/config/nvim/lua/config/lazy.lua b/config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..2d56dcb --- /dev/null +++ b/config/nvim/lua/config/lazy.lua @@ -0,0 +1,46 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/config/nvim/lua/config/options.lua b/config/nvim/lua/config/options.lua new file mode 100644 index 0000000..415944a --- /dev/null +++ b/config/nvim/lua/config/options.lua @@ -0,0 +1,3 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here diff --git a/config/nvim/lua/plugins/user.lua b/config/nvim/lua/plugins/user.lua new file mode 100644 index 0000000..d03567e --- /dev/null +++ b/config/nvim/lua/plugins/user.lua @@ -0,0 +1,63 @@ +return { + + { + "ellisonleao/gruvbox.nvim", + }, + + { + "folke/tokyonight.nvim", + style = "moon", + priority = 1000, + }, + + { "skywind3000/asyncrun.vim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "tokyonight", + }, + }, + + { "equalsraf/neovim-gui-shim" }, + + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + filesystem = { + filtered_items = { + hide_dotfiles = false, + hide_gitignored = false, + }, + use_libuv_file_watcher = true, + }, + }, + }, + + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + + { + "nvim-orgmode/orgmode", + dependencies = { + { "nvim-treesitter/nvim-treesitter", lazy = true }, + }, + event = "VeryLazy", + config = function() + require("orgmode").setup_ts_grammar() + + require("nvim-treesitter.configs").setup({ + highlight = { + enable = true, + additional_vim_regex_highlighting = { "org" }, + }, + ensure_installed = { "org" }, + }) + + require("orgmode").setup() + end, + }, +} diff --git a/config/nvim/stylua.toml b/config/nvim/stylua.toml new file mode 100644 index 0000000..6dc96a7 --- /dev/null +++ b/config/nvim/stylua.toml @@ -0,0 +1,4 @@ +indent_type = "Spaces" +indent_width = 4 +column_width = 120 + diff --git a/flake.lock b/flake.lock index 69e4d2a..13e4ac6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701216516, + "narHash": "sha256-jKSeJn+7hZ1dZdiH1L+NWUGT2i/BGomKAJ54B9kT06Q=", + "owner": "ryantm", + "repo": "agenix", + "rev": "13ac9ac6d68b9a0896e3d43a082947233189e247", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "cachix": { "inputs": { "flake-compat": "flake-compat", @@ -24,6 +46,28 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673295039, + "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -78,6 +122,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1682203081, + "narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -215,8 +280,9 @@ }, "root": { "inputs": { + "agenix": "agenix", "cachix": "cachix", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 6049686..489bed1 100644 --- a/flake.nix +++ b/flake.nix @@ -5,13 +5,20 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; cachix = { url = "github:cachix/devenv/v0.6.3"; inputs.nixpkgs.follows = "nixpkgs"; }; + agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = inputs @ { self, nixpkgs, home-manager, ... }: { + outputs = inputs @ { self, nixpkgs, home-manager, agenix, ... }: { nixosConfigurations = { astora = with nixpkgs; lib.nixosSystem { system = "x86_64-linux"; - modules = [ home-manager.nixosModules.home-manager ./nixosConfigurations/astora ./nixosModules/bonfire.nix ]; + modules = [ + home-manager.nixosModules.home-manager + agenix.nixosModules.default + ./nixosConfigurations/astora + ./nixosModules/bonfire.nix + ]; + specialArgs = { inherit inputs; }; }; }; diff --git a/nixosConfigurations/astora/default.nix b/nixosConfigurations/astora/default.nix index 6b54962..2db1328 100644 --- a/nixosConfigurations/astora/default.nix +++ b/nixosConfigurations/astora/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, agenix, inputs, ... }: { system.stateVersion = "23.11"; @@ -90,6 +90,9 @@ gcc cachix + inputs.agenix.packages.${system}.default + + helix ]; programs = { @@ -101,6 +104,8 @@ }; }; + programs.direnv.enable = true; + fonts.packages = with pkgs; [ nerdfonts ]; programs.steam.enable = true; diff --git a/nixosConfigurations/astora/users.nix b/nixosConfigurations/astora/users.nix index 05c2d75..3115b1e 100644 --- a/nixosConfigurations/astora/users.nix +++ b/nixosConfigurations/astora/users.nix @@ -49,6 +49,7 @@ pinentry-program ${pkgs.pinentry.gtk2}/bin/pinentry ''; home.file.".config/git/config".source = "${config.bonfire.configDir}/git/config"; + home.file.".config/nvim" = { source = "${config.bonfire.configDir}/nvim"; recursive = true; }; }; programs.gnupg.agent = {