feat: Initial bootstrapping.

This commit is contained in:
punkfairie 2024-11-22 16:59:44 -08:00
commit b0a4ab2dc4
Signed by: punkfairie
GPG key ID: 8CEDBFDF5C0D613D
5 changed files with 682 additions and 0 deletions

419
flake.lock Normal file
View file

@ -0,0 +1,419 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732021966,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732025103,
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732016537,
"narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"unstable"
],
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1732315025,
"narHash": "sha256-vPAMWd5/akE3U3B8uXzi05X/9fUd71sZaOnfBrX4AR0=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c1271fa10a54a3b35db6040dd6e779f349af52bf",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1731936508,
"narHash": "sha256-z0BSSf78LkxIrrFXZYmCoRRAxAmxMUKpK7CyxQRvkZI=",
"owner": "NuschtOS",
"repo": "search",
"rev": "fe07070f811b717a4626d01fab714a87d422a9e1",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",
"snowfall-lib": "snowfall-lib",
"unstable": "unstable"
}
},
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730136121,
"narHash": "sha256-tfVayj13Zw+zzOKrmJhnvBod7Hdb9ixBR6/4GUlyMA0=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "dd348182c1a010993e68004eada86cf0341fe2c4",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "lib",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732111664,
"narHash": "sha256-XWHuPWcP59QnHEewdZJXBX1TA2lAP78Vz4daG6tfIr4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "62003fdad7a5ab7b6af3ea9bd7290e4c220277d0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

40
flake.nix Normal file
View file

@ -0,0 +1,40 @@
{
description = "MarleyVim";
outputs =
inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
snowfall = {
namespace = "marleyos";
};
# channels-config.allowUnfree = true;
alias.packages.default = "neovim";
overlays = with inputs; [ nixvim.overlays.default ];
outputs-builder = channels: {
formatter = channels.nixpkgs.nixfmt-rfc-style;
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "unstable";
};
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
viAlias = true;
vimAlias = true;
luaLoader.enable = true;
# Ignore ~/.config/nvim entirely.
impureRtp = false;
}

View file

@ -0,0 +1,148 @@
{ pkgs, helpers, ... }:
{
extraPackages = [ pkgs.ripgrep ];
opts = {
# Relative line numbers.
number = true;
relativenumber = true;
# Set <Tab> to 2 spaces.
expandtab = true;
shiftwidth = 2;
tabstop = 2;
# Smart/auto indenting.
shiftround = true;
smartindent = true;
breakindent = true;
# Show matches while searching.
hlsearch = true;
incsearch = true;
# Disable text wrap.
wrap = true;
# Better splitting.
splitbelow = true;
splitright = true;
# Enable mouse mode.
mouse = "a";
# Smart handling of case when searching.
ignorecase = true;
smartcase = true;
# Use Ripgrep for searching.
grepprg = "rg --vimgrep";
grepformat = "%f:%l:%c:%m";
# Faster swap file saving.
updatetime = 200;
# Completion.
completeopt = [
"menu"
"menuone"
"noselect"
"noinsert"
];
# Persistent & bigger undo history.
undofile = true;
undolevels = 10000;
# Enable 24-bit colors.
termguicolors = true;
# Always show the signcolumn to keep the text from shifting.
signcolumn = "yes";
# Highlight the current line.
cursorline = true;
# Fold settings.
foldcolumn = "1";
foldlevel = 99;
foldenable = true;
foldmethod = "expr";
foldexpr = "v:lua.vim.treesitter.foldexpr()";
# Always keep 4 lines above/below cursor.
scrolloff = 4;
# Max width.
textwidth = 80;
colorcolumn = "+1";
# Show some invisible chars.
list = true;
listchars = {
tab = "->";
trail = "·";
};
# Only show a single status line instead of one for each window.
laststatus = 3;
# Preview subsitutions as you type.
inccommand = "split";
# Only set clipboard if not in SSH, to make sure the OSC 52
# integration works automatically.
clipboard = helpers.mkRaw # lua
''
vim.env.SSH_TTY and "" or "unnamedplus"
'';
# Ask to save changes before exiting modified buffer.
confirm = true;
# I don't understand this but LazyVim sets it and it seems like a good idea.
jumpoptions = "view";
# Enable a little transparency for pop-ups.
pumblend = 10;
# Disable showing line/col numbers in statusline.
ruler = false;
# What to save when calling :mksession.
sessionoptions = [
"buffers"
"curdir"
"tabpages"
"winsize"
"help"
"globals"
"skiprtp"
"folds"
];
# Smoother left/right scrolling.
sidescroll = 1;
# Min columns to show to the left/right of cursor when side-scrolling.
sidescrolloff = 8;
# Languages to use for spelling suggestions.
spelllang = [ "en" ];
# Allow cursor to move where there is no text in visual block mode.
virtualedit = "block";
# Command mode completion mode.
wildmode = [ "longest:full" "full" ];
# Min window width when splitting.
winminwidth = 5;
};
extraConfigLua = # lua
''
-- Disable messages.
vim.opt.shortmess:append({ W = true, I = true, c = true, C = true })
'';
}

View file

@ -0,0 +1,65 @@
{ lib
, pkgs
, inputs
, neovim-settings ? { }
, neovim-config ? { }
, ...
}:
let
raw-modules = lib.snowfall.fs.get-default-nix-files-recursive (
lib.snowfall.fs.get-file "/modules/nixvim"
);
wrapped-modules = builtins.map
(
raw-module:
args@{ ... }:
let
module = import raw-module;
result =
if builtins.isFunction module then
module
(
args
// {
# NOTE: nixvim doesn't allow for these to be customized so we must work around the
# module system here...
inherit lib pkgs;
}
)
else
module;
in
result // { _file = raw-module; }
)
raw-modules;
raw-neovim = pkgs.nixvim.makeNixvimWithModule {
inherit pkgs;
module = {
imports = wrapped-modules;
config = lib.mkMerge [
{
_module.args = {
settings = neovim-settings;
lib = lib.mkForce lib;
};
}
neovim-config
];
};
};
neovim = raw-neovim.overrideAttrs (attrs: {
meta = attrs.meta // {
# NOTE: The default platforms specified aren't actually all
# supported by nixvim. Instead, only support the ones that can build with
# the module system.
platforms = builtins.attrNames inputs.nixvim.legacyPackages;
};
});
in
neovim