diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..3550a30f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/README.md b/README.md index 6e9ce7b0..6e4c4008 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,6 @@ These are dotfiles for my Linux, MacOS and Windows machines ### For nix I'm a recent convert to NixOS from ArchLinux and have been usin it as primary os as well as a package manager on macos so the flake.nix contains configuration for both nix-darwin as well as nixos. It also contains a native home-manager module configuration for non-nixos devices ( like a SteamDeck ). -The - #### Tools Some useful tools I regularly use. @@ -53,25 +51,3 @@ Some useful tools I regularly use. `zig` zig toolchain can be used to compile tree-sitter definitions without having to go through all the hassle of setting up llvm / MSVC on windows `hx/helix` Vim/Neovim - like editor which has autocomplete, tree-sitter, debugger built-in. `winget` Use winget to install tools onto windows. It comes by default and can easily install most things. - -#### Installation -To install on unixes simply do ( needs to have git installed ) - -```sh -curl sh.uttarayan.me | sh -``` - -#### Dotfiles -Includes the dotfiles for - -- [alacritty](#alacritty) -- [bspwm](#bspwm) -- [conky](#conky) -- [neovim](#neovim) -- [neomutt](#neomutt) -- [picom](#picom) -- [rofi](#rofi) -- [sxhkd](#sxhkd) -- [tmux](#tmux) -- [fish](#fish) -- [zsh](#zsh) diff --git a/common/goread.nix b/common/goread.nix new file mode 100644 index 00000000..1322fe48 --- /dev/null +++ b/common/goread.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: { + imports = [ ../modules/goread.nix ]; + programs.goread = { + enable = true; + config = { + urls = { + categories = [{ + name = "Rust"; + desc = "Stuff related to the rust programming language"; + subscriptions = [ + { + name = "r/rust"; + desc = "The rust subreddit"; + url = "https://www.reddit.com/r/rust/.rss"; + } + { + name = "thesquareplanet"; + desc = "jonhoo's blog"; + url = "https://thesquareplanet.com/feed.xml"; + } + { + name = "Jon Gjengset's Youtube"; + desc = "jonhoo's youtube channel"; + url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ"; + } + ]; + }]; + }; + }; + }; + +} diff --git a/common/home.nix b/common/home.nix index fd95ea55..a07b6dba 100644 --- a/common/home.nix +++ b/common/home.nix @@ -4,6 +4,7 @@ ./tmux.nix ./wezterm.nix ./nvim.nix + ./goread.nix ] ++ lib.optionals device.isLinux [ ../linux ]; home.packages = with pkgs; @@ -11,7 +12,6 @@ pandoc gnupg gpg-tui - ngrok slack yarn spotify-player @@ -40,6 +40,7 @@ nil pkg-config lua-language-server + codelldb (nerdfonts.override { fonts = [ "Hasklig" ]; }) pfetch-rs ] ++ lib.optionals device.isLinux [ @@ -67,18 +68,12 @@ }) usbutils handlr-regex + handlr-xdg webcord-vencord spotify lsof wl-clipboard ncpamixer - (pkgs.writeShellApplication { - name = "xdg-open"; - runtimeInputs = [ handlr-regex ]; - text = '' - handlr open "$@" - ''; - }) ] ++ lib.optionals device.isMac [ ]; xdg.enable = true; @@ -171,9 +166,18 @@ settings = let flavour = "mocha"; # Replace with your preferred palette in { - # Other config here - format = "$all"; # Remove this line to disable the default prompt format + # Check https://starship.rs/config/#prompt + format = "$all$character"; palette = "catppuccin_${flavour}"; + character = { + success_symbol = "[[OK](bold green) ❯](maroon)"; + error_symbol = "[❯](red)"; + vimcmd_symbol = "[❮](green)"; + }; + directory = { + truncation_length = 4; + style = "bold lavender"; + }; } // builtins.fromTOML (builtins.readFile (pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml)); }; @@ -219,6 +223,18 @@ if device.isMac then pkgs.pinentry_mac else pkgs.pinentry-qt; }; }; + + # Only for checking markdown previews + vscode = { + enable = true; + package = pkgs.vscodium; + extensions = with pkgs.vscode-extensions; [ + shd101wyy.markdown-preview-enhanced + asvetliakov.vscode-neovim + ]; + }; + + home-manager = { enable = true; }; }; @@ -249,3 +265,4 @@ ]; }; } + diff --git a/common/nvim.nix b/common/nvim.nix index d21fa9af..e53d0e6b 100644 --- a/common/nvim.nix +++ b/common/nvim.nix @@ -1,4 +1,4 @@ -{ pkgs, config, inputs, ... }: { +{ pkgs, config, inputs, device, ... }: { imports = [ inputs.nixneovim.nixosModules.default ]; programs.nixneovim = { enable = true; @@ -122,6 +122,7 @@ mappings = { normal = { "ff" = "require'telescope.builtin'.find_files"; + "fb" = "require'telescope'.extensions.file_browser.file_browser"; "gg" = "require'telescope.builtin'.live_grep"; ";" = "require'telescope.builtin'.buffers"; "o" = "[[TroubleToggle]]"; @@ -141,7 +142,7 @@ "%" = "[[vsplit]]"; "bb" = "require'dap'.toggle_breakpoint"; - "dd" = "require'dapui'.toggle"; + "du" = "require'dapui'.toggle"; "dr" = "[[RustLsp debuggables]]"; "" = "[[Outline]]"; @@ -202,153 +203,185 @@ pkgs.tree-sitter-grammars.tree-sitter-just + # Testing + neotest + # neotest-rust + ]; - extraConfigLua = /* lua */ '' - require('rest-nvim').setup() - require('telescope').setup { - defaults = { - initial_mode = 'insert', - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - } + extraConfigLua = + let + codelldb = pkgs.codelldb; + liblldb = + if device.isLinux then + "${codelldb}/lldb/lib/liblldb.so" + else if device.isMac then + "${codelldb}/lldb/lib/liblldb.dylib" + else null + ; + in + /* lua */ + '' + require'neotest'.setup({ + adapters = { + -- require('neotest-rust') { + -- args = { "--no-capture" }, + -- } + require('rustaceanvim.neotest'), } - } + }) - require('telescope').load_extension("ui-select") - require('telescope').load_extension("dap") - require('telescope').load_extension("fzf") - require('telescope').load_extension("file_browser") - require('telescope').load_extension("rest") + require('rest-nvim').setup() + require('telescope').setup { + defaults = { + initial_mode = 'insert', + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + } + } + } - vim.g.rustaceanvim = { - tools = { - enable_clippy = false, - }, - server = { - capabilities = require 'lsp-zero'.get_capabilities(), - on_attach = function(client, bufnr) - if client.server_capabilities.inlayHintProvider then - vim.lsp.inlay_hint.enable(bufnr, true) - end - end, - }, - dap = { - autoload_configurations = false - }, - } + require('telescope').load_extension("ui-select") + require('telescope').load_extension("dap") + require('telescope').load_extension("fzf") + require('telescope').load_extension("file_browser") + require('telescope').load_extension("rest") - require("copilot").setup({ - suggestion = { - enabled = true, - auto_trigger = true, - keymap = { - accept = "", - } - }, - panel = { enabled = true }, - }) + vim.g.rustaceanvim = { + tools = { + enable_clippy = false, + }, + server = { + capabilities = require 'lsp-zero'.get_capabilities(), + on_attach = function(client, bufnr) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(bufnr, true) + end + end, + settings = function(project_root) + local ra = require('rustaceanvim.config.server') + return ra.load_rust_analyzer_settings(project_root, { + settings_file_pattern = 'rust-analyzer.json' + }) + end + }, + dap = { + autoload_configurations = false, + adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${codelldb}/lldb/lib/liblldb.so") + }, + } - require 'fidget'.setup() - -- ======================================================================= - -- nvim-cmp - -- ======================================================================= - local cmp = require("cmp") - cmp.setup({ - view = { - entries = { name = 'custom', selection_order = 'near_cursor' } - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - sources = cmp.config.sources({ - { name = "copilot", }, - { name = 'buffer' }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'treesitter' }, - { name = 'path' }, - { name = 'git' }, - { name = 'tmux' } - }), - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.confirm(), - [''] = cmp.mapping.complete(), - -- [''] = cmp.mapping.complete(), - [''] = cmp.config.next, - [''] = cmp.config.prev, - }) - }) + require("copilot").setup({ + suggestion = { + enabled = true, + auto_trigger = true, + keymap = { + accept = "", + } + }, + panel = { enabled = true }, + }) - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline { - -- [''] = cmp.config.disable, - -- [''] = cmp.config.disable, - }, - sources = { - { name = 'buffer' } - } - }) - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline { - -- [''] = cmp.config.disable, - -- [''] = cmp.config.disable, - }, - -- mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). - }, { - { name = 'buffer' }, - }) - }) - require('crates').setup() - require('outline').setup() - 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, -- requires hrsh7th/nvim-cmp - }, - }, - -- you can enable a preset for easier configuration - presets = { - bottom_search = false, -- 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 = true, -- add a border to hover docs and signature help - }, - }) + require 'fidget'.setup() + -- ======================================================================= + -- nvim-cmp + -- ======================================================================= + local cmp = require("cmp") + cmp.setup({ + view = { + entries = { name = 'custom', selection_order = 'near_cursor' } + }, + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + sources = cmp.config.sources({ + { name = "copilot", }, + { name = 'buffer' }, + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'treesitter' }, + { name = 'path' }, + { name = 'git' }, + { name = 'tmux' } + }), + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.confirm(), + [''] = cmp.mapping.complete(), + -- [''] = cmp.mapping.complete(), + [''] = cmp.config.next, + [''] = cmp.config.prev, + }) + }) - require 'FTerm'.setup({ - border = 'double', - dimensions = { - height = 0.95, - width = 0.95, - }, - cmd = "fish", - blend = 10, - }) - ''; + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline { + -- [''] = cmp.config.disable, + -- [''] = cmp.config.disable, + }, + sources = { + { name = 'buffer' } + } + }) + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline { + -- [''] = cmp.config.disable, + -- [''] = cmp.config.disable, + }, + -- mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). + }, { + { name = 'buffer' }, + }) + }) + require('crates').setup() + require('outline').setup() + 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, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = false, -- 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 = true, -- add a border to hover docs and signature help + }, + }) + + require 'FTerm'.setup({ + border = 'double', + dimensions = { + height = 0.95, + width = 0.95, + }, + cmd = "fish", + blend = 10, + }) + ''; # builtins.readFile ./extraConfig.lua; package = pkgs.neovim-nightly; }; diff --git a/flake.lock b/flake.lock index 3df894a3..635b585f 100644 --- a/flake.lock +++ b/flake.lock @@ -168,6 +168,54 @@ "type": "github" } }, + "flake-compat_3": { + "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_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": { + "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-parts": { "inputs": { "nixpkgs-lib": [ @@ -270,6 +318,42 @@ "type": "indirect" } }, + "flake-parts_6": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_7": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -288,6 +372,42 @@ "type": "github" } }, + "flake-utils_10": { + "inputs": { + "systems": "systems_10" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_11": { + "inputs": { + "systems": "systems_11" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flake-utils_2": { "inputs": { "systems": "systems_2" @@ -395,6 +515,61 @@ "type": "github" } }, + "flake-utils_8": { + "inputs": { + "systems": "systems_8" + }, + "locked": { + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_9": { + "inputs": { + "systems": "systems_9" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gen-luarc": { + "inputs": { + "flake-parts": "flake-parts_7", + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1708688915, + "narHash": "sha256-Vcfbdo2IOEiimRnehGLUM5l2VEIjZYZdKS0sjYWwfb4=", + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "rev": "6eb62734dae84e5f79368dfc545b3fff305df754", + "type": "github" + }, + "original": { + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -417,6 +592,51 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "rustaceanvim", + "neorocks", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "rustaceanvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "haumea": { "inputs": { "nixpkgs": "nixpkgs_5" @@ -566,6 +786,28 @@ "type": "github" } }, + "neorocks": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_8", + "neovim-nightly": "neovim-nightly", + "nixpkgs": "nixpkgs_8", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1709961913, + "narHash": "sha256-IRSChjhNfpqWKwiC83knmxJ3NUpgcAk4xj3SB99PVkQ=", + "owner": "nvim-neorocks", + "repo": "neorocks", + "rev": "b6f97791287e1974699fa502590c4c36b6a5faff", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "neorocks", + "type": "github" + } + }, "neovim-flake": { "inputs": { "flake-utils": "flake-utils_6", @@ -590,6 +832,31 @@ "type": "github" } }, + "neovim-nightly": { + "inputs": { + "flake-utils": "flake-utils_9", + "nixpkgs": [ + "rustaceanvim", + "neorocks", + "nixpkgs" + ] + }, + "locked": { + "dir": "contrib", + "lastModified": 1709934546, + "narHash": "sha256-S24CAQvkeivCFM6tK4D10AEyjsMgE07XVgLIkrh6Ljc=", + "owner": "neovim", + "repo": "neovim", + "rev": "a69c72063994f8e9064b6d9c9f280120423897b8", + "type": "github" + }, + "original": { + "dir": "contrib", + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat_2", @@ -777,6 +1044,42 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1709237383, + "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_3": { + "locked": { + "dir": "lib", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1704874635, @@ -793,6 +1096,38 @@ "type": "github" } }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { + "locked": { + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1706487304, @@ -856,11 +1191,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1709961763, - "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", "type": "github" }, "original": { @@ -870,6 +1205,54 @@ "type": "github" } }, + "nixpkgs_7": { + "locked": { + "lastModified": 1708475490, + "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0e74ca98a74bc7270d28838369593635a5db3260", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1709780214, + "narHash": "sha256-p4iDKdveHMhfGAlpxmkCtfQO3WRzmlD11aIcThwPqhk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f945939fd679284d736112d3d5410eb867f3b31c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nmd": { "flake": false, "locked": { @@ -946,6 +1329,32 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_10", + "gitignore": "gitignore_2", + "nixpkgs": [ + "rustaceanvim", + "neorocks", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -977,6 +1386,28 @@ "type": "github" } }, + "pre-commit-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_5", + "flake-utils": "flake-utils_11", + "gitignore": "gitignore_3", + "nixpkgs": "nixpkgs_9", + "nixpkgs-stable": "nixpkgs-stable_3" + }, + "locked": { + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "anyrun": "anyrun", @@ -992,7 +1423,8 @@ "nix-index-database": "nix-index-database", "nixneovim": "nixneovim", "nixpkgs": "nixpkgs_6", - "nur": "nur" + "nur": "nur", + "rustaceanvim": "rustaceanvim" } }, "rust-overlay": { @@ -1080,6 +1512,30 @@ "type": "github" } }, + "rustaceanvim": { + "inputs": { + "flake-parts": "flake-parts_6", + "gen-luarc": "gen-luarc", + "neorocks": "neorocks", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks_2" + }, + "locked": { + "lastModified": 1710468696, + "narHash": "sha256-kd0IgnjkLWGgNE1WoY4w6WpTpZBkE/YH6Y1mbupHJFs=", + "owner": "mrcjkb", + "repo": "rustaceanvim", + "rev": "69a22c2ec63ab375190006751562b62ebb318250", + "type": "github" + }, + "original": { + "owner": "mrcjkb", + "repo": "rustaceanvim", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -1095,6 +1551,36 @@ "type": "github" } }, + "systems_10": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_11": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -1184,6 +1670,36 @@ "repo": "default", "type": "github" } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index dfaa4e45..ac12882e 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,10 @@ # url = "github:NixNeovim/NixNeovimPlugins"; # inputs.nixpkgs.follows = "nixpkgs"; # } + rustaceanvim = { + url = "github:mrcjkb/rustaceanvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nix-index-database.url = "github:Mic92/nix-index-database"; nur.url = "github:nix-community/nur"; diff --git a/modules/goread.nix b/modules/goread.nix new file mode 100644 index 00000000..0be4173b --- /dev/null +++ b/modules/goread.nix @@ -0,0 +1,42 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let cfg = config.programs.goread; +in { + options = { + programs.goread = { + enable = mkEnableOption "goread - a terminal RSS/Atom reader"; + + config = with types; { + urls = mkOption { + type = attrsOf (listOf attrs); + default = { }; + description = '' + Urls that will be fetched ~/.config/goread/urls.yml + ''; + example = { }; + }; + + colorscheme = mkOption { + type = attrsOf str; + default = { }; + example = { }; + description = '' + Colorscheme that will be fetched ~/.config/goread/colorscheme.json + ''; + }; + }; + }; + }; + + config = { + home.packages = mkIf cfg.enable [ pkgs.goread ]; + + xdg.configFile = mkIf cfg.enable { + "goread/urls.yml".text = generators.toYAML { } cfg.config.urls; + # "goread/colorscheme.json".text = lib.generators.toJSON cfg.config.colorscheme; + }; + + }; +} diff --git a/overlays.nix b/overlays.nix index 20501b57..38cdde52 100644 --- a/overlays.nix +++ b/overlays.nix @@ -1,5 +1,30 @@ { inputs, ... }: let + shell-scipts = final: prev: { + handlr-xdg = (final.pkgs.writeShellApplication { + name = "xdg-open"; + runtimeInputs = [ final.pkgs.handlr-regex ]; + text = '' + handlr open "$@" + ''; + }); + }; + + misc-applications = final: prev: { + goread = final.pkgs.buildGoModule { + pname = "goread"; + version = "v1.6.4"; + vendorHash = "sha256-/kxEnw8l9S7WNMcPh1x7xqiQ3L61DSn6DCIvJlyrip0"; + src = final.pkgs.fetchFromGitHub { + owner = "TypicalAM"; + repo = "goread"; + rev = "v1.6.4"; + sha256 = "sha256-m6reRaJNeFhJBUatfPNm66LwTXPdD/gioT8HTv52QOw"; + }; + checkPhase = null; + }; + }; + anyrun-overlay = final: prev: { anyrun = inputs.anyrun.packages.${prev.system}.anyrun; hyprwin = inputs.anyrun-hyprwin.packages.${prev.system}.hyprwin; @@ -94,9 +119,12 @@ in vimPlugins tree-sitter-grammars tmuxPlugins - inputs.neovim-nightly-overlay.overlay anyrun-overlay + nix-index-db + shell-scipts + misc-applications + inputs.neovim-nightly-overlay.overlay inputs.nixneovim.overlays.default inputs.nur.overlay - nix-index-db + inputs.rustaceanvim.overlays.default ]