From 5db06024d727b2ca11f03d3ea6153a7946d8f720 Mon Sep 17 00:00:00 2001 From: schererleander Date: Tue, 29 Apr 2025 20:41:52 +0200 Subject: move modules --- flake.lock | 36 ++-- flake.nix | 22 ++- modules/default.nix | 14 ++ modules/emacs.nix | 13 ++ modules/foot.nix | 48 +++++ modules/git.nix | 23 +++ modules/home-manager/default.nix | 15 -- modules/home-manager/emacs.nix | 13 -- modules/home-manager/foot.nix | 48 ----- modules/home-manager/git.nix | 23 --- modules/home-manager/neovim/default.nix | 57 ------ modules/home-manager/neovim/lua/autocmds.lua | 8 - modules/home-manager/neovim/lua/keymaps.lua | 0 modules/home-manager/neovim/lua/options.lua | 45 ----- modules/home-manager/neovim/lua/plugins.lua | 268 --------------------------- modules/home-manager/nextcloud.nix | 39 ---- modules/home-manager/nixcord.nix | 22 --- modules/home-manager/spicetify.nix | 21 --- modules/home-manager/sway.nix | 104 ----------- modules/home-manager/tmux.nix | 14 -- modules/home-manager/waybar.nix | 72 ------- modules/home-manager/zsh.nix | 29 --- modules/neovim/default.nix | 57 ++++++ modules/neovim/lua/autocmds.lua | 8 + modules/neovim/lua/keymaps.lua | 0 modules/neovim/lua/options.lua | 45 +++++ modules/neovim/lua/plugins.lua | 268 +++++++++++++++++++++++++++ modules/nextcloud.nix | 39 ++++ modules/nixcord.nix | 28 +++ modules/nixos/audio.nix | 16 -- modules/nixos/default.nix | 6 - modules/nixos/wooting.nix | 34 ---- modules/spicetify.nix | 21 +++ modules/sway.nix | 104 +++++++++++ modules/tmux.nix | 14 ++ modules/waybar.nix | 72 +++++++ modules/zsh.nix | 29 +++ 37 files changed, 819 insertions(+), 856 deletions(-) create mode 100644 modules/default.nix create mode 100644 modules/emacs.nix create mode 100644 modules/foot.nix create mode 100644 modules/git.nix delete mode 100644 modules/home-manager/default.nix delete mode 100644 modules/home-manager/emacs.nix delete mode 100644 modules/home-manager/foot.nix delete mode 100644 modules/home-manager/git.nix delete mode 100644 modules/home-manager/neovim/default.nix delete mode 100644 modules/home-manager/neovim/lua/autocmds.lua delete mode 100644 modules/home-manager/neovim/lua/keymaps.lua delete mode 100644 modules/home-manager/neovim/lua/options.lua delete mode 100644 modules/home-manager/neovim/lua/plugins.lua delete mode 100644 modules/home-manager/nextcloud.nix delete mode 100644 modules/home-manager/nixcord.nix delete mode 100644 modules/home-manager/spicetify.nix delete mode 100644 modules/home-manager/sway.nix delete mode 100644 modules/home-manager/tmux.nix delete mode 100644 modules/home-manager/waybar.nix delete mode 100644 modules/home-manager/zsh.nix create mode 100644 modules/neovim/default.nix create mode 100644 modules/neovim/lua/autocmds.lua create mode 100644 modules/neovim/lua/keymaps.lua create mode 100644 modules/neovim/lua/options.lua create mode 100644 modules/neovim/lua/plugins.lua create mode 100644 modules/nextcloud.nix create mode 100644 modules/nixcord.nix delete mode 100644 modules/nixos/audio.nix delete mode 100644 modules/nixos/default.nix delete mode 100644 modules/nixos/wooting.nix create mode 100644 modules/spicetify.nix create mode 100644 modules/sway.nix create mode 100644 modules/tmux.nix create mode 100644 modules/waybar.nix create mode 100644 modules/zsh.nix diff --git a/flake.lock b/flake.lock index 070fd51..af9f1a9 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ ] }, "locked": { - "lastModified": 1743387206, - "narHash": "sha256-24N3NAuZZbYqZ39NgToZgHUw6M7xHrtrAm18kv0+2Wo=", + "lastModified": 1745557122, + "narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=", "owner": "nix-community", "repo": "home-manager", - "rev": "15c5f9d04fabd176f30286c8f52bbdb2c853a146", + "rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1", "type": "github" }, "original": { @@ -43,11 +43,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1743833482, - "narHash": "sha256-tUV7MhS/JFOEp3JQxiyvo8K3aS5zP5jcF/Buk57yWDo=", + "lastModified": 1745890743, + "narHash": "sha256-iKW6QSWBZWU/jp/AD9+rkXlhIvsPsAny0yC4hDVixi8=", "owner": "kaylorben", "repo": "nixcord", - "rev": "2903d897d5939324a758bd3f2cee1fbcb118b5d1", + "rev": "f0311ca697aabe78035bd95adb41beef332e14ee", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745804731, - "narHash": "sha256-v/sK3AS0QKu/Tu5sHIfddiEHCvrbNYPv8X10Fpux68g=", + "lastModified": 1744868846, + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "29335f23bea5e34228349ea739f31ee79e267b88", + "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1743367904, - "narHash": "sha256-sOos1jZGKmT6xxPvxGQyPTApOunXvScV4lNjBCXd/CI=", + "lastModified": 1745868005, + "narHash": "sha256-hZScOyQphT4RUmSEJX+2OxjIlGgLwSd8iW1LNtAWIOs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7ffe0edc685f14b8c635e3d6591b0bbb97365e6c", + "rev": "330d0a4167924b43f31cc9406df363f71b768a02", "type": "github" }, "original": { @@ -104,11 +104,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1743595372, - "narHash": "sha256-e3x1mhpPpYgyyin9j/VbrBpOT5PFpEfx2hkxVZuJZhg=", + "lastModified": 1745922559, + "narHash": "sha256-13U33TrQ86aCXbdfbn7DH/iZuokplIufgTkLx2iEYOU=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "543f12dd14c62ddee79ab79fbfd8726f312b89ff", + "rev": "25289c6cacf0eef2812e44ed7774f87dd866d95c", "type": "github" }, "original": { @@ -154,11 +154,11 @@ ] }, "locked": { - "lastModified": 1742370146, - "narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=", + "lastModified": 1744961264, + "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "adc195eef5da3606891cedf80c0d9ce2d3190808", + "rev": "8d404a69efe76146368885110f29a2ca3700bee6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bb99d96..f1e63af 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,19 @@ username = "leander"; desktop = "nixos"; - pkgs = import nixpkgs { inherit system; }; + overlays = [ + (final: prev: { + discord = prev.callPackage ./modules/home-manager/discord.nix { + libgbm = prev.mesa; + }; + }) + ]; + + + pkgs = import nixpkgs { + inherit system; + overlays = overlays; + }; in { nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { @@ -25,14 +37,16 @@ specialArgs = { inherit inputs; }; modules = [ ./hosts/nixos/configuration.nix - - inputs.spicetify-nix.nixosModules.spicetify - + home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.${username} = import ./hosts/nixos/home.nix; + + home-manager.sharedModules = [ + inputs.nixcord.homeModules.nixcord + ]; } ]; }; diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..8a68d80 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,14 @@ +{ pkgs, lib, ... }: { + imports = [ + ./git.nix + ./zsh.nix + ./foot.nix + ./sway.nix + ./tmux.nix + ./emacs.nix + ./waybar.nix + ./neovim/default.nix + ./nextcloud.nix + ./spicetify.nix + ]; +} diff --git a/modules/emacs.nix b/modules/emacs.nix new file mode 100644 index 0000000..47192a4 --- /dev/null +++ b/modules/emacs.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.emacs; +in { + options.emacs.enable = lib.mkEnableOption "Enable emacs and setup"; + config = lib.mkIf cfg.enable { + programs.emacs = { + enable = true; + package = pkgs.emacs; + }; + }; +} diff --git a/modules/foot.nix b/modules/foot.nix new file mode 100644 index 0000000..107b7bb --- /dev/null +++ b/modules/foot.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.foot; +in { + options.foot.enable = lib.mkEnableOption "Enable and configure the Foot terminal emulator"; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + ibm-plex + ]; + + programs.foot = { + enable = true; + settings = { + main = { + pad = "10x10"; + font = "IBM Plex Mono:size=10"; + line-height = 12; + }; + + colors = { + background = "000000"; + foreground = "f8f8f6"; + + regular0 = "232a2d"; + regular1 = "e57474"; + regular2 = "8ccf7e"; + regular3 = "e5c76b"; + regular4 = "67b0e8"; + regular5 = "c47fd5"; + regular6 = "6cbfbf"; + regular7 = "b3b9b8"; + + bright0 = "2d3437"; + bright1 = "ef7e7e"; + bright2 = "96d988"; + bright3 = "f4d67a"; + bright4 = "71baf2"; + bright5 = "ce89df"; + bright6 = "67cbe7"; + bright7 = "bdc3c2"; + }; + }; + }; + }; +} + diff --git a/modules/git.nix b/modules/git.nix new file mode 100644 index 0000000..2e44a34 --- /dev/null +++ b/modules/git.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.git; +in { + options.git.enable = lib.mkEnableOption "Enable and configure Git"; + + config = lib.mkIf cfg.enable { + programs.git = { + enable = true; + userName = "schererleander"; + userEmail = "leander@schererleander.de"; + + extraConfig = '' + [alias] + co = checkout + br = branch + st = status + ''; + }; + }; +} + diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index ebddc5f..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, lib, ... }: { - imports = [ - ./git.nix - ./zsh.nix - ./foot.nix - ./sway.nix - ./tmux.nix - ./emacs.nix - ./waybar.nix - ./neovim/default.nix - ./nextcloud.nix - ./spicetify.nix - ./nixcord.nix - ]; -} diff --git a/modules/home-manager/emacs.nix b/modules/home-manager/emacs.nix deleted file mode 100644 index 47192a4..0000000 --- a/modules/home-manager/emacs.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.emacs; -in { - options.emacs.enable = lib.mkEnableOption "Enable emacs and setup"; - config = lib.mkIf cfg.enable { - programs.emacs = { - enable = true; - package = pkgs.emacs; - }; - }; -} diff --git a/modules/home-manager/foot.nix b/modules/home-manager/foot.nix deleted file mode 100644 index 107b7bb..0000000 --- a/modules/home-manager/foot.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.foot; -in { - options.foot.enable = lib.mkEnableOption "Enable and configure the Foot terminal emulator"; - - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - ibm-plex - ]; - - programs.foot = { - enable = true; - settings = { - main = { - pad = "10x10"; - font = "IBM Plex Mono:size=10"; - line-height = 12; - }; - - colors = { - background = "000000"; - foreground = "f8f8f6"; - - regular0 = "232a2d"; - regular1 = "e57474"; - regular2 = "8ccf7e"; - regular3 = "e5c76b"; - regular4 = "67b0e8"; - regular5 = "c47fd5"; - regular6 = "6cbfbf"; - regular7 = "b3b9b8"; - - bright0 = "2d3437"; - bright1 = "ef7e7e"; - bright2 = "96d988"; - bright3 = "f4d67a"; - bright4 = "71baf2"; - bright5 = "ce89df"; - bright6 = "67cbe7"; - bright7 = "bdc3c2"; - }; - }; - }; - }; -} - diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix deleted file mode 100644 index 2e44a34..0000000 --- a/modules/home-manager/git.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.git; -in { - options.git.enable = lib.mkEnableOption "Enable and configure Git"; - - config = lib.mkIf cfg.enable { - programs.git = { - enable = true; - userName = "schererleander"; - userEmail = "leander@schererleander.de"; - - extraConfig = '' - [alias] - co = checkout - br = branch - st = status - ''; - }; - }; -} - diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix deleted file mode 100644 index 415861a..0000000 --- a/modules/home-manager/neovim/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.neovim; -in { - options.neovim.enable = lib.mkEnableOption "Enable and setup neovim"; - - config = lib.mkIf cfg.enable { - xdg.configFile."nvim/lua".source = pkgs.lib.mkForce ./lua; - - programs.neovim = { - enable = true; - vimAlias = true; - - extraPackages = with pkgs; [ - lua-language-server - ]; - - plugins = with pkgs.vimPlugins; [ - lazy-nvim - nvim-lspconfig - friendly-snippets - telescope-nvim - - (nvim-treesitter.withPlugins (plugins: with plugins; [ - tree-sitter-bash - tree-sitter-c - tree-sitter-json - tree-sitter-lua - tree-sitter-python - tree-sitter-nix - tree-sitter-vim - tree-sitter-vimdoc - tree-sitter-yaml - tree-sitter-markdown - tree-sitter-markdown_inline - ])) - ]; - - extraLuaConfig = '' - vim.g.mapleader = " " - vim.g.maplocalleader = "\\" - - require('options') - require('keymaps') - require('plugins') - require('autocmds') - ''; - }; - - home.sessionVariables = rec { - EDITOR = "nvim"; - GIT_EDITOR = EDITOR; - }; - }; -} - diff --git a/modules/home-manager/neovim/lua/autocmds.lua b/modules/home-manager/neovim/lua/autocmds.lua deleted file mode 100644 index f7e6923..0000000 --- a/modules/home-manager/neovim/lua/autocmds.lua +++ /dev/null @@ -1,8 +0,0 @@ -vim.cmd('highlight WinSeparator guibg=None ctermbg=None') -vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE') --- hide background lsp coloum -vim.cmd('highlight SignColumn guibg=NONE ctermbg=None') - --- transparent background -vim.cmd('highlight Normal guibg=NONE ctermbg=NONE') -vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE') diff --git a/modules/home-manager/neovim/lua/keymaps.lua b/modules/home-manager/neovim/lua/keymaps.lua deleted file mode 100644 index e69de29..0000000 diff --git a/modules/home-manager/neovim/lua/options.lua b/modules/home-manager/neovim/lua/options.lua deleted file mode 100644 index 891668f..0000000 --- a/modules/home-manager/neovim/lua/options.lua +++ /dev/null @@ -1,45 +0,0 @@ -local options = { - list = false, - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - conceallevel = 2, -- so that `` is visible in markdown files - fileencoding = "utf-8", -- the encoding written to a file - hidden = true, -- required to keep multiple buffers and open multiple buffers - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim - laststatus = 3, - showmode = false, -- we don't need to see things like -- INSERT -- anymore - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = true, -- force all horizontal splits to go below current window ↕️ - splitright = true, -- force all vertical splits to go to the right of current window ↔️ - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion (4000ms default) ⚡ - writebackup = false, -- if a file is being edited by another program, it is not allowed to be edited - expandtab = true, -- use tabs instead of spaces ␣ - pumheight = 10, - cmdheight = 2, - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab ⇥ - cursorline = false, -- highlight the current line (disabled for now) - number = false, -- set numbered lines - relativenumber = false, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 (default 4) - wrap = false, -- display lines as one long lines -} - -vim.opt.shortmess:append 'c' - -for k, v in pairs(options) do - vim.opt[k] = v -end - -vim.wo.list = false -vim.cmd 'set whichwrap+=<,>,[,],h,l' - --- lazy load -vim.loader.enable() diff --git a/modules/home-manager/neovim/lua/plugins.lua b/modules/home-manager/neovim/lua/plugins.lua deleted file mode 100644 index 7c2d956..0000000 --- a/modules/home-manager/neovim/lua/plugins.lua +++ /dev/null @@ -1,268 +0,0 @@ -require("lazy").setup({ - { - "ellisonleao/gruvbox.nvim", - priority = 1000, - config = function () - require("gruvbox").setup({}) - vim.cmd("colorscheme gruvbox") - end - }, - - { - "hrsh7th/nvim-cmp", - dependencies = { - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "onsails/lspkind-nvim" - }, - config = function() - local signs = { - Error = " ", - Warn = " ", - Hint = " ", - Info = " ", - } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) - end - - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - local on_attach = function(client, bufnr) - local opts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) - vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) - vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set("n", "wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts) - vim.keymap.set("n", "D", vim.lsp.buf.type_definition, opts) - vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) - vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) - end - - local lspconfig = require("lspconfig") - - lspconfig.lua_ls.setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - }, - telemetry = { - enable = false, - }, - }, - }, - }) - - local cmp = require("cmp") - local luasnip = require("luasnip") - local lspkind = require("lspkind") - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - ellipsis_char = "..." - }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - }) - - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'buffer' }, - }) - }) - - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - end, - }, - - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "BufRead", - config = function() - require("nvim-treesitter.configs").setup({ - auto_install = true, - ensure_installed = { "c", "lua", "vim", "python", "java", "javascript", "typescript", "css", "html" }, - highlight = { enable = true, use_languagetree = true }, - indent = { enable = true }, - }) - end, - }, - - { - "nvim-tree/nvim-tree.lua", - enabled = false, - config = function() - require("nvim-tree").setup({ - view = { width = 20, side = "left" }, - disable_netrw = true, - hijack_cursor = true, - update_cwd = true, - hijack_directories = { auto_open = true }, - renderer = { - root_folder_label = false, - indent_markers = { - enable = true, - icons = { corner = "└ ", edge = "│ ", none = " " }, - }, - }, - }) - end, - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "", ":silent Telescope current_buffer_fuzzy_find", desc = "Open Telescope" }, - }, - config = function() - require("telescope").setup({ - defaults = { mapping = {} }, - pickers = {}, - extensions = {}, - }) - end, - }, - - { - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - end, - }, - - { - "echasnovski/mini.nvim", - version = false, - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("mini.starter").setup({ - header = table.concat({ - " /l、 ", - "(゚、 。 7 ", - " l ~ ヽ ", - " じしf_,)ノ ", - }, "\n"), - footer = "", - content_hooks = { - require("mini.starter").gen_hook.adding_bullet("» "), - require("mini.starter").gen_hook.aligning("center", "center"), - }, - }) - end, - }, - - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - require("nvim-autopairs").setup {} - end, - }, - - { - "tamton-aquib/staline.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("staline").setup { - sections = { - left = { 'file_name', 'branch' }, - mid = { 'lsp' }, - right = { 'line_column' }, - }, - special_table = { - NvimTree = { 'NvimTree', ' ' }, - packer = { 'Packer', ' ' }, - starter = { '', '' }, - lazy = { '', '' }, - mason = { '', '' }, - }, - lsp_symbols = { - Error = " ", - Info = " ", - Warn = " ", - Hint = "", - }, - defaults = { - true_colors = true, - line_column = ' ☰ %l/%L %c', - branch_symbol = " ", - exclude_fts = { 'NvimTree' }, - }, - } - vim.cmd('highlight Statusline guibg=none') - vim.cmd('highlight StatuslineNC guibg=none') - end, - }, -}) diff --git a/modules/home-manager/nextcloud.nix b/modules/home-manager/nextcloud.nix deleted file mode 100644 index 6e8774f..0000000 --- a/modules/home-manager/nextcloud.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.nextcloud; -in { - options.nextcloud.enable = lib.mkEnableOption "Enable nextcloud and setup"; - config = lib.mkIf cfg.enable { - home.file.".netrc".text = ''default - login exmaple - password test123 - ''; - - home.packages = pkgs.nextcloud-client; - - systemd.user = { - services.nextcloud-autosync = { - Unit = { - Description = "Auto sync Nextcloud"; - After = "network-online.target"; - }; - Service = { - Type = "simple"; - ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n https://cloud.schererleander.de"; - TimeoutStopSec = "180"; - KillMode = "process"; - KillSignal = "SIGINT"; - }; - Install.WantedBy = ["multi-user.target"]; - }; - timers.nextcloud-autosync = { - Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes"; - Timer.OnBootSec = "5min"; - Timer.OnUnitActiveSec = "60min"; - Install.WantedBy = ["multi-user.target" "timers.target"]; - }; - startServices = true; - }; - }; -} diff --git a/modules/home-manager/nixcord.nix b/modules/home-manager/nixcord.nix deleted file mode 100644 index 8b085c4..0000000 --- a/modules/home-manager/nixcord.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.nixcord; -in { - options.nixcord.enable = lib.mkEnableOption "Enable nixord and setup"; - config = lib.mkIf cfg.enable { - programs.nixcord = { - enable = true; - config = { - themeLinks = [ - "https://github.com/TheCommieAxolotl/BetterDiscord-Stuff/blob/main/Ultra/Ultra.theme.css" - ]; - frameless = true; - plugins = { - alwaysAnimate.enable = true; - clearURLs.enable = true; - }; - }; - }; - }; -} diff --git a/modules/home-manager/spicetify.nix b/modules/home-manager/spicetify.nix deleted file mode 100644 index d961779..0000000 --- a/modules/home-manager/spicetify.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: -let - cfg = config.spicetify; - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system}; -in { - options.spicetify.enable = lib.mkEnableOption "Enable Spicetify integration"; - config = lib.mkIf cfg.enable { - programs.spicetify = { - enable = true; - enabledSnippets = with spicePkgs.snippets; [ - pointer - sonicDancing - modernScrollbar - nyanCatProgressBar - declutterNowPlayingBar - ]; - theme = spicePkgs.themes.sleek; - colorScheme = "coral"; - }; - }; -} diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix deleted file mode 100644 index 77f1138..0000000 --- a/modules/home-manager/sway.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.sway; -in { - options.sway.enable = lib.mkEnableOption "Enable sway and setup"; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - wmenu - swaybg - wl-clipboard - playerctl - ]; - - xdg = { - portal = { - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-wlr - xdg-desktop-portal-gtk - ]; - }; - }; - - wayland.windowManager.sway = { - enable = true; - config = { - input = { - "*" = { - xkb_layout = "de"; - }; - }; - output = { - DP-1 = { - resolution = "1920x1080@240Hz"; - bg = "/etc/nixos/jaison-lin-2WHTac8jVA8-unsplash.jpg fill"; - }; - }; - gaps = { - inner = 15; - }; - window = { - titlebar = false; - border = 0; - }; - keybindings = let - mod = "Mod4"; - in - lib.mkOptionDefault { - "${mod}+Return" = "exec ${pkgs.foot}/bin/foot"; - "${mod}+q" = "kill"; - "${mod}+d" = "exec exec ${pkgs.wmenu}/bin/wmenu-run -b -N 000000"; - "${mod}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; - "${mod}+Tab" = "workspace back_and_forth"; - "${mod}+1" = "workspace number 1"; - "${mod}+2" = "workspace number 2"; - "${mod}+3" = "workspace number 3"; - "${mod}+4" = "workspace number 4"; - "${mod}+5" = "workspace number 5"; - "${mod}+6" = "workspace number 6"; - "${mod}+7" = "workspace number 7"; - "${mod}+8" = "workspace number 8"; - "${mod}+9" = "workspace number 9"; - "${mod}+0" = "workspace number 10"; - - "${mod}+Shift+1" = "move container to workspace number 1"; - "${mod}+Shift+2" = "move container to workspace number 2"; - "${mod}+Shift+3" = "move container to workspace number 3"; - "${mod}+Shift+4" = "move container to workspace number 4"; - "${mod}+Shift+5" = "move container to workspace number 5"; - "${mod}+Shift+6" = "move container to workspace number 6"; - "${mod}+Shift+7" = "move container to workspace number 7"; - "${mod}+Shift+8" = "move container to workspace number 8"; - "${mod}+Shift+9" = "move container to workspace number 9"; - "${mod}+Shift+0" = "move container to workspace number 10"; - - "${mod}+b" = "splith"; - "${mod}+v" = "splitv"; - "${mod}+f" = "fullscreen"; - "${mod}+Shift+space" = "floating toggle"; - - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioPrev" = "exec playerctl previous"; - "XF86AudioNext" = "exec playerctl next"; - - "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ +5%"; - "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ -5%"; - "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_DEVICE@ toggle"; - }; - defaultWorkspace = "workspace number 1"; - bars = [{ - "command" = "${pkgs.waybar}/bin/waybar"; - }]; - }; - checkConfig = false; - wrapperFeatures.base = true; - wrapperFeatures.gtk = true; - }; - - home.sessionVariables = { - XDG_CURRENT_DESKTOP = "wayland"; - }; - }; -} diff --git a/modules/home-manager/tmux.nix b/modules/home-manager/tmux.nix deleted file mode 100644 index c4bfefc..0000000 --- a/modules/home-manager/tmux.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.tmux; -in { - options.tmux.enable = lib.mkEnableOption "Enable and configure Tmux"; - - config = lib.mkIf cfg.enable { - programs.tmux = { - enable = true; - }; - }; -} - diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix deleted file mode 100644 index 6a54d0d..0000000 --- a/modules/home-manager/waybar.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.waybar; -in { - options.waybar.enable = lib.mkEnableOption "Enable and configure Waybar"; - - config = lib.mkIf cfg.enable { - programs.waybar = { - enable = true; - settings = { - mainBar = { - height = 20; - layer = "top"; - position = "bottom"; - tray = { spacing = 10; }; - modules-center = [ "sway/window" ]; - modules-left = [ "sway/workspaces" "sway/mode" ]; - modules-right = [ - "pulseaudio" - "clock" - "tray" - ]; - clock = { - format-alt = "{:%Y-%m-%d}"; - tooltip-format = "{:%Y-%m-%d | %H:%M}"; - }; - pulseaudio = { - format = "{volume}% {icon} {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-icons = { - car = ""; - default = [ "" "" "" ]; - handsfree = ""; - headphones = ""; - headset = ""; - phone = ""; - portable = ""; - }; - format-muted = " {format_source}"; - format-source = "{volume}% "; - format-source-muted = ""; - on-click = "pavucontrol"; - }; - }; - }; - style = '' - * { - border: none; - border-radius: 0; - font-family: monospace; - font-size: 12px; - } - - window#waybar { - background: #000000; - } - - #workspaces button { - padding-left: 5px; - padding-right: 5px; - } - - #clock, #pulseaudio, #tray { - padding-left: 5px; - padding-right: 5px; - } - ''; - }; - }; -} diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix deleted file mode 100644 index 9dab7d8..0000000 --- a/modules/home-manager/zsh.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.zsh; -in { - options.zsh.enable = lib.mkEnableOption "Enable zsh and configure"; - - config = lib.mkIf cfg.enable { - programs.zsh = { - enable = true; - autosuggestion.enable = true; - historySubstringSearch.enable = true; - plugins = [ - { - name = "pure"; - src = "${pkgs.pure-prompt}/share/zsh/site-functions"; - } - { - name = "zsh-completions"; - src = "${pkgs.zsh-completions}/share/zsh/site-functions"; - } - { - name = "fast-syntax-highlighting"; - src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions"; - } - ]; - }; - }; -} diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix new file mode 100644 index 0000000..415861a --- /dev/null +++ b/modules/neovim/default.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.neovim; +in { + options.neovim.enable = lib.mkEnableOption "Enable and setup neovim"; + + config = lib.mkIf cfg.enable { + xdg.configFile."nvim/lua".source = pkgs.lib.mkForce ./lua; + + programs.neovim = { + enable = true; + vimAlias = true; + + extraPackages = with pkgs; [ + lua-language-server + ]; + + plugins = with pkgs.vimPlugins; [ + lazy-nvim + nvim-lspconfig + friendly-snippets + telescope-nvim + + (nvim-treesitter.withPlugins (plugins: with plugins; [ + tree-sitter-bash + tree-sitter-c + tree-sitter-json + tree-sitter-lua + tree-sitter-python + tree-sitter-nix + tree-sitter-vim + tree-sitter-vimdoc + tree-sitter-yaml + tree-sitter-markdown + tree-sitter-markdown_inline + ])) + ]; + + extraLuaConfig = '' + vim.g.mapleader = " " + vim.g.maplocalleader = "\\" + + require('options') + require('keymaps') + require('plugins') + require('autocmds') + ''; + }; + + home.sessionVariables = rec { + EDITOR = "nvim"; + GIT_EDITOR = EDITOR; + }; + }; +} + diff --git a/modules/neovim/lua/autocmds.lua b/modules/neovim/lua/autocmds.lua new file mode 100644 index 0000000..f7e6923 --- /dev/null +++ b/modules/neovim/lua/autocmds.lua @@ -0,0 +1,8 @@ +vim.cmd('highlight WinSeparator guibg=None ctermbg=None') +vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE') +-- hide background lsp coloum +vim.cmd('highlight SignColumn guibg=NONE ctermbg=None') + +-- transparent background +vim.cmd('highlight Normal guibg=NONE ctermbg=NONE') +vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE') diff --git a/modules/neovim/lua/keymaps.lua b/modules/neovim/lua/keymaps.lua new file mode 100644 index 0000000..e69de29 diff --git a/modules/neovim/lua/options.lua b/modules/neovim/lua/options.lua new file mode 100644 index 0000000..891668f --- /dev/null +++ b/modules/neovim/lua/options.lua @@ -0,0 +1,45 @@ +local options = { + list = false, + backup = false, -- creates a backup file + clipboard = "unnamedplus", -- allows neovim to access the system clipboard + conceallevel = 2, -- so that `` is visible in markdown files + fileencoding = "utf-8", -- the encoding written to a file + hidden = true, -- required to keep multiple buffers and open multiple buffers + hlsearch = true, -- highlight all matches on previous search pattern + ignorecase = true, -- ignore case in search patterns + mouse = "a", -- allow the mouse to be used in neovim + laststatus = 3, + showmode = false, -- we don't need to see things like -- INSERT -- anymore + smartcase = true, -- smart case + smartindent = true, -- make indenting smarter again + splitbelow = true, -- force all horizontal splits to go below current window ↕️ + splitright = true, -- force all vertical splits to go to the right of current window ↔️ + swapfile = false, -- creates a swapfile + termguicolors = true, -- set term gui colors (most terminals support this) + timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) + undofile = true, -- enable persistent undo + updatetime = 300, -- faster completion (4000ms default) ⚡ + writebackup = false, -- if a file is being edited by another program, it is not allowed to be edited + expandtab = true, -- use tabs instead of spaces ␣ + pumheight = 10, + cmdheight = 2, + shiftwidth = 2, -- the number of spaces inserted for each indentation + tabstop = 2, -- insert 2 spaces for a tab ⇥ + cursorline = false, -- highlight the current line (disabled for now) + number = false, -- set numbered lines + relativenumber = false, -- set relative numbered lines + numberwidth = 4, -- set number column width to 2 (default 4) + wrap = false, -- display lines as one long lines +} + +vim.opt.shortmess:append 'c' + +for k, v in pairs(options) do + vim.opt[k] = v +end + +vim.wo.list = false +vim.cmd 'set whichwrap+=<,>,[,],h,l' + +-- lazy load +vim.loader.enable() diff --git a/modules/neovim/lua/plugins.lua b/modules/neovim/lua/plugins.lua new file mode 100644 index 0000000..7c2d956 --- /dev/null +++ b/modules/neovim/lua/plugins.lua @@ -0,0 +1,268 @@ +require("lazy").setup({ + { + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = function () + require("gruvbox").setup({}) + vim.cmd("colorscheme gruvbox") + end + }, + + { + "hrsh7th/nvim-cmp", + dependencies = { + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "L3MON4D3/LuaSnip", + "onsails/lspkind-nvim" + }, + config = function() + local signs = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + end + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + local on_attach = function(client, bufnr) + local opts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set("n", "wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set("n", "D", vim.lsp.buf.type_definition, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) + end + + local lspconfig = require("lspconfig") + + lspconfig.lua_ls.setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + }, + }, + }) + + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", + maxwidth = 50, + ellipsis_char = "..." + }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + }) + + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'buffer' }, + }) + }) + + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + end, + }, + + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = "BufRead", + config = function() + require("nvim-treesitter.configs").setup({ + auto_install = true, + ensure_installed = { "c", "lua", "vim", "python", "java", "javascript", "typescript", "css", "html" }, + highlight = { enable = true, use_languagetree = true }, + indent = { enable = true }, + }) + end, + }, + + { + "nvim-tree/nvim-tree.lua", + enabled = false, + config = function() + require("nvim-tree").setup({ + view = { width = 20, side = "left" }, + disable_netrw = true, + hijack_cursor = true, + update_cwd = true, + hijack_directories = { auto_open = true }, + renderer = { + root_folder_label = false, + indent_markers = { + enable = true, + icons = { corner = "└ ", edge = "│ ", none = " " }, + }, + }, + }) + end, + }, + + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + { "", ":silent Telescope current_buffer_fuzzy_find", desc = "Open Telescope" }, + }, + config = function() + require("telescope").setup({ + defaults = { mapping = {} }, + pickers = {}, + extensions = {}, + }) + end, + }, + + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }, + + { + "echasnovski/mini.nvim", + version = false, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("mini.starter").setup({ + header = table.concat({ + " /l、 ", + "(゚、 。 7 ", + " l ~ ヽ ", + " じしf_,)ノ ", + }, "\n"), + footer = "", + content_hooks = { + require("mini.starter").gen_hook.adding_bullet("» "), + require("mini.starter").gen_hook.aligning("center", "center"), + }, + }) + end, + }, + + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup {} + end, + }, + + { + "tamton-aquib/staline.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("staline").setup { + sections = { + left = { 'file_name', 'branch' }, + mid = { 'lsp' }, + right = { 'line_column' }, + }, + special_table = { + NvimTree = { 'NvimTree', ' ' }, + packer = { 'Packer', ' ' }, + starter = { '', '' }, + lazy = { '', '' }, + mason = { '', '' }, + }, + lsp_symbols = { + Error = " ", + Info = " ", + Warn = " ", + Hint = "", + }, + defaults = { + true_colors = true, + line_column = ' ☰ %l/%L %c', + branch_symbol = " ", + exclude_fts = { 'NvimTree' }, + }, + } + vim.cmd('highlight Statusline guibg=none') + vim.cmd('highlight StatuslineNC guibg=none') + end, + }, +}) diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix new file mode 100644 index 0000000..6e8774f --- /dev/null +++ b/modules/nextcloud.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.nextcloud; +in { + options.nextcloud.enable = lib.mkEnableOption "Enable nextcloud and setup"; + config = lib.mkIf cfg.enable { + home.file.".netrc".text = ''default + login exmaple + password test123 + ''; + + home.packages = pkgs.nextcloud-client; + + systemd.user = { + services.nextcloud-autosync = { + Unit = { + Description = "Auto sync Nextcloud"; + After = "network-online.target"; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n https://cloud.schererleander.de"; + TimeoutStopSec = "180"; + KillMode = "process"; + KillSignal = "SIGINT"; + }; + Install.WantedBy = ["multi-user.target"]; + }; + timers.nextcloud-autosync = { + Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes"; + Timer.OnBootSec = "5min"; + Timer.OnUnitActiveSec = "60min"; + Install.WantedBy = ["multi-user.target" "timers.target"]; + }; + startServices = true; + }; + }; +} diff --git a/modules/nixcord.nix b/modules/nixcord.nix new file mode 100644 index 0000000..a969edf --- /dev/null +++ b/modules/nixcord.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, inputs, ... }: + +let + cfg = config.nixcord; +in { + options.nixcord.enable = lib.mkEnableOption "Enable nixord and setup"; + config = lib.mkIf cfg.enable { + programs.nixcord = { + enable = true; # enable Nixcord. Also installs discord package + #quickCss = "some CSS"; # quickCSS file + config = { + #useQuickCss = true; # use out quickCSS + #themeLinks = [ # or use an online theme + # "https://raw.githubusercontent.com/link/to/some/theme.css" + #]; + frameless = true; # set some Vencord options + plugins = { + hideAttachments.enable = true; # Enable a Vencord plugin + ignoreActivities = { # Enable a plugin and set some options + enable = true; + ignorePlaying = true; + ignoreWatching = true; + }; + }; + }; + }; + }; +} diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix deleted file mode 100644 index 4757803..0000000 --- a/modules/nixos/audio.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - cfg = config.audio; -in { - options.audio.enable = lib.mkEnableOption "Enable audio with pipewire"; - config = lib.mkIf cfg.enable { - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100644 index 75e6fad..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, lib, ... }: { - imports = [ - ./audio.nix - ./wooting.nix - ]; -} diff --git a/modules/nixos/wooting.nix b/modules/nixos/wooting.nix deleted file mode 100644 index eadfe9c..0000000 --- a/modules/nixos/wooting.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.wooting; -in { - options.wooting.enable = lib.mkEnableOption "Enable Wooting udev rules"; - - config = lib.mkIf cfg.enable { - services.udev.extraRules = '' - # Wooting One Legacy - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" - - # Wooting One update mode - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess" - - # Wooting Two Legacy - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" - - # Wooting Two update mode - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", TAG+="uaccess" - - # Generic Wootings - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="31e3", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="31e3", TAG+="uaccess" - ''; - - environment.systemPackages = with pkgs; [ - wootility - ]; - }; -} - diff --git a/modules/spicetify.nix b/modules/spicetify.nix new file mode 100644 index 0000000..d871620 --- /dev/null +++ b/modules/spicetify.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, inputs, ... }: +let + cfg = config.spicetify; + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system}; +in { + options.spicetify.enable = lib.mkEnableOption "Enable Spicetify integration"; + config = lib.mkIf cfg.enable { + programs.spicetify = { + enable = true; + enabledSnippets = with spicePkgs.snippets; [ + pointer + sonicDancing + modernScrollbar + nyanCatProgressBar + declutterNowPlayingBar + ]; + theme = spicePkgs.themes.sleek; + colorScheme = "Coral"; + }; + }; +} diff --git a/modules/sway.nix b/modules/sway.nix new file mode 100644 index 0000000..77f1138 --- /dev/null +++ b/modules/sway.nix @@ -0,0 +1,104 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sway; +in { + options.sway.enable = lib.mkEnableOption "Enable sway and setup"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + wmenu + swaybg + wl-clipboard + playerctl + ]; + + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + }; + }; + + wayland.windowManager.sway = { + enable = true; + config = { + input = { + "*" = { + xkb_layout = "de"; + }; + }; + output = { + DP-1 = { + resolution = "1920x1080@240Hz"; + bg = "/etc/nixos/jaison-lin-2WHTac8jVA8-unsplash.jpg fill"; + }; + }; + gaps = { + inner = 15; + }; + window = { + titlebar = false; + border = 0; + }; + keybindings = let + mod = "Mod4"; + in + lib.mkOptionDefault { + "${mod}+Return" = "exec ${pkgs.foot}/bin/foot"; + "${mod}+q" = "kill"; + "${mod}+d" = "exec exec ${pkgs.wmenu}/bin/wmenu-run -b -N 000000"; + "${mod}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; + "${mod}+Tab" = "workspace back_and_forth"; + "${mod}+1" = "workspace number 1"; + "${mod}+2" = "workspace number 2"; + "${mod}+3" = "workspace number 3"; + "${mod}+4" = "workspace number 4"; + "${mod}+5" = "workspace number 5"; + "${mod}+6" = "workspace number 6"; + "${mod}+7" = "workspace number 7"; + "${mod}+8" = "workspace number 8"; + "${mod}+9" = "workspace number 9"; + "${mod}+0" = "workspace number 10"; + + "${mod}+Shift+1" = "move container to workspace number 1"; + "${mod}+Shift+2" = "move container to workspace number 2"; + "${mod}+Shift+3" = "move container to workspace number 3"; + "${mod}+Shift+4" = "move container to workspace number 4"; + "${mod}+Shift+5" = "move container to workspace number 5"; + "${mod}+Shift+6" = "move container to workspace number 6"; + "${mod}+Shift+7" = "move container to workspace number 7"; + "${mod}+Shift+8" = "move container to workspace number 8"; + "${mod}+Shift+9" = "move container to workspace number 9"; + "${mod}+Shift+0" = "move container to workspace number 10"; + + "${mod}+b" = "splith"; + "${mod}+v" = "splitv"; + "${mod}+f" = "fullscreen"; + "${mod}+Shift+space" = "floating toggle"; + + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioPrev" = "exec playerctl previous"; + "XF86AudioNext" = "exec playerctl next"; + + "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ +5%"; + "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ -5%"; + "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_DEVICE@ toggle"; + }; + defaultWorkspace = "workspace number 1"; + bars = [{ + "command" = "${pkgs.waybar}/bin/waybar"; + }]; + }; + checkConfig = false; + wrapperFeatures.base = true; + wrapperFeatures.gtk = true; + }; + + home.sessionVariables = { + XDG_CURRENT_DESKTOP = "wayland"; + }; + }; +} diff --git a/modules/tmux.nix b/modules/tmux.nix new file mode 100644 index 0000000..c4bfefc --- /dev/null +++ b/modules/tmux.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.tmux; +in { + options.tmux.enable = lib.mkEnableOption "Enable and configure Tmux"; + + config = lib.mkIf cfg.enable { + programs.tmux = { + enable = true; + }; + }; +} + diff --git a/modules/waybar.nix b/modules/waybar.nix new file mode 100644 index 0000000..6a54d0d --- /dev/null +++ b/modules/waybar.nix @@ -0,0 +1,72 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.waybar; +in { + options.waybar.enable = lib.mkEnableOption "Enable and configure Waybar"; + + config = lib.mkIf cfg.enable { + programs.waybar = { + enable = true; + settings = { + mainBar = { + height = 20; + layer = "top"; + position = "bottom"; + tray = { spacing = 10; }; + modules-center = [ "sway/window" ]; + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-right = [ + "pulseaudio" + "clock" + "tray" + ]; + clock = { + format-alt = "{:%Y-%m-%d}"; + tooltip-format = "{:%Y-%m-%d | %H:%M}"; + }; + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-icons = { + car = ""; + default = [ "" "" "" ]; + handsfree = ""; + headphones = ""; + headset = ""; + phone = ""; + portable = ""; + }; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = ""; + on-click = "pavucontrol"; + }; + }; + }; + style = '' + * { + border: none; + border-radius: 0; + font-family: monospace; + font-size: 12px; + } + + window#waybar { + background: #000000; + } + + #workspaces button { + padding-left: 5px; + padding-right: 5px; + } + + #clock, #pulseaudio, #tray { + padding-left: 5px; + padding-right: 5px; + } + ''; + }; + }; +} diff --git a/modules/zsh.nix b/modules/zsh.nix new file mode 100644 index 0000000..9dab7d8 --- /dev/null +++ b/modules/zsh.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.zsh; +in { + options.zsh.enable = lib.mkEnableOption "Enable zsh and configure"; + + config = lib.mkIf cfg.enable { + programs.zsh = { + enable = true; + autosuggestion.enable = true; + historySubstringSearch.enable = true; + plugins = [ + { + name = "pure"; + src = "${pkgs.pure-prompt}/share/zsh/site-functions"; + } + { + name = "zsh-completions"; + src = "${pkgs.zsh-completions}/share/zsh/site-functions"; + } + { + name = "fast-syntax-highlighting"; + src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions"; + } + ]; + }; + }; +} -- cgit v1.3.1