Compare commits

...

12 commits

Author SHA1 Message Date
b418f7ca4b
Revert "feat: Try to add cachix support in github action"
This reverts commit f9f147e5ec.
2025-11-08 03:55:40 +08:00
2c68cb50eb
Revert "fix: Wrong github action matrix definition"
This reverts commit 384ce384b6.
2025-11-08 03:55:39 +08:00
63cd931425
Revert "fix: Enable pipe-operator feature for nix"
This reverts commit 5feeaeb6e4.
2025-11-08 03:55:37 +08:00
41adff27ec
Revert "fix: Try enable pipe-operator"
This reverts commit 3b570cc47a.
2025-11-08 03:55:36 +08:00
4205a8bcb3
Revert "fix: Remove |> operator to fix ci"
This reverts commit 6a7b5838bc.
2025-11-08 03:55:34 +08:00
ff78d71406
Revert "fix: Try to use lix installer in github ci"
This reverts commit c8d5b218b0.
2025-11-08 03:55:32 +08:00
cb97f43e11
Revert "Revert "fix: Try to use lix installer in github ci""
This reverts commit 8de70ee867.
2025-11-08 03:55:31 +08:00
55c578d3db
Revert "feat: Move nvchad config to ulic-youthlic/nvchad-starter"
This reverts commit 9c59296b24.
2025-11-08 03:55:29 +08:00
8fd58722da
Revert "feat: Add nix build option for github ci"
This reverts commit 02b5da7c5f.
2025-11-08 03:55:28 +08:00
f6b325d3d5
Revert "fix: Remove Akun from github ci hostname"
This reverts commit b6184c5045.
2025-11-08 03:55:26 +08:00
ce86623717
Revert "fix: Remove Cape from hostname to test ci"
This reverts commit 7a22d0a37e.
2025-11-08 03:55:24 +08:00
e313d6de92
Revert "feat: Try to use dix installer in github ci"
This reverts commit e26fdb7852.
2025-11-08 03:55:22 +08:00
25 changed files with 477 additions and 211 deletions

View file

@ -1,33 +0,0 @@
name: "Test Cachix"
on:
workflow_dispatch:
pull_request:
branches:
- dev
push:
branches:
- dev
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
hostname:
- Tytonidae
# - Akun
# - Cape
steps:
- name: Checkout commit
uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: false
extra-conf: |
trusted-public-keys = youthlic.cachix.org-1:zkUZ/ZGGF5fZxvg5WO3K8XAsUAPFmQKWbnAFb3W5x+Y= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
substituters = https://youthlic.cachix.org/ https://niri.cachix.org/ https://nix-community.cachix.org/ https://chaotic-nyx.cachix.org/ https://cache.nixos.org/
- uses: cachix/cachix-action@v14
with:
name: youthlic
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix build -L .#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel
- run: nix run nixpkgs#toybox -- echo OK

13
flake.lock generated
View file

@ -1260,17 +1260,14 @@
"nvchad-starter": {
"flake": false,
"locked": {
"lastModified": 1762537390,
"lastModified": 1,
"narHash": "sha256-Y6UCxZkTMCxnteIRtuvl49ceQNSu+EIH2PbjOGvvp/I=",
"owner": "ulic-youthlic",
"repo": "nvchad-starter",
"rev": "b713ab7064a8aac684e724f82a253e753754d396",
"type": "github"
"path": "./nvchad",
"type": "path"
},
"original": {
"owner": "ulic-youthlic",
"repo": "nvchad-starter",
"type": "github"
"path": "./nvchad",
"type": "path"
}
},
"pre-commit-hooks-nix": {

View file

@ -186,9 +186,7 @@
repo = "neovim-nightly-overlay";
};
nvchad-starter = {
type = "github";
owner = "ulic-youthlic";
repo = "nvchad-starter";
url = "path:./nvchad";
flake = false;
};
nix4nvchad = {

View file

@ -39,20 +39,16 @@ in
};
config = {
flake.deploy.nodes =
with lib;
pipe
[
"Cape"
"Akun"
]
[
(map (
hostName:
mkDeployNode {
inherit hostName;
}
))
(foldr (a: b: a // b) { })
];
[
"Cape"
"Akun"
]
|> map (
hostName:
mkDeployNode {
inherit hostName;
}
)
|> lib.foldr (a: b: a // b) { };
};
}

View file

@ -9,20 +9,18 @@ let
inherit (self) outputs;
homeModules =
(
with lib;
pipe (rootPath + "/home") [
builtins.readDir
(filterAttrs (_key: value: value == "directory"))
(filterAttrs (
key: _value:
!builtins.elem key [
"modules"
"extra"
]
))
builtins.attrNames
(flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
]
(rootPath + "/home")
|> builtins.readDir
|> lib.filterAttrs (_key: value: value == "directory")
|> lib.filterAttrs (
key: _value:
!builtins.elem key [
"modules"
"extra"
]
)
|> builtins.attrNames
|> (with lib; flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
)
// {
default = import "${toString rootPath}/home/modules";
@ -71,15 +69,12 @@ let
in
{
flake = {
homeConfigurations =
with lib;
foldr (a: b: a // b) { } (
pipe
[
# Hostname
]
[ (map (hostName: makeHomeConfiguration { inherit hostName; })) ]
);
homeConfigurations = lib.foldr (a: b: a // b) { } (
[
# Hostname
]
|> map (hostName: makeHomeConfiguration { inherit hostName; })
);
inherit homeModules;
};
}

View file

@ -30,13 +30,11 @@ in
};
};
in
with lib;
pipe
[
"Tytonidae"
"Cape"
"Akun"
]
[ (flip genAttrs makeNixosConfiguration) ];
[
"Tytonidae"
"Cape"
"Akun"
]
|> (with lib; flip genAttrs makeNixosConfiguration);
};
}

View file

@ -11,11 +11,9 @@ let
in
{
flake.overlays =
with lib;
pipe
[
"modifications"
"additions"
]
[ (flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))) ];
[
"modifications"
"additions"
]
|> (with lib; flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}")));
}

View file

@ -17,22 +17,14 @@ in
programs.alacritty = {
enable = true;
package = pkgs.alacritty_git;
settings =
(
with lib;
pipe ./alacritty.toml [
builtins.readFile
builtins.fromTOML
]
)
// {
colors = lib.mkForce { };
font.size = lib.mkForce 16;
window.opacity = lib.mkForce 0.8;
general.import = [
"${pkgs.alacritty-theme}/share/alacritty-theme/gruvbox_dark.toml"
];
};
settings = (./alacritty.toml |> builtins.readFile |> builtins.fromTOML) // {
colors = lib.mkForce { };
font.size = lib.mkForce 16;
window.opacity = lib.mkForce 0.8;
general.import = [
"${pkgs.alacritty-theme}/share/alacritty-theme/gruvbox_dark.toml"
];
};
};
};
}

View file

@ -56,12 +56,7 @@ in
enable = true;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings =
with lib;
pipe ./config.toml [
builtins.readFile
builtins.fromTOML
];
settings = ./config.toml |> builtins.readFile |> builtins.fromTOML;
languages = lib.recursiveUpdate {
language-server = {
neocmakelsp = {

View file

@ -9,15 +9,13 @@
{
config = {
environment.etc =
with lib;
pipe inputs [
(mapAttrs' (
name: value:
lib.nameValuePair "nix/inputs/${name}" {
source = value;
}
))
];
inputs
|> lib.mapAttrs' (
name: value:
lib.nameValuePair "nix/inputs/${name}" {
source = value;
}
);
nixpkgs = {
config = {
allowUnfree = true;
@ -74,7 +72,9 @@
experimental-features = [
"nix-command"
"flakes"
];
]
++ (lib.optional config.lix.enable "pipe-operator")
++ (lib.optional (!config.lix.enable) "pipe-operators");
warn-dirty = false;
system-features = [
"kvm"
@ -85,17 +85,15 @@
};
package = pkgs.nix;
registry =
with lib;
pipe inputs [
(filterAttrs (name: _value: name != "nixpkgs"))
(mapAttrs (
_name: value: {
flake = lib.mkForce {
outPath = value;
};
}
))
];
inputs
|> lib.filterAttrs (name: _value: name != "nixpkgs")
|> lib.mapAttrs (
_name: value: {
flake = lib.mkForce {
outPath = value;
};
}
);
};
};
}

37
nvchad/init.lua Normal file
View file

@ -0,0 +1,37 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "options"
require "autocmds"
vim.schedule(function()
require "mappings"
end)

1
nvchad/lua/autocmds.lua Normal file
View file

@ -0,0 +1 @@
require "nvchad.autocmds"

31
nvchad/lua/chadrc.lua Normal file
View file

@ -0,0 +1,31 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :( @type ChadrcConfig
local M = {}
M.base46 = {
theme = "solarized_light",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
M.nvdash = { load_on_startup = true }
M.ui = {
cmp = {
style = "atom_colored",
},
tabufline = {
-- lazyload = true,
enabled = false,
},
statusline = {
enabled = true,
separator_style = "arrow",
theme = "default",
},
}
return M

View file

@ -0,0 +1,18 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
nix = {
"nixfmt",
lsp_format = "fallback",
},
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
},
}
return options

View file

@ -0,0 +1,8 @@
local options = {}
options = {
default_regexp_syntax = true,
use_default_semantic_hl_groups = true
}
return options

View file

@ -0,0 +1,45 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View file

@ -0,0 +1,23 @@
require("nvchad.configs.lspconfig").defaults()
vim.diagnostic.config({
virtual_lines = {
current_line = true,
source = "if_many"
},
virtual_text = false
})
local servers = {
"nixd",
"nil_ls",
"lua_ls",
"jsonls",
"taplo"
}
vim.lsp.enable(servers, true)
local lua_ls_libraries = vim.deepcopy(vim.lsp.config.lua_ls.settings.Lua.workspace.library)
table.insert(lua_ls_libraries,
#lua_ls_libraries, vim.fn.stdpath "data" .. "/lazy/NvChad/lua/nvchad")
vim.lsp.config.lua_ls.settings.Lua.workspace.library = lua_ls_libraries

32
nvchad/lua/mappings.lua Normal file
View file

@ -0,0 +1,32 @@
require "nvchad.mappings"
local map = vim.keymap.set
map("n", "<M-x>", ":", { desc = "CMD enter command mode" })
map("n", "<leader>ti", function()
local is_enabled = vim.lsp.inlay_hint.is_enabled()
if is_enabled then
vim.lsp.inlay_hint.enable(false)
else
vim.lsp.inlay_hint.enable(true)
end
end, { desc = "Toggle lsp inlay hint" })
map({ "n", "v" }, "j", "gj")
map({ "n", "v" }, "k", "gk")
map({ "n", "v" }, "gj", "j")
map({ "n", "v" }, "gk", "k")
map({ "n", "v" }, "<C-h>", "<cmd>Telescope help_tags<CR>", { desc = "telescope help page" })
map("i", "<C-d>", "<BS>", { desc = "backspace" })
map({ "n", "v" }, "<leader>tm", function()
local image_api = require("image")
local is_enabled = image_api.is_enabled()
if is_enabled then
image_api.disable()
else
image_api.enable()
end
end, { desc = "Toggle image.nvim" })
map("n", "gh", "0")
map("n", "gl", "$")
map("n", "gs", "^")

99
nvchad/lua/options.lua Normal file
View file

@ -0,0 +1,99 @@
local opt = vim.opt
local options = {
autoindent = true,
autoread = true,
backspace = {
"indent",
"eol",
"start",
},
backup = false,
breakindent = true,
breakindentopt = { "sbr" },
showbreak = "",
cdhome = true,
cmdheight = 1,
completeopt = {
"fuzzy",
"menuone",
"noselect",
"popup",
},
concealcursor = { ["v"] = true },
confirm = true,
cursorline = true,
cursorlineopt = { "number", "screenline" },
diffopt = {
"algorithm:minimal",
"closeoff",
"context:20",
"followwrap",
"internal",
"linematch:40",
},
errorbells = true,
expandtab = true,
exrc = true,
foldcolumn = "auto",
fsync = true,
gdefault = false,
helplang = {
"zh",
"en",
},
history = 10000,
hlsearch = true,
ignorecase = true,
smartcase = true,
inccommand = "split",
list = true,
listchars = {
tab = "--→",
trail = "·",
multispace = " ",
nbsp = "",
space = "·",
},
magic = true,
more = true,
mouse = "a",
number = true,
numberwidth = 4,
relativenumber = true,
scrollback = 100000,
scrolloff = 5,
shiftround = true,
shiftwidth = 2,
showmode = false,
signcolumn = "yes",
smoothscroll = true,
splitbelow = true,
splitright = true,
startofline = true,
swapfile = false,
tabclose = {
"uselast",
},
tabstop = 2,
termguicolors = true,
undofile = true,
undolevels = 100000,
virtualedit = {
"block",
"onemore",
},
whichwrap = { b = true, s = true, ["<"] = true, [">"] = true },
wildmenu = true,
wildmode = { "full" },
wildoptions = {
"fuzzy",
"pum",
},
winborder = "solid",
wrap = true
}
for key, value in pairs(options) do
opt[key] = value
end

View file

@ -0,0 +1,56 @@
return {
{
"stevearc/conform.nvim",
event = "BufWritePre", -- uncomment for format on save
opts = require "configs.conform",
},
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
{ import = "nvchad.blink.lazyspec" },
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"markdown",
"typst",
"lua",
"toml",
"yaml",
"json",
"rust"
},
},
},
{
"idris-community/idris2-nvim",
dependencies = {
"neovim/nvim-lspconfig",
"MunifTanjim/nui.nvim"
},
main = "idris2",
opts = require("configs.idris2"),
ft = { "idris2", "ipkg", "lidris2" }
},
{
"3rd/image.nvim",
opts = {
processor = "magick_cli",
integrations = {
markdown = {
only_render_image_at_cursor = true,
only_render_image_at_cursor_mode = "popup",
},
}
},
ft = { "markdown", "typst" }
},
{
"mrcjkb/rustaceanvim",
version = "^6",
lazy = false,
},
}

View file

@ -3,22 +3,18 @@ final: prev:
let
inherit (prev) lib;
in
with lib;
pipe
[
./TrackersListCollection.nix
./OuterWildsTextAdventure.nix
./editor-runtime.nix
./wallpapers.nix
./rime-yuhaostar.nix
./rime-all.nix
./nixvim.nix
./doom-emacs.nix
./osu-lazer-bin.nix # typochecker: disable-line
[
./TrackersListCollection.nix
./OuterWildsTextAdventure.nix
./editor-runtime.nix
./wallpapers.nix
./rime-yuhaostar.nix
./rime-all.nix
./nixvim.nix
./doom-emacs.nix
./osu-lazer-bin.nix # typochecker: disable-line
./pkgsNoCuda.nix
]
[
(map (file: import file args))
(overlays: (lib.composeManyExtensions overlays) final prev)
]
./pkgsNoCuda.nix
]
|> map (file: import file args)
|> (overlays: (lib.composeManyExtensions overlays) final prev)

View file

@ -3,26 +3,22 @@ final: prev:
let
inherit (prev) lib;
in
with lib;
pipe
[
./niri.nix
./spotifyx.nix
./radicle-explorer.nix
./wshowkeys.nix
# ./QQ.nix
./helix.nix
./cliphist.nix
./zulip.nix
./spotifyd.nix
./nautilus.nix
./neovim-nightly.nix
./vim.nix
[
./niri.nix
./spotifyx.nix
./radicle-explorer.nix
./wshowkeys.nix
# ./QQ.nix
./helix.nix
./cliphist.nix
./zulip.nix
./spotifyd.nix
./nautilus.nix
./neovim-nightly.nix
./vim.nix
# Nur
./nur.nix
]
[
(map (file: import file args))
(overlays: (lib.composeManyExtensions overlays) final prev)
]
# Nur
./nur.nix
]
|> map (file: import file args)
|> (overlays: (lib.composeManyExtensions overlays) final prev)

