From f9e05c8fbe2e0999972d4a1ca8d5f80c9f67cb1b Mon Sep 17 00:00:00 2001 From: lulusilly Date: Mon, 12 Jan 2026 17:57:30 +0000 Subject: [PATCH] Initialized repository --- configuration.nix | 21 +++++++ dots/nvim/init.lua | 134 +++++++++++++++++++++++++++++++++++++++++++++ flake.lock | 101 ++++++++++++++++++++++++++++++++++ flake.nix | 29 ++++++++++ home.nix | 78 ++++++++++++++++++++++++++ 5 files changed, 363 insertions(+) create mode 100644 configuration.nix create mode 100755 dots/nvim/init.lua create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..b76fde7 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,21 @@ +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://nix-community.github.io/NixOS-WSL/ + +{ config, lib, pkgs, ... }: + +{ + wsl.enable = true; + wsl.defaultUser = "lunita"; + + programs.zsh.enable = true; + users.users.lunita.shell = pkgs.zsh; + + services.openssh = { + enable = true; + ports = [ 4356 ]; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "25.05"; +} diff --git a/dots/nvim/init.lua b/dots/nvim/init.lua new file mode 100755 index 0000000..6cbe098 --- /dev/null +++ b/dots/nvim/init.lua @@ -0,0 +1,134 @@ +-- =================================== +-- | General Neovim Configuration | +-- =================================== +-- I won't lie to you, I vibecoded the boilerplate for this stuff. +-- Aside from Emacs, I don't really like having to configure my editors +-- very much. Basic understanding of the config is all I really prioritize. +vim.opt.number = true -- Show line numbers +vim.opt.relativenumber = true -- Show relative line numbers +vim.opt.tabstop = 2 -- A tab is 2 spaces +vim.opt.shiftwidth = 2 -- Indent is 2 spaces +vim.opt.expandtab = true -- Use spaces instead of tabs +vim.opt.termguicolors = true -- Enable terminal colors +vim.opt.scrolloff = 8 -- Lines above/below cursor +vim.opt.signcolumn = "yes" -- Always show the sign column +-- Set the leader key to space. This is a crucial step for custom mappings. +vim.g.mapleader = " " +-- ==================================== +-- | Plugin Management with lazy.nvim | +-- ==================================== +-- The configuration below bootstraps lazy.nvim if it's not already installed. +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", lazypath + }) +end +vim.opt.rtp:prepend(lazypath) +-- Setup the plugins you need. +require("lazy").setup({ + -- For background transparency + { 'xiyaowong/transparent.nvim' }, + -- === The colorscheme plugin is specified here. === + -- Gruvbox theme plugin. It will be automatically installed by lazy.nvim. + { 'ellisonleao/gruvbox.nvim', config = function() + -- Ensure the background is set to 'dark' for the gruvbox colorscheme. + vim.o.background = 'dark' + -- Load the colorscheme. + vim.cmd.colorscheme("gruvbox") + end }, + -- Treesitter plugin for syntax highlighting. + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + -- Autocomplete plugins + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp" }, + { "L3MON4D3/LuaSnip" }, + { "neovim/nvim-lspconfig" }, + -- Plugin to automatically close paired characters like (), {}, [], and "" + { 'echasnovski/mini.pairs' }, + -- File tree and icon plugins + { + 'nvim-tree/nvim-tree.lua', + version = '*', + lazy = false, + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + -- The setup call for the nvim-tree plugin. + require('nvim-tree').setup {} + end + }, +}) +-- Transparent configuration +require('transparent').setup({ + enable = true, -- boolean: enable transparent + extra_groups = { -- table: additional groups to clear + 'Normal', 'NormalNC', 'Comment', 'Constant', 'Identifier', + 'Statement', 'PreProc', 'Type', 'Special', 'Underlined', + 'Todo', 'String', 'Function', 'Conditional', 'Repeat', + 'Operator', 'Structure', 'LineNr', 'SignColumn', 'EndOfBuffer' + }, +}) +-- Autocomplete (cmp) configuration. +local cmp = require("cmp") +cmp.setup({ + snippet = { + expand = function(args) require("luasnip").lsp_expand(args.body) end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = { + { name = "nvim_lsp" }, + }, +}) +-- Mini.pairs configuration. +-- This simple setup is all that's needed for the basic functionality. +require('mini.pairs').setup({}) +-- =================================== +-- | Custom Keymaps | +-- =================================== +-- Keymaps are custom commands mapped to a specific key combination. +-- The "" prefix will be replaced with your leader key, which is "space". +-- Split creation keymaps +vim.keymap.set('n', 'sv', ':vsplit', { desc = 'Create a vertical split' }) +vim.keymap.set('n', 'ss', ':split', { desc = 'Create a horizontal split' }) +-- Buffer navigation +-- bh/j/k/l to navigate between buffers +vim.keymap.set('n', 'bh', ':bprev', { desc = 'Go to previous buffer' }) +vim.keymap.set('n', 'bl', ':bnext', { desc = 'Go to next buffer' }) +-- The following mappings are less common, but fulfill your request. +vim.keymap.set('n', 'bj', ':bnext', { desc = 'Go to next buffer' }) +vim.keymap.set('n', 'bk', ':bprev', { desc = 'Go to previous buffer' }) +-- Split navigation +-- sh/j/k/l to move between splits +vim.keymap.set('n', 'sh', 'h', { desc = 'Move to left split' }) +vim.keymap.set('n', 'sj', 'j', { desc = 'Move to split below' }) +vim.keymap.set('n', 'sk', 'k', { desc = 'Move to split above' }) +vim.keymap.set('n', 'sl', 'l', { desc = 'Move to right split' }) +-- Normal mode keymaps +-- Save the current file. +vim.keymap.set('n', 'w', ':w', { desc = 'Save file' }) +-- Force quit the current window without saving. +vim.keymap.set('n', 'q', ':q!', { desc = 'Force quit window' }) +-- Save and quit. +vim.keymap.set('n', 'x', ':wq', { desc = 'Save and quit' }) +-- Save all open buffers. +vim.keymap.set('n', 'wa', ':wa', { desc = 'Save all buffers' }) +-- Close all windows except the current one. +vim.keymap.set('n', 'o', ':only', { desc = 'Close all other windows' }) +-- Toggle the file tree. +vim.keymap.set('n', 'e', ':NvimTreeToggle', { desc = 'Toggle file tree' }) +-- Select the entire file content. +vim.keymap.set('n', 'a', 'ggVG', { desc = 'Select entire file' }) +-- Various commands to compile different file types. +-- Groff => PDF +vim.keymap.set('n', 'cg', ':!groff -ms -e %:t -T pdf > %:r.pdf', { desc = 'Compile Groff file to PDF' }) +-- Typst => PDF +vim.keymap.set('n', 'ct', ':!typst compile %:t', { desc = 'Compile Typst file to PDF'} ) +-- Keybinding to toggle transparency +vim.api.nvim_set_keymap('n', 'tt', ':TransparentToggle', { noremap = true, silent = true }) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8fd10f7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,101 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1765121682, + "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767792169, + "narHash": "sha256-WSAu+ZxF697u/OJDdBLO+YFhtqFsPowrXXOQbjDT/uA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "aea57993a89bfc2a66c0434e0f4383ebf164e2a3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1765841014, + "narHash": "sha256-55V0AJ36V5Egh4kMhWtDh117eE3GOjwq5LhwxDn9eHg=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "be4af8042e7a61fa12fda58fe9a3b3babdefe17b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1767640445, + "narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5dc1196 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, nixos-wsl, home-manager, ... }: { + nixosConfigurations = { + prometheus = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nixos-wsl.nixosModules.default + ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.lunita = import ./home.nix; + } + ]; + }; + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..be5457a --- /dev/null +++ b/home.nix @@ -0,0 +1,78 @@ +{ pkgs, ... }: + +{ + home.username = "lunita"; + home.homeDirectory = "/home/lunita"; + + home.stateVersion = "25.05"; + + home.packages = with pkgs; [ + wget + tree + htop + irssi + ]; + + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + }; + + home.sessionVariables = { + EDITOR = "nvim"; + }; + + home.file = { + ".config/nvim/init.lua" .source = dots/nvim/init.lua; + }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.git = { + enable = true; + settings = { + user.name = "lulusilly"; + user.email = "lunita@puppygirl.onl"; + settings.alias = { + a = "add ."; + c = "clone"; + ci = "commit -m"; + pu = "push origin main"; + pm = "push origin master"; + s = "status"; + co = "checkout"; + }; + }; + }; + + programs.zsh = { + enable = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + initContent = '' + bindkey -r "^L" + ''; + + shellAliases = { + upd = "sudo nixos-rebuild switch --flake ~/.nix#prometheus"; + l = "ls -al"; + v = "nvim"; + c = "clear"; + }; + + history.size = 10000; + + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + theme = "lambda"; + }; + }; + + programs.home-manager.enable = true; +}