commit 2fa019c5674e3f070aa7e21ae934bc4ea331df18 Author: Kristian Krsnik Date: Sun Jul 23 05:04:32 2023 +0200 initial commit diff --git a/alacritty.nix b/alacritty.nix new file mode 100644 index 0000000..183a335 --- /dev/null +++ b/alacritty.nix @@ -0,0 +1,5 @@ +{enable}: { + inherit enable; + settings.font.size = 14.0; + settings.window.opacity = 0.8; +} diff --git a/bash.nix b/bash.nix new file mode 100644 index 0000000..a83fde4 --- /dev/null +++ b/bash.nix @@ -0,0 +1,8 @@ +{enable}: { + inherit enable; + shellAliases = { + ll = "ls -lh"; + la = "ls -lah"; + ".." = "cd .."; + }; +} diff --git a/firefox.nix b/firefox.nix new file mode 100644 index 0000000..2fef9ee --- /dev/null +++ b/firefox.nix @@ -0,0 +1,25 @@ +{ + nur, + enable, +}: { + inherit enable; + profiles.kristian = { + isDefault = true; + search.default = "DuckDuckGo"; + search.force = true; + extensions = builtins.attrValues { + inherit + (nur.repos.rycee.firefox-addons) + ublock-origin + umatrix + sponsorblock + xbrowsersync + sidebery + ; + }; + settings = { + "extensions.pocket.enabled" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8dfe48e --- /dev/null +++ b/flake.lock @@ -0,0 +1,236 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1687871164, + "narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.05", + "repo": "home-manager", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1690047096, + "narHash": "sha256-VvZqoWLscSlRonCGq+OdIgA9GkZJJ/Z4yyoXn7m8kjY=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "b21644b61143de0835fef9c3fa69fbdd2553cdfa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1684265364, + "narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1688500189, + "narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "78419edadf0fabbe5618643bd850b2f2198ed060", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1689956312, + "narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1689088367, + "narHash": "sha256-Y2tl2TlKCWEHrOeM9ivjCLlRAKH3qoPUE/emhZECU14=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5c9ddb86679c400d6b7360797b8a22167c2053f8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1690055134, + "narHash": "sha256-pca36VkwUxcygKtrY8OPWp9MpxHgWauwBWxO8lgHQTU=", + "owner": "nix-community", + "repo": "NUR", + "rev": "15a8d4645c280e35c00a36303bb76eb697d38206", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs_2", + "nur": "nur", + "zig": "zig" + } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1689611045, + "narHash": "sha256-3RTOlQabkNetQ4O4UzSf57JPco9VGVHhSU1ls5uKBeE=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685385764, + "narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "zig": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1689899128, + "narHash": "sha256-jlWnAn+KLgEsJzl9KPABOZrZ7gYmgUHDLfQLskY2O4g=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "7af90962d9271745087d287248afe2766b58fb71", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..04d6d9f --- /dev/null +++ b/flake.nix @@ -0,0 +1,54 @@ +{ + description = "Home Manager configuration of kristian"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + home-manager = { + url = "github:nix-community/home-manager/release-23.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Hyprland Window Manager + hyprland.url = "github:hyprwm/Hyprland"; + + # Nix User Repository + nur.url = "github:nix-community/NUR"; + + # Zig + zig.url = "github:mitchellh/zig-overlay"; + }; + + outputs = { + self, + nixpkgs, + home-manager, + hyprland, + nur, + zig, + } @ inputs: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; + homeConfigurations = { + kristian = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + modules = [ + ./home.nix + + { + nixpkgs.overlays = [ + hyprland.overlays.default # Adds waybar-hyprland + zig.overlays.default + ]; + } + + hyprland.homeManagerModules.default + + nur.nixosModules.nur + ]; + }; + }; + }; +} diff --git a/git.nix b/git.nix new file mode 100644 index 0000000..0a67db8 --- /dev/null +++ b/git.nix @@ -0,0 +1,6 @@ +{enable}: { + inherit enable; + userName = "Kristian Krsnik"; + userEmail = "git@krsnik.at"; + extraConfig = {init.defaultBranch = "main";}; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..721a98f --- /dev/null +++ b/home.nix @@ -0,0 +1,111 @@ +{ + config, + pkgs, + lib, + options, + specialArgs, + modulesPath, +}: { + nixpkgs.config.allowUnfreePredicate = _: true; + + home.stateVersion = "23.05"; + home.username = "kristian"; + home.homeDirectory = "/home/kristian"; + + # For cursor not showing in hyprland with nvidia + home.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1"; + + # Symlinks + home.file = { + ".wallpaper".source = ./wallpaper; # Wallpaper + #"Media".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Media"; + #"Documents".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Documents"; + }; + + # TODO: Change for Laptop + targets.genericLinux.enable = false; # Enable on non-nixos ditros + + # Keyboard Layout + home.keyboard.layout = "at"; # NOTE: Set by Hyprland config + + # Programs (additional programs) + home.packages = import ./packages.nix {inherit pkgs;}; + + ## Services + services.copyq.enable = true; + services.playerctld.enable = true; # for mpris waybar module + + # Programs + programs = { + home-manager.enable = true; # Allow home-manager to manage itself + wofi.enable = true; + mpv.enable = true; + obs-studio.enable = true; + zathura.enable = true; + yt-dlp.enable = true; + lf.enable = true; + vscode.enable = true; + bashmount.enable = true; + + bash = import ./bash.nix {enable = true;}; + alacritty = import ./alacritty.nix {enable = true;}; + neovim = import ./nvim { + enable = true; + pkgs = pkgs; + }; + firefox = import ./firefox.nix { + enable = true; + nur = config.nur; + }; + waybar = import ./waybar.nix { + enable = true; + pkgs = pkgs; + }; + git = import ./git.nix {enable = true;}; + thunderbird = import ./thunderbird.nix {enable = true;}; + }; + + xdg.mimeApps = { + enable = true; + defaultApplications = {"video/*" = ["mpv.desktop"];}; + }; + + systemd.user.mounts = let + home = "home-kristian"; + in { + "${home}-Media" = { + Unit = { + Description = "Mount disk-1 with sshfs"; + After = ["graphical-session-pre.target"]; + PartOf = ["graphical-session-pre.target"]; + }; + Install = {WantedBy = ["graphical-session-pre.target"];}; + Mount = { + What = "kristian@krsnik.at:/mnt/TITAN/Media"; + Where = "/home/kristian/kristian/Media"; + Type = "fuse.sshfs"; + #Options=_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount + #TimeoutSec=60 + #Options = "resolve-symlinks"; + }; + }; + "${home}-Documents" = { + Unit = { + Description = "Mount disk-1 with sshfs"; + After = ["graphical.target "]; + Wants = ["graphical.target"]; + }; + Install = {WantedBy = ["default.target"];}; + Mount = { + What = "kristian@krsnik.at:/mnt/TITAN/Documents"; + Where = "/home/kristian/Documents"; + Type = "fuse.sshfs"; + Options = "_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount"; + TimeoutSec = 60; + #Options = "resolve-symlinks"; + }; + }; + }; + + wayland.windowManager.hyprland = import ./hyprland.nix {enable = true;}; +} diff --git a/hyprland.nix b/hyprland.nix new file mode 100644 index 0000000..5c64ac2 --- /dev/null +++ b/hyprland.nix @@ -0,0 +1,90 @@ +{enable}: { + inherit enable; + xwayland.enable = true; + extraConfig = '' + # Waybar + exec-once = waybar + + # Notifications Daemon + exec-once = dunst & + + # Wallpaper + exec-once = swww init + exec-once = swww img ~/.wallpaper --transition-step 255 + + # Clipboard + exec-once = copyq --start-server + + # Window Rules + windowrulev2 = float,title:(CopyQ)$ + windowrulev2 = float,title:^(Volume Control)$ + + # Keybinds + $Mod = Alt + $altMod = SUPER + + bind = $Mod, D, exec, wofi --show drun + bind = $Mod, Return, exec, alacritty + bind = $Mod, V, exec, copyq + bind = $Mod, S, exec, grim -g "$(slurp)" + bind = $Mod SHIFT, C, exec, copyq show + + bind = $Mod, C, killactive, + bind = $Mod CONTROL SHIFT, K, exit, + bind = $Mod, M, togglefloating + bind = $Mod, F, fullscreen, 1 # maximize + bind = $Mod SHIFT, F, fullscreen, 0 # fullscreen + bind = $Mod, P, pseudo + + # Move focus with mainMod + arrow keys + bind = $Mod, h, movefocus, l + bind = $Mod, j, movefocus, d + bind = $Mod, k, movefocus, u + bind = $Mod, l, movefocus, r + + bind = $Mod SHIFT, h, swapwindow, l + bind = $Mod SHIFT, j, swapwindow, d + bind = $Mod SHIFT, k, swapwindow, u + bind = $Mod SHIFT, l, swapwindow, r + + bind = $Mod , Tab, cyclenext, prev + bind = $Mod SHIFT, Tab, cyclenext, + + # Layouting + bind = $Mod , Space, togglegroup, + bind = $altMod , Tab , changegroupactive, forward + bind = $altMod SHIFT, Tab , changegroupactive, back + + bind = $altMod, h, moveintogroup, l + bind = $altMod, j, moveintogroup, d + bind = $altMod, k, moveintogroup, u + bind = $altMod, l, moveintogroup, r + + bind = $altMod SHIFT, h, moveoutofgroup, l + bind = $altMod SHIFT, j, moveoutofgroup, d + bind = $altMod SHIFT, k, moveoutofgroup, u + bind = $altMod SHIFT, l, moveoutofgroup, r + + # Switch workspaces + bind = $Mod, 1, workspace, -1 + bind = $Mod, 2, workspace, +1 + + # Move active window to a workspace + bind = $Mod SHIFT, 1, movetoworkspace, -1 + bind = $Mod SHIFT, 2, movetoworkspace, +1 + + # Scroll through existing workspaces + bind = $Mod, mouse_up, workspace, -1 + bind = $Mod, mouse_down, workspace, +1 + + # Move/resize windows + bindm = $Mod, mouse:272, movewindow + bindm = $Mod, mouse:273, resizewindow + + # TODO: renameworkspace with dmenu or rofi prompt + + input { + kb_layout = at + } + ''; +} diff --git a/nvim/cmp.lua b/nvim/cmp.lua new file mode 100644 index 0000000..68b75c2 --- /dev/null +++ b/nvim/cmp.lua @@ -0,0 +1,64 @@ +-- Set up nvim-cmp. +local cmp = require'cmp' + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + -- { name = 'vsnip' }, -- For vsnip users. + { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) +}) + +-- Set configuration for specific filetype. +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' }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) + +-- Set up lspconfig. +local capabilities = require('cmp_nvim_lsp').default_capabilities() +-- Replace with each lsp server you've enabled. +require('lspconfig')['pyright'].setup { + capabilities = capabilities +} diff --git a/nvim/colors.lua b/nvim/colors.lua new file mode 100644 index 0000000..b15474e --- /dev/null +++ b/nvim/colors.lua @@ -0,0 +1,11 @@ +require('tokyonight').setup({style = 'moon',}) + +function ColorMyPencils(color) + color = color or 'tokyonight' + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' }) +end + +ColorMyPencils() diff --git a/nvim/default.nix b/nvim/default.nix new file mode 100644 index 0000000..d71ae05 --- /dev/null +++ b/nvim/default.nix @@ -0,0 +1,59 @@ +{ + pkgs, + enable, +}: { + inherit enable; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + + plugins = builtins.attrValues ({ + inherit + (pkgs.vimPlugins) + telescope-nvim # fuzzy finder + tokyonight-nvim # theme + undotree # undotree + vim-fugitive # git integration + nvim-treesitter # syntax highlighting + + # Autocomplete and LSP + + nvim-lspconfig + nvim-cmp + cmp-nvim-lsp + luasnip + ; + } + // { + # Parsers for syntax highlighting + inherit + (pkgs.vimPlugins.nvim-treesitter-parsers) + nix + zig + python + vim + vimdoc + markdown + dockerfile + yaml + json + toml + lua + c + glsl + bash + ; + }); + extraPackages = [pkgs.nodePackages.pyright]; + extraLuaConfig = + builtins.readFile ./keybinds.lua + + builtins.readFile ./colors.lua + + builtins.readFile ./undotree.lua + + builtins.readFile ./fugitive.lua + + builtins.readFile ./treesitter.lua + + builtins.readFile ./telescope.lua + + builtins.readFile ./cmp.lua + + builtins.readFile ./lspconfig.lua; + extraConfig = "set number relativenumber"; +} diff --git a/nvim/fugitive.lua b/nvim/fugitive.lua new file mode 100644 index 0000000..6e1b92d --- /dev/null +++ b/nvim/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set('n', 'gs', vim.cmd.Git) diff --git a/nvim/keybinds.lua b/nvim/keybinds.lua new file mode 100644 index 0000000..610cc58 --- /dev/null +++ b/nvim/keybinds.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = ' ' +vim.keymap.set('n', 'pv', vim.cmd.Ex) diff --git a/nvim/lspconfig.lua b/nvim/lspconfig.lua new file mode 100644 index 0000000..46db1bf --- /dev/null +++ b/nvim/lspconfig.lua @@ -0,0 +1,40 @@ +-- Global mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +vim.keymap.set('n', 'e', vim.diagnostic.open_float) +vim.keymap.set('n', '', vim.diagnostic.goto_prev) +vim.keymap.set('n', '', vim.diagnostic.goto_next) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist) + +-- Use LspAttach autocommand to only map the following keys +-- after the language server attaches to the current buffer +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, 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', 'v' }, 'ca', vim.lsp.buf.code_action, opts) + + vim.keymap.set('n', 'f', function() + vim.lsp.buf.format { async = true } + end, opts) + end, +}) diff --git a/nvim/telescope.lua b/nvim/telescope.lua new file mode 100644 index 0000000..bcaa355 --- /dev/null +++ b/nvim/telescope.lua @@ -0,0 +1,7 @@ +local telescope = require('telescope.builtin') + +vim.keymap.set('n', 'pf', telescope.find_files, {}) +vim.keymap.set('n', '', telescope.git_files, {}) +vim.keymap.set('n', 'ps', function() + telescope.grep_string({ search = vim.fn.input("Grep > ")}); +end) diff --git a/nvim/treesitter.lua b/nvim/treesitter.lua new file mode 100644 index 0000000..6c6d53b --- /dev/null +++ b/nvim/treesitter.lua @@ -0,0 +1,8 @@ +-- Treesitter +require'nvim-treesitter.configs'.setup { + highlight = { + -- `false` will disable the whole extension + enable = true, + additional_vim_regex_highlighting = false, + }, +} diff --git a/nvim/undotree.lua b/nvim/undotree.lua new file mode 100644 index 0000000..a346462 --- /dev/null +++ b/nvim/undotree.lua @@ -0,0 +1 @@ +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..c4bae28 --- /dev/null +++ b/packages.nix @@ -0,0 +1,48 @@ +{pkgs}: +with pkgs; [ + # Basic utils + unzip + magic-wormhole + wl-clipboard # vim clipboard access + + # Audio + pulseaudio + pulsemixer + pavucontrol + + # Important graphical applications + keepassxc + logseq + xournalpp + onlyoffice-bin + + # Communication + discord + telegram-desktop + signal-desktop + element-desktop + + # For Hyprland + libsForQt5.polkit-kde-agent # For permission pop-ups + libsForQt5.qt5.qtwayland + qt6.qtwayland + dunst # Notifications + swww # Wallpaper + grim + slurp # Screenshots + + # Video Editor + # davinci-resolve # Currently borken. Fixed in https://github.com/NixOS/nixpkgs/pull/242751 + + # LaTeX Editor + setzer + + gnome.nautilus + + steam + + # Misc + nerdfonts # Font with glyphs for status bar + + zigpkgs.master # latest nightly release of zig +] diff --git a/thunderbird.nix b/thunderbird.nix new file mode 100644 index 0000000..a7b1fba --- /dev/null +++ b/thunderbird.nix @@ -0,0 +1,6 @@ +{enable}: { + inherit enable; + profiles.kristian = { + isDefault = true; + }; +} diff --git a/wallpaper b/wallpaper new file mode 100644 index 0000000..fdca91c Binary files /dev/null and b/wallpaper differ diff --git a/waybar.nix b/waybar.nix new file mode 100644 index 0000000..915fac4 --- /dev/null +++ b/waybar.nix @@ -0,0 +1,113 @@ +{ + pkgs, + enable, +}: { + inherit enable; + package = pkgs.waybar-hyprland; + settings = { + mainBar = { + layer = "top"; + height = 30; + + modules-left = ["wlr/workspaces"]; + modules-center = ["clock"]; + modules-right = ["pulseaudio" "memory" "cpu" "tray"]; + + "hyprland/workspaces" = { + format = "{icon}"; + on-click = "activate"; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + #format-icons = { + # "1" = ""; + # "2" = ""; + # "3" = ""; + # "4" = ""; + # "5" = ""; + # urgent = ""; + # active = ""; + # default = ""; + #}; + sort-by-number = true; + }; + + "wlr/window" = { + max-length = 50; + }; + + mpris = { + format = "DEFAULT: {player_icon} {dynamic}"; + format-paused = "DEFAULT: {status_icon} {dynamic}"; + player-icons = { + default = "▶"; + mpv = "🎵"; + }; + status-icons = { + paused = "⏸"; + }; + }; + + pulseaudio = { + format = "{volume}% {icon}"; + format-bluetooth = " {volume}% {icon}"; + format-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" ""]; + }; + scroll-step = 1; + on-click = "pavucontrol"; + ignored-sinks = ["Easy Effects Sink"]; + }; + + cpu = { + interval = 10; + format = " {load}% {icon}"; + format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; + }; + + memory = { + interval = 30; + format = " {used:0.1f}G / {total:0.1f}G"; + }; + + clock = { + # TODO: Fix that calendar width is too small + format = "{:%H:%M}  "; + format-alt = "{:%A, %B %d, %Y (%R)}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + + tray = { + "icon-size" = 21; + "spacing" = 10; + }; + }; + }; +}