commit 96243073769e4e72a511ffbbe7f44bf2ff71f5c0 Author: Daanish Syed Date: Thu Jul 2 07:12:22 2026 +0100 Added gitea support diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..a77905e --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,94 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "syedm"; + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + programs.fish.enable = true; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.me = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV syed@tardis" + ]; + packages = with pkgs; []; + }; + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + environment.systemPackages = with pkgs; [ + neovim + wget + curl + stow + unzip + git + ]; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + services.caddy = { + enable = true; + virtualHosts."syedm.dev".extraConfig = '' + respond "Hello, world!" + ''; + virtualHosts."git.syedm.dev".extraConfig = '' + reverse_proxy 3000 + ''; + }; + + services.gitea = { + enable = true; + appName = "gitea: My personal projects."; + database.type = "sqlite3"; + settings = { + server = { + DOMAIN = "git.syedm.dev"; + ROOT_URL = "https://git.syedm.dev/"; + HTTP_ADDR = "0.0.0.0"; + HTTP_PORT = 3000; + SSH_DOMAIN = "git.syedm.dev"; + SSH_PORT = 22; + }; + service = { + DISABLE_REGISTRATION = true; + REQUIRE_SIGNIN_VIEW = true; + }; + session.COOKIE_SECURE = true; + log.LEVEL = "Info"; + }; + lfs.enable = true; + }; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ 22 80 443 ]; + networking.firewall.allowedUDPPorts = []; + + # DO NOT CHNAGE, EVER! + system.stateVersion = "26.05"; +} + diff --git a/nixos/flake.lock b/nixos/flake.lock new file mode 100644 index 0000000..b84cc16 --- /dev/null +++ b/nixos/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1782723713, + "narHash": "sha256-oPXCU/SSUokcGaJREHibG1CBX3+s/W7orDWQOZDsEeQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b5aa0fbd538984f6e3d201be0005b4463d8b09f8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixos/flake.nix b/nixos/flake.nix new file mode 100644 index 0000000..59adeb8 --- /dev/null +++ b/nixos/flake.nix @@ -0,0 +1,11 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = inputs@{ self, nixpkgs, ... }: { + nixosConfigurations.syedm = nixpkgs.lib.nixosSystem { + modules = [ ./configuration.nix ]; + }; + }; +} + diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..87653e3 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c5fedde6-79d4-4a44-92e4-2aa764553875"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/510C-E000"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/712d25ef-146d-4c66-b6d4-1b64491a974e"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nvim/dot-config/nvim/init.lua b/nvim/dot-config/nvim/init.lua new file mode 100644 index 0000000..74dad5f --- /dev/null +++ b/nvim/dot-config/nvim/init.lua @@ -0,0 +1,313 @@ +local vim = vim or {} + +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + +if not vim.loop.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }) +end + +vim.opt.rtp:prepend(lazypath) + +-- Options +local o = vim.opt +vim.g.mapleader = " " +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 +vim.g.clipboard = 'osc52' +o.number = true +o.expandtab = true +o.shiftwidth = 2 +o.tabstop = 4 +o.softtabstop = 4 +o.completeopt = { "menuone", "noselect", "noinsert" } +o.updatetime = 100 +o.timeoutlen = 300 +o.clipboard = "unnamedplus" +o.shell = "/usr/bin/fish" +o.foldenable = false +o.list = true +o.listchars = { + tab = "→ ", + eol = " ", + space = " ", + nbsp = "␣", + trail = "·", + lead = "·", +} +o.scroll = 5 +o.smoothscroll = true +o.termguicolors = true +o.laststatus = 3 +o.mousescroll = "ver:0,hor:0" + +vim.lsp.semantic_tokens.enable = false + +vim.lsp.handlers.hover = function(_, result, ctx, config) + config = config or {} + config.border = "rounded" + return vim.lsp.handlers.hover(_, result, ctx, config) +end + +vim.lsp.handlers.signature_help = function(_, result, ctx, config) + config = config or {} + config.border = "rounded" + return vim.lsp.handlers.signature_help(_, result, ctx, config) +end + +vim.g.rainbow_delimiters = { + highlight = { + "RainbowDelimiterYellow", + "RainbowDelimiterBlue", + "RainbowDelimiterOrange", + "RainbowDelimiterGreen", + "RainbowDelimiterViolet", + "RainbowDelimiterCyan", + "RainbowDelimiterRed", + }, +} + +vim.diagnostic.config({ + virtual_text = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "󰅚 ", + [vim.diagnostic.severity.WARN] = "󰀪 ", + [vim.diagnostic.severity.INFO] = "󰋽 ", + [vim.diagnostic.severity.HINT] = "󰌶 ", + }, + }, + underline = true, + update_in_insert = true, + severity_sort = true, +}) + +-- Plugin List +require("lazy").setup({ + { "rcarriga/nvim-notify", lazy = false }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + { "neovim/nvim-lspconfig", lazy = false }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + }, + lazy = false, + opts = { + filesystem = { + filtered_items = { visible = true }, + }, + }, + }, + { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + }, + { "HiPhish/rainbow-delimiters.nvim" }, + { "ya2s/nvim-cursorline" }, + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + dependencies = { + "williamboman/mason.nvim", + "neovim/nvim-lspconfig", + }, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd", + }, + }) + end, + }, + { + "stevearc/conform.nvim", + config = function() + require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + }) + end, + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + }, + }, + { "karb94/neoscroll.nvim" }, + { + "SyedM-dev/PicVim", + lazy = false, + config = function() + require("picvim").setup() + end, + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }, + { + "echasnovski/mini.pairs", + config = function() + require("mini.pairs").setup({}) + end, + }, +}) + +-- Plugin's setup +require("lualine").setup({ + options = { theme = "auto" }, + sections = { + lualine_b = { + { "branch" }, + { + "diff", + symbols = { + added = " ", + modified = " ", + removed = " ", + }, + diff_color = { + added = { fg = "#a6e3a1" }, + modified = { fg = "#f9e2af" }, + removed = { fg = "#f38ba8" }, + }, + }, + }, + }, +}) + +require("nvim-cursorline").setup({ + cursorline = { + enable = true, + timeout = 0, + number = false, + }, + cursorword = { + enable = true, + min_length = 1, + hl = { underline = true }, + }, +}) + +local neoscroll = require("neoscroll") +neoscroll.setup({ + mappings = { + "", + "", + "", + "", + "", + "", + "zt", + "zz", + "zb", + }, +}) + +local cmp = require("cmp") +cmp.setup({ + window = { + completion = cmp.config.window.bordered({ + border = "rounded", + }), + documentation = cmp.config.window.bordered({ + border = "rounded", + }), + }, + + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + }), + + sources = { + { name = "nvim_lsp" }, + { name = "clangd" }, + }, +}) + +-- Keymaps +local map = vim.keymap.set +map({ "n", "i", "v" }, "", "w") +map("n", ";", ":") +map("n", "", ":move-2") +map("n", "", ":move+1") +map("x", "", ":move '<-2gv") +map("x", "", ":move '>+1gv") +map("i", "", ":move-2") +map("i", "", ":move+1") +map("n", ">", ">>") +map("v", ">", ">gv") +map("n", "<", "<<") +map("v", "<", ">") +map("v", ".", ">gv") +map("n", ",", "<<") +map("v", ",", "", "nohlsearch") +map("n", "u", "ggVG") +map("n", "z", "u") +map("n", "d", "red") +map("n", "q", "Neotree") +map("n", "", "Minuet virtualtext toggle") +map("x", "p", '"_dP') +map("x", "P", '"_dP') +map("n", "\\", function() + vim.cmd([[ + Neotree close + mksession! p.vim + echo "saved session" + ]]) +end) +map("n", "", function() + neoscroll.scroll(-0.05, { move_cursor = false, duration = 20 }) +end) +map("n", "", function() + neoscroll.scroll(0.05, { move_cursor = false, duration = 20 }) +end) + +-- Vimscript stuff +vim.cmd([[ +aunmenu PopUp +colorscheme tokyonight-night +]]) + +-- AutoCMD's + +local autocmd = vim.api.nvim_create_autocmd + +autocmd("CursorHold", { + callback = function() + vim.diagnostic.open_float(nil, { + focusable = false, + border = "rounded", + source = "if_many", + }) + end, +}) + diff --git a/nvim/dot-config/nvim/lazy-lock.json b/nvim/dot-config/nvim/lazy-lock.json new file mode 100644 index 0000000..2ceb525 --- /dev/null +++ b/nvim/dot-config/nvim/lazy-lock.json @@ -0,0 +1,23 @@ +{ + "PicVim": { "branch": "main", "commit": "5114853ed8f24661e48b726135bf78860d9339d5" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "mini.pairs": { "branch": "main", "commit": "db0fac0a25884183650352ccf92b362a41ed2e9c" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" }, + "neoscroll.nvim": { "branch": "master", "commit": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-cursorline": { "branch": "main", "commit": "d4425a9ba73a66fca8a34fda9254eb8949b1784d" }, + "nvim-lspconfig": { "branch": "master", "commit": "292f44408498103c47996ff5c18fd366293840d8" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, + "nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" }, + "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" } +} diff --git a/p.vim b/p.vim new file mode 100644 index 0000000..c7baeb3 --- /dev/null +++ b/p.vim @@ -0,0 +1,50 @@ +let SessionLoad = 1 +let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 +let v:this_session=expand(":p") +doautoall SessionLoadPre +silent only +silent tabonly +cd ~/dotfiles +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +let s:shortmess_save = &shortmess +set shortmess+=aoO +badd +0 ~/dotfiles/nixos/configuration.nix +argglobal +%argdel +edit ~/dotfiles/nixos/configuration.nix +argglobal +balt ~/dotfiles/nixos/configuration.nix +setlocal foldmethod=manual +setlocal foldexpr=0 +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal nofoldenable +silent! normal! zE +let &fdl = &fdl +let s:l = 48 - ((11 * winheight(0) + 28) / 56) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 48 +normal! 07| +tabnext 1 +if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 +let &shortmess = s:shortmess_save +let s:sx = expand(":p:r")."x.vim" +if filereadable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &g:so = s:so_save | let &g:siso = s:siso_save +set hlsearch +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim :