From e313d6de927a67a3388c6d088b92bc97c0a7ed10 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 01/12] Revert "feat: Try to use dix installer in github ci" This reverts commit e26fdb78527d035a7033f4d78d39159765733d19. --- .github/workflows/test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19735f0..7f40a4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,12 +17,11 @@ jobs: # - Akun # - Cape steps: - - name: Checkout commit - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 with: - determinate: false - extra-conf: | + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | 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 From ce866237173098216de45b2b302dde0ed206bb4d Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 02/12] Revert "fix: Remove Cape from hostname to test ci" This reverts commit 7a22d0a37edfda5282805f1bfada3083e9b30c0a. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f40a4f..e9a3726 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: hostname: - Tytonidae # - Akun - # - Cape + - Cape steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v25 From f6b325d3d5a0104a35bcd6896767d21fe98f752a Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 03/12] Revert "fix: Remove Akun from github ci hostname" This reverts commit b6184c50459b1577279d8c3d2ad388c0eb7d65f3. --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9a3726..26b9937 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - hostname: - - Tytonidae - # - Akun - - Cape + hostname: [Tytonidae, Akun, Cape] steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v25 From 8fd58722da7d871269138e95f3945cb5c8166f55 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 04/12] Revert "feat: Add nix build option for github ci" This reverts commit 02b5da7c5fa481699588419bca792c0bce2bad04. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26b9937..177e1be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,5 +25,5 @@ jobs: with: name: youthlic authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - run: nix build -L .#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel + - run: nix build .#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel - run: nix run nixpkgs#toybox -- echo OK From 55c578d3db77626d27b86d3fadb8d25a54c97629 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 05/12] Revert "feat: Move nvchad config to `ulic-youthlic/nvchad-starter`" This reverts commit 9c59296b243e6964d80773b0bc3382e112857880. --- flake.lock | 13 ++--- flake.nix | 4 +- nvchad/init.lua | 37 ++++++++++++ nvchad/lua/autocmds.lua | 1 + nvchad/lua/chadrc.lua | 31 ++++++++++ nvchad/lua/configs/conform.lua | 18 ++++++ nvchad/lua/configs/idris2.lua | 8 +++ nvchad/lua/configs/lazy.lua | 45 +++++++++++++++ nvchad/lua/configs/lspconfig.lua | 23 ++++++++ nvchad/lua/mappings.lua | 32 +++++++++++ nvchad/lua/options.lua | 99 ++++++++++++++++++++++++++++++++ nvchad/lua/plugins/init.lua | 56 ++++++++++++++++++ 12 files changed, 356 insertions(+), 11 deletions(-) create mode 100644 nvchad/init.lua create mode 100644 nvchad/lua/autocmds.lua create mode 100644 nvchad/lua/chadrc.lua create mode 100644 nvchad/lua/configs/conform.lua create mode 100644 nvchad/lua/configs/idris2.lua create mode 100644 nvchad/lua/configs/lazy.lua create mode 100644 nvchad/lua/configs/lspconfig.lua create mode 100644 nvchad/lua/mappings.lua create mode 100644 nvchad/lua/options.lua create mode 100644 nvchad/lua/plugins/init.lua diff --git a/flake.lock b/flake.lock index d80729b..daea469 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 7ca5cae..50ab6f7 100644 --- a/flake.nix +++ b/flake.nix @@ -186,9 +186,7 @@ repo = "neovim-nightly-overlay"; }; nvchad-starter = { - type = "github"; - owner = "ulic-youthlic"; - repo = "nvchad-starter"; + url = "path:./nvchad"; flake = false; }; nix4nvchad = { diff --git a/nvchad/init.lua b/nvchad/init.lua new file mode 100644 index 0000000..e861b68 --- /dev/null +++ b/nvchad/init.lua @@ -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) diff --git a/nvchad/lua/autocmds.lua b/nvchad/lua/autocmds.lua new file mode 100644 index 0000000..d2db0bb --- /dev/null +++ b/nvchad/lua/autocmds.lua @@ -0,0 +1 @@ +require "nvchad.autocmds" diff --git a/nvchad/lua/chadrc.lua b/nvchad/lua/chadrc.lua new file mode 100644 index 0000000..bd014be --- /dev/null +++ b/nvchad/lua/chadrc.lua @@ -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 diff --git a/nvchad/lua/configs/conform.lua b/nvchad/lua/configs/conform.lua new file mode 100644 index 0000000..dd5af91 --- /dev/null +++ b/nvchad/lua/configs/conform.lua @@ -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 diff --git a/nvchad/lua/configs/idris2.lua b/nvchad/lua/configs/idris2.lua new file mode 100644 index 0000000..8504e40 --- /dev/null +++ b/nvchad/lua/configs/idris2.lua @@ -0,0 +1,8 @@ +local options = {} + +options = { + default_regexp_syntax = true, + use_default_semantic_hl_groups = true +} + +return options diff --git a/nvchad/lua/configs/lazy.lua b/nvchad/lua/configs/lazy.lua new file mode 100644 index 0000000..e3b15c2 --- /dev/null +++ b/nvchad/lua/configs/lazy.lua @@ -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", + }, + }, + }, +} diff --git a/nvchad/lua/configs/lspconfig.lua b/nvchad/lua/configs/lspconfig.lua new file mode 100644 index 0000000..d8d5552 --- /dev/null +++ b/nvchad/lua/configs/lspconfig.lua @@ -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 diff --git a/nvchad/lua/mappings.lua b/nvchad/lua/mappings.lua new file mode 100644 index 0000000..b561611 --- /dev/null +++ b/nvchad/lua/mappings.lua @@ -0,0 +1,32 @@ +require "nvchad.mappings" + +local map = vim.keymap.set + +map("n", "", ":", { desc = "CMD enter command mode" }) +map("n", "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" }, "", "Telescope help_tags", { desc = "telescope help page" }) +map("i", "", "", { desc = "backspace" }) +map({ "n", "v" }, "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", "^") diff --git a/nvchad/lua/options.lua b/nvchad/lua/options.lua new file mode 100644 index 0000000..200ea2f --- /dev/null +++ b/nvchad/lua/options.lua @@ -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 diff --git a/nvchad/lua/plugins/init.lua b/nvchad/lua/plugins/init.lua new file mode 100644 index 0000000..60c51b2 --- /dev/null +++ b/nvchad/lua/plugins/init.lua @@ -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, + }, +} From cb97f43e1102a24b48b8590ef71a97212e066868 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 06/12] Revert "Revert "fix: Try to use lix installer in github ci"" This reverts commit 8de70ee867bd4ef4188787059a33d695cfada62f. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177e1be..c9d9ed0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,7 @@ jobs: - uses: cachix/install-nix-action@v25 with: nix_path: nixpkgs=channel:nixos-unstable + install_url: "https://install.lix.systems/lix" extra_nix_config: | 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/ From ff78d71406b11294fa59b1fad132f32352a660f2 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 07/12] Revert "fix: Try to use lix installer in github ci" This reverts commit c8d5b218b052fb92c5b97cfe1c6be397dba944de. --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9d9ed0..177e1be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,6 @@ jobs: - uses: cachix/install-nix-action@v25 with: nix_path: nixpkgs=channel:nixos-unstable - install_url: "https://install.lix.systems/lix" extra_nix_config: | 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/ From 4205a8bcb3e081521d175b9ac879fa6a56facb26 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 08/12] Revert "fix: Remove `|>` operator to fix ci" This reverts commit 6a7b5838bc28801ca28019e493e2a48319acc13a. --- .github/workflows/test.yml | 1 + flake/deploy.nix | 26 +++++------- flake/home.nix | 41 ++++++++----------- flake/nixos.nix | 14 +++---- flake/overlays.nix | 12 +++--- .../modules/programs/alacritty/default.nix | 24 ++++------- home/modules/programs/helix/default.nix | 7 +--- nixos/modules/nix.nix | 40 +++++++++--------- overlays/additions/default.nix | 32 +++++++-------- overlays/modifications/default.nix | 40 ++++++++---------- pkgs/helix/runtime.nix | 36 ++++++++-------- pkgs/wallpapers.nix | 7 ++-- treefmt.nix | 9 +--- 13 files changed, 122 insertions(+), 167 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177e1be..8c14ea4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: extra_nix_config: | 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/ + experimental-features = nix-command flakes pipe-operator - uses: cachix/cachix-action@v14 with: name: youthlic diff --git a/flake/deploy.nix b/flake/deploy.nix index cc91f14..8ebe2b4 100644 --- a/flake/deploy.nix +++ b/flake/deploy.nix @@ -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) { }; }; } diff --git a/flake/home.nix b/flake/home.nix index 88e403b..639acb5 100644 --- a/flake/home.nix +++ b/flake/home.nix @@ -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; }; } diff --git a/flake/nixos.nix b/flake/nixos.nix index 5dc4fc1..aad7864 100644 --- a/flake/nixos.nix +++ b/flake/nixos.nix @@ -30,13 +30,11 @@ in }; }; in - with lib; - pipe - [ - "Tytonidae" - "Cape" - "Akun" - ] - [ (flip genAttrs makeNixosConfiguration) ]; + [ + "Tytonidae" + "Cape" + "Akun" + ] + |> (with lib; flip genAttrs makeNixosConfiguration); }; } diff --git a/flake/overlays.nix b/flake/overlays.nix index 95d165b..eb44391 100644 --- a/flake/overlays.nix +++ b/flake/overlays.nix @@ -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}"))); } diff --git a/home/david/modules/programs/alacritty/default.nix b/home/david/modules/programs/alacritty/default.nix index 37df2d4..69551d6 100644 --- a/home/david/modules/programs/alacritty/default.nix +++ b/home/david/modules/programs/alacritty/default.nix @@ -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" + ]; + }; }; }; } diff --git a/home/modules/programs/helix/default.nix b/home/modules/programs/helix/default.nix index 64bb758..717d76b 100644 --- a/home/modules/programs/helix/default.nix +++ b/home/modules/programs/helix/default.nix @@ -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 = { diff --git a/nixos/modules/nix.nix b/nixos/modules/nix.nix index cae67e7..cbae8ed 100644 --- a/nixos/modules/nix.nix +++ b/nixos/modules/nix.nix @@ -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; + }; + } + ); }; }; } diff --git a/overlays/additions/default.nix b/overlays/additions/default.nix index 44b55b5..a73aec7 100644 --- a/overlays/additions/default.nix +++ b/overlays/additions/default.nix @@ -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) diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index e6bcfee..0069ba5 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -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) diff --git a/pkgs/helix/runtime.nix b/pkgs/helix/runtime.nix index 65117ee..d7c5683 100644 --- a/pkgs/helix/runtime.nix +++ b/pkgs/helix/runtime.nix @@ -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 diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix index e759e92..837ac5f 100644 --- a/pkgs/wallpapers.nix +++ b/pkgs/wallpapers.nix @@ -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 diff --git a/treefmt.nix b/treefmt.nix index a81d136..cb2cca0 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -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; From 41adff27ec69b11ad503a6e2f68bba411d53866e Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 09/12] Revert "fix: Try enable pipe-operator" This reverts commit 3b570cc47a593c036706e94ec885481567ed15f7. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c14ea4..78f779a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: extra_nix_config: | 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/ - experimental-features = nix-command flakes pipe-operator + experimental-features = nix-command flakes pipe-operators - uses: cachix/cachix-action@v14 with: name: youthlic From 63cd93142566248587092f2cb310f1dde4b1e357 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 10/12] Revert "fix: Enable pipe-operator feature for nix" This reverts commit 5feeaeb6e41dfe82ea8a50e5b8af20108903ac89. --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78f779a..177e1be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,6 @@ jobs: extra_nix_config: | 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/ - experimental-features = nix-command flakes pipe-operators - uses: cachix/cachix-action@v14 with: name: youthlic From 2c68cb50eb6e08f1494bc284f147ae8390ad337a Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 11/12] Revert "fix: Wrong github action matrix definition" This reverts commit 384ce384b6631a814ab99f4773e2df8064c0c99f. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177e1be..b2616fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - hostname: [Tytonidae, Akun, Cape] + hostname: [Tytonidae Akun Cape] steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v25 From b418f7ca4b0ddc5a1f56d04ae9dbf8c2767605da Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 03:53:33 +0800 Subject: [PATCH 12/12] Revert "feat: Try to add cachix support in github action" This reverts commit f9f147e5ec91f8f3e8ea1b0035e881e3096db119. --- .github/workflows/test.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index b2616fc..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +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: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - 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 .#nixosConfigurations.${{ matrix.hostname }}.config.system.build.toplevel - - run: nix run nixpkgs#toybox -- echo OK