View file

@ -60,30 +60,26 @@ let
runHook postFixup
'';
};
grammars = with lib; pipe srcs [ (filterAttrs (key: _: hasPrefix "tree-sitter-" key)) ];
grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key);
queries =
with lib;
pipe grammars [
(mapAttrsToList (
_: value: ''
mkdir -p $out/${value.name}
grammars
|> lib.mapAttrsToList (
_: value: ''
mkdir -p $out/${value.name}
ln -s ${value.src}/queries/* $out/${value.name}/
''
))
];
ln -s ${value.src}/queries/* $out/${value.name}/
''
);
grammarLinks =
with lib;
pipe grammars [
(builtins.mapAttrs (
_: v: {
inherit (v) name;
value = buildGrammar v;
}
))
(mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"))
];
grammars
|> builtins.mapAttrs (
_: v: {
inherit (v) name;
value = buildGrammar v;
}
)
|> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so");
grammarDir = runCommandLocal "helix-grammars" { } ''
mkdir -p $out

View file

@ -7,10 +7,9 @@
let
wallpapers =
with lib;
pipe srcs [
(filterAttrs (name: _value: hasPrefix "wallpaper" name))
(concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}"))
];
srcs
|> filterAttrs (name: _value: hasPrefix "wallpaper" name)
|> concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}");
in
runCommandLocal "wallpapers" { } ''
mkdir -p $out

View file

@ -1,6 +1,6 @@
{
perSystem =
{ pkgs, lib, ... }:
{ pkgs, ... }:
{
treefmt = {
programs = {
@ -41,12 +41,7 @@
};
typos =
let
config =
with lib;
pipe ./.typos.toml [
builtins.readFile
builtins.fromTOML
];
config = ./.typos.toml |> builtins.readFile |> builtins.fromTOML;
in
{
enable = true;