mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-28 18:39:31 +02:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d7c0e7caa6 | |||
| d8759cc845 | |||
| 6c6ada4243 | |||
| 95cdd40c77 | |||
| a04d6dfdf6 | |||
| adf1415868 | |||
| b1c6f1b90f | |||
| 5e9f98e56d | |||
| 885205d9e3 | |||
| 385bcd2d87 | |||
| b3b55c36d8 | |||
| 7d6fa4028d | |||
| 0ea8548f37 | |||
| c29148fc77 | |||
| 1eecf89793 | |||
| 5fcf0d0995 | |||
| 66949f6b8f | |||
| 36ba5a4efc | |||
| 68285a70d0 | |||
| f97ad2fd1e | |||
| 1d66cf655d | |||
| 04fa05151a | |||
| 62d986d1c8 | |||
| 730906ebf2 | |||
| bcf5b8b1cb | |||
| 1f14f5899c | |||
| 9732c87d1f | |||
| 032f478d2a | |||
| 71cb1cf295 | |||
| 09a9e086d8 | |||
| e903f95a46 | |||
| 1239f4549a | |||
| 4433e018d9 | |||
| e9ac7d8ddc | |||
| cf51e77d75 | |||
| 095b092e08 | |||
| 4e4eb9a003 | |||
| 1efe489846 | |||
| ea13da3031 | |||
| 47a735d235 | |||
| 84c4708b98 | |||
| 12494d66af | |||
| 97ff571431 | |||
| c0e3af3fad | |||
| bbe2e80650 |
+1
-1
@@ -1,3 +1,3 @@
|
||||
github: ryan4yin
|
||||
patreon: ryan4yin
|
||||
custom: ["https://buymeacoffee.com/ryan4yin", "https://afdian.net/a/ryan4yin"]
|
||||
custom: ["https://buymeacoffee.com/ryan4yin"]
|
||||
|
||||
@@ -10,4 +10,5 @@ extend-ignore-re = [
|
||||
"iterm2",
|
||||
"iHgEIBYKACAWIQSizQe9ljFEyyclWmtVhZllwnQrSwUCZZ1T9wIdAAAKCRBVhZll", # crypto keys
|
||||
"noice", # noice.nvim
|
||||
"crypted-nixos",
|
||||
]
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> My configuration is becoming more and more complex, and it will be difficult for beginners to
|
||||
> read. If you are new to NixOS and want to know how I use NixOS, I would recommend you to take a
|
||||
> My configuration is becoming more and more complex, and **it will be difficult for beginners to
|
||||
> read**. If you are new to NixOS and want to know how I use NixOS, I would recommend you to take a
|
||||
> look at the [ryan4yin/nix-config/releases](https://github.com/ryan4yin/nix-config/releases) first,
|
||||
> **checkout to some simpler older versions, such as
|
||||
> [i3-kickstarter](https://github.com/ryan4yin/nix-config/tree/i3-kickstarter), which will be much
|
||||
|
||||
Generated
+190
-441
File diff suppressed because it is too large
Load Diff
@@ -12,18 +12,16 @@
|
||||
|
||||
# the nixConfig here only affects the flake itself, not the system configuration!
|
||||
# for more information, see:
|
||||
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/add-custom-cache-servers
|
||||
# https://nixos-and-flakes.thiscute.world/nix-store/add-binary-cache-servers
|
||||
nixConfig = {
|
||||
# substituers will be appended to the default substituters when fetching packages
|
||||
extra-substituters = [
|
||||
"https://anyrun.cachix.org"
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-gaming.cachix.org"
|
||||
# "https://nixpkgs-wayland.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||
];
|
||||
@@ -36,9 +34,9 @@
|
||||
# which represents the GitHub repository URL + branch/commit-id/tag.
|
||||
|
||||
# Official NixOS package source, using nixos's unstable branch by default
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||
# nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
|
||||
# for macos
|
||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
|
||||
@@ -50,8 +48,8 @@
|
||||
|
||||
# home-manager, used for managing user configuration
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-24.05";
|
||||
# url = "github:nix-community/home-manager/master";
|
||||
url = "github:nix-community/home-manager/master";
|
||||
# url = "github:nix-community/home-manager/release-24.05";
|
||||
|
||||
# The `follows` keyword in inputs is used for inheritance.
|
||||
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
|
||||
@@ -60,17 +58,12 @@
|
||||
};
|
||||
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote/v0.3.0";
|
||||
url = "github:nix-community/lanzaboote/v0.4.1";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
hyprland = {
|
||||
url = "github:hyprwm/Hyprland/v0.39.1";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# community wayland nixpkgs
|
||||
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||
# anyrun - a wayland launcher
|
||||
|
||||
@@ -5,17 +5,22 @@
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
skopeo
|
||||
docker-compose
|
||||
dive # explore docker layers
|
||||
lazydocker # Docker terminal UI.
|
||||
skopeo # copy/sync images between registries and local storage
|
||||
go-containerregistry # provides `crane` & `gcrane`, it's similar to skopeo
|
||||
|
||||
kubectl
|
||||
kubebuilder
|
||||
istioctl
|
||||
clusterctl # for kubernetes cluster-api
|
||||
kubevirt # virtctl
|
||||
kubernetes-helm
|
||||
fluxcd
|
||||
argocd
|
||||
|
||||
ko # build go project to container image
|
||||
];
|
||||
|
||||
programs = {
|
||||
|
||||
@@ -115,6 +115,33 @@ $env.config = {
|
||||
# buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
||||
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||
edit_mode: emacs # emacs, vi
|
||||
shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
|
||||
shell_integration: {
|
||||
# osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
|
||||
osc2: true
|
||||
# osc7 is a way to communicate the path to the terminal, this is helpful for spawning new tabs in the same directory
|
||||
osc7: true
|
||||
# osc8 is also implemented as the deprecated setting ls.show_clickable_links, it shows clickable links in ls output if your terminal supports it. show_clickable_links is deprecated in favor of osc8
|
||||
osc8: true
|
||||
# osc9_9 is from ConEmu and is starting to get wider support. It's similar to osc7 in that it communicates the path to the terminal
|
||||
osc9_9: false
|
||||
# osc133 is several escapes invented by Final Term which include the supported ones below.
|
||||
# 133;A - Mark prompt start
|
||||
# 133;B - Mark prompt end
|
||||
# 133;C - Mark pre-execution
|
||||
# 133;D;exit - Mark execution finished with exit code
|
||||
# This is used to enable terminals to know where the prompt is, the command is, where the command finishes, and where the output of the command is
|
||||
osc133: true
|
||||
# osc633 is closely related to osc133 but only exists in visual studio code (vscode) and supports their shell integration features
|
||||
# 633;A - Mark prompt start
|
||||
# 633;B - Mark prompt end
|
||||
# 633;C - Mark pre-execution
|
||||
# 633;D;exit - Mark execution finished with exit code
|
||||
# 633;E - NOT IMPLEMENTED - Explicitly set the command line with an optional nonce
|
||||
# 633;P;Cwd=<path> - Mark the current working directory and communicate it to the terminal
|
||||
# and also helps with the run recent menu in vscode
|
||||
osc633: true
|
||||
# reset_application_mode is escape \x1b[?1l and was added to help ssh work better
|
||||
reset_application_mode: true
|
||||
}
|
||||
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let
|
||||
{pkgs-unstable, ...}: let
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
@@ -11,6 +11,7 @@ in {
|
||||
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.nushell;
|
||||
configFile.source = ./config.nu;
|
||||
inherit shellAliases;
|
||||
};
|
||||
|
||||
@@ -3,5 +3,8 @@
|
||||
mitmproxy # http/https proxy tool
|
||||
insomnia # REST client
|
||||
wireshark # network analyzer
|
||||
|
||||
# IDEs
|
||||
jetbrains.idea-community
|
||||
];
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
|
||||
# aliyun
|
||||
aliyun-cli
|
||||
# digitalocean
|
||||
doctl
|
||||
# google cloud
|
||||
google-cloud-sdk
|
||||
|
||||
# cloud tools that nix do not have cache for.
|
||||
terraform
|
||||
terraformer # generate terraform configs from existing cloud resources
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
# Automatically trims your branches whose tracking remote refs are merged or gone
|
||||
# It's really useful when you work on a project for a long time.
|
||||
git-trim
|
||||
gitleaks
|
||||
|
||||
# need to run `conda-install` before using it
|
||||
# need to run `conda-shell` before using command `conda`
|
||||
|
||||
@@ -30,7 +30,7 @@ Use `:tutor` in helix to start the tutorial.
|
||||
1. Personally I'm glad to take a look at a Rust codebase, but not a VimScript/Lua codebase.
|
||||
1. Neovim have a very activate plugin ecosystem, and it's easy to find plugins for almost
|
||||
everything.
|
||||
1. Helix is still new, and it even do have a stable plugin system yet. A PR to add a plugin
|
||||
1. Helix is still new, and it even don't have a stable plugin system yet. A PR to add a plugin
|
||||
system is still envolving: <https://github.com/helix-editor/helix/pull/8675>
|
||||
1. Neovim has integrated terminal, and it's very powerful. It's quite similar to VSCode's integrated
|
||||
terminal. I use it a lot.
|
||||
|
||||
@@ -88,7 +88,7 @@ plugin.
|
||||
### Window Navigation
|
||||
|
||||
- Switch between windows: `<Ctrl> + h/j/k/l`
|
||||
- Resize windows: `<Ctrl> + Up/Down/Left/Right`
|
||||
- Resize windows: `<Ctrl> + Up/Down/Left/Right` (`<Ctrl-w> + -/+/</>`)
|
||||
- Note: On macOS, conflicts with system shortcuts
|
||||
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
||||
|
||||
@@ -159,10 +159,11 @@ Provided by mini.surround plugin.
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
| Action | |
|
||||
| --------------------- | --------------- |
|
||||
| Show all Yank History | `:<Space> + yh` |
|
||||
| Show undo history | `:<Space> + uh` |
|
||||
| Action | |
|
||||
| --------------------------------- | --------------- |
|
||||
| Show all Yank History | `:<Space> + yh` |
|
||||
| Show undo history | `:<Space> + uh` |
|
||||
| Show the path of the current file | `:!echo $%` |
|
||||
|
||||
## Additional Resources
|
||||
|
||||
|
||||
@@ -30,8 +30,10 @@ in {
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
# currently we use lazy.nvim as neovim's package manager, so comment this one.
|
||||
# Install packages that will compile locally or download FHS binaries via Nix!
|
||||
# Currently we use lazy.nvim as neovim's package manager, so comment this one.
|
||||
#
|
||||
# NOTE: These plugins will not be used by astronvim by default!
|
||||
# We should install packages that will compile locally or download FHS binaries via Nix!
|
||||
# and use lazy.nvim's `dir` option to specify the package directory in nix store.
|
||||
# so that these plugins can work on NixOS.
|
||||
#
|
||||
@@ -40,6 +42,8 @@ in {
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# search all the plugins using https://search.nixos.org/packages
|
||||
telescope-fzf-native-nvim
|
||||
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
@@ -42,40 +41,51 @@ return {
|
||||
-- end
|
||||
},
|
||||
-- enable servers that you already have installed without mason
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
servers = {
|
||||
---- Frontend & NodeJS
|
||||
---- Data & Configuration Languages
|
||||
"jsonls", -- json language server
|
||||
"jsonnet_ls", -- jsonnet language server
|
||||
"yamlls", -- yaml language server
|
||||
"taplo", -- toml language server
|
||||
"dagger", -- cuelsp - cue language server
|
||||
"terraformls", -- terraform hcl
|
||||
"marksman", -- markdown ls
|
||||
"nickel_ls", -- nickel language server
|
||||
"nil_ls", -- nix language server
|
||||
"bufls", -- protocol buffer language server
|
||||
"dockerls", -- dockerfile
|
||||
"cmake", -- cmake language server
|
||||
"sqls", -- sql language server
|
||||
|
||||
---- General Purpose Languages
|
||||
"clangd", -- c/c++
|
||||
"gopls", -- go
|
||||
"jdtls", -- java language server, provides only basic features
|
||||
"rust_analyzer", -- rust
|
||||
"pyright", -- python
|
||||
"ruff_lsp", -- extremely fast Python linter and code transformation
|
||||
-- "julials", -- julia language server
|
||||
-- "zls", -- zig language server
|
||||
"lua_ls", -- lua
|
||||
"bashls", -- bash
|
||||
"nushell", -- nushell language server
|
||||
|
||||
---- Web Development
|
||||
"tsserver", -- typescript/javascript language server
|
||||
"tailwindcss", -- tailwindcss language server
|
||||
"html", -- html language server
|
||||
"cssls", -- css language server
|
||||
"prismals", -- prisma language server
|
||||
"volar", -- vue language server
|
||||
---- Configuration Language
|
||||
"marksman", -- markdown ls
|
||||
"jsonls", -- json language server
|
||||
"yamlls", -- yaml language server
|
||||
"taplo", -- toml language server
|
||||
---- Backend
|
||||
"lua_ls", -- lua
|
||||
"gopls", -- go
|
||||
"rust_analyzer", -- rust
|
||||
"pyright", -- python
|
||||
"ruff_lsp", -- extremely fast Python linter and code transformation
|
||||
"jdtls", -- java
|
||||
"nil_ls", -- nix language server
|
||||
"bufls", -- protocol buffer language server
|
||||
"zls", -- zig language server
|
||||
---- HDL
|
||||
"verible", -- verilog language server
|
||||
---- Operation & Cloud Nativautoindente
|
||||
"bashls", -- bash
|
||||
"cmake", -- cmake language server
|
||||
"clangd", -- c/c++
|
||||
"dockerls", -- dockerfile
|
||||
"jsonnet_ls", -- jsonnet language server
|
||||
"terraformls", -- terraform hcl
|
||||
"nushell", -- nushell language server
|
||||
|
||||
---- Lisp Like
|
||||
"scheme_langserver", -- scheme language server
|
||||
"elixirls", -- elixir language server
|
||||
-- "clojure_lsp", -- clojure language server"
|
||||
|
||||
---- Circuit Design
|
||||
"verible", -- verilog language server
|
||||
},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
---@diagnostic disable: missing-fields
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
-- NOTE: additional parser
|
||||
{ "nushell/tree-sitter-nu" }, -- nushell scripts
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.incremental_selection = {
|
||||
enable = true,
|
||||
@@ -13,48 +17,25 @@ return {
|
||||
node_decremental = "<bs>", -- Backspace
|
||||
},
|
||||
}
|
||||
opts.ignore_install = { "gotmpl" }
|
||||
opts.ignore_install = { "gotmpl", "wing" }
|
||||
|
||||
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter/tree/master
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
-- neovim
|
||||
"vim",
|
||||
"lua",
|
||||
-- operation & cloud native
|
||||
"dockerfile",
|
||||
"hcl",
|
||||
"jsonnet",
|
||||
"regex",
|
||||
"terraform",
|
||||
"nix",
|
||||
-- please add only the tree-sitters that are not available in nixpkgs here
|
||||
|
||||
"kdl",
|
||||
"csv",
|
||||
-- other programming language
|
||||
"xml",
|
||||
|
||||
---- Misc
|
||||
"diff",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitignore",
|
||||
"gitcommit",
|
||||
"latex",
|
||||
"sql",
|
||||
-- Lisp like
|
||||
"fennel",
|
||||
"clojure",
|
||||
"commonlisp",
|
||||
-- customized languages:
|
||||
"scheme",
|
||||
"gitattributes",
|
||||
"ssh_config",
|
||||
})
|
||||
|
||||
-- add support for scheme
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.scheme = {
|
||||
install_info = {
|
||||
url = "https://github.com/6cdh/tree-sitter-scheme", -- local path or git repo
|
||||
files = { "src/parser.c" },
|
||||
-- optional entries:
|
||||
branch = "main", -- default branch in case of git repo if different from master
|
||||
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||
},
|
||||
}
|
||||
-- use scheme parser for filetypes: scm
|
||||
vim.treesitter.language.register("scheme", "scm")
|
||||
end,
|
||||
}
|
||||
|
||||
+131
-113
@@ -5,133 +5,151 @@
|
||||
'';
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
#-- c/c++
|
||||
cmake
|
||||
cmake-language-server
|
||||
gnumake
|
||||
checkmake
|
||||
# c/c++ compiler, required by nvim-treesitter!
|
||||
gcc
|
||||
# c/c++ tools with clang-tools, the unwrapped version won't
|
||||
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
||||
# llvmPackages.clang-unwrapped
|
||||
clang-tools
|
||||
lldb
|
||||
home.packages = with pkgs; (
|
||||
# -*- Data & Configuration Languages -*-#
|
||||
[
|
||||
#-- nix
|
||||
nil
|
||||
# rnix-lsp
|
||||
# nixd
|
||||
statix # Lints and suggestions for the nix programming language
|
||||
deadnix # Find and remove unused code in .nix source files
|
||||
alejandra # Nix Code Formatter
|
||||
|
||||
#-- python
|
||||
nodePackages.pyright # python language server
|
||||
(python311.withPackages (
|
||||
ps:
|
||||
with ps; [
|
||||
ruff-lsp
|
||||
black # python formatter
|
||||
# debugpy
|
||||
#-- nickel lang
|
||||
nickel
|
||||
|
||||
# my commonly used python packages
|
||||
jupyter
|
||||
ipython
|
||||
pandas
|
||||
requests
|
||||
pyquery
|
||||
pyyaml
|
||||
boto3
|
||||
#-- json like
|
||||
# terraform # install via brew on macOS
|
||||
terraform-ls
|
||||
jsonnet
|
||||
jsonnet-language-server
|
||||
taplo # TOML language server / formatter / validator
|
||||
nodePackages.yaml-language-server
|
||||
actionlint # GitHub Actions linter
|
||||
|
||||
## emacs's lsp-bridge dependenciesge
|
||||
# epc
|
||||
# orjson
|
||||
# sexpdata
|
||||
# six
|
||||
# setuptools
|
||||
# paramiko
|
||||
# rapidfuzz
|
||||
]
|
||||
))
|
||||
#-- dockerfile
|
||||
hadolint # Dockerfile linter
|
||||
nodePackages.dockerfile-language-server-nodejs
|
||||
|
||||
#-- rust
|
||||
rust-analyzer
|
||||
cargo # rust package manager
|
||||
rustfmt
|
||||
#-- markdown
|
||||
marksman # language server for markdown
|
||||
glow # markdown previewer
|
||||
pandoc # document converter
|
||||
hugo # static site generator
|
||||
|
||||
#-- nix
|
||||
nil
|
||||
# rnix-lsp
|
||||
# nixd
|
||||
statix # Lints and suggestions for the nix programming language
|
||||
deadnix # Find and remove unused code in .nix source files
|
||||
alejandra # Nix Code Formatter
|
||||
#-- sql
|
||||
sqlfluff
|
||||
|
||||
#-- golang
|
||||
go
|
||||
gomodifytags
|
||||
iferr # generate error handling code for go
|
||||
impl # generate function implementation for go
|
||||
gotools # contains tools like: godoc, goimports, etc.
|
||||
gopls # go language server
|
||||
delve # go debugger
|
||||
#-- protocol buffer
|
||||
buf # linting and formatting
|
||||
]
|
||||
++
|
||||
#-*- General Purpose Languages -*-#
|
||||
[
|
||||
#-- c/c++
|
||||
cmake
|
||||
cmake-language-server
|
||||
gnumake
|
||||
checkmake
|
||||
# c/c++ compiler, required by nvim-treesitter!
|
||||
gcc
|
||||
gdb
|
||||
# c/c++ tools with clang-tools, the unwrapped version won't
|
||||
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
||||
# llvmPackages.clang-unwrapped
|
||||
clang-tools
|
||||
lldb
|
||||
|
||||
# -- java
|
||||
jdk17
|
||||
gradle
|
||||
maven
|
||||
spring-boot-cli
|
||||
#-- python
|
||||
pyright # python language server
|
||||
(python311.withPackages (
|
||||
ps:
|
||||
with ps; [
|
||||
ruff-lsp
|
||||
black # python formatter
|
||||
# debugpy
|
||||
|
||||
#-- lua
|
||||
stylua
|
||||
lua-language-server
|
||||
# my commonly used python packages
|
||||
jupyter
|
||||
ipython
|
||||
pandas
|
||||
requests
|
||||
pyquery
|
||||
pyyaml
|
||||
boto3
|
||||
|
||||
#-- bash
|
||||
nodePackages.bash-language-server
|
||||
shellcheck
|
||||
shfmt
|
||||
## emacs's lsp-bridge dependenciesge
|
||||
# epc
|
||||
# orjson
|
||||
# sexpdata
|
||||
# six
|
||||
# setuptools
|
||||
# paramiko
|
||||
# rapidfuzz
|
||||
]
|
||||
))
|
||||
|
||||
#-- javascript/typescript --#
|
||||
nodePackages.nodejs
|
||||
nodePackages.typescript
|
||||
nodePackages.typescript-language-server
|
||||
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
||||
nodePackages.vscode-langservers-extracted
|
||||
nodePackages."@tailwindcss/language-server"
|
||||
emmet-ls
|
||||
#-- rust
|
||||
rust-analyzer
|
||||
cargo # rust package manager
|
||||
rustfmt
|
||||
|
||||
# -- Lisp like Languages
|
||||
guile
|
||||
racket-minimal
|
||||
fnlfmt # fennel
|
||||
#-- golang
|
||||
go
|
||||
gomodifytags
|
||||
iferr # generate error handling code for go
|
||||
impl # generate function implementation for go
|
||||
gotools # contains tools like: godoc, goimports, etc.
|
||||
gopls # go language server
|
||||
delve # go debugger
|
||||
|
||||
#-- Others
|
||||
taplo # TOML language server / formatter / validator
|
||||
nodePackages.yaml-language-server
|
||||
sqlfluff # SQL linter
|
||||
actionlint # GitHub Actions linter
|
||||
buf # protoc plugin for linting and formatting
|
||||
proselint # English prose linter
|
||||
# -- java
|
||||
jdk17
|
||||
gradle
|
||||
maven
|
||||
spring-boot-cli
|
||||
jdt-language-server
|
||||
|
||||
#-- Misc
|
||||
tree-sitter # common language parser/highlighter
|
||||
nodePackages.prettier # common code formatter
|
||||
marksman # language server for markdown
|
||||
glow # markdown previewer
|
||||
fzf
|
||||
pandoc # document converter
|
||||
hugo # static site generator
|
||||
#-- zig
|
||||
zls
|
||||
|
||||
#-- Optional Requirements:
|
||||
gdu # disk usage analyzer, required by AstroNvim
|
||||
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
|
||||
#-- lua
|
||||
stylua
|
||||
lua-language-server
|
||||
|
||||
#-- CloudNative
|
||||
nodePackages.dockerfile-language-server-nodejs
|
||||
# terraform # install via brew on macOS
|
||||
terraform-ls
|
||||
jsonnet
|
||||
jsonnet-language-server
|
||||
hadolint # Dockerfile linter
|
||||
#-- bash
|
||||
nodePackages.bash-language-server
|
||||
shellcheck
|
||||
shfmt
|
||||
]
|
||||
#-*- Web Development -*-#
|
||||
++ [
|
||||
nodePackages.nodejs
|
||||
nodePackages.typescript
|
||||
nodePackages.typescript-language-server
|
||||
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
||||
nodePackages.vscode-langservers-extracted
|
||||
nodePackages."@tailwindcss/language-server"
|
||||
emmet-ls
|
||||
]
|
||||
# -*- Lisp like Languages -*-#
|
||||
++ [
|
||||
guile
|
||||
racket-minimal
|
||||
fnlfmt # fennel
|
||||
]
|
||||
++ [
|
||||
proselint # English prose linter
|
||||
|
||||
#-- zig
|
||||
zls
|
||||
#-- verilog / systemverilog
|
||||
verible
|
||||
gdb
|
||||
];
|
||||
#-- verilog / systemverilog
|
||||
verible
|
||||
|
||||
#-- Optional Requirements:
|
||||
nodePackages.prettier # common code formatter
|
||||
fzf
|
||||
gdu # disk usage analyzer, required by AstroNvim
|
||||
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ in {
|
||||
use ${nu_scripts}/share/nu_scripts/custom-completions/cargo/cargo-completions.nu *
|
||||
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
||||
# alias
|
||||
use ${nu_scripts}/share/nu_scripts/aliases/git/git-aliases.nu *
|
||||
# use ${nu_scripts}/share/nu_scripts/aliases/git/git-aliases.nu *
|
||||
use ${nu_scripts}/share/nu_scripts/aliases/eza/eza-aliases.nu *
|
||||
# use ${nu_scripts}/share/nu_scripts/aliases/bat/bat-aliases.nu *
|
||||
use ${nu_scripts}/share/nu_scripts/aliases/bat/bat-aliases.nu *
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
{pkgs-stable, ...}: {
|
||||
home.packages = with pkgs-stable; [
|
||||
# https://joplinapp.org/help/
|
||||
joplin # joplin-cli
|
||||
joplin-desktop
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Fix anyrun
|
||||
## https://github.com/anyrun-org/anyrun/issues/153
|
||||
ln -s $XDG_RUNTIME_DIR/hypr /tmp/hypr
|
||||
|
||||
## Autostart Programs
|
||||
|
||||
# Kill already running process
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
hyprland,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: let
|
||||
package = hyprland.packages.${pkgs.system}.hyprland;
|
||||
package = pkgs.hyprland;
|
||||
in {
|
||||
# NOTE:
|
||||
# We have to enable hyprland/i3's systemd user service in home-manager,
|
||||
@@ -30,7 +29,10 @@ in {
|
||||
};
|
||||
extraConfig = builtins.readFile ../conf/hyprland.conf;
|
||||
# gammastep/wallpaper-switcher need this to be enabled.
|
||||
systemd.enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
variables = ["--all"];
|
||||
};
|
||||
};
|
||||
|
||||
# NOTE: this executable is used by greetd to start a wayland session when system boot up
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
LUKS encrypted SSD for NixOS, on Orange Pi 5 Plus.
|
||||
|
||||
Host running storage, operation and maintenance related services:
|
||||
Storage, operation and maintenance related services are running on this host:
|
||||
|
||||
1. Storage such as git server, file server/browser, torrent downloader,, etc.
|
||||
1. Backup or sync my personal data to cloud or NAS.
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
boot.initrd = {
|
||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||
luks.devices."encrypted-nixos" = {
|
||||
luks.devices."crypted-nixos" = {
|
||||
device = "/dev/nvme0n1p4";
|
||||
# the keyfile(or device partition) that should be used as the decryption key for the encrypted device.
|
||||
# if not specified, you will be prompted for a passphrase instead.
|
||||
|
||||
@@ -272,6 +272,12 @@ routing {
|
||||
domain(geosite:openai) -> sg
|
||||
domain(regex:'.+\.openai$') -> sg
|
||||
|
||||
# Steam
|
||||
domain(suffix: steampowered.com) -> direct
|
||||
domain(suffix: steamserver.net) -> direct
|
||||
domain(geosite:steam@cn) -> direct
|
||||
domain(geosite:steam) -> proxy
|
||||
|
||||
### Media
|
||||
domain(geosite:netflix) -> media
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ zram0 253:0 0 15.6G 0 disk [SWAP]
|
||||
nvme0n1 259:0 0 1.8T 0 disk
|
||||
├─nvme0n1p1 259:2 0 598M 0 part /boot
|
||||
└─nvme0n1p2 259:3 0 1.8T 0 part
|
||||
└─encrypted-nixos 254:0 0 1.8T 0 crypt /tmp
|
||||
└─crypted-nixos 254:0 0 1.8T 0 crypt /tmp
|
||||
/swap/swapfile
|
||||
/swap
|
||||
/snapshots
|
||||
|
||||
@@ -41,12 +41,10 @@ in {
|
||||
};
|
||||
virtualisation.docker.enableNvidia = true; # for nvidia-docker
|
||||
|
||||
hardware.opengl = {
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
# if hardware.opengl.driSupport is enabled, mesa is installed and provides Vulkan for supported hardware.
|
||||
driSupport = true;
|
||||
# needed by nvidia-docker
|
||||
driSupport32Bit = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
boot.initrd = {
|
||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||
luks.devices."encrypted-nixos" = {
|
||||
luks.devices."crypted-nixos" = {
|
||||
# NOTE: DO NOT use device name here(like /dev/sda, /dev/nvme0n1p2, etc), use UUID instead.
|
||||
# https://github.com/ryan4yin/nix-config/issues/43
|
||||
device = "/dev/disk/by-uuid/a21ca82a-9ee6-4e5c-9d3f-a93e84e4e0f4";
|
||||
|
||||
@@ -27,8 +27,10 @@ in {
|
||||
kubernetes-helm
|
||||
cilium-cli
|
||||
fluxcd
|
||||
clusterctl # for kubernetes cluster-api
|
||||
|
||||
skopeo
|
||||
skopeo # copy/sync images between registries and local storage
|
||||
go-containerregistry # provides `crane` & `gcrane`, it's similar to skopeo
|
||||
dive # explore docker layers
|
||||
];
|
||||
|
||||
|
||||
+2
-1
@@ -92,9 +92,10 @@
|
||||
substituters = [
|
||||
# cache mirror located in China
|
||||
# status: https://mirror.sjtu.edu.cn/
|
||||
# "https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
# status: https://mirrors.ustc.edu.cn/status/
|
||||
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||
|
||||
"https://nix-community.cachix.org"
|
||||
# my own cache server
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}:
|
||||
##########################################################################
|
||||
@@ -80,7 +81,7 @@ in {
|
||||
programs.zsh.enable = true;
|
||||
environment.shells = [
|
||||
pkgs.zsh
|
||||
pkgs.nushellFull # my custom shell
|
||||
pkgs-unstable.nushell # my custom shell
|
||||
];
|
||||
|
||||
# homebrew need to be installed manually, see https://brew.sh
|
||||
@@ -103,7 +104,7 @@ in {
|
||||
Wechat = 836500024;
|
||||
QQ = 451108668;
|
||||
WeCom = 1189898970; # Wechat for Work
|
||||
TecentMetting = 1484048379;
|
||||
TecentMeeting = 1484048379;
|
||||
QQMusic = 595615424;
|
||||
};
|
||||
|
||||
@@ -164,7 +165,7 @@ in {
|
||||
# Misc
|
||||
"shadowsocksx-ng" # proxy tool
|
||||
"iina" # video player
|
||||
"raycast" # (HotKey: alt/option + space)search, caculate and run scripts(with many plugins)
|
||||
"raycast" # (HotKey: alt/option + space)search, calculate and run scripts(with many plugins)
|
||||
"stats" # beautiful system status monitor in menu bar
|
||||
# "reaper" # audio editor
|
||||
"sonic-pi" # music programming
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
# Add ability to used TouchID for sudo authentication
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
time.timeZone = "Asia/Shanghai";
|
||||
|
||||
system = {
|
||||
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
||||
activationScripts.postUserActivation.text = ''
|
||||
@@ -183,13 +185,7 @@
|
||||
|
||||
# Fonts
|
||||
fonts = {
|
||||
# will be removed after this PR is merged:
|
||||
# https://github.com/LnL7/nix-darwin/pull/754
|
||||
fontDir.enable = true;
|
||||
|
||||
# will change to `fonts.packages` after this PR is merged:
|
||||
# https://github.com/LnL7/nix-darwin/pull/754
|
||||
fonts = with pkgs; [
|
||||
packages = with pkgs; [
|
||||
# packages = with pkgs; [
|
||||
# icon fonts
|
||||
material-design-icons
|
||||
|
||||
@@ -18,12 +18,19 @@
|
||||
|
||||
services.btrbk.instances.btrbk = {
|
||||
# How often this btrbk instance is started. See systemd.time(7) for more information about the format.
|
||||
onCalendar = "daily";
|
||||
onCalendar = "Tue,Fri,Sat,Sun *-*-* 3:45:20"; # daily at 3:45, except on Monday, Wednesday, and Thursday
|
||||
settings = {
|
||||
# keep daily snapshots for 14 days
|
||||
snapshot_preserve = "14d";
|
||||
# keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
|
||||
# how to prune local snapshots:
|
||||
# 1. keep daily snapshots for xx days
|
||||
snapshot_preserve = "9d";
|
||||
# 2. keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
|
||||
snapshot_preserve_min = "2d";
|
||||
|
||||
# hot to prune remote incremental baqckups:
|
||||
# keep daily backups for 9 days, weekly backups for 4 weeks, and monthly backups for 2 months
|
||||
target_preserve = "9d 4w 2m";
|
||||
target_preserve_min = "no";
|
||||
|
||||
volume = {
|
||||
"/btr_pool" = {
|
||||
subvolume = {
|
||||
@@ -31,7 +38,10 @@
|
||||
snapshot_create = "always";
|
||||
};
|
||||
};
|
||||
target = "/snapshots";
|
||||
|
||||
# backup to a remote server or a local directory
|
||||
# its prune policy is defined by `target_preserve` and `target_preserve_min`
|
||||
# target = "/snapshots";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
# add user's shell into /etc/shells
|
||||
environment.shells = with pkgs; [
|
||||
bashInteractive
|
||||
nushellFull
|
||||
pkgs-unstable.nushell
|
||||
];
|
||||
# set user's default shell system-wide
|
||||
users.defaultUserShell = pkgs.bashInteractive;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
};
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit.enable = true;
|
||||
# Remove sound.enable or turn it off if you had it set previously, it seems to cause conflicts with pipewire
|
||||
sound.enable = false;
|
||||
# Disable pulseaudio, it conflicts with pipewire too.
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ cryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --hash sha512 --iter
|
||||
cryptsetup luksDump /dev/nvme0n1p2
|
||||
|
||||
# open(unlock) the device with the passphrase you just set
|
||||
cryptsetup luksOpen /dev/nvme0n1p2 encrypted-nixos
|
||||
cryptsetup luksOpen /dev/nvme0n1p2 crypted-nixos
|
||||
|
||||
# show disk status
|
||||
lsblk
|
||||
@@ -110,7 +110,7 @@ Formatting the root partition:
|
||||
# NOTE: `cat shoukei.md | grep create-btrfs > btrfs.sh` to generate this script
|
||||
mkfs.fat -F 32 -n ESP /dev/nvme0n1p1 # create-btrfs
|
||||
# format the root partition with btrfs and label it
|
||||
mkfs.btrfs -L encrypted-nixos /dev/mapper/crypted-nixos # create-btrfs
|
||||
mkfs.btrfs -L crypted-nixos /dev/mapper/crypted-nixos # create-btrfs
|
||||
|
||||
# mount the root partition and create subvolumes
|
||||
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
||||
@@ -130,7 +130,7 @@ umount /mnt # create-btrfs
|
||||
# 1. Extend the life of the SSD.
|
||||
# 2. improve the performance of disks with low IOPS / RW throughput, such as HDD and SATA SSD.
|
||||
# 2. Save the disk space.
|
||||
mkdir /mnt/{nix,tmp,swap,persistent,snapshots,boot} # mount-1
|
||||
mkdir /mnt/{nix,gnu,tmp,swap,persistent,snapshots,boot} # mount-1
|
||||
mount -o compress-force=zstd:1,noatime,subvol=@nix /dev/mapper/crypted-nixos /mnt/nix # mount-1
|
||||
mount -o compress-force=zstd:1,noatime,subvol=@guix /dev/mapper/crypted-nixos /mnt/gnu # mount-1
|
||||
mount -o compress-force=zstd:1,subvol=@tmp /dev/mapper/crypted-nixos /mnt/tmp # mount-1
|
||||
@@ -162,7 +162,7 @@ $ lsblk
|
||||
nvme0n1 259:0 0 1.8T 0 disk
|
||||
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
||||
└─nvme0n1p2 259:3 0 1.8T 0 part
|
||||
└─encrypted-nixos 254:0 0 1.8T 0 crypt /mnt/swap
|
||||
└─crypted-nixos 254:0 0 1.8T 0 crypt /mnt/swap
|
||||
/mnt/persistent
|
||||
/mnt/snapshots
|
||||
/mnt/nix
|
||||
|
||||
@@ -79,7 +79,7 @@ cryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --hash sha512 --iter
|
||||
cryptsetup luksDump /dev/nvme0n1p4
|
||||
|
||||
# open(unlock) the device with the passphrase you just set
|
||||
cryptsetup luksOpen /dev/nvme0n1p4 encrypted-nixos
|
||||
cryptsetup luksOpen /dev/nvme0n1p4 crypted-nixos
|
||||
|
||||
# show disk status
|
||||
lsblk
|
||||
@@ -90,7 +90,7 @@ Formatting the root partition:
|
||||
```bash
|
||||
# NOTE: `cat shoukei.md | egrep "create-btrfs" > create-btrfs.sh` to generate this script
|
||||
# format the root partition with btrfs and label it
|
||||
mkfs.btrfs -L encrypted-nixos /dev/mapper/crypted-nixos # create-btrfs
|
||||
mkfs.btrfs -L crypted-nixos /dev/mapper/crypted-nixos # create-btrfs
|
||||
# mount the root partition and create subvolumes
|
||||
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
||||
btrfs subvolume create /mnt/@nix # create-btrfs
|
||||
@@ -139,7 +139,7 @@ $ lsblk
|
||||
nvme0n1 259:0 0 1.8T 0 disk
|
||||
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
||||
└─nvme0n1p4 259:3 0 1.8T 0 part
|
||||
└─encrypted-nixos 254:0 0 1.8T 0 crypt /mnt/swap
|
||||
└─crypted-nixos 254:0 0 1.8T 0 crypt /mnt/swap
|
||||
/mnt/persistent
|
||||
/mnt/snapshots
|
||||
/mnt/nix
|
||||
|
||||
@@ -5,17 +5,24 @@
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
nuenv.url = "github:DeterminateSystems/nuenv";
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
nixpkgs,
|
||||
nixos-hardware,
|
||||
nuenv,
|
||||
...
|
||||
}: {
|
||||
nixosConfigurations = {
|
||||
ai = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = inputs // {myvars.username = "ryan";};
|
||||
specialArgs =
|
||||
inputs
|
||||
// {
|
||||
myvars.username = "ryan";
|
||||
myvars.userfullname = "Ryan Yin";
|
||||
};
|
||||
modules = [
|
||||
{networking.hostName = "ai";}
|
||||
|
||||
@@ -33,7 +40,12 @@
|
||||
|
||||
shoukei = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = inputs // {myvars.username = "ryan";};
|
||||
specialArgs =
|
||||
inputs
|
||||
// {
|
||||
myvars.username = "ryan";
|
||||
myvars.userfullname = "Ryan Yin";
|
||||
};
|
||||
modules = [
|
||||
# Building on a USB installer is buggy, lack of disk space, memory, trublesome to setup substituteers, etc.
|
||||
# so we disable apple-t2 module here to avoid build kernel during the initial installation, and enable it after the first boot.
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@
|
||||
# To use chrome, we need to allow the installation of non-free software
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
# pkgs-stable = import inputs.nixpkgs-stable {
|
||||
# inherit system;
|
||||
# # To use chrome, we need to allow the installation of non-free software
|
||||
# config.allowUnfree = true;
|
||||
# };
|
||||
pkgs-stable = import inputs.nixpkgs-stable {
|
||||
inherit system;
|
||||
# To use chrome, we need to allow the installation of non-free software
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
# This is the args for all the haumea modules in this folder.
|
||||
|
||||
Reference in New Issue
Block a user