Compare commits

..

43 Commits

Author SHA1 Message Date
htran 8246e8eb93 feat: reuse window
https://github.com/nvim-telescope/telescope.nvim/issues/2188\#issuecomment-1516861881
2023-09-30 23:19:34 -07:00
htran 2dd2ae2c08 ref: git lola and git lol as git plugins for ease of shipping 2023-09-30 21:49:13 -07:00
htran 75ba98e276 feat: git-worktree; fix: htran should work, kpxc sadge 2023-09-30 21:03:22 -07:00
htran bcc7f68c1e feat(nvim): +git-worktree 2023-09-29 18:33:38 -07:00
pegasust 8033f1f90c feat: +hlargs back again 2023-09-29 18:03:58 -07:00
pegasust 7f87490ce0 Merge pull request 'plugins-need-update' (#20) from plugins-need-update into bleed
Reviewed-on: #20
2023-09-25 05:06:03 +00:00
pegasust fbbbd6510e feat: git-lola and git-lol now has time 2023-09-24 22:01:51 -07:00
pegasust da666d64b2 fix: make lspconfig bareable 2023-09-24 17:18:28 -07:00
pegasust c43c27f5dd bug: there's also :LspInfo that is outdated 2023-09-24 16:03:12 -07:00
pegasust b5b08fdfd9 fix: neovim nightly works on aarch64-darwin 2023-09-24 15:32:47 -07:00
pegasust 15d0f85f90 feat(nvim+nix): update statically installed plugins 2023-09-24 02:06:11 -07:00
pegasust 3c8c707cb8 fix: exa is unmaintained -> eza 2023-09-24 01:46:32 -07:00
pegasust eb6142e06f feat(nvim): harpoon + telescope multi-select
- Give my gist some love https://gist.github.com/Pegasust/364b123b40dfc36cd113ae9526f83904
2023-09-24 00:51:21 -07:00
pegasust 33a164ba98 feat(nvim): telescope live-args 2023-09-24 00:51:18 -07:00
htran 122693e9c8 feat: done messing around with firacode, looks so much better now 2023-09-22 18:17:13 -07:00
htran 9405373bc8 feat: more ssh hosts 2023-09-22 16:53:40 -07:00
htran ffe82f65f8 feat: ssh huaweil3 matching correctly 2023-09-01 12:20:38 -07:00
pegasust f969912c08 flake lock 2023-08-01 00:36:14 -07:00
pegasust 7b5a6cfa94 feat(pixi): some repl around, cannot match heic with mov 2023-08-01 00:35:06 -07:00
htran 8ba20cbc56 fix: gh ssh hostname 2023-07-29 16:28:00 -07:00
htran 6ba1836a03 add gh shortform 2023-07-29 16:23:31 -07:00
htran c87dba3422 patch latest 2023-07-25 13:26:29 -07:00
pegasust fd4ff2cbbc plugin intelligence 2023-07-25 13:24:49 -07:00
pegasust 7914c40d91 gopls 2023-07-22 01:37:24 -07:00
pegasust 5f5439d793 forgorr to invoke lspconfig 2023-07-21 00:56:04 -07:00
pegasust 4ae426dbad forgorr to add setup logic 2023-07-21 00:51:35 -07:00
pegasust b83f698dc4 add gopls please 2023-07-21 00:49:04 -07:00
pegasust 7c4b7d0db6 fix(nvim): nil_ls uses lspconfig instead of mason-lspconfig 2023-07-10 02:08:36 -07:00
htran 22a78899ed feat: add nix configs for data collections 2023-07-08 20:43:20 -07:00
htran 5b61ab39f9 feat(nvim): nil_ls is now registered, but not ensure_installed from mason 2023-07-08 18:28:13 -07:00
htran e13cd11a68 untested - rclone 2023-07-07 00:43:18 -07:00
htran 187890cc9b add keepassxc 2023-07-07 00:43:14 -07:00
htran b8abf4e3dd bump 2023-07-04 01:43:44 -07:00
htran a2619bf71a fix: ssh looks at me funny and says 'i dont know what xterm-kitty is' 2023-06-23 09:44:02 -07:00
htran 74a0ef58c4 feat: more ssh 2023-06-23 01:29:26 -07:00
htran 0208a946f2 feat: real tab title template hacker mode 2023-06-23 01:13:06 -07:00
htran c2b5908fa5 kitty as my main terminal now 2023-06-22 23:36:52 -07:00
htran 83c2b01570 ^std breaking change 2023-06-22 20:52:40 -07:00
htran ab8e04f3a0 add sg-nvim (cody!) 2023-06-22 10:34:20 -07:00
htran eb91f32d53 move 2023-06-20 14:10:00 -07:00
htran 0dd6558770 doc: reason for removal of mickael-menu/zk 2023-06-18 04:37:00 -07:00
htran f04fea60d2 remove mickael-menu/zk 2023-06-18 04:22:11 -07:00
htran 024e8530d0 alejandra fmt and some cleanup 2023-06-18 02:51:33 -07:00
58 changed files with 2808 additions and 3539 deletions

21
.envrc
View File

@ -1,16 +1,11 @@
#! /bin/sh
#!/bin/sh
source "$(
nix eval \
--no-update-lock-file \
--no-write-lock-file \
--no-warn-dirty \
--accept-flake-config \
.#__std.direnv_lib 2>/dev/null \
|| nix eval .#__std.direnv_lib # show the errors
)"
# FIXME: This should check if $USER is in userShells, if not,
# fall back to `use nix`
use std nix "//repo/userShells:${USER}"
# first time
if [[ ! -d $(nix store add-path --name source --dry-run .) ]]; then
nix store add-path --name source .
fi
# shellcheck disable=SC1090
. "$(fetchurl "https://raw.githubusercontent.com/paisano-nix/direnv/bd36f51b9d566d8a36e230dab638abf3074625c3/lib" "sha256-IgQhKK7UHL1AfCUntJO2KCaIDJQotRnK2qC4Daxk+wI=")"
use envreload "//repo/userShells/${USER}" //repo/userShells/default //repo/userShells

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
result
.direnv
.data

View File

@ -1,7 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.globals": [
"vim",
"vim"
],
"workspace.library": [
],
"Lua.workspace.checkThirdParty": false
}

View File

@ -53,6 +53,9 @@ via writing and typing.
I am in the process of moving away from Obsidian so that I can write ZK notes
text-editor agnostically.
#### mickael-menu/zk
- Config file: `zk/config.toml`
- Command: `ln [-s] $PWD/zk/config.toml ~/.config/zk/config.toml`
@ -62,6 +65,18 @@ text-editor agnostically.
Note (2023-06-07): I'm now using a mix of nvim-zk with Notion. I'm still figuring out
a centralize place to put my notes and use it to do some knowledge graph magic
NOTE (2023-06-18): I used `mickael-menu/zk` for some time, but have found myself
resort to notion due to the need for easier linking (just copy-paste onto
selected note) where as I need to:
- `cS]` to encapsulate the selection with `[]`, then do `(<C-v>`. Too many keystrokes.
On retrospect, I could probably remap this workflow to `<LocalLeader>el"`:
Though, I want to just develop my own solution with
[`nucliadb`](https://github.com/nuclia/nucliadb) and
[`h2ogpt`](https://github.com/h2oai/h2ogpt)
## Troubleshoots
### My MacOS just updated, `nix` is no-longer here

1
dev/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

101
dev/pixi/poetry.lock generated Normal file
View File

@ -0,0 +1,101 @@
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
[[package]]
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "exceptiongroup"
version = "1.1.2"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
{file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"},
{file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"},
]
[package.extras]
test = ["pytest (>=6)"]
[[package]]
name = "iniconfig"
version = "2.0.0"
description = "brain-dead simple config-ini parsing"
optional = false
python-versions = ">=3.7"
files = [
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
[[package]]
name = "packaging"
version = "23.1"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.7"
files = [
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
]
[[package]]
name = "pluggy"
version = "1.2.0"
description = "plugin and hook calling mechanisms for python"
optional = false
python-versions = ">=3.7"
files = [
{file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"},
{file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"},
]
[package.extras]
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "pytest"
version = "7.4.0"
description = "pytest: simple powerful testing with Python"
optional = false
python-versions = ">=3.7"
files = [
{file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"},
{file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"},
]
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=0.12,<2.0"
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
[package.extras]
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
[[package]]
name = "tomli"
version = "2.0.1"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "1cf751550a88abe6c6ea8896fe41073f08488ebbd3fb959572a2038d4d944ebc"

20
dev/pixi/pyproject.toml Normal file
View File

@ -0,0 +1,20 @@
[tool.poetry]
name = "pixi"
version = "0.0.1"
description = "Toy project to investigate about apple photos synced iphone -> mac"
authors = ["Pegasust <pegasucksgg@gmail.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
[tool.poetry.group.dev.dependencies]
pytest = "^7.3.1"
[[tool.poetry.packages]]
include = "repl"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@ -0,0 +1,118 @@
#!/usr/bin/env python
"""
REPL-friendly python mono-module for importing and execution singleton
"""
import os
from dataclasses import dataclass
from itertools import groupby
from typing import Iterable
mac_photos = os.getenv("MAC_PHOTOS_PATH", default="mac_photos")
@dataclass(slots=True, frozen=True)
class PhotosKExt:
name: str
parent: tuple[str, ...]
exts_lowered: tuple[str, ...]
@classmethod
def from_root_file(cls, root: str, filename: str):
ext_elems = filename.split('.')
return cls(
name=ext_elems[0],
parent=os.path.split(root),
exts_lowered=tuple(
ext.lower() for ext in ext_elems[1:]
)
)
@dataclass(slots=True, frozen=True)
class PhotosKey:
filename: str
parent: tuple[str, ...]
@classmethod
def from_key_ext(cls, ext: PhotosKExt):
return cls(filename=ext.name, parent=ext.parent)
@dataclass(slots=True)
class PhotosValue:
exts: dict[str, list[str]]
def heic_paths(self) -> list[str]:
return self.exts.get("heic", list())
def mov_paths(self) -> list[str]:
return self.exts.get("mov", list())
def candidate_exts(file_exts: Iterable[PhotosKExt]):
"""
>>> {ext: len(files)for ext, files in cexts.items()}
stdout> {... 'mov': 2769, 'heic': 2354 ...}
We could make a bold guess that iPhone 11 stores both `heic` and `mov`
for materialized best capture and live movie for live capture.
"""
exts_rv: dict[str, list[PhotosKExt]] = dict()
for file in file_exts:
for ext in file.exts_lowered:
exts_rv.setdefault(ext, list()).append(file)
return exts_rv
def file_exts(photos_dir: str = mac_photos):
return {
PhotosKExt.from_root_file(filename=file, root=root)
for root, _, files in os.walk(photos_dir, followlinks=True)
for file in files
}
def photos_exts(files_with_ext: Iterable[PhotosKExt]):
return {
k: list(v)
for k, v in groupby(files_with_ext, key=lambda x: (x.name, x.parent))
}
def main():
fexts = file_exts()
cexts = candidate_exts(fexts)
print(f"{photos_exts(fexts)=}")
print(f"{cexts=}")
ext_counts = {ext: len(files)for ext, files in cexts.items()}
print(ext_counts)
# stdout>
"""
{'jpeg': 6023, 'mov': 2769, 'heic': 2354, 'thm': 197, 'png': 168, 'plist': 163,
'log': 1, 'aae': 102, 'kgdb': 3, 'mp4': 26, 'data': 3, 'db': 3, 'xml': 26,
'cmap': 2, 'plj': 16, 'kgdb-wal': 3, 'sqlite-shm': 11, 'cloudphotodb-wal': 1,
'kgdb-shm': 3, '00001]': 1, 'frag': 2, 'ithmb': 3, 'sqlite': 15, 'lock': 1,
'sqlite-wal': 11, 'aoi': 3, '0': 1,
'm3u8-8f37dbfb-b3a6-4d52-beca-d17aaed01606': 2, 'jpg': 2, 'roi': 3, 'poi': 3,
'db-shm': 1, 'm3u8-37f64716-0b2d-4a82-854a-5a6c78ce505a': 1, 'descriptor': 3,
'bin': 2, 'm3u8': 5, 'cloudphotodb': 1, 'db-wal': 1, 'nature': 3,
'm3u8-d8faad08-4fcc-4161-a600-1562d755c97b': 1, 'initfrag': 2, '20201]': 1,
'cloudphotodb-shm': 1}
"""
movs = cexts['mov']
heics = cexts['heic']
heic_name_set = {heic.name.lower() for heic in heics}
mov_name_set = {mov.name.lower() for mov in movs}
print(len(heic_name_set - mov_name_set) - len(heic_name_set))
# stdout> (not 0)
# Hence, we are not able to match `.heic` with its `.mov` with just names
# Could it be that the `.heic` also contains the high-quality live?
if __name__ == "__main__":
main()

View File

@ -0,0 +1,9 @@
# Local nixlib in `nix repl`
Pretty useful for airplane-driven development
```console
nixlib = import <nixpkgs/lib>
nix-repl> nixlib.genAttrs
«lambda @ /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/attrsets.nix:619:5»
```

View File

@ -3,7 +3,7 @@
The current [`scripts/vim.dsl`](../scripts/vim.dsl) grabs the upstream supported vim plugins
onto a sqlite database to be stored in memory. We could perform some data exploration via this database
## Explore which plugins should be added to `neovim.nix`
## Example: Explore which plugins should be added to `neovim.nix`
Gather list of plugins need to be added. This can be done simply by adding
a print statement on `WPlug` in `../native_configs/neovim/init.lua` then run neovim

1486
flake.lock

File diff suppressed because it is too large Load Diff

View File

@ -8,16 +8,18 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-latest.url = "github:nixos/nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
std.url = "github:divnix/std";
# deploy-rs.url = "github:serokell/deploy-rs";
std = {
url = "github:divnix/std";
inputs.devshell.url = "github:numtide/devshell";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
# need to pin this until darwin build is successful again.
url = "github:nix-community/neovim-nightly-overlay?rev=88a6c749a7d126c49f3374f9f28ca452ea9419b8";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:pegasust/neovim-nightly-overlay/darwin-fix";
};
nix-boost = {
url = "git+https://git.pegasust.com/pegasust/nix-boost?ref=bleed";
@ -31,40 +33,52 @@
# Should show the latest nixpkgs whenever possible
inputs.nixpkgs.follows = "nixpkgs-latest";
};
nixpkgs-vimplugins.url = "github:cornedor/nixpkgs/update-vim-plugins";
sg-nvim = {
url = "git+https://github.com/pegasust/sg.nvim?ref=sg-cody-discover";
};
};
outputs = {self, std, ...} @ inputs:
outputs = {
self,
std,
...
} @ inputs:
std.growOn
{
# boilerplate
inherit inputs;
# All cell blocks are under ./nix/cells/<cell>/<cellblock> as `<cellblock>.nix`
# All cell blocks are under ./nix/<cell>/<cellblock> as `<cellblock>.nix`
# or `<cellblock/default.nix`
cellsFrom = ./nix/cells;
cellsFrom = ./nix;
# modules = ./nix/modules;
cellBlocks = let
inherit (std.blockTypes) devshells functions anything installables;
inherit (std.blockTypes) devshells functions anything installables runnables;
in [
(installables "shells")
(devshells "devshells")
(devshells "userShells")
(functions "home-profiles")
(functions "home-modules")
(anything "home-configs")
(anything "home-configs")
(installables "packages")
(anything "lib")
(runnables "formatter")
];
}
{
devShells = std.harvest self [["dotfiles" "devshells"]];
# nixosConfigurations = std.pick [ [ "dotfiles" "nixos" ] ];
# homeConfigurations = std.pick [ [ "dotfiles" "home" ] ];
devShells = std.harvest self [["dotfiles" "devshells"] ["dev" "shells"]];
homeModules = std.pick self [["repo" "home-modules"]];
packages = std.harvest self [["repo" "packages"]];
packages = std.harvest self [
["repo" "packages"]
["dev" "packages"]
];
legacyPackages = std.harvest self [["repo" "home-configs"]];
lib = std.pick self [["repo" "lib"]];
# TODO: Debug only
homeProfiles = std.pick self [["repo" "home-profiles"]];
formatter = std.harvest self [["repo" "formatter"]];
};
}

1
mac_photos Symbolic link
View File

@ -0,0 +1 @@
/Users/hungtran/Pictures/Photos Library.photoslibrary

View File

@ -15,99 +15,99 @@
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
#window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
# must be non-zero for this to take effect. The number of columns must be at
# least `2`, while using a value of `0` for columns and lines will fall back
# to the window manager's recommended size
#dimensions:
# columns: 0
# lines: 0
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
# must be non-zero for this to take effect. The number of columns must be at
# least `2`, while using a value of `0` for columns and lines will fall back
# to the window manager's recommended size
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#opacity: 1.0
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#opacity: 1.0
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Window title
#title: Alacritty
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Decorations theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme/Wayland client side decorations.
# Commonly supported values are `dark` and `light`. Set this to `None` to use
# the default theme variant.
#decorations_theme_variant: None
# Decorations theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme/Wayland client side decorations.
# Commonly supported values are `dark` and `light`. Set this to `None` to use
# the default theme variant.
#decorations_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
@ -120,12 +120,11 @@ font:
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: DroidSansMono NF
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
@ -135,8 +134,8 @@ font:
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
@ -146,8 +145,8 @@ font:
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
@ -157,9 +156,8 @@ font:
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
# Point size
size: 7.0
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
@ -181,24 +179,24 @@ font:
#
#builtin_box_drawing: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night)
#colors:
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not
# present. If the bright foreground color is not set, or
# `draw_bold_text_with_bright_colors` is `false`, the normal foreground
# color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not
# present. If the bright foreground color is not set, or
# `draw_bold_text_with_bright_colors` is `false`, the normal foreground
# color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
@ -224,32 +222,32 @@ font:
#
# Colors used for the search bar and match highlighting.
#search:
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: '#ffffff'
# background: '#000000'
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: '#ffffff'
# background: '#000000'
# Keyboard hints
#hints:
# First character in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#start:
# foreground: '#1d1f21'
# background: '#e9ff5e'
# First character in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#start:
# foreground: '#1d1f21'
# background: '#e9ff5e'
# All characters after the first one in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#end:
# foreground: '#e9ff5e'
# background: '#1d1f21'
# All characters after the first one in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#end:
# foreground: '#e9ff5e'
# background: '#1d1f21'
# Line indicator
#
@ -333,10 +331,10 @@ font:
# regardless of their background color.
#transparent_background_colors: false
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
@ -374,7 +372,7 @@ font:
#
#command: None
#selection:
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
@ -382,25 +380,25 @@ font:
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
@ -426,36 +424,36 @@ font:
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
# Offer IPC using `alacritty msg` (unix only)
# ipc_socket: true
# Offer IPC using `alacritty msg` (unix only)
# ipc_socket: true
#mouse:
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
@ -467,11 +465,11 @@ font:
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Hints
#
# Terminal hints can be used to find text or hyperlink in the visible part of
# the terminal and pipe it to other applications.
#hints:
# Hints
#
# Terminal hints can be used to find text or hyperlink in the visible part of
# the terminal and pipe it to other applications.
#hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
@ -517,247 +515,247 @@ font:
# key: U
# mods: Control|Shift
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings for actions not exclusive to mouse mode)
#
# - Mouse exclusive actions:
#
# - ExpandSelection
# Expand the selection to the current mouse cursor location.
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Right, action: ExpandSelection }
# - { mouse: Right, mods: Control, action: ExpandSelection }
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings for actions not exclusive to mouse mode)
#
# - Mouse exclusive actions:
#
# - ExpandSelection
# Expand the selection to the current mouse cursor location.
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Right, action: ExpandSelection }
# - { mouse: Right, mods: Control, action: ExpandSelection }
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - CreateNewWindow
# Create a new Alacritty window from the current process.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
# - CenterAroundViCursor
# Center view around vi mode cursor
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - CreateNewWindow
# Create a new Alacritty window from the current process.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
# - CenterAroundViCursor
# Center view around vi mode cursor
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
key_bindings:
- { key: N, mods: Control, action: CreateNewWindow }
# - { key: Paste, action: Paste }
@ -771,7 +769,12 @@ key_bindings:
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
- { key: Escape, mods: Shift, mode: ~Search, action: ToggleViMode }
- {
key: Escape,
mods: Shift,
mode: ~Search,
action: ToggleViMode
}
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
@ -834,9 +837,9 @@ key_bindings:
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
- { key: C, mods: Control|Shift, action: Copy }
- { key: Return, mods: Alt, action: ToggleFullscreen }
- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
- { key: C, mods: Control|Shift, action: Copy }
# - { key: Return, mods: Alt, action: ToggleFullscreen }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
@ -866,11 +869,13 @@ key_bindings:
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
- { key: Return, mods: Command, action: ToggleFullscreen }
# NOTE: Use Command + Control + F
#
# - { key: Return, mods: Command, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false

View File

@ -0,0 +1,133 @@
# Font configuration
font_family FiraCode Nerd Font Mono
bold_font FiraCode Nerd Font Mono Bold
italic_font FiraCode Nerd Font Mono Italic
bold_italic_font FiraCode Nerd Font Mono Bold Italic
font_size 11.0
# firacode-specific
modify_font cell_height -6px
modify_font baseline 2
sync_to_monitor no
# if I'm hovering over the font, don't perform ligature, thanks.
disable_ligatures cursor
# NO BELLS!
enable_audio_bell no
# theme gruvbox_dark
# include /themes/gruvbox_dark.conf
# window_margin_width 5.0
# window_padding_width 5.0
# I'm on Prime's team here, blinking cursor is too distracting
cursor_blink_interval 0
background #282c34
dynamic_background_opacity true
background_opacity 0.97
macos_traditional_fullscreen no
# from nvim-nonicons
# symbol_map U+f101-U+f208 nonicon regular
# No creating windows
map ctrl+shift+enter no_op
map cmd+enter no_op
# I don't understand why some of these have remaps on MacOS
# new_os_window
map ctrl+shift+n no_op
# new_os_window
map cmd+n no_op
map ctrl+shift+w close_window
map shft+cmd+d no_op # just disable any apple-linux segregation
# tabs
## Tab creation
map ctrl+shift+t combine | new_tab | set_tab_title _
map cmd+t no_op
map ctrl+, set_tab_title _
## No tab destruction
map ctrl+shift+q no_op
map ctrl+shift+w no_op
# close_tab 🍎
map cmd+w no_op
## No tab iteration
# next_tab
map ctrl+shift+right no_op
# next_tab 🍎
map shift+cmd+] no_op
# next_tab
map ctrl+tab no_op
# previous_tab
map ctrl+shift+left no_op
# previous_tab 🍎
map shift+cmd+[ no_op
# previous_tab
map ctrl+shift+tab no_op
# move_tab_forward
map ctrl+shift+. no_op
## Tab linear jumping
map ctrl+1 goto_tab 1
map ctrl+2 goto_tab 2
map ctrl+3 goto_tab 3
map ctrl+4 goto_tab 4
map ctrl+5 goto_tab 5
map ctrl+6 goto_tab 6
map ctrl+7 goto_tab 7
map ctrl+8 goto_tab 8
map ctrl+9 goto_tab 9
map ctrl+0 goto_tab 10
### A bit ergonomics for mac
map cmd+1 goto_tab 1
map cmd+2 goto_tab 2
map cmd+3 goto_tab 3
map cmd+4 goto_tab 4
map cmd+5 goto_tab 5
map cmd+6 goto_tab 6
map cmd+7 goto_tab 7
map cmd+8 goto_tab 8
map cmd+9 goto_tab 9
map cmd+0 goto_tab 10
## Just disable all iteration of tab - use linear mapping
map ctrl+shift+right no_op
map shift+cmd+] no_op
map ctrl+tab no_op
map ctrl+shift+left no_op
map shift+cmd+[ no_op
map ctrl+shift+tab no_op
## Titles
tab_bar_edge top
tab_fade 0.6 1
tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{index}|{title}{(lambda parts: '/'.join([p if len(p) <= 2 else p[:2]+'…' for p in parts[:-1]] + [parts[-1]]))(tab.active_wd.split('/'))}"
active_tab_font_style bold
active_tab_foreground #000
active_tab_background #eee
inactive_tab_foreground #444
inactive_tab_background #999
map ctrl+shift+, set_tab_title
# set_tab_title
map ctrl+shift+alt+t no_op
# set_tab_title
map shift+cmd+i no_op
# map ctrl+shift+p>n kitten hints --type=linenum --linenum-action=tab nvim +{line} {path}
# I don't really have good way to ever press F1
# map f1 kitten hints --customize-processing hint_define_word.py

View File

@ -18,12 +18,13 @@ endif
local Plug = vim.fn['plug#']
-- prepare a list of installed plugins from rtp
--- @type table<string, boolean>
local installed_plugins = {}
-- NOTE: nvim_list_runtime_paths will expand wildcard paths for us.
for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do
local last_folder_start = path:find("/[^/]*$")
if last_folder_start then
local plugin_name = path:sub(last_folder_start + 1)
local plugin_name = string.lower(path:sub(last_folder_start + 1))
installed_plugins[plugin_name] = true
end
end
@ -31,20 +32,31 @@ end
local wplug_log = require('plenary.log').new({ plugin = 'wplug_log', level = 'debug', use_console = false })
-- Do Plug if plugin not yet linked in `rtp`. This takes care of Nix-compatibility
local function WPlug(plugin_path, ...)
-- hrsh7th/cmp-nvim -> cmp-nvim
local plugin_name = string.lower(plugin_path:match("/([^/]+)$"))
if not installed_plugins[plugin_name] then
wplug_log.info("Plugging " .. plugin_path)
wplug_log.info("Missing in rtp: " .. plugin_name .. " path: " .. plugin_path)
Plug(plugin_path, ...)
end
installed_plugins[plugin_name] = false
end
-- Borked, reason unknown
-- for plugin, plugged in pairs(installed_plugins) do
-- if plugged ~= false then
-- wplug_log.info("Plugin " .. plugin .. " added to rtp but not WPlug-ed")
-- end
-- end
vim.call('plug#begin')
-- libs and dependencies
-- Plug('nvim-lua/plenary.nvim') -- The base of all plugins
WPlug('nvim-lua/plenary.nvim') -- The base of all plugins
WPlug('MunifTanjim/nui.nvim') -- For some .so or .dylib neovim UI action
-- plugins
WPlug('tjdevries/nlua.nvim') -- adds symbols of vim stuffs in init.lua
WPlug('nvim-treesitter/nvim-treesitter') -- language parser engine for highlighting
WPlug('nvim-treesitter/nvim-treesitter-textobjects') -- more text objects
WPlug('nvim-telescope/telescope.nvim', { branch = '0.1.x' }) -- file browser
@ -59,6 +71,7 @@ WPlug('nvim-telescope/telescope.nvim', { branch = '0.1.x' }) -- file browser
-- Make sure that WPlug does not run `make` and use the output it needs
WPlug('nvim-telescope/telescope-fzf-native.nvim',
{ ['do'] = 'make >> /tmp/log 2>&1' })
WPlug('nvim-telescope/telescope-live-grep-args.nvim')
WPlug('nvim-telescope/telescope-file-browser.nvim')
-- cmp: auto-complete/suggestions
@ -70,7 +83,7 @@ WPlug('hrsh7th/cmp-cmdline')
WPlug('hrsh7th/nvim-cmp')
WPlug('hrsh7th/cmp-nvim-lsp-signature-help')
WPlug('onsails/lspkind-nvim')
WPlug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
-- WPlug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
WPlug('nathanalderson/yang.vim')
-- WPlug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
@ -94,6 +107,7 @@ WPlug('radenling/vim-dispatch-neovim') -- Add support for neovim's terminal
WPlug('gennaro-tedesco/nvim-jqx') -- JSON formatter (use :Jqx*)
WPlug('kylechui/nvim-surround') -- surrounds with tags/parenthesis
WPlug('simrat39/rust-tools.nvim') -- config rust-analyzer and nvim integration
WPlug('tjdevries/sg.nvim') -- Cody and other cool sourcegraph stuffs
-- UI & colorscheme
WPlug('simrat39/inlay-hints.nvim') -- type-hints with pseudo-virtual texts
@ -107,11 +121,11 @@ WPlug('NvChad/nvim-colorizer.lua') -- color highlighter with tailwi
WPlug('roobert/tailwindcss-colorizer-cmp.nvim') -- color for tailiwnd for compe
-- other utilities
WPlug('ThePrimeagen/git-worktree.nvim') -- Worktrees are the canonical way to git thru
WPlug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of func/class scope
WPlug('nvim-treesitter/playground') -- Sees Treesitter AST - less hair pulling, more PRs
WPlug('saadparwaiz1/cmp_luasnip') -- snippet engine
WPlug('L3MON4D3/LuaSnip') -- snippet engine
WPlug('mickael-menu/zk-nvim') -- Zettelkasten
WPlug('folke/neodev.nvim') -- Neovim + lua development setup
-- Switch cases:
-- `gsp` -> PascalCase (classes), `gsc` -> camelCase (Java), `gs_` -> snake_case (C/C++/Rust)
@ -209,8 +223,8 @@ vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert" }
-- vim.opt.clipboard = "unnamedplus"
-- more aggressive swap file writing. ThePrimeagen believes higher number
-- leads to low DX
-- more aggressive swap file writing. ThePrimeagen believes higher number leads to low DX
vim.opt.updatetime = 50
vim.g.mapleader = ' '
@ -242,18 +256,18 @@ colorscheme gruvbox
require('hlargs').setup()
require('nvim-web-devicons').setup()
require('trouble').setup {
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = {
-- key mappings for actions in the trouble list
-- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
@ -289,7 +303,7 @@ require('trouble').setup {
information = "",
other = "",
},
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
}
@ -344,8 +358,93 @@ vim.api.nvim_create_user_command(
-- telescope
local fb_actions = require "telescope".extensions.file_browser.actions
local tel_actions = require("telescope.actions")
local tel_action_state = require("telescope.actions.state")
local tel_actionset = require("telescope.actions.set")
-- telescope + harpoon mark
local function default_harpoon_mark()
require('harpoon.mark').add_file()
end
local harpoon_keymap = '<leader>m'
local function telescope_multi_selection(prompt_bufnr)
local picker = tel_action_state.get_current_picker(prompt_bufnr)
---@class telescope.make_entry.Entry
---@field value any
---@field valid boolean | nil
---@field ordinal string for filtering and (fuzzy) search-friendly string
---@field display string|function
---@field filename string | nil
---@field bufnr number | nil
---@field lum number | nil
---@field col number | nil
---@class telescope.make_entry.gen_from_file__rv: telescope.make_entry.Entry
---@field cwd string | nil
---@field path string via __index
---@field __index function
---@type telescope.make_entry.gen_from_file__rv[]
local rv = picker:get_multi_selection()
return rv
end
local function mark_telescope_selections(prompt_bufnr)
-- NOTE: This works for both bulitin Telescope file browser and fuzzy search
local selections = telescope_multi_selection(prompt_bufnr)
--[[
local entries = {}
for k, e in ipairs(selections) do
table.insert(entries, { k = k, e = e })
end
print(vim.inspect({
prompt_bufnr = prompt_bufnr,
selections = selections,
entries = entries,
}))
stdout> (builtin.__file)
{
entries = { { "native_configs/ssh/authorized_keys",
index = 6,
<metatable> = <1>{
__index = <function 1>,
cwd = "/Users/hungtran/local_repos/dotfiles",
display = <function 2>
}
}, { "native_configs/ssh/config", index = 7, <metatable> = <table 1> } },
prompt_bufnr = 56
}
--]]
---@type string[]
local filenames = {}
for _, entry in ipairs(selections) do
local has_path, path = pcall(function() return entry:__index("path") --[[ @as string ]] end)
if has_path then
table.insert(filenames, path)
goto continue
end
-- invariant: pcall on has_path false will assign second rv as the error
-- payload. Most of the time, this is a string, but for safety, we could
-- not assume so.
local err = path
log.warn("No `.path` for entry `" .. vim.inspect(entry) .. "`: " .. vim.inspect(err))
::continue::
end
log.debug(vim.inspect(filenames))
for _, filename in pairs(filenames) do
require('harpoon.mark').add_file(filename)
end
end
local function term_height()
return vim.opt.lines:get()
end
@ -356,10 +455,20 @@ require('telescope').setup {
n = {
['<C-u>'] = function(prompt_bufnr) tel_actionset.shift_selection(prompt_bufnr, -math.floor(term_height() / 2)) end,
['<C-d>'] = function(prompt_bufnr) tel_actionset.shift_selection(prompt_bufnr, math.floor(term_height() / 2)) end,
[harpoon_keymap] = function(prompt_bufnr)
mark_telescope_selections(prompt_bufnr)
end,
['<CR>'] = tel_actions.select_drop,
},
i = {
['<CR>'] = tel_actions.select_drop,
},
},
},
extensions = {
live_grep_args = {
auto_quoting = true,
},
fzf = {
fuzzy = true, -- allow fuzzy matches
override_generic_sorter = true,
@ -394,12 +503,21 @@ require('telescope').setup {
-- Telescope key remap stuffs
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'file_browser')
pcall(require('telescope').load_extension, 'git_worktree')
remap('n', '<C-p>', '<cmd>Telescope<cr>', { desc = 'Open Telescope general search' })
remap('n', '<leader>fm', function()
require("telescope").extensions.file_browser.file_browser({})
end, { desc = '[F]ile [M]utation' })
remap('n', '<leader>ft', function()
require("telescope").extensions.git_worktree.git_worktrees()
end, { desc = '[F]ind [T]ree' })
remap('n', '<leader>tm', function()
require("telescope").extensions.git_worktree.create_git_worktree()
end, { desc = '[T]ree [M]utate' })
remap('n', '<leader>ff', function()
require('telescope.builtin').find_files({
hidden = false,
@ -417,12 +535,14 @@ remap('n', '<leader>fa', function()
end, { desc = '[F]ind [A]ll files' })
remap('n', '<leader>fg', function()
require('telescope.builtin').live_grep()
require('telescope').extensions.live_grep_args.live_grep_args()
end, { desc = '[F]ind thru [G]rep' })
remap('n', '<leader>fug', function()
-- This relies on many factors: We use `rg` and that `-g '**/*'` effectively
-- drops ignore rules like the default `.gitignore` rule.
vim.notify("fuzzy unrestricted grep is deprecated, use Find thru Grep with `-uuu` query instead")
require('telescope.builtin').live_grep({ glob_pattern = '**/*' })
end, { desc = '[F]ind thru [u]nrestricted [G]rep' })
@ -438,16 +558,6 @@ remap('n', '<leader>fd', function()
require('telescope.builtin').diagnostics()
end, { desc = '[F]ind [D]iagnostics' })
-- ZK remap stuffs
remap('n', '<leader>zf', function()
-- vim.cmd([[:ZkNotes]])
require('zk').edit({}, { multi_select = false })
end, { desc = '[Z]ettelkasten [F]iles' })
remap('n', '<leader>zg', function()
vim.cmd(":ZkGrep")
end, { desc = '[Z]ettelkasten [G]rep' })
-- tab management {{{
-- Jump to specific tab with <C-t>[number]
@ -491,12 +601,12 @@ vim.api.nvim_set_keymap('n', '<C-t>x', ':tabdo if tabpagenr() > 1 | tabclose | e
-- treesitter
require 'treesitter-context'
require('nvim-treesitter.configs').setup {
yati = {
enable = true,
default_lazy = true,
default_fallback = "auto",
disable = { "nix" }
},
-- yati = {
-- enable = true,
-- default_lazy = true,
-- default_fallback = "auto",
-- disable = { "nix" }
-- },
indent = { enable = false },
highlight = {
enable = true,
@ -558,7 +668,12 @@ require('guess-indent').setup {
}
-- harpoon: O(1) buffer/terminal switching
remap('n', '<leader>m', function() require('harpoon.mark').add_file() end, { desc = "[H]arpoon [M]ark" })
remap('n', harpoon_keymap, function()
local is_err, err = pcall(require('harpoon.mark').add_file)
if is_err then
log.warn(vim.inspect(err))
end
end, { desc = "[H]arpoon [M]ark" })
local function harpoon_nav(key, nav_file_index, lead_keybind)
lead_keybind = lead_keybind or '<leader>h'
assert(type(key) == "string", "expect key to be string(keybind)")
@ -678,6 +793,10 @@ local on_attach = function(client, bufnr)
-- enable inlay hints if available
require('inlay-hints').on_attach(client, bufnr)
end
require("sg").setup {
on_attach = on_attach,
}
-- nvim-cmp
local cmp = require 'cmp'
@ -803,11 +922,11 @@ local cmp_config = {
vim_item = kind_fn(entry, vim_item)
-- copium that this will force resolve for entry
entry_filter(entry, function(entry)
if entry.source_name == "nvim_lsp" then
log.debug('format:entry: ' .. vim.inspect(entry, { depth = 2 }))
end
end)
-- entry_filter(entry, function(entry)
-- if entry.source_name == "nvim_lsp" then
-- log.debug('format:entry: ' .. vim.inspect(entry, { depth = 2 }))
-- end
-- end)
return require('tailwindcss-colorizer-cmp').formatter(entry, vim_item)
end,
@ -937,6 +1056,54 @@ local inlay_hint_tsjs = {
includeInlayVariableTypeHints = true,
};
local setup = {
["nil_ls"] = function()
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
--- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md
--- for the list of configurations available for `nil_ls`
settings = {
["nil"] = {
formatting = {
-- NOTE: nil_ls automatically adds the specific path to the filename
-- at the end, so we couldn't really have a fallback mechanism without
-- wrapping.
command = {
"nix", "run", "nixpkgs#alejandra"
},
},
nix = {
flake = {
-- calls `nix flake archive` to put a flake and its output to store
autoArchive = true,
-- auto eval flake inputs for improved completion
autoEvalInputs = true,
},
},
},
},
}
end,
["gopls"] = function()
local lspconfig = require('lspconfig')
lspconfig.gopls.setup {
cmd = { "gopls" },
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
},
},
root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
on_attach = on_attach,
capabilities = capabilities,
}
end
}
require('mason-lspconfig').setup_handlers({
-- default handler
function(server_name)
@ -1043,30 +1210,10 @@ require('mason-lspconfig').setup_handlers({
},
}
end,
["nil_ls"] = function()
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
--- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md
--- for the list of configurations available for `nil_ls`
settings = {
["nil"] = {
formatting = {
command = { "nix", "run", "nixpkgs#alejandra" },
},
nix = {
flake = {
-- calls `nix flake archive` to put a flake and its output to store
autoArchive = true,
-- auto eval flake inputs for improved completion
autoEvalInputs = true,
},
},
},
},
}
end,
})
setup["nil_ls"]()
setup["gopls"]()
require("rust-tools").setup {
tools = {
-- rust-tools options
@ -1253,49 +1400,6 @@ require("rust-tools").setup {
},
}
require('zk').setup({
picker = "telescope",
lsp = {
config = {
cmd = { "zk", "lsp" },
name = "zk",
on_attach = on_attach,
},
auto_attach = {
enable = true,
filetypes = { "markdown" }
},
},
})
-- Custom ZkOrphans that determines unlinked notes
-- `:ZkOrphans {tags = {"work"}}`
require('zk.commands').add("ZkOrphans", function(options)
options = vim.tbl_extend("force", { orphan = true }, options or {})
-- zk.edit opens notes picker
require('zk').edit(options, { title = "Zk Orphans (unlinked notes)" })
end)
--
-- ZkGrep: opens file picker
-- In the case where `match_ctor` is falsy, create a prompt.
-- This is so that we distinguish between ZkGrep and ZkNotes
-- Params:
-- match_ctor: string | {match= :string,...} | "" | nil
require('zk.commands').add("ZkGrep", function(match_ctor)
-- handle polymorphic `match_ctor`
local grep_str = match_ctor
local match
if match_ctor == nil or match_ctor == '' then
vim.fn.inputsave()
grep_str = vim.fn.input('Grep string: >')
match = { match = grep_str }
elseif type(match_ctor) == 'string' then
match = { match = grep_str }
end
require('zk').edit(match, { title = "Grep: '" .. grep_str .. "'", mutli_select = false })
end)
-- Gitsigns
require('gitsigns').setup {
signs = {
@ -1344,9 +1448,9 @@ require('lualine').setup {
require('nvim-surround').setup {}
require('fidget').setup({
text = {
spinner = "moon", -- animation shown when tasks are ongoing
done = "", -- character shown when all tasks are complete
commenced = "Started", -- message shown when task starts
spinner = "moon", -- animation shown when tasks are ongoing
done = "", -- character shown when all tasks are complete
commenced = "Started", -- message shown when task starts
completed = "Completed", -- message shown when task completes
},
align = {

View File

@ -5,3 +5,5 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFQN5Ia8rTalnQgcvdxH2n7UNNT1Tq9UvNdJeg9ziJ
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgmng5xL/auvI2F8ufFAfId2Ey55ONHjgnKKSEWLVWkPMutXT3BCnSglNAuEVRLX2zfzg3beQd80AHTow+qro5QWI/rYfeL1QPNEwoThbRFcvtWLTlgzBGA4ejjpIF9sCPNp0sXrrQRfxRP7w4b23BcRJQcsDoaEtKGKJZ2GQIoOafkYypwcunANb54EAouZTfHEPKDr26Gfw8usc2Sae32G/80QLBF2jGabyexJjNE3F6hdJTwq5iiqIVdSr4ue82zo3M8jBdtCMDGaOliI5RWSa9iuX9o2scCGDU69Gkw7ma+JHOP/e9Z8sUz03TkjPbEnGi3EC3YAHEoDzmwqTi07hppCuzacLB5NZ9UZ1g5PzBIZR8TJTONngT08EQyGrkNv2sUnn0dtBqve5tHR04NuXy65ym7Iwl2DDVbAL0NlM4gKWzOGZ2CnSLT0WmkG2sQKU37NmS2pBJ8RXJBatUFe4vQVzqlFj39iRGIBV5XR0I9xcxDfCxBHFs3aIqAqE= hwtr@hwtr-prince
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/UzKwmFsAlLoCXvOq2lsC1sr1BRDW5uPkdcYUfQ7z4JowL/pscoTV9zjfJd1hPBvHLBvn7gs7gWt0wNnJfD1Oor26VreHjhi1PZE2kovrEzjmPoz+GqMPciV+HF9XNIRwDiHlUNFPt9qJjAJXJCFhzcmT9q0JQuPlNgJtQ6+By7RgPuJczpf17IbxpheLcXqtOFcTHyRT01KijIPhAtWRlmG5dahVuu50EfpmHRYZ8nCJJqkuJ6uRbFaPE6mYLnXLSzJUdyakYnzWbCd5phpoGAuFyQZnS503CFZUOFCnNEN8QfO2DXihp7lvrzzpI6PgcpvpotSo9kYFiEuB+DRlBQcVMWL0lUk2J1JHJH83y3CxwH0pUc7E1k6FAZE4pv4x0KEvbZSvmb8jAGWZkn4HvZCwXR5wGVi22s6RCdIHvR2PCpAy+ZSjpM+2FJIqDHpxY/vo3ktM9rpeCSwp14F/iiw6nanVq/KZBpCZ2paMcAU4WreCFZiPdGsdiixYlts= hungtr@bao
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAW4E8L/zGkcqixJo1102ddqeexoBMHIhXRXpWR3dTmJtbaaVbo4+rHRsjHPvHif9CRfi+BQ8CHG3zmBjH7DZPZIRCVtkms1EDe1k/G3fEnfgYc6gboJfoTdLkVjNOtdStTi03dCA/riQqUKc7/v16R5ZXIAmNCnmMHelObCSDPzYg8psZAUk1ZZY//pnhp9JRPsC2JxsshN7HCNIED9aFgrJkvUt+wUVGjVHzyQwyR6J7m1yyoivTwdmYdulG7OriLeeNq8vkoDmLGgLSC+zKehzJYOZsH3EKuxuZjQ3J9tK/NseQOhsQglRHE/OvphMwT/J96gl9dZR/LQXp4S6hwLccTzFfs8rLaTOIK6CEpqBUuBonot/1vJP5j5E73hfkHwZO7TQKwfXtpRCxCl5Nm3cB2Y3kz5mArDiwWioVsX4qd0XR0F9MFtuTVTn2f4K/Gwr9P3XMkLWXU1+1KbQiWIg+Zf5DpQgBW5HWryZzsMcjyMC2I2BJCl6Q+V8ofSM= nixos@Felia
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJvOCZ4nyFiiKK7gkwzP4hXJ6NmtgbdUJdWgIzUL0GMA htran@Hungs-MacBook-Pro.local
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBCA6TLpBjcffVHr7DwSqaqPgFStuI7W8VJA3/ya5Xhw hungtran@Hungs-MacBook-Air.local

View File

@ -3,18 +3,30 @@ Host felia-win
HostName felia.coati-celsius.ts.net
Port 2222
User _nhitrl
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
# Ubuntu 12c 32G-RAM
Host felia
HostName felia.coati-celsius.ts.net
User ubuntu_admin
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
# 2c 16G-RAM 200G drive
Host fel
HostName fel.coati-celsius.ts.net
User user
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
# AMZ Linux aarch64 hungtr@AMZ
Host nioma
@ -22,32 +34,56 @@ Host nioma
User ec2-user
IdentityFile ~/.ssh/free-aws.pem
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
# NixOS Pegasust-gh@Linode
Host nyx
HostName nyx.pegasust.com
User hungtr
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host lizzi
HostName 172.105.135.218
User hungtr
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host pixi
HostName 139.144.60.254
User hungtr
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host mokoi
HostName 129.146.98.121
User ubuntu_admin
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host noami
HostName 10.100.200.230
User htran
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host sr1
HostName 10.30.76.46
@ -56,22 +92,57 @@ Host sr1
StrictHostKeyChecking no
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host bgp1
HostName 10.111.100.113
User htran
Port 22
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
SendEnv TERM
SetEnv TERM=xterm-256color
Host bgp2
HostName 10.111.100.114
User htran
Port 22
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
SendEnv TERM
SetEnv TERM=xterm-256color
Host 10.111.100.*
User htran
Port 22
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
SendEnv TERM
SetEnv TERM=xterm-256color
Host 10.111.101.*
User htran
Port 22
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
SendEnv TERM
SetEnv TERM=xterm-256color
Host d1-30
HostName 10.111.103.60
User htran
@ -80,6 +151,8 @@ Host d1-30
UserKnownHostsFile /dev/null
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host d3l-3
HostName 10.111.103.65
@ -89,54 +162,127 @@ Host d3l-3
UserKnownHostsFile /dev/null
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host dev0
HostName 10.100.200.230
User htran
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host dev2
HostName 10.100.200.210
User htran
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host dev1
HostName 10.100.200.220
User htran
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host ztp-egi
HostName 10.23.27.201
User root
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host goat
HostName 10.133.32.100
User "EGN NOC"
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host portal2
HostName portal2.egihosting.com
User root
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host egn-rest-api
HostName egn-rest-api.egihosting.com
User root
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
SendEnv TERM
SetEnv TERM=xterm-256color
Host gl-egi
HostName gitlab.egihosting.com
User git
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host 10.111.103.*
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Host *
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host *
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host *.egihosting.com
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host grafana-egi
HostName grafana.egihosting.com
User nokia
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host syslog-egi
HostName syslog.egihosting.com
User root
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host geofeed-egi
HostName geofeed.egihosting.com
User root
Port 22
SendEnv TERM
SetEnv TERM=xterm-256color
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
Host gh
HostName github.com
User git
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa

View File

@ -1,4 +1,5 @@
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
# TODO: just install these things, then symlink to mason's bin directory
#
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
@ -15,23 +16,13 @@
# see: :/--suffix.*PATH
# there should be mentions of additional packages
my_neovim = pkgs.neovim-unwrapped;
rust_pkgs =
pkgs.rust-bin.selectLatestNightlyWith
(
toolchain:
toolchain.default.override {
extensions = ["rust-src" "rust-analyzer" "rust-docs" "rustfmt" "clippy" "miri"];
}
);
nvim_pkgs =
[
# pkgs.gccStdenv
pkgs.tree-sitter
# pkgs.tree-sitter
pkgs.fzf # file name fuzzy search
pkgs.ripgrep # content fuzzy search
pkgs.zk # Zettelkasten (limited support)
pkgs.fd # Required by a Telescope plugin (?)
pkgs.stdenv.cc.cc.lib
pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo
pkgs.rust4cargo
pkgs.nickel
@ -140,6 +131,8 @@ in {
vim-dispatch-neovim
vim-fugitive
vim-jack-in
sg-nvim
telescope-live-grep-args-nvim
;
in [
plenary-nvim
@ -185,6 +178,8 @@ in {
vim-dispatch-neovim
vim-fugitive
vim-jack-in
sg-nvim
telescope-live-grep-args-nvim
];
};
# home.packages = nvim_pkgs;

View File

@ -70,7 +70,7 @@ in {
settings = let
native = builtins.fromTOML (builtins.readFile "${proj_root.config.path}/starship/starship.toml");
patch-nix = pkgs.lib.recursiveUpdate native {
# WARNING: home-manager fails on here for some reason. Likely not at the
# WARNING: home-manager fails on here for some reason. Likely not at the
# validation phase (type-checking), but at evaluation phaase (stringify)
# c.commands = [
# ["nix" "run" "nixpkgs#clang" "--" "--version"]
@ -96,6 +96,7 @@ in {
{
nix-rebuild = "sudo nixos-rebuild switch";
hm-switch = "home-manager switch --flake";
hm-switch-u = "home-manager switch --flake .#$${USER}";
}
// (cfg.shellAliases or {});
history = {

View File

@ -4,3 +4,6 @@ post-build-hook = /etc/nix/upload-to-cache.sh
trusted-users = root htran hungtran hwtr
max-jobs = 8
cores = 12
# default is true for Linux, false for every one else
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-sandbox
sandbox = true

View File

@ -2,8 +2,9 @@ let
# user-specific (~/.ssh/id_ed25519.pub)
users = {
"hungtr@bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z";
"htran@Hungs-MacBook-Pro.local" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJvOCZ4nyFiiKK7gkwzP4hXJ6NmtgbdUJdWgIzUL0GMA";
};
# System-specific settings (/etc/ssh/ssh_hsot_ed25519_key.pub)
# System-specific settings (/etc/ssh/ssh_host_ed25519_key.pub)
systems = {
"bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBuAaAE7TiQmMH300VRj/pYCri1qPmHjd+y9aX2J0Fs";
};

View File

@ -1,47 +0,0 @@
# TODO: this should use winnow with a fair matching of supported systems
{
inputs,
cell,
}: let
inherit (cell) home-profiles home-modules;
inherit (inputs) home-manager;
pkgs = inputs.nixpkgs;
# hm is derivation that is compatible with homeConfigurations
home-config = {supported_systems, hm, tested_systems ? []}:
hm // {
_supported_systems = supported_systems;
_tested_systems = tested_systems;
};
base-modules = [
home-profiles.alacritty
# home-profiles.git
home-profiles.ssh
home-profiles.shells
({config.programs.home-manager.enable = true;})
home-profiles.nix-index
home-profiles.neovim
];
in {
homeConfigurations.htran = home-config {
supported_systems = ["aarch64-darwin" "x86_64-darwin"];
tested_systems = ["aarch64-darwin"];
hm = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = base-modules ++ [
home-profiles.nerd_font_module
home-profiles.git-htran
home-profiles.dev-packages
home-profiles.zk
home-modules.darwin-spotlight
({
home.username = "htran";
home.homeDirectory = "/Users/htran";
home.stateVersion = "23.11";
})
];
};
};
}

View File

@ -1,250 +0,0 @@
# This is an interface for home-profiles and should not contain opinionated
# configurations. It should provide alternative configurations, aggregates
# or new configurations
_imports@{ inputs, cell }:
let
namespace = "repo";
imports = _imports // { inherit namespace; };
in
{
git = { config, lib, ... }:
let
cfg = config."${namespace}".git;
baseAliases = {
a = "add";
c = "commit";
ca = "commit --amend";
cm = "commit -m";
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all";
sts = "status";
co = "checkout";
b = "branch";
};
default-user = "Pegasust";
default-email = "pegasucksgg@gmail.com";
in
{
options."${namespace}".git = {
aliases = lib.mkOption {
type = lib.types.attrs;
default = { };
example = baseAliases;
description = ''
Additional git aliases. This settings comes with base configuration.
Redeclaring the base config will override the values.
''; # TODO: Add baseAliases as string here (builtins.toString doesn't work)
};
name = lib.mkOption {
type = lib.types.str;
default = default-user;
description = "Git username that appears on commits";
example = default-user;
};
email = lib.mkOption {
type = lib.types.str;
default = default-email;
example = default-email;
description = "Git email that appears on commits";
};
ignores = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
".vscode" # vscode settings
".direnv" # .envrc cached outputs
".DS_Store" # MacOS users, amrite
];
description = ''
.gitignore patterns that are applied in every "${namespace}"sitory.
This is useful for IDE-specific settings.
'';
example = [ ".direnv" "node_modules" ];
};
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Enables git
'';
example = false;
};
credentialCacheTimeoutSeconds = lib.mkOption {
type = lib.types.int;
default = 3000;
description = "Credential cache (in-memory store) for Git in seconds.";
example = 3000;
};
};
# TODO : anyway to override configuration?
# idk wtf I was thinking about. there is no context in this question
config.programs.git = {
inherit (cfg) enable ignores;
userName = cfg.name;
userEmail = cfg.email;
aliases = baseAliases // cfg.aliases;
extraConfig = {
# TODO: in the case of darwin, git always open up the built-in keychain.
# possibly something we can't really control since we don't have access to `nix-darwin`
credential.helper = "cache --timeout=${builtins.toString cfg.credentialCacheTimeoutSeconds}";
};
lfs.enable = true;
};
};
alacritty = { config, lib, ... }:
let
inherit (inputs.cells.repo.lib) fromYAML;
cfg = config."${namespace}".alacritty;
in
{
options."${namespace}".alacritty = {
font.family = lib.mkOption {
type = lib.types.nullOr lib.types.singleLineStr;
default = null;
description = ''
The font family for Alacritty
'';
example = "DroidSansMono NF";
};
font.size = lib.mkOption {
type = lib.types.nullOr lib.types.number;
default = 11.0;
description = ''
The default font size for Alacritty. This is probably measured in px.
'';
example = 7.0;
};
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables alacritty
'';
example = true;
};
config-path = lib.mkOption {
type = lib.types.path;
description = "Path to alacritty yaml";
default = null;
example = "./config/alacritty.yaml";
};
};
config.programs.alacritty = {
enable = cfg.enable;
settings =
let
actualConfig =
if cfg.config-path != null then fromYAML (builtins.readFile cfg.config-path) else { };
in
lib.recursiveUpdate actualConfig {
font.normal.family = lib.mkIf (cfg.font.family != null) cfg.font.family;
font.size = lib.mkIf (cfg.font.size != null) cfg.font.size;
};
};
};
# TODO: chromium is not really supported on darwin
private_chromium = { config, pkgs, lib, ... }:
let
cfg = config."${namespace}".private_chromium;
in
{
options."${namespace}".private_chromium = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
Enable extremely lightweight chromium with vimium plugin
'';
};
};
config = lib.mkIf (cfg.enable) {
# home.packages = [pkgs.ungoogled-chromium];
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
extensions =
let
# TODO: how about a chrome extension registry?
mkChromiumExtForVersion = browserVersion: { id, sha256, extVersion, ... }:
{
inherit id;
crxPath = builtins.fetchurl {
url = "https://clients2.google.com/service/update2/crx" +
"?response=redirect" +
"&acceptformat=crx2,crx3" +
"&prodversion=${browserVersion}" +
"&x=id%3D${id}%26installsource%3Dondemand%26uc";
name = "${id}.crx";
inherit sha256;
};
version = extVersion;
};
mkChromiumExt = mkChromiumExtForVersion (lib.versions.major pkgs.ungoogled-chromium.version);
in
[
# vimium
(mkChromiumExt {
id = "dbepggeogbaibhgnhhndojpepiihcmeb";
sha256 = "00qhbs41gx71q026xaflgwzzridfw1sx3i9yah45cyawv8q7ziic";
extVersion = "1.67.4";
})
];
};
};
};
darwin-spotlight = { lib, pkgs, config, ... }: {
# This patch exists since Darwin's search bar requires solid apps and not
# symlinked
# TODO: QA
# - [x] works for base case
# - [x] works for repeated case
# - [ ] works after base case, then removed
# - [ ] works for repeated case, then removed
# Copy GUI apps to "~/Applications/Home Manager Apps"
# Based on this comment: https://github.com/nix-community/home-manager/issues/1341#issuecomment-778820334
home.activation.patch-spotlight =
if pkgs.stdenv.isDarwin then
let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in
lib.hm.dag.entryAfter [ "linkGeneration" ] ''
# Install MacOS applications to the user environment.
HM_APPS="$HOME/Applications/Home Manager Apps"
# Reset current state
if [ -e "$HM_APPS" ]; then
$DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)"
fi
$DRY_RUN_CMD mkdir -p "$HM_APPS"
# .app dirs need to be actual directories for Finder to detect them as Apps.
# In the env of Apps we build, the .apps are symlinks. We pass all of them as
# arguments to cp and make it dereference those using -H
$DRY_RUN_CMD cp --archive -H --dereference ${apps}/Applications/* "$HM_APPS"
$DRY_RUN_CMD chmod +w -R "$HM_APPS"
''
else
"";
# We need this in case upstream home-manager changes the behavior of linking
# applications
home.activation.remove-patch-spotlight =
if pkgs.stdenv.isDarwin then
lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
HM_APPS="$HOME/Applications/Home Manager Apps"
# Reset current state
if [ -e "$HM_APPS" ]; then
$DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)"
fi
''
else
"";
};
}

View File

@ -1,6 +0,0 @@
{
inputs,
cell,
}: {
inherit (inputs.cells.dotfiles.packages) kpcli-py;
}

22
nix/dev/packages.nix Normal file
View File

@ -0,0 +1,22 @@
{
inputs,
cell,
}: let
inherit (inputs.nixpkgs) system;
poetry2nix = inputs.nix-boost.inputs.poetry2nix.legacyPackages.${system};
pixi-src = "${inputs.self}/dev/pixi";
in {
pixi-deps = poetry2nix.mkPoetryEnv {
projectDir = pixi-src;
editablePackageSources = {
pixi = pixi-src;
};
};
pixi-edit = poetry2nix.mkPoetryEditablePackage {
projectDir = pixi-src;
editablePackageSources = {
pixi = pixi-src;
};
};
}

15
nix/dev/shells.nix Normal file
View File

@ -0,0 +1,15 @@
{
inputs,
cell,
}: let
inherit (inputs.nixpkgs) system;
inherit (cell.packages) pixi-deps pixi-edit;
in {
pixi = inputs.nixpkgs.mkShell {
buildInputs = [
pixi-deps
# pixi-edit
inputs.std.packages.${system}.default
];
};
}

View File

@ -21,4 +21,16 @@ in {
});
};
# sg-nvim = inputs.nixpkgs.vimUtils.buildVimPluginFrom2Nix {
# pname = "sg.nvim";
# version = "2023-06-20";
# src = inputs.nixpkgs.fetchFromGitHub {
# owner = "sourcegraph";
# repo = "sg.nvim";
# rev = "b87f87614357e0a7e6ff888918532ea11e87feb3";
# sha256 = "1xmj05i4bw2cx9d18mm85ynkn29dkngn5090r71wssvan6dm3fb4";
# };
# meta.homepage = "https://github.com/sourcegraph/sg.nvim/";
# };
sg-nvim = inputs.sg-nvim.packages.${system}.default;
}

5
nix/repo/formatter.nix Normal file
View File

@ -0,0 +1,5 @@
{
inputs,
cell,
}:
inputs.nixpkgs.alejandra

View File

@ -0,0 +1,82 @@
# TODO: this should use winnow with a fair matching of supported systems
{
inputs,
cell,
}: let
inherit (cell) home-profiles home-modules;
inherit (inputs) home-manager;
pkgs = inputs.nixpkgs;
# hm is derivation that is compatible with homeConfigurations
home-config = {
supported_systems,
hm,
tested_systems ? [],
}:
hm
// {
_supported_systems = supported_systems;
_tested_systems = tested_systems;
};
base-modules = [
# home-profiles.alacritty
home-modules.alacritty
home-profiles.kitty
home-profiles.git
home-profiles.ssh
home-profiles.shells
{config.programs.home-manager.enable = true;}
# home-profiles.nix-index
home-profiles.neovim
];
in {
homeConfigurations.htran = home-config {
supported_systems = ["aarch64-darwin" "x86_64-darwin"];
tested_systems = ["aarch64-darwin"];
hm = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
base-modules
++ [
home-profiles.darwin-patches
home-profiles.nerd_font_module
home-profiles.git-htran
home-profiles.dev-packages
# home-profiles.zk
home-modules.darwin-spotlight
{
home.username = "htran";
home.homeDirectory = "/Users/htran";
home.stateVersion = "23.11";
}
# home-profiles.passman
];
};
};
homeConfigurations.hungtran = home-config {
supported_systems = ["aarch64-darwin" "x86_64-darwin"];
tested_systems = ["aarch64-darwin"];
hm = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
base-modules
++ [
home-profiles.darwin-patches
home-profiles.nerd_font_module
home-profiles.git-pegasust
home-profiles.dev-packages
# home-profiles.zk
home-modules.darwin-spotlight
{
home.username = "hungtran";
home.homeDirectory = "/Users/hungtran";
home.stateVersion = "23.11";
}
];
};
};
}

View File

@ -0,0 +1,292 @@
# This is an interface for home-profiles and should not contain opinionated
# configurations. It should provide alternative configurations, aggregates
# or new configurations
_imports @ {
inputs,
cell,
}: let
namespace = "repo";
imports = _imports // {inherit namespace;};
in {
git = {
config,
lib,
options,
...
}: let
cfg = config."${namespace}".git;
baseAliases = {
a = "add";
c = "commit";
ca = "commit --amend";
cm = "commit -m";
# lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
# lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all";
sts = "status";
co = "checkout";
b = "branch";
};
default-user = "Pegasust";
default-email = "pegasucksgg@gmail.com";
in {
options."${namespace}".git = {
aliases = lib.mkOption {
type = lib.types.attrs;
default = {};
example = baseAliases;
description = ''
Additional git aliases. This settings comes with base configuration.
Redeclaring the base config will override the values.
''; # TODO: Add baseAliases as string here (builtins.toString doesn't work)
};
name = lib.mkOption {
type = lib.types.str;
default = default-user;
description = "Git username that appears on commits";
example = default-user;
};
email = lib.mkOption {
type = lib.types.str;
default = default-email;
example = default-email;
description = "Git email that appears on commits";
};
ignores = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
".vscode" # vscode settings
".direnv" # .envrc cached outputs
".DS_Store" # MacOS users, amrite
];
description = ''
.gitignore patterns that are applied in every "${namespace}"sitory.
This is useful for IDE-specific settings.
'';
example = [".direnv" "node_modules"];
};
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Enables git
'';
example = false;
};
credentialCacheTimeoutSeconds = lib.mkOption {
type = lib.types.int;
default = 3000;
description = "Credential cache (in-memory store) for Git in seconds.";
example = 3000;
};
};
# TODO : anyway to override configuration?
# idk wtf I was thinking about. there is no context in this question
config.programs.git = {
inherit (cfg) enable ignores;
userName = cfg.name;
userEmail = cfg.email;
aliases = baseAliases // cfg.aliases;
extraConfig = {
# TODO: in the case of darwin, git always open up the built-in keychain.
# possibly something we can't really control since we don't have access to `nix-darwin`
credential.helper = "cache --timeout=${builtins.toString cfg.credentialCacheTimeoutSeconds}";
};
lfs.enable = true;
};
};
alacritty = {
config,
lib,
...
}: let
inherit (inputs.cells.repo.lib) fromYAML;
cfg = config."${namespace}".alacritty;
in {
options."${namespace}".alacritty = {
font.family = lib.mkOption {
type = lib.types.nullOr lib.types.singleLineStr;
default = null;
description = ''
The font family for Alacritty
'';
example = "DroidSansMono NF";
};
font.size = lib.mkOption {
type = lib.types.nullOr lib.types.number;
default = 11.0;
description = ''
The default font size for Alacritty. This is probably measured in px.
'';
example = 7.0;
};
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables alacritty
'';
example = true;
};
config-path = lib.mkOption {
type = lib.types.path;
description = "Path to alacritty yaml";
default = null;
example = "./config/alacritty.yaml";
};
};
config.programs.alacritty = {
enable = cfg.enable;
settings = let
actualConfig =
if cfg.config-path != null
then fromYAML (builtins.readFile cfg.config-path)
else {};
in
lib.recursiveUpdate actualConfig {
font.normal.family = lib.mkIf (cfg.font.family != null) cfg.font.family;
font.size = lib.mkIf (cfg.font.size != null) cfg.font.size;
};
};
};
kitty = {
config,
lib,
# pkgs,
...
}: let
cfg = config."${namespace}".kitty;
in {
options."${namespace}".kitty = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enables kitty";
};
conf = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to kitty.conf. See https://sw.kovidgoyal.net/kitty/conf.html";
example = "../../../native_configs/kitty/kitty.conf";
};
};
config.programs.kitty = {
enable = cfg.enable;
extraConfig = lib.mkIf (cfg.conf != null) (builtins.readFile cfg.conf);
};
};
# TODO: chromium is not really supported on darwin
private_chromium = {
config,
pkgs,
lib,
...
}: let
cfg = config."${namespace}".private_chromium;
in {
options."${namespace}".private_chromium = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
Enable extremely lightweight chromium with vimium plugin
'';
};
};
config = lib.mkIf (cfg.enable) {
# home.packages = [pkgs.ungoogled-chromium];
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
extensions = let
# TODO: how about a chrome extension registry?
mkChromiumExtForVersion = browserVersion: {
id,
sha256,
extVersion,
...
}: {
inherit id;
crxPath = builtins.fetchurl {
url =
"https://clients2.google.com/service/update2/crx"
+ "?response=redirect"
+ "&acceptformat=crx2,crx3"
+ "&prodversion=${browserVersion}"
+ "&x=id%3D${id}%26installsource%3Dondemand%26uc";
name = "${id}.crx";
inherit sha256;
};
version = extVersion;
};
mkChromiumExt = mkChromiumExtForVersion (lib.versions.major pkgs.ungoogled-chromium.version);
in [
# vimium
(mkChromiumExt {
id = "dbepggeogbaibhgnhhndojpepiihcmeb";
sha256 = "00qhbs41gx71q026xaflgwzzridfw1sx3i9yah45cyawv8q7ziic";
extVersion = "1.67.4";
})
];
};
};
};
darwin-spotlight = {
lib,
pkgs,
config,
...
}: {
# This patch exists since Darwin's search bar requires solid apps and not
# symlinked
# TODO: QA
# - [x] works for base case
# - [x] works for repeated case
# - [ ] works after base case, then removed
# - [ ] works for repeated case, then removed
# Copy GUI apps to "~/Applications/Home Manager Apps"
# Based on this comment: https://github.com/nix-community/home-manager/issues/1341#issuecomment-778820334
home.activation.patch-spotlight =
if pkgs.stdenv.isDarwin
then let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in
lib.hm.dag.entryAfter ["linkGeneration"] ''
# Install MacOS applications to the user environment.
HM_APPS="$HOME/Applications/Home Manager Apps"
# Reset current state
if [ -e "$HM_APPS" ]; then
$DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)"
fi
$DRY_RUN_CMD mkdir -p "$HM_APPS"
# .app dirs need to be actual directories for Finder to detect them as Apps.
# In the env of Apps we build, the .apps are symlinks. We pass all of them as
# arguments to cp and make it dereference those using -H
$DRY_RUN_CMD cp --archive -H --dereference ${apps}/Applications/* "$HM_APPS"
$DRY_RUN_CMD chmod +w -R "$HM_APPS"
''
else "";
# We need this in case upstream home-manager changes the behavior of linking
# applications
home.activation.remove-patch-spotlight =
if pkgs.stdenv.isDarwin
then
lib.hm.dag.entryBefore ["checkLinkTargets"] ''
HM_APPS="$HOME/Applications/Home Manager Apps"
# Reset current state
if [ -e "$HM_APPS" ]; then
$DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)"
fi
''
else "";
};
}

View File

@ -0,0 +1,71 @@
{
inputs,
cell,
}: {
rclone-mount = {
config,
lib,
pkgs,
...
}: let
cfg = config.services.rclone;
rcloneCommand = "${pkgs.rclone}/bin/rclone";
inherit (lib) mkEnableOption mkOption types mkIf mapAttrs' nameValuePair;
makeMountService = name: mountCfg: {
Unit = {
Description = "Rclone Mount ${name}";
After = ["network.target"];
};
Service = {
ExecStart = "${rcloneCommand} mount ${mountCfg.remotePath} ${mountCfg.mountPoint}";
Restart = "on-failure";
};
Install = {WantedBy = ["default.target"];};
};
makeLaunchdService = name: mountCfg: {
enable = true;
settings = {
ProgramArguments = ["/bin/sh" "-c" "${rcloneCommand} mount ${mountCfg.remotePath} ${mountCfg.mountPoint}"];
KeepAlive = {
NetworkState = true;
};
};
};
in {
options.services.rclone = {
enable = mkEnableOption "rclone mount service";
mounts = mkOption {
type = types.attrsOf (types.submodule {
options = {
remotePath = mkOption {
type = types.str;
default = "";
description = "The remote path to mount via rclone";
};
mountPoint = mkOption {
type = types.str;
default = "";
description = "The local mount point for the rclone mount";
};
};
});
default = {};
description = "Rclone mounts";
};
};
config = mkIf cfg.enable {
home.packages = [pkgs.rclone];
systemd.user.services = mapAttrs' (n: v: nameValuePair "rclone-mount-${n}" (makeMountService n v)) cfg.mounts;
launchd.user.agents = mapAttrs' (n: v: nameValuePair "rclone-mount-${n}" (makeLaunchdService n v)) cfg.mounts;
};
};
}

View File

@ -18,9 +18,9 @@ in {
}: {
config.fonts.fontconfig.enable = true;
config.home.packages = [
(pkgs.nerdfonts.override {fonts = ["Hack"];})
(pkgs.nerdfonts.override {fonts = ["FiraCode"];})
];
config."${namespace}".alacritty.font.family = "Hack Nerd Font Mono";
config."${namespace}".alacritty.font.family = "FiraCode Nerd Font Mono";
};
secrets = {
@ -67,9 +67,7 @@ in {
config,
lib,
...
}: let
cfg = config."${namespace}".alacritty;
in {
}: {
imports = [
inputs.cells.repo.home-modules.alacritty
];
@ -77,7 +75,21 @@ in {
enable = true;
config-path = "${inputs.self}//native_configs/alacritty/alacritty.yml";
font.size = 11.0;
font.family = "Hack Nerd Font Mono";
font.family = "FiraCode Nerd Font Mono";
};
};
kitty = {
config,
lib,
...
}: {
imports = [
inputs.cells.repo.home-modules.kitty
];
config."${namespace}".kitty = {
enable = true;
conf = "${inputs.self}/native_configs/kitty/kitty.conf";
};
};
@ -139,16 +151,30 @@ in {
'';
example = [".direnv" "node_modules"];
};
plugins = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [
cell.packages.git-plus
];
description = ''
Git plugins are just programs that are exposed to git-custom-command.
Git takes the responsibility to do map it into `git custom-command`
'';
example = ''
[ pkgs.git-filter-repo ]
'';
};
};
# WARNING: This should be completed wtf
config."${namespace}".git = {
inherit (cfg) name email ignores aliases;
enable = true;
config = {
"${namespace}".git = {
inherit (cfg) name email ignores aliases;
enable = true;
};
home.packages = cfg.plugins;
};
};
git-htran = {
imports = [inputs.cells.repo.home-profiles.git];
config."${namespace}".profile.git = {
name = "htran";
email = "htran@egihosting.com";
@ -156,14 +182,15 @@ in {
};
git-pegasust = {
imports = [inputs.cells.repo.home-profiles.git];
config."${namespace}".profile.git = {
email = "pegasucksgg@gmail.com";
name = "pegasust";
};
};
dev-packages = let pkgs = inputs.nixpkgs; in {
dev-packages = let
pkgs = inputs.nixpkgs;
in {
programs.jq.enable = true;
home.packages = [
pkgs.htop
@ -197,4 +224,31 @@ in {
inputs.nixpkgs.zk
];
};
passman = {pkgs}: {
# Bruh, keepassxc on Darwin doesn't contain cli
# On Linux, however, it correctly gives `keepassxc-cli`
home.packages = assert !pkgs.stdenv.isDarwin || throw "kpxc known to have caused sandbox-exec problem"; [
cell.packages.kpxc
];
};
darwin-patches = {
# This should ideally be as empty as possible. Though, home-manager is
# a community-driven project. Things fail to build all the time.
manual.manpages.enable = false;
};
# inspo: https://github.com/NixOS/nixpkgs/blob/0396d3b0fb7f62ddc79a506ad3e6124f01d2ed0a/nixos/modules/rename.nix
rename = {
config,
options,
pkgs,
}: {
imports = let
inherit (pkgs.lib) mkRemovedOptionModule;
in [
(mkRemovedOptionModule ["programs" "nix-index" "enable"] "nix-index seems to not really benefit us")
];
};
}

View File

@ -1,5 +1,5 @@
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory
#
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
# TODO: just install these things, then symlink to mason's bin directory
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
{
@ -12,13 +12,17 @@
config,
...
}: let
inherit (inputs.nixpkgs) system;
# NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace
# and is added to the path after wrapping.
# check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand`
# see: :/--suffix.*PATH
# there should be mentions of additional packages
my_neovim = pkgs.neovim-unwrapped;
inherit (inputs.nixpkgs) system;
# my_neovim = pkgs.neovim-unwrapped;
my_neovim = inputs.neovim-nightly-overlay.packages.${system}.neovim;
# These are added to the wrapper. Which means `which zk` is likely to show only
# within neovim's environment
nvim_pkgs =
[
# pkgs.gccStdenv
@ -28,10 +32,9 @@
pkgs.zk # Zettelkasten (limited support)
pkgs.fd # Required by a Telescope plugin (?)
pkgs.stdenv.cc.cc.lib
pkgs.nil # oxalica's better nix language server
pkgs.nil # oxalica's better nix language server
inputs.nix-boost.packages."${system}".rust4cargo
pkgs.nickel
pkgs.nls
inputs.sg-nvim.packages.${system}.default
pkgs.go # doesn't work, Mason installs from runtime path
@ -81,9 +84,19 @@ in {
# NOTE: this adds path to the wrapped version of neovim
extraPackages = nvim_pkgs;
extraLuaConfig = builtins.readFile "${inputs.self}/native_configs/neovim/init.lua";
/*
* type: (either derivation pluginWithConfigType)
* pluginWithConfigType {
* config: nullOr lines,
* type: enum[],
* optional: (mkType (mkDefault false) bool), # Don't load by default (:packadd)
* plugin: package,
* runtime: (mkType (mkDefault {}) {?})
* }
*/
plugins = let
inherit
(inputs.nixpkgs-latest.legacyPackages.${system}.vimPlugins)
(inputs.nixpkgs-vimplugins.legacyPackages.${system}.vimPlugins)
plenary-nvim
nvim-treesitter
nvim-treesitter-textobjects
@ -104,7 +117,6 @@ in {
nvim-ts-autotag
guess-indent-nvim
harpoon
zk-nvim
luasnip
fidget-nvim
rust-tools-nvim
@ -115,18 +127,23 @@ in {
mason-lspconfig-nvim
mason-nvim
neogit
nlua-nvim
nvim-jqx
nvim-surround
nvim-web-devicons
playground
todo-comments-nvim
comment-nvim
trouble-nvim
vim-dispatch
vim-dispatch-neovim
vim-fugitive
vim-jack-in
nui-nvim
telescope-live-grep-args-nvim
nvim-colorizer-lua
git-worktree-nvim
;
inherit (inputs.cells.dotfiles.packages) sg-nvim;
in [
plenary-nvim
nvim-treesitter.withAllGrammars
@ -147,11 +164,12 @@ in {
nvim-ts-autotag
guess-indent-nvim
harpoon
zk-nvim
luasnip
nvim-treesitter-context
fidget-nvim
rust-tools-nvim
telescope-live-grep-args-nvim
comment-nvim
cmp_luasnip
gitsigns-nvim
@ -160,7 +178,6 @@ in {
mason-lspconfig-nvim
mason-nvim
neogit
nlua-nvim
nvim-jqx
nvim-surround
nvim-web-devicons
@ -170,7 +187,18 @@ in {
vim-dispatch
vim-dispatch-neovim
vim-fugitive
nvim-colorizer-lua
vim-jack-in
{
plugin = sg-nvim;
# NOTE: Wait, this mean the plugin is exclusively lua only since package.cpath is Lua API
config = ''
package.cpath = package.cpath .. ";${sg-nvim}/lib/*.so;${sg-nvim}/lib/*.dylib"
'';
type = "lua";
}
git-worktree-nvim
nui-nvim
];
};
# home.packages = nvim_pkgs;

View File

@ -58,7 +58,7 @@ in {
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
'';
# Colored ls
programs.exa = {
programs.eza = {
enable = true;
enableAliases = true;
};
@ -69,7 +69,7 @@ in {
settings = let
native = builtins.fromTOML (builtins.readFile "${inputs.self}/native_configs/starship/starship.toml");
patch-nix = pkgs.lib.recursiveUpdate native {
# WARNING: home-manager fails on here for some reason. Likely not at the
# WARNING: home-manager fails on here for some reason. Likely not at the
# validation phase (type-checking), but at evaluation phaase (stringify)
# I'm thinking when `settings` are evaluated, it has some sort of
# recursive processing before it gets turned into a toml
@ -88,6 +88,9 @@ in {
enable = true;
enableCompletion = true;
initExtra = cfg.shellInitExtra or "";
shellAliases =
{ }
// (cfg.shellAliases or {});
};
programs.zsh = {
enable = true;
@ -107,8 +110,11 @@ in {
enable = true;
plugins = [
"git" # git command aliases: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git#aliases
"command-not-found" # suggests which package to install; does not support nixos (we have solution already)
"gitignore" # `gi list` -> `gi java >>.gitignore`
# DEPRECATION: potentially smelly plugin with nix
# "command-not-found" # suggests which package to install; does not support nixos (we have solution already)
# DEPRECATION: 0 usage, mostly because I don't have a use for it
# "gitignore" # `gi list` -> `gi java >>.gitignore`
"ripgrep" # adds completion for `rg`
"rust" # compe for rustc/cargo
"poetry" # compe for poetry - Python's cargo
@ -120,6 +126,7 @@ in {
# VI_MODE_SET_CURSOR = true;
# ZVM_VI_ESCAPE_BINDKEY = "";
ZVM_READKEY_ENGINE = "$ZVM_READKEY_ENGINE_NEX";
# lowest possible: 0.004s
ZVM_KEYTIMEOUT = 0.004; # 40ms, or subtly around 25 FPS. I'm a gamer :)
ZVM_ESCAPE_KEYTIMEOUT = 0.004; # 40ms, or subtly around 25 FPS. I'm a gamer :)
};

View File

@ -1,16 +1,20 @@
{ inputs, cell }:
let
{
inputs,
cell,
}: let
namespace = "repo"; # ignore: unused
yamlToJsonDrv = pkgs: yamlContent: outputPath: (pkgs.runCommand
outputPath
{ inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
{
inherit yamlContent;
nativeBuildInputs = [pkgs.yq];
}
# run yq which outputs '.' (no filter) on file at yamlPath
# note that $out is passed onto the bash/sh script for execution
''
echo "$yamlContent" | yq >$out
'');
in
{
in {
fromYAML = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv inputs.nixpkgs yamlContent "fromYaml.json"));
}

30
nix/repo/nixConfig.nix Normal file
View File

@ -0,0 +1,30 @@
{
inputs,
cell,
}: let
# decorator for now, for data collecting :)
nix-conf = a: a;
in {
"htran@mbp" = nix-conf ''
accept-flake-config = true
experimental-features = nix-command flakes
post-build-hook = /etc/nix/upload-to-cache.sh
trusted-users = root htran hungtran hwtr
max-jobs = 8
cores = 12
# default is true for Linux, false for every one else
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-sandbox
sandbox = true
'';
"hungtran@mba-m2" = nix-conf ''
accept-flake-config = true
experimental-features = nix-command flakes
post-build-hook = /etc/nix/upload-to-cache.sh
trusted-users = root htran hungtran hwtr
max-jobs = 7
cores = 8
# default is true for Linux, false for every one else
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-sandbox
sandbox = true
'';
}

View File

@ -0,0 +1,82 @@
{
inputs,
cell,
}: let
pkgs = inputs.nixpkgs;
in {
inherit (inputs.cells.dotfiles.packages) kpcli-py;
kpxc = let
inherit (pkgs) keepassxc;
in
if pkgs.stdenv.isDarwin
then
pkgs.stdenv.mkDerivation {
pname = "keepassxc-darwin";
version = keepassxc.version;
phases = ["installPhase"];
installPhase = ''
mkdir -p $out/bin
cp -r ${keepassxc}/* $out/
${
if pkgs.stdenv.hostPlatform.isDarwin
then ''
for exe in $(find $out/Applications/KeePassXC.app/Contents/MacOS/ -type f -executable); do
exe_name=$(basename $exe)
ln -s $exe $out/bin/$exe_name
done
''
else ""
}
'';
meta =
keepassxc.meta
// {
description = "Wrapper for keepassxc and keepassxc-cli with additional Darwin-specific fixes";
};
}
else keepassxc;
pixi-edit = inputs.cells.dev.packages.pixi-edit;
nil = inputs.nixpkgs.nil;
git-plus = pkgs.symlinkJoin {
name = "pegasust-git-plus";
paths = [
(pkgs.writeShellScriptBin "git-lola" ''
git log --graph --decorate --color=always --abbrev-commit --all\
--pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' |
while IFS= read -r line; do
# Format the relative time
line=$(echo "$line" | sed -e 's/ minute/ min/' \
-e 's/ week/ wk/' \
-e 's/ hour/ hr/' \
-e 's/ month/ mo/' \
-e 's/ year/ yr/' \
-e 's/ ago//')
# Print the formatted line
echo "$line"
done | less -R
'')
(pkgs.writeShellScriptBin "git-lol" ''
git log --graph --decorate --color=always --abbrev-commit \
--pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' |
while IFS= read -r line; do
# Format the relative time
line=$(echo "$line" | sed -e 's/ minute/ min/' \
-e 's/ week/ wk/' \
-e 's/ hour/ hr/' \
-e 's/ month/ mo/' \
-e 's/ year/ yr/' \
-e 's/ ago//')
# Print the formatted line
echo "$line"
done | less -R
'')
];
};
}

View File

@ -1,20 +0,0 @@
Copyright (c) 2020-2021 Eelco Dolstra and the flake-compat contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,29 +0,0 @@
# flake-compat
## Usage
To use, add the following to your `flake.nix`:
```nix
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
```
Afterwards, create a `default.nix` file containing the following:
```nix
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
```
If you would like a `shell.nix` file, create one containing the above, replacing `defaultNix` with `shellNix`.

View File

@ -1,301 +0,0 @@
# Compatibility function to allow flakes to be used by
# non-flake-enabled Nix versions. Given a source tree containing a
# 'flake.nix' and 'flake.lock' file, it fetches the flake inputs and
# calls the flake's 'outputs' function. It then returns an attrset
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
# (to be used in 'shell.nix').
{
src,
system ? builtins.currentSystem or "unknown-system",
}: let
lockFilePath = src + "/flake.lock";
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
fetchTree = info:
if info.type == "github"
then {
outPath =
fetchTarball
(
{url = "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}";}
// (
if info ? narHash
then {sha256 = info.narHash;}
else {}
)
);
rev = info.rev;
shortRev = builtins.substring 0 7 info.rev;
lastModified = info.lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
}
else if info.type == "git"
then
{
outPath =
builtins.fetchGit
(
{url = info.url;}
// (
if info ? rev
then {inherit (info) rev;}
else {}
)
// (
if info ? ref
then {inherit (info) ref;}
else {}
)
// (
if info ? submodules
then {inherit (info) submodules;}
else {}
)
);
lastModified = info.lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
}
// (
if info ? rev
then {
rev = info.rev;
shortRev = builtins.substring 0 7 info.rev;
}
else {}
)
else if info.type == "path"
then {
outPath = builtins.path {
path =
if builtins.substring 0 1 info.path != "/"
then src + ("/" + info.path) # make this absolute path by prepending ./
else info.path; # it's already an absolute path
};
narHash = info.narHash;
}
else if info.type == "tarball"
then {
outPath =
fetchTarball
(
{inherit (info) url;}
// (
if info ? narHash
then {sha256 = info.narHash;}
else {}
)
);
}
else if info.type == "gitlab"
then {
inherit (info) rev narHash lastModified;
outPath =
fetchTarball
(
{url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}";}
// (
if info ? narHash
then {sha256 = info.narHash;}
else {}
)
);
shortRev = builtins.substring 0 7 info.rev;
}
else
# FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${info.type}'";
callFlake4 = flakeSrc: locks: let
flake = import (flakeSrc + "/flake.nix");
inputs =
builtins.mapAttrs
(n: v:
if v.flake or true
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
else fetchTree (v.locked // v.info))
locks;
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
in
assert flake.edition == 201909; outputs;
callLocklessFlake = flakeSrc: let
flake = import (flakeSrc + "/flake.nix");
outputs = flakeSrc // (flake.outputs {self = outputs;});
in
outputs;
rootSrc = let
# Try to clean the source tree by using fetchGit, if this source
# tree is a valid git repository.
tryFetchGit = src:
if isGit && !isShallow
then let
res = builtins.fetchGit src;
in
if res.rev == "0000000000000000000000000000000000000000"
then removeAttrs res ["rev" "shortRev"]
else res
else {outPath = src;};
# NB git worktrees have a file for .git, so we don't check the type of .git
isGit = builtins.pathExists (src + "/.git");
isShallow = builtins.pathExists (src + "/.git/shallow");
in
{
lastModified = 0;
lastModifiedDate = formatSecondsSinceEpoch 0;
}
// (
if src ? outPath
then src
else tryFetchGit src
);
# Format number of seconds in the Unix epoch as %Y%m%d%H%M%S.
formatSecondsSinceEpoch = t: let
rem = x: y: x - x / y * y;
days = t / 86400;
secondsInDay = rem t 86400;
hours = secondsInDay / 3600;
minutes = (rem secondsInDay 3600) / 60;
seconds = rem t 60;
# Courtesy of https://stackoverflow.com/a/32158604.
z = days + 719468;
era =
(
if z >= 0
then z
else z - 146096
)
/ 146097;
doe = z - era * 146097;
yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
y = yoe + era * 400;
doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
mp = (5 * doy + 2) / 153;
d = doy - (153 * mp + 2) / 5 + 1;
m =
mp
+ (
if mp < 10
then 3
else -9
);
y' =
y
+ (
if m <= 2
then 1
else 0
);
pad = s:
if builtins.stringLength s < 2
then "0" + s
else s;
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
allNodes =
builtins.mapAttrs
(
key: node: let
sourceInfo =
if key == lockFile.root
then rootSrc
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
subdir =
if key == lockFile.root
then ""
else node.locked.dir or "";
flake = import (sourceInfo
+ (
if subdir != ""
then "/"
else ""
)
+ subdir
+ "/flake.nix");
inputs =
builtins.mapAttrs
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
(node.inputs or {});
# Resolve a input spec into a node name. An input spec is
# either a node name, or a 'follows' path from the root
# node.
resolveInput = inputSpec:
if builtins.isList inputSpec
then getInputByPath lockFile.root inputSpec
else inputSpec;
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
# root node, returning the final node.
getInputByPath = nodeName: path:
if path == []
then nodeName
else
getInputByPath
# Since this could be a 'follows' input, call resolveInput.
(resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
(builtins.tail path);
outputs = flake.outputs (inputs // {self = result;});
result =
outputs
// sourceInfo
// {
inherit inputs;
inherit outputs;
inherit sourceInfo;
};
in
if node.flake or true
then assert builtins.isFunction flake.outputs; result
else sourceInfo
)
lockFile.nodes;
result =
if !(builtins.pathExists lockFilePath)
then callLocklessFlake rootSrc
else if lockFile.version == 4
then callFlake4 rootSrc (lockFile.inputs)
else if lockFile.version >= 5 && lockFile.version <= 7
then allNodes.${lockFile.root}
else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
in rec {
defaultNix =
(builtins.removeAttrs result ["__functor"])
// (
if result ? defaultPackage.${system}
then {default = result.defaultPackage.${system};}
else {}
)
// (
if result ? packages.${system}.default
then {default = result.packages.${system}.default;}
else {}
);
shellNix =
defaultNix
// (
if result ? devShell.${system}
then {default = result.devShell.${system};}
else {}
)
// (
if result ? devShells.${system}.default
then {default = result.devShells.${system}.default;}
else {}
);
}

View File

@ -1,19 +0,0 @@
name: Test
on: [ push, pull_request ]
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.2
- uses: cachix/install-nix-action@v17
- uses: cachix/cachix-action@v10
with:
name: guibou
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build all
run: nix-build all.nix

View File

@ -1,248 +0,0 @@
# NixGL
NixGL solve the "OpenGL" problem with [nix](https://nixos.org/nix/). It works with all mesa drivers (Intel cards and "free" version for Nvidia or AMD cards), Nvidia proprietary drivers, and even with hybrid configuration via bumblebee. It works for Vulkan programs too.
# Motivation
Using Nix on non-NixOS distros, it's common to see GL application errors:
```bash
$ program
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
```
NixGL provides a set of wrappers able to launch GL or Vulkan applications:
```bash
$ nixGL program
$ nixVulkan program
```
# Installation
## nix-channel (Recommended)
To get started,
```bash
$ nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update
$ nix-env -iA nixgl.auto.nixGLDefault # or replace `nixGLDefault` with your desired wrapper
```
Many wrappers are available, depending on your hardware and the graphical API you want to use (i.e. Vulkan or OpenGL). You may want to install a few of them, for example if you want to support OpenGL and Vulkan on a laptop with an hybrid configuration.
OpenGL wrappers:
- `auto.nixGLDefault`: Tries to auto-detect and install Nvidia, if not, fallback to mesa. Recommended. Invoke with `nixGL program`.
- `auto.nixGLNvidia`: Proprietary Nvidia driver (auto detection of version)
- `auto.nixGLNvidiaBumblebee`: Proprietary Nvidia driver on hybrid hardware (auto detection).
- `nixGLIntel`: Mesa OpenGL implementation (intel, amd, nouveau, ...).
Vulkan wrappers:
- `auto.nixVulkanNvidia`: Proprietary Nvidia driver (auto detection).
- `nixVulkanIntel`: Mesa Vulkan implementation.
The Vulkan wrapper also sets `VK_LAYER_PATH` the validation layers in the nix store.
## Flakes
### Directly run nixGL
You need to specify the same version of `nixpkgs` that your `program` is using. For example, replace `nixos-21.11` with `nixos-21.05`.
```sh
nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:guibou/nixGL -- program
```
If you use the default `nixpkgs` channel (i.e. `nixpkgs-unstable`), you can ommit those arguments like so:
```sh
nix run --impure github:guibou/nixGL -- program
```
You can also specify which wrapper to use instead of using the default auto detection:
```sh
nix run github:guibou/nixGL#nixGLIntel -- program
```
This will result in a lighter download and execution time. Also, this evaluation is pure.
#### Error about experimental features
You can directly use:
```sh
nix --extra-experimental-features "nix-command flakes" run --impure github:guibou/nixGL -- program
```
Or set the appropriate conf in `~/.config/nix/nix.conf` / `/etc/nix/nix.conf` / `nix.extraOptions`.
#### Error with GLIBC version
if you get errors with messages similar to
```
/nix/store/g02b1lpbddhymmcjb923kf0l7s9nww58-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/hrl51nkr7dszlwcs29wmyxq0jsqlaszn-libglvnd-1.4.0/lib/libGLX.so.0)
```
It means that there's a mismatch between the versions of `nixpkgs` used by `nixGL` and `program`.
### Use an overlay
Add nixGL as a flake input:
```Nix
{
inputs = {
nixgl.url = "github:guibou/nixGL";
};
outputs = { nixgl, ... }: { };
}
```
Then, use the flake's `overlay` attr:
```Nix
{
outputs = { nixgl, nixpkgs, ... }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ nixgl.overlay ];
};
in
# You can now reference pkgs.nixgl.nixGLIntel, etc.
{ }
}
```
## Installation from source
```bash
$ git clone https://github.com/guibou/nixGL
$ cd nixGL
$ nix-env -f ./ -iA <your desired wrapper name>
```
# Usage
Just launch the program you want prefixed by the right wrapper.
For example, for OpenGL programs:
```bash
$ nixGL program args # For the `nixGLDefault` wrapper, recommended.
$ nixGLNvidia program args
$ nixGLIntel program args
$ nixGLNvidiaBumblebee program args
```
For Vulkan programs:
```bash
$ nixVulkanNvidia program args
$ nixVulkanIntel program args
```
# OpenGL - Hybrid Intel + Nvidia laptop
After installing `nixGLIntel` and `nixGLNvidiaBumblebee`.
```bash
$ nixGLIntel $(nix run nixpkgs.glxinfo -c glxinfo) | grep -i 'OpenGL version string'
OpenGL version string: 3.0 Mesa 17.3.3
$ nixGLNvidiaBumblebee $(nix run nixpkgs.glxinfo -c glxinfo) | grep -i 'OpenGL version string'
OpenGL version string: 4.6.0 NVIDIA 390.25
```
If the program you'd like to run is already installed by nix in your current environment, you can simply run it with the wrapper, for example:
```bash
$ nixGLIntel blender
```
# Vulkan - Intel GPU
After installing `nixVulkanIntel`.
```bash
$ sudo apt install mesa-vulkan-drivers
...
$ nixVulkanIntel $(nix-build '<nixpkgs>' --no-out-link -A vulkan-tools)/bin/vulkaninfo | grep VkPhysicalDeviceProperties -A 7
VkPhysicalDeviceProperties:
===========================
apiVersion = 0x400036 (1.0.54)
driverVersion = 71311368 (0x4402008)
vendorID = 0x8086
deviceID = 0x591b
deviceType = INTEGRATED_GPU
deviceName = Intel(R) HD Graphics 630 (Kaby Lake GT2)
```
# Troubleshooting
## Nvidia auto detection does not work
```bash
building '/nix/store/ijs5h6h07faai0k74diiy5b2xlxh891g-auto-detect-nvidia.drv'...
pcregrep: Failed to open /proc/driver/nvidia/version: No such file or directory
builder for '/nix/store/ijs5h6h07faai0k74diiy5b2xlxh891g-auto-detect-nvidia.drv' failed with exit code 2
error: build of '/nix/store/ijs5h6h07faai0k74diiy5b2xlxh891g-auto-detect-nvidia.drv' faile
```
You can run the Nvidia installer using an explicit version string instead of the automatic detection method:
```bash
nix-build -A auto.nixGLNvidia --argstr nvidiaVersion 440.82
```
(or `nixGLNvidiaBumblebee`, `nixVulkanNividia`)
The version of your driver can be found using `glxinfo` from your system default package manager, or `nvidia-settings`.
## On nixOS
`nixGL` can also be used on nixOS if the system is installed with a different
nixpkgs clone than the one your application are installed with. Override the
`pkgs` argument of the script with the correct nixpkgs clone:
```bash
nix-build ./default.nix -A nixGLIntel --arg pkgs "import path_to_your_nixpkgs {}".
```
## Old nvidia drivers
Users of Nvidia legacy driver should use the `backport/noGLVND` branch. This branch is not tested and may not work well, please open a bug report, it will be taken care of as soon as possible.
# `nixGLCommon`
`nixGLCommon nixGLXXX` can be used to get `nixGL` executable which fallback to `nixGLXXX`. It is a shorter name for people with only one OpenGL configuration.
For example:
```
nix-build -E "with import ./default.nix {}; nixGLCommon nixGLIntel"
```
# Limitations
`nixGL` is badly tested, mostly because it is difficult to test automatically in a continuous integration context because you need access to different type of hardware.
Some OpenGL configurations may not work, for example AMD proprietary drivers. There is no fundamental limitation, so if you want support for theses configurations, open an issue.
# Hacking
One great way to contribute to nixGL is to run the test suite. Just run
`./Test.hs` in the main directory and check that all the test relevant to your
hardware are green.

View File

@ -1,110 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages(p: with p; [hspec process])" -p nix
{-# LANGUAGE OverloadedStrings #-}
import Test.Hspec
import System.Process
import qualified Data.Text as Text
import Data.Text (Text)
import Control.Monad.IO.Class (liftIO)
import Data.List (find)
-- nixos-19-09 is used so hopefully it will have a different libc than
-- the current `<nixpkgs>` used in a current nixOS system, so it will trigger the
-- driver failure.
-- Run `./Test.hs --match "/Sanity/"` to ensure that non wrapped
-- binaries fails on NixOS.
currentChannel = "channel:nixos-19.09-small"
-- | Utils function: run a command and returns its output.
processOutput p args = Text.strip . Text.pack <$> readCreateProcess ((proc (Text.unpack p) (Text.unpack <$> args)) { std_err = Inherit }) ""
-- * OpenGL
-- | Returns the path to the nixGLXXX binary.
getNixGLBin version = (<>("/bin/"<>version)) <$> processOutput "nix-build" ["./", "-A", version, "-I", "nixpkgs=" <> currentChannel]
-- | Returns the vendor string associated with a glxinfo wrapped by a nixGL.
getVendorString io = do
output <- Text.lines <$> io
pure $ Text.unpack <$> find ("OpenGL version string"`Text.isPrefixOf`) output
-- | Checks that a nixGL wrapper works with glxinfo 32 & 64 bits.
checkOpenGL_32_64 glxinfo32 glxinfo64 vendorName nixGLName = do
beforeAll (getNixGLBin nixGLName) $ do
it "32 bits" $ \nixGLBin -> do
Just vendorString <- getVendorString (processOutput nixGLBin [glxinfo32, "-B"])
vendorString `shouldContain` vendorName
it "64 bits" $ \nixGLBin -> do
Just vendorString <- getVendorString (processOutput nixGLBin [glxinfo64, "-B"])
vendorString `shouldContain` vendorName
-- * Vulkan
-- | Heuristic to detect if vulkan work. `driverName` must appears in the output
checkVulkanIsWorking io = do
res <- io
res `shouldSatisfy` ("driverName"`Text.isInfixOf`)
-- | Checks that a nixGL wrapper works with glxinfo 32 & 64 bits.
checkVulkan_32_64 vulkaninfo32 vulkaninfo64 vendorName nixGLName = do
beforeAll (getNixGLBin nixGLName) $ do
it "32 bits" $ \nixGLBin -> do
checkVulkanIsWorking (processOutput nixGLBin [vulkaninfo32])
it "64 bits" $ \nixGLBin -> do
checkVulkanIsWorking (processOutput nixGLBin [vulkaninfo64])
main = do
putStrLn "Running tests for nixGL"
putStrLn "It can take a while, this will build and test all drivers in the background"
glxinfo64 <- (<>"/bin/glxinfo") <$> processOutput "nix-build" [currentChannel, "-A", "glxinfo"]
glxinfo32 <- (<>"/bin/glxinfo") <$> processOutput "nix-build" [currentChannel, "-A", "pkgsi686Linux.glxinfo"]
vulkaninfo64 <- (<>"/bin/vulkaninfo") <$> processOutput "nix-build" [currentChannel, "-A", "vulkan-tools"]
vulkaninfo32 <- (<>"/bin/vulkaninfo") <$> processOutput "nix-build" [currentChannel, "-A", "pkgsi686Linux.vulkan-tools"]
let checkOpenGL = checkOpenGL_32_64 glxinfo32 glxinfo64
checkVulkan = checkVulkan_32_64 vulkaninfo32 vulkaninfo64
hspec $ do
-- This category ensure that tests are failing if not run with nixGL
-- This allows testing on nixOS
describe "Sanity" $ do
describe "OpenGL" $ do
it "fails with unwrapped glxinfo64" $ do
vendorString <- getVendorString (processOutput glxinfo64 ["-B"])
vendorString `shouldBe` Nothing
it "fails with unwrapped glxinfo32" $ do
vendorString <- getVendorString (processOutput glxinfo32 ["-B"])
vendorString `shouldBe` Nothing
describe "Vulkan" $ do
it "fails with unwrapped vulkaninfo64" $ do
processOutput vulkaninfo64 [] `shouldThrow` anyIOException
it "fails with unwrapped vulkaninfo32" $ do
processOutput vulkaninfo32 [] `shouldThrow` anyIOException
describe "NixGL" $ do
describe "Mesa" $ do
describe "OpenGL" $ do
checkOpenGL "Mesa" "nixGLIntel"
describe "Vulkan" $ do
checkVulkan "Mesa" "nixVulkanIntel"
describe "Nvidia - Bumblebee" $ do
describe "OpenGL" $ do
checkOpenGL "NVIDIA" "nixGLNvidiaBumblebee"
xdescribe "Vulkan" $ do
-- Not tested: I don't have the hardware (@guibou)
checkVulkan "NVIDIA" "nixVulkanNvidiaBumblebee"
-- TODO: check Nvidia (I don't have this hardware)
describe "Nvidia" $ do
describe "OpenGL" $ do
checkOpenGL "NVIDIA" "nixGLNvidia"
describe "Vulkan" $ do
checkVulkan "NVIDIA" "nixVulkanNvidia"

View File

@ -1,25 +0,0 @@
let
pkgs = import ./nixpkgs.nix {config = {allowUnfree = true;};};
pure = pkgs.recurseIntoAttrs (pkgs.callPackage ./nixGL.nix {
nvidiaVersion = "440.82";
nvidiaHash = "edd415acf2f75a659e0f3b4f27c1fab770cf21614e84a18152d94f0d004a758e";
});
versionFile440 = pkgs.callPackage ./nixGL.nix {
nvidiaVersionFile = pkgs.writeText "nvidia-version-440.82" ''
NVRM version: NVIDIA UNIX x86_64 Kernel Module 440.82 Wed Apr 1 20:04:33 UTC 2020
GCC version: gcc version 9.3.0 (Arch Linux 9.3.0-1)
'';
};
versionFile510 = pkgs.callPackage ./nixGL.nix {
nvidiaVersionFile = pkgs.writeText "nvidia-version-510.54" ''
NVRM version: NVIDIA UNIX x86_64 Kernel Module 510.54 Wed Apr 1 20:04:33 UTC 2020
GCC version: gcc version 9.3.0 (Arch Linux 9.3.0-1)
'';
};
in
(with pure; [nixGLIntel nixVulkanNvidia nixGLNvidia nixVulkanIntel])
++ (with versionFile440.auto; [nixGLNvidia nixGLDefault nixVulkanNvidia])
++ (with versionFile510.auto; [nixGLNvidia nixGLDefault nixVulkanNvidia])

View File

@ -1,41 +0,0 @@
{
## Nvidia informations.
# Version of the system kernel module. Let it to null to enable auto-detection.
nvidiaVersion ? null,
# Hash of the Nvidia driver .run file. null is fine, but fixing a value here
# will be more reproducible and more efficient.
nvidiaHash ? null,
# Alternatively, you can pass a path that points to a nvidia version file
# and let nixGL extract the version from it. That file must be a copy of
# /proc/driver/nvidia/version. Nix doesn't like zero-sized files (see
# https://github.com/NixOS/nix/issues/3539 ).
nvidiaVersionFile ? null,
# Enable 32 bits driver
# This is on by default, you can switch it to off if you want to reduce a
# bit the size of nixGL closure.
enable32bits ? true,
# Make sure to enable config.allowUnfree to the instance of nixpkgs to be
# able to access the nvidia drivers.
pkgs ?
import <nixpkgs> {
config = {allowUnfree = true;};
},
# Enable all Intel specific extensions which only works on x86_64
enableIntelX86Extensions ? true,
}:
pkgs.callPackage ./nixGL.nix ({
inherit
nvidiaVersion
nvidiaVersionFile
nvidiaHash
enable32bits
;
}
// (
if enableIntelX86Extensions
then {}
else {
intel-media-driver = null;
vaapiIntel = null;
}
))

View File

@ -1,81 +0,0 @@
#!/usr/bin/env python3
# execution: fetch.py >nvidia_versions.json
import http.client
import json
import sys
NV_FREE_X86_URL = "download.nvidia.com"
POTENTIAL_SHA256_EXTS = [".sha256sum", ".sha256"]
RIGHT_PAD = " " * 20
conn = http.client.HTTPSConnection(NV_FREE_X86_URL)
conn.request("GET", "/XFree86/Linux-x86_64/")
response = conn.getresponse()
dir_html = response.read()
assert (response.status < 400), "Error occurred fetching for source from"
def scrape_driver_versions(dir_html: bytes):
# The idea is to recursively follows all interesting `src` from `<a href={src}>`
def _rec(dir_html: bytes, href_url_start: int = 0, so_far: list[str] = []) -> list[str]:
MATCH_START = b"<span class=\'dir\'><a href=\'"
href_url_start = dir_html.find(MATCH_START, href_url_start)
if href_url_start == -1: # EOF
return so_far
# version href should start with a number
potential_version_start = href_url_start + len(MATCH_START)
p = potential_version_start
if not (dir_html[p: p+1].decode().isnumeric()):
return _rec(dir_html, potential_version_start, so_far)
version_end = dir_html.find(b"/", potential_version_start)
assert version_end != -1, "Should have end-signaling /"
so_far.append(dir_html[potential_version_start:version_end].decode())
return _rec(dir_html, version_end, so_far)
versions = _rec(dir_html, 0, [])
num_versions = len(versions)
for i, version in enumerate(versions):
print(f"[{i+1}/{num_versions}] Processing version {version}{RIGHT_PAD}", end="\r", file=sys.stderr)
yield version
print()
versions = scrape_driver_versions(dir_html)
download_urls_of = lambda ver: [f"/XFree86/Linux-x86_64/{ver}/NVIDIA-Linux-x86_64-{ver}.run"]
sha256_urls_of = lambda ver: [
f"{url}{dl_ext}"
for dl_ext in POTENTIAL_SHA256_EXTS
for url in download_urls_of(ver)
]
def sha256_of(version: str) -> str | None:
if int(version.split(".")[0]) < 256:
# Has 3 different packages that we should probably not bother
return None
for url in sha256_urls_of(version):
conn = http.client.HTTPSConnection(NV_FREE_X86_URL)
conn.request("GET", url)
response = conn.getresponse()
if response.status < 400:
return response.read().decode().split()[0]
print(f"No sha256 for {version}{RIGHT_PAD}", file=sys.stderr)
return None
def fetch(version: str):
dl_url = download_urls_of(version)[0]
sha256 = sha256_of(version)
return (version, dl_url, sha256)
fetch_data = [fetch(v) for v in versions]
fetch_data.append(("latest", *fetch_data[-1][1:]))
# now print the JSON object
print(json.dumps({
version: {
"url": f"https://{NV_FREE_X86_URL}{dl_url}",
"sha256": sha256
} for (version, dl_url, sha256) in fetch_data if sha256 is not None}, indent=4))

View File

@ -1,42 +0,0 @@
{
"nodes": {
"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"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,49 +0,0 @@
{
description = "A wrapper tool for nix OpenGL applications";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
outputs = {
self,
nixpkgs,
flake-utils,
}:
(flake-utils.lib.eachDefaultSystem (system: let
isIntelX86Platform = system == "x86_64-linux";
nix_pkgs = import nixpkgs {inherit system;};
pkgs = import ./default.nix {
pkgs = nix_pkgs;
enable32bits = isIntelX86Platform;
enableIntelX86Extensions = isIntelX86Platform;
};
in rec {
packages = {
# makes it easy to use "nix run nixGL --impure -- program"
default = pkgs.auto.nixGLDefault;
nixGLDefault = pkgs.auto.nixGLDefault;
nixGLNvidia = pkgs.auto.nixGLNvidia;
nixGLNvidiaBumblebee = pkgs.auto.nixGLNvidiaBumblebee;
nixGLIntel = pkgs.nixGLIntel;
nixVulkanNvidia = pkgs.auto.nixVulkanNvidia;
nixVulkanIntel = pkgs.nixVulkanIntel;
};
# deprecated attributes for retro compatibility
defaultPackage = packages;
}))
// rec {
# deprecated attributes for retro compatibility
overlay = overlays.default;
overlays.default = final: _: let
isIntelX86Platform = final.system == "x86_64-linux";
in {
nixgl = import ./default.nix {
pkgs = final;
enable32bits = isIntelX86Platform;
enableIntelX86Extensions = isIntelX86Platform;
};
};
};
}

View File

@ -1,293 +0,0 @@
{
# # Nvidia informations.
# Version of the system kernel module. Let it to null to enable auto-detection.
nvidiaVersion ? null,
# Hash of the Nvidia driver .run file. null is fine, but fixing a value here
# will be more reproducible and more efficient.
nvidiaHash ? null,
# Alternatively, you can pass a path that points to a nvidia version file
# and let nixGL extract the version from it. That file must be a copy of
# /proc/driver/nvidia/version. Nix doesn't like zero-sized files (see
# https://github.com/NixOS/nix/issues/3539 ).
nvidiaVersionFile ? null,
# Enable 32 bits driver
# This is one by default, you can switch it to off if you want to reduce a
# bit the size of nixGL closure.
enable32bits ? true,
writeTextFile,
shellcheck,
pcre,
runCommand,
linuxPackages,
fetchurl,
lib,
runtimeShell,
bumblebee,
libglvnd,
vulkan-validation-layers,
mesa,
libvdpau-va-gl,
intel-media-driver,
vaapiIntel,
pkgsi686Linux,
driversi686Linux,
zlib,
libdrm,
xorg,
wayland,
gcc,
}: let
writeExecutable = {
name,
text,
}:
writeTextFile {
inherit name text;
executable = true;
destination = "/bin/${name}";
checkPhase = ''
${shellcheck}/bin/shellcheck "$out/bin/${name}"
# Check that all the files listed in the output binary exists
for i in $(${pcre}/bin/pcregrep -o0 '/nix/store/.*?/[^ ":]+' $out/bin/${name})
do
ls $i > /dev/null || (echo "File $i, referenced in $out/bin/${name} does not exists."; exit -1)
done
'';
};
fetch_db = builtins.fromJSON (builtins.readFile ./nvidia_versions.json);
top = rec {
/*
It contains the builder for different nvidia configuration, parametrized by
the version of the driver and sha256 sum of the driver installer file.
*/
nvidiaPackages = {
version,
sha256 ? fetch_db."${version}".sha256,
}: let
nvidiaDrivers =
(linuxPackages.nvidia_x11.override {}).overrideAttrs
(oldAttrs: {
pname = "nvidia";
name = "nvidia-x11-${version}-nixGL";
inherit version;
src = let
url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}.run";
in
fetchurl {inherit url sha256;};
useGLVND = true;
});
nvidiaLibsOnly = nvidiaDrivers.override {
libsOnly = true;
kernel = null;
};
nixNvidiaWrapper = api:
writeExecutable {
name = "nix${api}Nvidia-${version}";
text = ''
#!${runtimeShell}
${lib.optionalString (api == "Vulkan")
"export VK_LAYER_PATH=${vulkan-validation-layers}/share/vulkan/explicit_layer.d"}
NVIDIA_JSON=(${nvidiaLibsOnly}/share/glvnd/egl_vendor.d/*nvidia.json)
${lib.optionalString enable32bits "NVIDIA_JSON32=(${nvidiaLibsOnly.lib32}/share/glvnd/egl_vendor.d/*nvidia.json)"}
${''export __EGL_VENDOR_LIBRARY_FILENAMES=''${NVIDIA_JSON[*]}${
lib.optionalString enable32bits
'':''${NVIDIA_JSON32[*]}''
}"''${__EGL_VENDOR_LIBRARY_FILENAMES:+:$__EGL_VENDOR_LIBRARY_FILENAMES}"''}
${
lib.optionalString (api == "Vulkan")
''export VK_ICD_FILENAMES=${nvidiaLibsOnly}/share/vulkan/icd.d/nvidia_icd.json${
lib.optionalString enable32bits
":${nvidiaLibsOnly.lib32}/share/vulkan/icd.d/nvidia_icd.json"
}"''${VK_ICD_FILENAMES:+:$VK_ICD_FILENAMES}"''
}
export LD_LIBRARY_PATH=${
lib.makeLibraryPath ([libglvnd nvidiaLibsOnly]
++ lib.optional (api == "Vulkan") vulkan-validation-layers
++ lib.optionals enable32bits [
nvidiaLibsOnly.lib32
pkgsi686Linux.libglvnd
])
}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$@"
'';
};
in {
inherit nvidiaDrivers nvidiaLibsOnly;
nixGLNvidiaBumblebee = writeExecutable {
name = "nixGLNvidiaBumblebee-${version}";
text = ''
#!${runtimeShell}
export LD_LIBRARY_PATH=${
lib.makeLibraryPath [nvidiaDrivers]
}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
${
bumblebee.override {
nvidia_x11 = nvidiaDrivers;
nvidia_x11_i686 = nvidiaDrivers.lib32;
}
}/bin/optirun --ldpath ${
lib.makeLibraryPath ([libglvnd nvidiaDrivers]
++ lib.optionals enable32bits [
nvidiaDrivers.lib32
pkgsi686Linux.libglvnd
])
} "$@"
'';
};
# TODO: 32bit version? Not tested.
inherit nixNvidiaWrapper;
# TODO: 32bit version? Not tested.
nixGLNvidia = nixNvidiaWrapper "GL";
# TODO: 32bit version? Not tested.
nixVulkanNvidia = nixNvidiaWrapper "Vulkan";
};
nixGLIntel = writeExecutable {
name = "nixGLIntel";
# add the 32 bits drivers if needed
text = let
mesa-drivers =
[mesa.drivers]
++ lib.optional enable32bits pkgsi686Linux.mesa.drivers;
intel-driver =
[intel-media-driver vaapiIntel]
# Note: intel-media-driver is disabled for i686 until https://github.com/NixOS/nixpkgs/issues/140471 is fixed
++ lib.optionals enable32bits [
/*
pkgsi686Linux.intel-media-driver
*/
driversi686Linux.vaapiIntel
];
libvdpau =
[libvdpau-va-gl]
++ lib.optional enable32bits pkgsi686Linux.libvdpau-va-gl;
glxindirect = runCommand "mesa_glxindirect" {} ''
mkdir -p $out/lib
ln -s ${mesa.drivers}/lib/libGLX_mesa.so.0 $out/lib/libGLX_indirect.so.0
'';
in ''
#!${runtimeShell}
export LIBGL_DRIVERS_PATH=${lib.makeSearchPathOutput "lib" "lib/dri" mesa-drivers}
export LIBVA_DRIVERS_PATH=${lib.makeSearchPathOutput "out" "lib/dri" intel-driver}
${''export __EGL_VENDOR_LIBRARY_FILENAMES=${mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json${
lib.optionalString enable32bits
":${pkgsi686Linux.mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json"
}"''${__EGL_VENDOR_LIBRARY_FILENAMES:+:$__EGL_VENDOR_LIBRARY_FILENAMES}"''}
export LD_LIBRARY_PATH=${lib.makeLibraryPath mesa-drivers}:${lib.makeSearchPathOutput "lib" "lib/vdpau" libvdpau}:${glxindirect}/lib:${lib.makeLibraryPath [libglvnd]}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$@"
'';
};
nixVulkanIntel = writeExecutable {
name = "nixVulkanIntel";
text = let
# generate a file with the listing of all the icd files
icd = runCommand "mesa_icd" {} (
# 64 bits icd
''
ls ${mesa.drivers}/share/vulkan/icd.d/*.json > f
''
# 32 bits ones
+ lib.optionalString enable32bits ''
ls ${pkgsi686Linux.mesa.drivers}/share/vulkan/icd.d/*.json >> f
''
# concat everything as a one line string with ":" as seperator
+ ''cat f | xargs | sed "s/ /:/g" > $out''
);
in ''
#!${runtimeShell}
if [ -n "$LD_LIBRARY_PATH" ]; then
echo "Warning, nixVulkanIntel overwriting existing LD_LIBRARY_PATH" 1>&2
fi
export VK_LAYER_PATH=${vulkan-validation-layers}/share/vulkan/explicit_layer.d
ICDS=$(cat ${icd})
export VK_ICD_FILENAMES=$ICDS"''${VK_ICD_FILENAMES:+:$VK_ICD_FILENAMES}"
export LD_LIBRARY_PATH=${
lib.makeLibraryPath [
zlib
libdrm
xorg.libX11
xorg.libxcb
xorg.libxshmfence
wayland
gcc.cc
]
}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$@"
'';
};
nixGLCommon = nixGL:
runCommand "nixGL" {} ''
mkdir -p "$out/bin"
# star because nixGLNvidia... have version prefixed name
cp ${nixGL}/bin/* "$out/bin/nixGL";
'';
auto = let
_nvidiaVersionFile =
if nvidiaVersionFile != null
then nvidiaVersionFile
else
# HACK: Get the version from /proc. It turns out that /proc is mounted
# inside of the build sandbox and varies from machine to machine.
#
# builtins.readFile is not able to read /proc files. See
# https://github.com/NixOS/nix/issues/3539.
runCommand "impure-nvidia-version-file"
{
# To avoid sharing the build result over time or between machine,
# Add an impure parameter to force the rebuild on each access.
# time = builtins.currentTime;
preferLocalBuild = true;
allowSubstitutes = false;
} "cp /proc/driver/nvidia/version $out 2> /dev/null || touch $out";
# The nvidia version. Either fixed by the `nvidiaVersion` argument, or
# auto-detected. Auto-detection is impure.
nvidiaVersionAuto =
if nvidiaVersion != null
then nvidiaVersion
else
# Get if from the nvidiaVersionFile
let
data = builtins.readFile _nvidiaVersionFile;
versionMatch = builtins.match ".*Module ([0-9.]+) .*" data;
in
if versionMatch != null
then builtins.head versionMatch
else null;
autoNvidia = nvidiaPackages {version = nvidiaVersionAuto;};
in
rec {
# The output derivation contains nixGL which point either to
# nixGLNvidia or nixGLIntel using an heuristic.
nixGLDefault =
if nvidiaVersionAuto != null
then nixGLCommon autoNvidia.nixGLNvidia
else nixGLCommon nixGLIntel;
}
// autoNvidia;
};
in
top
// (
if nvidiaVersion != null
then
top.nvidiaPackages
{
version = nvidiaVersion;
sha256 = nvidiaHash;
}
else {}
)

View File

@ -1,7 +0,0 @@
let
rev = "4f6d8095fd51";
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
sha256 = "14sm0bjjcmi9qmznwy3nkd2vbhj5xcshgm54a5wiprl9ssvxqw53";
})

View File

@ -1,599 +0,0 @@
{
"256.25": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.25/NVIDIA-Linux-x86_64-256.25.run",
"sha256": "a93e4de6df8336741ace5a4bd2bc80b3b0b0ebde8c31003671af91bc44db61d3"
},
"256.29": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.29/NVIDIA-Linux-x86_64-256.29.run",
"sha256": "e387780b265e9eec2f68295f7f08dab0238c87426e9968d8dd9d02d6ff023da3"
},
"256.35": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.35/NVIDIA-Linux-x86_64-256.35.run",
"sha256": "ef10ecddd8db11f0fa3c6e4727dc275eb0ca9d23a7b7d37a038d17d2a42acb2a"
},
"256.38.02": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.38.02/NVIDIA-Linux-x86_64-256.38.02.run",
"sha256": "c3c9c60932830a648034b98f38910058df339a84ad5998adc8df19c697fd6663"
},
"256.38.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.38.03/NVIDIA-Linux-x86_64-256.38.03.run",
"sha256": "0dcb0098e294d5b89f57b8100f6af660225310ba48b4298a2ac79bb19cc8ca7c"
},
"256.44": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.44/NVIDIA-Linux-x86_64-256.44.run",
"sha256": "528aaed18b6b4ba79dbf4ae5c5ecda8350007d610d2c7c608eb646739cfeb500"
},
"256.52": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.52/NVIDIA-Linux-x86_64-256.52.run",
"sha256": "3ab713f969fe7cf0d7ccfdfee2863c92ea96d1eb5bf3f734b3a1e5b37c2611c8"
},
"256.53": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/256.53/NVIDIA-Linux-x86_64-256.53.run",
"sha256": "febee3eb128e1d62565fccb3ad1577f741c4bf067072e45e7766ab999aa590c9"
},
"260.19.04": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.04/NVIDIA-Linux-x86_64-260.19.04.run",
"sha256": "09391b63daa6bc08ea520c28295a8535b83710f8ba48d01778bf7fe22d095485"
},
"260.19.06": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.06/NVIDIA-Linux-x86_64-260.19.06.run",
"sha256": "ecd3e2113fbf9dd7e167c737d3b4490dd653b49b70ead62c194635ffc3fd4d00"
},
"260.19.12": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.12/NVIDIA-Linux-x86_64-260.19.12.run",
"sha256": "7cc90b5bd402742167a1647d0d92aa997af4184da614c2ca882afb2f2e48eb7e"
},
"260.19.21": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.21/NVIDIA-Linux-x86_64-260.19.21.run",
"sha256": "bf80147e94ab4c86dffe4529635e5f5b0caff5f6758a068d0e2d95ee466d2214"
},
"260.19.26": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.26/NVIDIA-Linux-x86_64-260.19.26.run",
"sha256": "78ce4e3344ee15330708054b5c3ceabb96aabaa1194a9bc92cee9559c7cd3c9f"
},
"260.19.29": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.29/NVIDIA-Linux-x86_64-260.19.29.run",
"sha256": "09461a1eb6f46b394e9a2cfef20448311a395c3969521881b334c413715174eb"
},
"260.19.36": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.36/NVIDIA-Linux-x86_64-260.19.36.run",
"sha256": "35a8769585e1f9b426c9c21b5f5898c06251a642ed73e9fb9eea9ab87ef91067"
},
"260.19.44": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/260.19.44/NVIDIA-Linux-x86_64-260.19.44.run",
"sha256": "8526267407d71b1257e43abc2b98e588c8d271e30584a754b8b8ef426cc69c64"
},
"270.18": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.18/NVIDIA-Linux-x86_64-270.18.run",
"sha256": "b10af40db402f9f8e6a3a5a55b2385a06e2b8b14c8fc539624b07c63d70bef32"
},
"270.26": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.26/NVIDIA-Linux-x86_64-270.26.run",
"sha256": "120ead8941ad6c9ea5bc263e12b004e6c4639151469cfe46a99781ab1cc1f33a"
},
"270.29": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.29/NVIDIA-Linux-x86_64-270.29.run",
"sha256": "c45209b72b2a0128fa4721c616dd51ad799e2698d46f672b006c4b2cc0c44f9c"
},
"270.30": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.30/NVIDIA-Linux-x86_64-270.30.run",
"sha256": "5f49d1497c60ea3d82e6640ebc233e05c855adf5f6702dfc0a5c73773f26207e"
},
"270.41.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.41.03/NVIDIA-Linux-x86_64-270.41.03.run",
"sha256": "35dd4a1d89228a8ffc26dd9513aaf806e67826c42ff34954e2bd576068abd0b5"
},
"270.41.06": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.41.06/NVIDIA-Linux-x86_64-270.41.06.run",
"sha256": "825c593e77d33df599b2cfe2a3b4cde0c61b837a843a3caa6469298de721f2fa"
},
"270.41.19": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/270.41.19/NVIDIA-Linux-x86_64-270.41.19.run",
"sha256": "4d7131f07e739abc787d69696ca4ac52df2fc0b338405ffd474288c2a4a1e7a6"
},
"275.09": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.09/NVIDIA-Linux-x86_64-275.09.run",
"sha256": "e4c94cbd85f619c2b83f6c53bddc8a7b7ce306f28b80c8cfacdfba884da45f4d"
},
"275.09.04": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.09.04/NVIDIA-Linux-x86_64-275.09.04.run",
"sha256": "dceb415aec70d7fa2bafea45268b1913100cc19e08e57dfda0f0920caad43b68"
},
"275.09.07": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.09.07/NVIDIA-Linux-x86_64-275.09.07.run",
"sha256": "747c09b0a0a8d60e1b5fee49fb1ea07ee5812f8e85a87b2403011af6de58164d"
},
"275.19": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.19/NVIDIA-Linux-x86_64-275.19.run",
"sha256": "58bf5d90fbabd30c5980a8ce5fe831337ccfe0ab843e78e0b0b12eec8e327e40"
},
"275.21": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.21/NVIDIA-Linux-x86_64-275.21.run",
"sha256": "9e071aef05545ece8f2836b57f49f73853adb998f9987669c4803549fb50f479"
},
"275.28": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.28/NVIDIA-Linux-x86_64-275.28.run",
"sha256": "fc1dfded42d21b08f40fa7f50589c6c0c4922cc0d30af71bf721ab8682b00648"
},
"275.36": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.36/NVIDIA-Linux-x86_64-275.36.run",
"sha256": "91a8c8865514fbeec20fa90c00690011426ad7b5d5c9a221f7ced253d94ddab7"
},
"275.43": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/275.43/NVIDIA-Linux-x86_64-275.43.run",
"sha256": "468515a3b3fb2423dc47a6066e2f1b646ec78283b008a3702c111e5cfd3f5dc2"
},
"280.04": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/280.04/NVIDIA-Linux-x86_64-280.04.run",
"sha256": "e230b25462ab4eeba71363f12360d4785223c023111f08d21ce1a7456665e712"
},
"280.11": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/280.11/NVIDIA-Linux-x86_64-280.11.run",
"sha256": "9d56c08c45a0648c62f00745413f0828549928f0e4e7549bea3d9fce8e498e5f"
},
"280.13": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/280.13/NVIDIA-Linux-x86_64-280.13.run",
"sha256": "98a08c7d943912a178a9bbe419db60634088e5262ae9053bf2fe730984e5a012"
},
"285.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/285.03/NVIDIA-Linux-x86_64-285.03.run",
"sha256": "fc1e895635b9ea7171f4e7c549e6502f3853838cb4cc254a190b004579a1f919"
},
"285.05.09": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/285.05.09/NVIDIA-Linux-x86_64-285.05.09.run",
"sha256": "7159a1f7e898b50dd49ea2273ac6facb870546ad5496bf70c6fbe1642d2c4970"
},
"290.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/290.03/NVIDIA-Linux-x86_64-290.03.run",
"sha256": "14a412b6a01cd9ae98b1dba0f1a2805c9038fd731dd66747ca57ab6ec4f550b0"
},
"290.06": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/290.06/NVIDIA-Linux-x86_64-290.06.run",
"sha256": "48df72cd225043ebecbe1a6a9a575d692e0a9fa0b0bb65c037800d83ba54f3ec"
},
"290.10": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/290.10/NVIDIA-Linux-x86_64-290.10.run",
"sha256": "34a2ab07f4ae7afdeb2c8415f3f37c1099e6690eb25f3dbef92eca771f7ce4cd"
},
"295.09": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.09/NVIDIA-Linux-x86_64-295.09.run",
"sha256": "4b2ff7f9fcc1db6f30f4b4a2eb5a22bc5fe1c566828e3d6a56ef088d187bf786"
},
"295.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.17/NVIDIA-Linux-x86_64-295.17.run",
"sha256": "b1fede162dce9c3d31a991cf48a4743dacece05cfef86dafac8e8284369a86c2"
},
"295.20": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.20/NVIDIA-Linux-x86_64-295.20.run",
"sha256": "3b84fdeae335c047193f68a1da26f2a736461c35cfe94566fc7ace1e5762d34c"
},
"295.33": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.33/NVIDIA-Linux-x86_64-295.33.run",
"sha256": "4e939bac1ebc03c6439969d638540b99900b0fe4e4799b4186e5ff9521d37b73"
},
"295.40": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.40/NVIDIA-Linux-x86_64-295.40.run",
"sha256": "f6d5ae338b3b8ac6c512d06b335010934a62728f181a1fa5253aa84b7bf45e7a"
},
"295.49": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.49/NVIDIA-Linux-x86_64-295.49.run",
"sha256": "61dc9623ea1981f801d97de7c67c32b7e4f7ef4aaa6744910967cb634d9ace62"
},
"295.53": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.53/NVIDIA-Linux-x86_64-295.53.run",
"sha256": "4525e994a0d0a8cd776415401423e7de3985923637642955c3fe50a3d047d4ca"
},
"295.59": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.59/NVIDIA-Linux-x86_64-295.59.run",
"sha256": "4b1d96389abd2b804ad470c5189142a02ee4c82c1ac56cea37ecb45e8051313e"
},
"295.71": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.71/NVIDIA-Linux-x86_64-295.71.run",
"sha256": "956c7660bff61c07a99cea2130e73baf1574907008d41d9462147aad6b83dcc6"
},
"295.75": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/295.75/NVIDIA-Linux-x86_64-295.75.run",
"sha256": "b7ae04da001ade59b87abd15e7786b3f0fc75a312368fa466f6c0400e803debd"
},
"302.07": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/302.07/NVIDIA-Linux-x86_64-302.07.run",
"sha256": "6a9e515c21afed122621a69a844a2891bb625773e481ebfe70699bf2d06be5e1"
},
"302.11": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/302.11/NVIDIA-Linux-x86_64-302.11.run",
"sha256": "e44816814bce58a9f1cf0d10edec1a2f4b25104a212714c2bbd1bc9e70b53f61"
},
"302.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/302.17/NVIDIA-Linux-x86_64-302.17.run",
"sha256": "5cf9059ebb70ade99e5621c0a605ed5bbb6c274f7c52a7ef40342ceb41b381fc"
},
"304.22": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.22/NVIDIA-Linux-x86_64-304.22.run",
"sha256": "4c1b6f7dcda007622bb5e243b858abdb3881d5d5befdc617b23393545d9c96fd"
},
"304.30": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.30/NVIDIA-Linux-x86_64-304.30.run",
"sha256": "ada4deee8a7a19093af7bb724dfd55e2594fb28932ff915723532ddf16b85e1f"
},
"304.32": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.32/NVIDIA-Linux-x86_64-304.32.run",
"sha256": "a26d6c64108371027fbca1b35b182d0ff1609dd53ce6f9d06fea85f039393bc8"
},
"304.37": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.37/NVIDIA-Linux-x86_64-304.37.run",
"sha256": "cae75158047d0b97ea48f269fd2903a6731f53b978a1065720343436c97ca9c2"
},
"304.43": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.43/NVIDIA-Linux-x86_64-304.43.run",
"sha256": "76946e2fe4160cfd59e7a75fefd174a9c7e71c51cca6b88c40a16cf35947b777"
},
"304.48": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.48/NVIDIA-Linux-x86_64-304.48.run",
"sha256": "c018541d30e4f276e1afc60077e5c75b54954daa8888c870fc80a19b28d4eae8"
},
"304.51": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.51/NVIDIA-Linux-x86_64-304.51.run",
"sha256": "28654ff26923660de7296488054154bbbac0ef6e669377eeed84178fd0c17e64"
},
"304.60": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.60/NVIDIA-Linux-x86_64-304.60.run",
"sha256": "12dbd2661e8b6114fa3f531cb0c7a6820c98198aa6044bddff0d2431141bc6d0"
},
"304.64": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.64/NVIDIA-Linux-x86_64-304.64.run",
"sha256": "b3c3bb7f136ccd978c9c5a511a02199ec2498c4243baae19ac68e5d905ca5340"
},
"304.84": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.84/NVIDIA-Linux-x86_64-304.84.run",
"sha256": "8d51e0a8e5bd20d0add5dbacdcdb95eba05bc01d17c3bb247b5a1880feb0e0fe"
},
"304.88": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.88/NVIDIA-Linux-x86_64-304.88.run",
"sha256": "c1a73211566b085214b0ad1824733aa56d09c6139f729feebd0eff44f6113da3"
},
"304.108": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.108/NVIDIA-Linux-x86_64-304.108.run",
"sha256": "56a61871f0488521f50c04607c568a177cad48a577c0f4ca625665d0015e2b39"
},
"304.116": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.116/NVIDIA-Linux-x86_64-304.116.run",
"sha256": "3f267f2cd3f4ede4f954c5f36c8427ae4a2fa19ca8c275f892488f4dc3a4109a"
},
"304.117": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.117/NVIDIA-Linux-x86_64-304.117.run",
"sha256": "0e5a751cf12b55057c00ccf53d05c8934d5eee49c5f8b3f33c5e11e2c6989e6e"
},
"304.119": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.119/NVIDIA-Linux-x86_64-304.119.run",
"sha256": "1fd710a78d2bf711ede3bcbd20058de1e94c498db31973dfec1b8c25bf87e6cd"
},
"304.121": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.121/NVIDIA-Linux-x86_64-304.121.run",
"sha256": "6532eef8b6f65dc44ed912b4ffa86494a954ae98f53c3ffd394fa511cdf75928"
},
"304.123": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.123/NVIDIA-Linux-x86_64-304.123.run",
"sha256": "68ee60d2a96ff80adad7e62f79f55f137dd10b8c38ce6c60fb481e73fdf6b155"
},
"304.125": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.125/NVIDIA-Linux-x86_64-304.125.run",
"sha256": "c654889b85a18326f2c610260a8fbc3b1bb6f9b8be1c052a46a213f60bd62262"
},
"304.128": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/304.128/NVIDIA-Linux-x86_64-304.128.run",
"sha256": "e301342b93af24a6676519cb3a7fbe5d557b6a23a588ef121478b7fbab8a495f"
},
"310.14": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.14/NVIDIA-Linux-x86_64-310.14.run",
"sha256": "a187cc9de4939b171b600544e8dbf78dbb1a05cb481b2b3b506c3699f8e6c4c7"
},
"310.19": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.19/NVIDIA-Linux-x86_64-310.19.run",
"sha256": "3326cf9eb432a10fee5cb663132cd6c175813d0225750ef237dcc7feefd20fca"
},
"310.32": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.32/NVIDIA-Linux-x86_64-310.32.run",
"sha256": "e5f179a62d1a0e6a877f3f89315d0a28cb7c3cbceff7df13e1a71ab189ac3616"
},
"310.40": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.40/NVIDIA-Linux-x86_64-310.40.run",
"sha256": "48fc9ff847b57ce959b401ad37040dc1332f9c0b3bdef08c246dba91e091a65e"
},
"310.44": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.44/NVIDIA-Linux-x86_64-310.44.run",
"sha256": "585365fc37939794ab7ed6907ab2fd9fbcc6f4f19c003d21139895dc97dd88f4"
},
"310.51": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/310.51/NVIDIA-Linux-x86_64-310.51.run",
"sha256": "4d0f9829105a8f06121f8308fa5e67834f52b84add48eaf4101b02522db15f53"
},
"313.09": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/313.09/NVIDIA-Linux-x86_64-313.09.run",
"sha256": "11cc2c4d32da321ad7ce63b9cdb41578400542d0b9d0ac6c5061a3253db96e13"
},
"313.18": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/313.18/NVIDIA-Linux-x86_64-313.18.run",
"sha256": "9aaf6ce2fb08f72b2ab4f7a2d9fc5af8216ac263fa4883deec3844f34ea7ba3a"
},
"313.26": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/313.26/NVIDIA-Linux-x86_64-313.26.run",
"sha256": "4cbf3ec4fe1ce0b24ebbdcc3badde369aeb98ab59b6689261fa39f2dde00d41e"
},
"313.30": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/313.30/NVIDIA-Linux-x86_64-313.30.run",
"sha256": "72317f2e4c459c33c764e3283deb3e1615b1852ead1f9bfad82148e120506022"
},
"319.12": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.12/NVIDIA-Linux-x86_64-319.12.run",
"sha256": "4b68617d75d0d1149d2d6e836783429c715204fad567aa621ae7982df676a8d4"
},
"319.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.17/NVIDIA-Linux-x86_64-319.17.run",
"sha256": "5579a8c4f5a7927eb9756d276c4e3d60540877cd68f6c946890fddc5d176764a"
},
"319.23": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.23/NVIDIA-Linux-x86_64-319.23.run",
"sha256": "d130dd0a9d889063d0dbad0a27789af756076af879a68a5dbc1175821542fa78"
},
"319.32": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.32/NVIDIA-Linux-x86_64-319.32.run",
"sha256": "204a00728c3cfbe3dcb12a9dae5bf0371a1e5b2c48dedf86a2bb6c881e901e2a"
},
"319.49": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.49/NVIDIA-Linux-x86_64-319.49.run",
"sha256": "f4bfee9f48725e20e05439ee099730fb1b42892b9ecfac000180426b044be585"
},
"319.60": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.60/NVIDIA-Linux-x86_64-319.60.run",
"sha256": "2bd663d0d0a9ae8769b0335ff282acfddea3cd86a3992970e445eb2f82fa1b04"
},
"319.72": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.72/NVIDIA-Linux-x86_64-319.72.run",
"sha256": "25a15200d6fd58782db860c7bc0807583b1d78c13810013c024700e63df4c643"
},
"319.82": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/319.82/NVIDIA-Linux-x86_64-319.82.run",
"sha256": "9e00555488fd1c934a86ccf04f3a9eb8c5bcbc29ea38ce66d72788d0bd9dde7b"
},
"325.08": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/325.08/NVIDIA-Linux-x86_64-325.08.run",
"sha256": "83a567dc6b1ddd0c74af1ebc54e966ae19f52baa17166981046af4d6288c6ce4"
},
"325.15": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/325.15/NVIDIA-Linux-x86_64-325.15.run",
"sha256": "01446fbd94f6eb3b2e1b3d3f2b06970bf470c3ee2cb1838b3d0c2416e6c74500"
},
"331.13": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.13/NVIDIA-Linux-x86_64-331.13.run",
"sha256": "571741b8ea153281916382d287849f99a9fa65b911aa54d678b48ef0091cc0cd"
},
"331.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.17/NVIDIA-Linux-x86_64-331.17.run",
"sha256": "22968b7bd6460456e99edcad18ec237ebe66fd19e349c9ec9c3d5a16c074eab4"
},
"331.20": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.20/NVIDIA-Linux-x86_64-331.20.run",
"sha256": "b8803906402354d201d3b9bc21938a0fe8a7d76e93e486fddaab340df18092ec"
},
"331.38": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.38/NVIDIA-Linux-x86_64-331.38.run",
"sha256": "1015ac65a85ba39bdbe9e6bac54ae7ce3b2441fc7512909074e991242a46cf34"
},
"331.49": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.49/NVIDIA-Linux-x86_64-331.49.run",
"sha256": "ee0e0c3e95439e3d55e76aa6477fdb62bc62c04805b3efaa1f028ea64d2422f8"
},
"331.67": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.67/NVIDIA-Linux-x86_64-331.67.run",
"sha256": "9c7f2bb44bb26a5effb915d8aa22132a6c06483e0cfa6f47b7265b15da83bbd7"
},
"331.79": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.79/NVIDIA-Linux-x86_64-331.79.run",
"sha256": "c3314bd7f1f722929a2b401e12301a750ee7a73640518932a5a9af39c390a604"
},
"331.89": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.89/NVIDIA-Linux-x86_64-331.89.run",
"sha256": "e7f51a6c7abfe3ba8f03dbb284e2ade7430cc909b2241ff7703b17beff0dd237"
},
"331.104": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.104/NVIDIA-Linux-x86_64-331.104.run",
"sha256": "e0a26dc4444e84dae876db773f717e33846e1ae8a23802795ba3d39f1631f79e"
},
"331.113": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/331.113/NVIDIA-Linux-x86_64-331.113.run",
"sha256": "e9d5eb4394ef31825f7a86290b19b522851d1b599284095d81bac0f33a996219"
},
"334.16": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/334.16/NVIDIA-Linux-x86_64-334.16.run",
"sha256": "59a930f7ed6391a1e57b9fc7683420facd1c4548757d4120b1c594479af759f7"
},
"334.21": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/334.21/NVIDIA-Linux-x86_64-334.21.run",
"sha256": "dd35011967b815e096c267f80b36664e34d779bc33017f396dabbd1a1b86d057"
},
"337.12": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/337.12/NVIDIA-Linux-x86_64-337.12.run",
"sha256": "8fa588e0491e652a1cfd45aa01be9336c9b5bb5dd54bf45801a40d53d957e4b4"
},
"337.19": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/337.19/NVIDIA-Linux-x86_64-337.19.run",
"sha256": "bd6998c4aa5e491fb8fcb957b11dfb983ebfb755e938fce0382b006a7aba59d2"
},
"337.25": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/337.25/NVIDIA-Linux-x86_64-337.25.run",
"sha256": "83280f7738f65bb2e790e7530a38978cf0bd0aa741eda51629c9e9b068128af0"
},
"340.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.17/NVIDIA-Linux-x86_64-340.17.run",
"sha256": "b3311d4bc82dd1c58805f2ac29d20711f2b0c0978407bba138d603606e603662"
},
"340.24": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.24/NVIDIA-Linux-x86_64-340.24.run",
"sha256": "db0f4f45ece587b95a8ceb0d1acf6f7f758a370ee0c4adfa2403ba4828d58ce6"
},
"340.32": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.32/NVIDIA-Linux-x86_64-340.32.run",
"sha256": "ef96003110564953cad4ffaec073696dcf9652338dfe5eb0c58ae3ce45db42ac"
},
"340.46": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.46/NVIDIA-Linux-x86_64-340.46.run",
"sha256": "57e7694b5a985ee95d2da37598ec37cdabf40f914490f4cdb0c5184f12a74270"
},
"340.58": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.58/NVIDIA-Linux-x86_64-340.58.run",
"sha256": "70cc452161b969d659225a3a7d4cc17d5827f8f8ce6eb053757f30f6a666a643"
},
"340.65": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.65/NVIDIA-Linux-x86_64-340.65.run",
"sha256": "cd3948db5c1e2468c50140efb4bb50f1a4c84c923db8ec756bd56ff35df9ff04"
},
"340.76": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.76/NVIDIA-Linux-x86_64-340.76.run",
"sha256": "3bf670e9a2bdb184648dec54ce06fab65e798a9a4c9dd5155e2be4efee3e0994"
},
"340.93": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/340.93/NVIDIA-Linux-x86_64-340.93.run",
"sha256": "ea2ac747fd473ea55ed5f6263bd314efa94c71384f3e03d527f8d550ba84c218"
},
"343.13": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/343.13/NVIDIA-Linux-x86_64-343.13.run",
"sha256": "424a7d0fbf668c94454a140c880c298c71496ad7dee699a0bfc594c70e499e54"
},
"343.22": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/343.22/NVIDIA-Linux-x86_64-343.22.run",
"sha256": "762e9d3c1253712a5a62f7052d58e4768eaea3f0492cab934dbf5349c8523315"
},
"343.36": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/343.36/NVIDIA-Linux-x86_64-343.36.run",
"sha256": "2285efa2c0e6675d8724e47a09403630a674c32e514bdcfb54cec3c81810fc78"
},
"346.16": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.16/NVIDIA-Linux-x86_64-346.16.run",
"sha256": "d44bc3f868ce9cbd6c5bbe88d8622f693ef44282f14ed018d150fcab21a0ce32"
},
"346.22": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.22/NVIDIA-Linux-x86_64-346.22.run",
"sha256": "ecb3edab63ff053aa1d6e19eb0a69360075ab1b021e5181a6df738e29be9b71a"
},
"346.35": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.35/NVIDIA-Linux-x86_64-346.35.run",
"sha256": "8625acbbc7a2abdda436a5cb9d06f2a7f5913b16e0a35ac4f9f106853a94d086"
},
"346.47": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.47/NVIDIA-Linux-x86_64-346.47.run",
"sha256": "85ab28abe9defc2838839969b31aea647e0de34615fbfed3ba716205de365d0a"
},
"346.59": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.59/NVIDIA-Linux-x86_64-346.59.run",
"sha256": "231020548431569c0172605815ba131a18f969966b4abf82129f974740bc64ca"
},
"346.72": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.72/NVIDIA-Linux-x86_64-346.72.run",
"sha256": "2ae3777bcff6bf4883b6a903c82b82257bf8fc323fe174992df96a3208c50cef"
},
"346.82": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.82/NVIDIA-Linux-x86_64-346.82.run",
"sha256": "f68b74479a2c329628fed061977e99f744980329c94b6e9c3f396714f2a10f0e"
},
"346.87": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.87/NVIDIA-Linux-x86_64-346.87.run",
"sha256": "908446b20c9992cc6a7700866d36c13d9f53646837842d096d91b35644ee4e31"
},
"346.96": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/346.96/NVIDIA-Linux-x86_64-346.96.run",
"sha256": "229b28a6b65965a248d07223d941de7d79b54cee7c6574f1037293e8a8026727"
},
"349.12": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/349.12/NVIDIA-Linux-x86_64-349.12.run",
"sha256": "fe2e3be342859d2de947aed55c369f4944211ecde00435c76e50a4842fffd68a"
},
"349.16": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/349.16/NVIDIA-Linux-x86_64-349.16.run",
"sha256": "f980b22729b20c9eb3a3a800af524da181afbc78e2409a3f83845894983f8322"
},
"352.09": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/352.09/NVIDIA-Linux-x86_64-352.09.run",
"sha256": "a3ec271896b775c936e1a14e7af2e8ebf02b0bd59381217510185b313c5a5fd6"
},
"352.21": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/352.21/NVIDIA-Linux-x86_64-352.21.run",
"sha256": "aadfbd991b5418cbf89d2368cc49485a4194196ef08362a18f92df049381f791"
},
"352.30": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/352.30/NVIDIA-Linux-x86_64-352.30.run",
"sha256": "4c5fb75ba94c97b6d70ddb9ea2cb11b5ed01829b5f671d9e8abce7afba20aef5"
},
"352.41": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/352.41/NVIDIA-Linux-x86_64-352.41.run",
"sha256": "0eb60d0543a0e7c5c3cfec13702005ffec6e2b8c7f22c631f324736ba2a1a832"
},
"355.06": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/355.06/NVIDIA-Linux-x86_64-355.06.run",
"sha256": "898304e1455bbccad4a3da3520d7fe17db254413f3458d0a296b45fb9cf2bcd6"
},
"355.11": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/355.11/NVIDIA-Linux-x86_64-355.11.run",
"sha256": "a59b425381add9d9058dc2d987bf3087ab59c43224b5eb04c3f273f5886451ed"
},
"470.161.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/470.161.03/NVIDIA-Linux-x86_64-470.161.03.run",
"sha256": "5da82a7f8c76e781e7d7f0be7b798db4d344f26bd4facf9abcf3c71c71fe7640"
},
"470.182.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/470.182.03/NVIDIA-Linux-x86_64-470.182.03.run",
"sha256": "3dbc1408fc48b865d3ddacefc45f4a3fc13b90b83a628ee546b0082ab2c3fc79"
},
"510.108.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/510.108.03/NVIDIA-Linux-x86_64-510.108.03.run",
"sha256": "410a515e78df29c2cba4ac0b497889ce0ff1b04cfc711ff889e2dfc80f0da0d8"
},
"515.86.01": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/515.86.01/NVIDIA-Linux-x86_64-515.86.01.run",
"sha256": "141777e1ca2f11e97d8d33260213f1be327eb73922ae22f4ddab404bb2ef4664"
},
"515.105.01": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/515.105.01/NVIDIA-Linux-x86_64-515.105.01.run",
"sha256": "9dd2221f26c847c864dfe80cc8533f322c5f4dfaa2939cf54a934b8f7a2f6a0d"
},
"525.53": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.53/NVIDIA-Linux-x86_64-525.53.run",
"sha256": "74bb0971f04f1dddd3c4641c891706fb96e8de52e22f6079e50de76d3a51687f"
},
"525.60.11": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.60.11/NVIDIA-Linux-x86_64-525.60.11.run",
"sha256": "816ee6c2e0813ccc3d4a7958f71fc49a37c60efe1d51d6146c1ce72403983d5d"
},
"525.60.13": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.60.13/NVIDIA-Linux-x86_64-525.60.13.run",
"sha256": "dce1c184f9f038be72237ccd29c66bb151077f6037f1c158c83d582bd2dba8ca"
},
"525.78.01": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.78.01/NVIDIA-Linux-x86_64-525.78.01.run",
"sha256": "43da42d2bf69bc37ea9c7c0fa02f52db0dcc483c272f52edacad89a5cb495a93"
},
"525.85.05": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.85.05/NVIDIA-Linux-x86_64-525.85.05.run",
"sha256": "ea63b4253403b224bb7313a8977a920dfe9d203d661dd5f6fc26585a70179140"
},
"525.89.02": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.89.02/NVIDIA-Linux-x86_64-525.89.02.run",
"sha256": "0e412c88c5bd98f842a839a6f64614f20e4c0950ef7cffb12b158a71633593e9"
},
"525.105.17": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/525.105.17/NVIDIA-Linux-x86_64-525.105.17.run",
"sha256": "c635a21a282c9b53485f19ebb64a0f4b536a968b94d4d97629e0bc547a58142a"
},
"530.30.02": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/530.30.02/NVIDIA-Linux-x86_64-530.30.02.run",
"sha256": "47fddbbd7a22ba661923dbce6e7f51eec54df68050c406cc0490c3bfbede7963"
},
"530.41.03": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/530.41.03/NVIDIA-Linux-x86_64-530.41.03.run",
"sha256": "ae27a16a968c85503f5d161dda343c1602612b025f4aee15f92e2ea0acb784b1"
},
"latest": {
"url": "https://download.nvidia.com/XFree86/Linux-x86_64/530.41.03/NVIDIA-Linux-x86_64-530.41.03.run",
"sha256": "ae27a16a968c85503f5d161dda343c1602612b025f4aee15f92e2ea0acb784b1"
}
}

View File

@ -1 +0,0 @@

View File

@ -1,4 +1,7 @@
#!/usr/bin/env python3 # A simple playground to explore vim plugins that are available in nixpkgs
#!/usr/bin/env python3
"""
A simple playground to explore vim plugins that are available in nixpkgs
"""
import csv
import urllib.request
@ -45,11 +48,11 @@ class VimPlugins:
return self.conn.cursor().execute(query).fetchall()
def vim_plugin_slug(name: str):
def vim_plugin_slug(name: str) -> str:
return name.replace(".", "-").lower()
def name_from_repo(repo: str):
def name_from_repo(repo: str) -> str:
spl = repo.split("/")
return vim_plugin_slug(spl[-1] or spl[-2])
@ -86,7 +89,8 @@ L3MON4D3/LuaSnip
arthurxavierx/vim-caser
~/local_repos/ts-ql
""".split()
need_install_plugins = [plugin.strip() for plugin in need_install_plugins if plugin.strip()]
need_install_plugins = [plugin.strip()
for plugin in need_install_plugins if plugin.strip()]
# Create the GitHub URL list
need_install_plugins_gh = [
@ -104,7 +108,7 @@ arthurxavierx/vim-caser
# Check if the repo is not in the list
repos = [repo for repo, _ in values]
not_in_repo = [name_from_repo(gh) for gh in need_install_plugins_gh if gh not in repos]
print("not in repo", not_in_repo) # nvim-yati, yang-vim, Comment-nvim, inlay-hints-nvim, hlargs-nvim, vim-caser, gruvbox-community
not_in_repo = [name_from_repo(
gh) for gh in need_install_plugins_gh if gh not in repos]
# nvim-yati, yang-vim, Comment-nvim, inlay-hints-nvim, hlargs-nvim, vim-caser, gruvbox-community
print("not in repo", not_in_repo)

View File

@ -15,46 +15,47 @@
flake-utils,
nixpkgs,
}:
with flake-utils; lib.eachSystem lib.defaultSystems (sys: let
overlays = [turbo.overlay];
# pkgs is our tweaked nixpkgs
pkgs = import nixpkgs {
system = sys;
overlays = overlays;
};
shellMsg = ''
echo "Hello from nix ${sys}"
echo "Local development may use our remote planetscale database (pscale login && pnpm dev:infra; pnpm dev)"
echo "Or from the specified docker-compose.yml (pnpm dev:local_infra && pnpm dev)"
echo "See more on CONTRIBUTING.md"
'';
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [pkgs.bashInteractive];
buildInputs = [
pkgs.nodejs-18_x
pkgs.nodePackages.pnpm
pkgs.nodePackages.prisma
pkgs.prisma-engines
pkgs.turbo
# pkgs.turbo-tooling
pkgs.jq
pkgs.pscale
pkgs.act # Github workflow
];
shellHook =
# https://github.com/prisma/prisma/issues/3026#issuecomment-927258138
# nix-direnv is required (impure build?) https://github.com/nix-community/nix-direnv
''
export PRISMA_MIGRATION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/migration-engine"
export PRISMA_QUERY_ENGINE_BINARY="${pkgs.prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${pkgs.prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${pkgs.prisma-engines}/bin/prisma-fmt"
export TURBO_BINARY_PATH="${pkgs.turbo}/bin/turbo"
pnpm install
''
+ shellMsg;
};
});
with flake-utils;
lib.eachSystem lib.defaultSystems (sys: let
overlays = [turbo.overlay];
# pkgs is our tweaked nixpkgs
pkgs = import nixpkgs {
system = sys;
overlays = overlays;
};
shellMsg = ''
echo "Hello from nix ${sys}"
echo "Local development may use our remote planetscale database (pscale login && pnpm dev:infra; pnpm dev)"
echo "Or from the specified docker-compose.yml (pnpm dev:local_infra && pnpm dev)"
echo "See more on CONTRIBUTING.md"
'';
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [pkgs.bashInteractive];
buildInputs = [
pkgs.nodejs-18_x
pkgs.nodePackages.pnpm
pkgs.nodePackages.prisma
pkgs.prisma-engines
pkgs.turbo
# pkgs.turbo-tooling
pkgs.jq
pkgs.pscale
pkgs.act # Github workflow
];
shellHook =
# https://github.com/prisma/prisma/issues/3026#issuecomment-927258138
# nix-direnv is required (impure build?) https://github.com/nix-community/nix-direnv
''
export PRISMA_MIGRATION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/migration-engine"
export PRISMA_QUERY_ENGINE_BINARY="${pkgs.prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${pkgs.prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${pkgs.prisma-engines}/bin/prisma-fmt"
export TURBO_BINARY_PATH="${pkgs.turbo}/bin/turbo"
pnpm install
''
+ shellMsg;
};
});
}