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
|
github: ryan4yin
|
||||||
patreon: 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",
|
"iterm2",
|
||||||
"iHgEIBYKACAWIQSizQe9ljFEyyclWmtVhZllwnQrSwUCZZ1T9wIdAAAKCRBVhZll", # crypto keys
|
"iHgEIBYKACAWIQSizQe9ljFEyyclWmtVhZllwnQrSwUCZZ1T9wIdAAAKCRBVhZll", # crypto keys
|
||||||
"noice", # noice.nvim
|
"noice", # noice.nvim
|
||||||
|
"crypted-nixos",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> My configuration is becoming more and more complex, and it will be difficult for beginners to
|
> 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
|
> 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,
|
> look at the [ryan4yin/nix-config/releases](https://github.com/ryan4yin/nix-config/releases) first,
|
||||||
> **checkout to some simpler older versions, such as
|
> **checkout to some simpler older versions, such as
|
||||||
> [i3-kickstarter](https://github.com/ryan4yin/nix-config/tree/i3-kickstarter), which will be much
|
> [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!
|
# the nixConfig here only affects the flake itself, not the system configuration!
|
||||||
# for more information, see:
|
# 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 = {
|
nixConfig = {
|
||||||
# substituers will be appended to the default substituters when fetching packages
|
# substituers will be appended to the default substituters when fetching packages
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
"https://anyrun.cachix.org"
|
"https://anyrun.cachix.org"
|
||||||
"https://hyprland.cachix.org"
|
|
||||||
"https://nix-gaming.cachix.org"
|
"https://nix-gaming.cachix.org"
|
||||||
# "https://nixpkgs-wayland.cachix.org"
|
# "https://nixpkgs-wayland.cachix.org"
|
||||||
];
|
];
|
||||||
extra-trusted-public-keys = [
|
extra-trusted-public-keys = [
|
||||||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
|
||||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||||
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||||
];
|
];
|
||||||
@@ -36,9 +34,9 @@
|
|||||||
# which represents the GitHub repository URL + branch/commit-id/tag.
|
# which represents the GitHub repository URL + branch/commit-id/tag.
|
||||||
|
|
||||||
# Official NixOS package source, using nixos's unstable branch by default
|
# 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-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
|
# for macos
|
||||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
|
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
|
||||||
@@ -50,8 +48,8 @@
|
|||||||
|
|
||||||
# home-manager, used for managing user configuration
|
# home-manager, used for managing user configuration
|
||||||
home-manager = {
|
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.
|
# 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,
|
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
|
||||||
@@ -60,17 +58,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
url = "github:nix-community/lanzaboote/v0.3.0";
|
url = "github:nix-community/lanzaboote/v0.4.1";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
hyprland = {
|
|
||||||
url = "github:hyprwm/Hyprland/v0.39.1";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
# community wayland nixpkgs
|
# community wayland nixpkgs
|
||||||
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
# anyrun - a wayland launcher
|
# anyrun - a wayland launcher
|
||||||
|
|||||||
@@ -5,17 +5,22 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
skopeo
|
|
||||||
docker-compose
|
docker-compose
|
||||||
dive # explore docker layers
|
dive # explore docker layers
|
||||||
lazydocker # Docker terminal UI.
|
lazydocker # Docker terminal UI.
|
||||||
|
skopeo # copy/sync images between registries and local storage
|
||||||
|
go-containerregistry # provides `crane` & `gcrane`, it's similar to skopeo
|
||||||
|
|
||||||
kubectl
|
kubectl
|
||||||
|
kubebuilder
|
||||||
istioctl
|
istioctl
|
||||||
|
clusterctl # for kubernetes cluster-api
|
||||||
kubevirt # virtctl
|
kubevirt # virtctl
|
||||||
kubernetes-helm
|
kubernetes-helm
|
||||||
fluxcd
|
fluxcd
|
||||||
argocd
|
argocd
|
||||||
|
|
||||||
|
ko # build go project to container image
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
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
|
# 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
|
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||||
edit_mode: emacs # emacs, vi
|
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.
|
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 = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ in {
|
|||||||
|
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs-unstable.nushell;
|
||||||
configFile.source = ./config.nu;
|
configFile.source = ./config.nu;
|
||||||
inherit shellAliases;
|
inherit shellAliases;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,5 +3,8 @@
|
|||||||
mitmproxy # http/https proxy tool
|
mitmproxy # http/https proxy tool
|
||||||
insomnia # REST client
|
insomnia # REST client
|
||||||
wireshark # network analyzer
|
wireshark # network analyzer
|
||||||
|
|
||||||
|
# IDEs
|
||||||
|
jetbrains.idea-community
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
# aliyun
|
# aliyun
|
||||||
aliyun-cli
|
aliyun-cli
|
||||||
|
# digitalocean
|
||||||
|
doctl
|
||||||
|
# google cloud
|
||||||
|
google-cloud-sdk
|
||||||
|
|
||||||
# cloud tools that nix do not have cache for.
|
# cloud tools that nix do not have cache for.
|
||||||
terraform
|
terraform
|
||||||
terraformer # generate terraform configs from existing cloud resources
|
terraformer # generate terraform configs from existing cloud resources
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
# Automatically trims your branches whose tracking remote refs are merged or gone
|
# 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.
|
# It's really useful when you work on a project for a long time.
|
||||||
git-trim
|
git-trim
|
||||||
|
gitleaks
|
||||||
|
|
||||||
# need to run `conda-install` before using it
|
# need to run `conda-install` before using it
|
||||||
# need to run `conda-shell` before using command `conda`
|
# 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. 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
|
1. Neovim have a very activate plugin ecosystem, and it's easy to find plugins for almost
|
||||||
everything.
|
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>
|
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
|
1. Neovim has integrated terminal, and it's very powerful. It's quite similar to VSCode's integrated
|
||||||
terminal. I use it a lot.
|
terminal. I use it a lot.
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ plugin.
|
|||||||
### Window Navigation
|
### Window Navigation
|
||||||
|
|
||||||
- Switch between windows: `<Ctrl> + h/j/k/l`
|
- 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
|
- Note: On macOS, conflicts with system shortcuts
|
||||||
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
||||||
|
|
||||||
@@ -159,10 +159,11 @@ Provided by mini.surround plugin.
|
|||||||
|
|
||||||
### Miscellaneous
|
### Miscellaneous
|
||||||
|
|
||||||
| Action | |
|
| Action | |
|
||||||
| --------------------- | --------------- |
|
| --------------------------------- | --------------- |
|
||||||
| Show all Yank History | `:<Space> + yh` |
|
| Show all Yank History | `:<Space> + yh` |
|
||||||
| Show undo history | `:<Space> + uh` |
|
| Show undo history | `:<Space> + uh` |
|
||||||
|
| Show the path of the current file | `:!echo $%` |
|
||||||
|
|
||||||
## Additional Resources
|
## Additional Resources
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ in {
|
|||||||
viAlias = true;
|
viAlias = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
||||||
# currently we use lazy.nvim as neovim's package manager, so comment this one.
|
# 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!
|
#
|
||||||
|
# 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.
|
# and use lazy.nvim's `dir` option to specify the package directory in nix store.
|
||||||
# so that these plugins can work on NixOS.
|
# so that these plugins can work on NixOS.
|
||||||
#
|
#
|
||||||
@@ -40,6 +42,8 @@ in {
|
|||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# search all the plugins using https://search.nixos.org/packages
|
# search all the plugins using https://search.nixos.org/packages
|
||||||
telescope-fzf-native-nvim
|
telescope-fzf-native-nvim
|
||||||
|
|
||||||
|
nvim-treesitter.withAllGrammars
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||||
-- as this provides autocomplete and documentation while editing
|
-- as this provides autocomplete and documentation while editing
|
||||||
|
|
||||||
|
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
"AstroNvim/astrolsp",
|
"AstroNvim/astrolsp",
|
||||||
@@ -42,40 +41,51 @@ return {
|
|||||||
-- end
|
-- end
|
||||||
},
|
},
|
||||||
-- enable servers that you already have installed without mason
|
-- enable servers that you already have installed without mason
|
||||||
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
servers = {
|
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
|
"tsserver", -- typescript/javascript language server
|
||||||
"tailwindcss", -- tailwindcss language server
|
"tailwindcss", -- tailwindcss language server
|
||||||
"html", -- html language server
|
"html", -- html language server
|
||||||
"cssls", -- css language server
|
"cssls", -- css language server
|
||||||
"prismals", -- prisma language server
|
"prismals", -- prisma language server
|
||||||
"volar", -- vue language server
|
"volar", -- vue language server
|
||||||
---- Configuration Language
|
|
||||||
"marksman", -- markdown ls
|
---- Lisp Like
|
||||||
"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
|
|
||||||
"scheme_langserver", -- scheme language server
|
"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`
|
-- customize language server configuration options passed to `lspconfig`
|
||||||
---@diagnostic disable: missing-fields
|
---@diagnostic disable: missing-fields
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
-- NOTE: additional parser
|
||||||
|
{ "nushell/tree-sitter-nu" }, -- nushell scripts
|
||||||
|
},
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.incremental_selection = {
|
opts.incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -13,48 +17,25 @@ return {
|
|||||||
node_decremental = "<bs>", -- Backspace
|
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
|
-- 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, {
|
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||||
-- neovim
|
-- please add only the tree-sitters that are not available in nixpkgs here
|
||||||
"vim",
|
|
||||||
"lua",
|
"kdl",
|
||||||
-- operation & cloud native
|
|
||||||
"dockerfile",
|
|
||||||
"hcl",
|
|
||||||
"jsonnet",
|
|
||||||
"regex",
|
|
||||||
"terraform",
|
|
||||||
"nix",
|
|
||||||
"csv",
|
"csv",
|
||||||
-- other programming language
|
"xml",
|
||||||
|
|
||||||
|
---- Misc
|
||||||
"diff",
|
"diff",
|
||||||
|
"git_config",
|
||||||
|
"git_rebase",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
"gitcommit",
|
"gitcommit",
|
||||||
"latex",
|
"gitattributes",
|
||||||
"sql",
|
"ssh_config",
|
||||||
-- Lisp like
|
|
||||||
"fennel",
|
|
||||||
"clojure",
|
|
||||||
"commonlisp",
|
|
||||||
-- customized languages:
|
|
||||||
"scheme",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- 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,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
+131
-113
@@ -5,133 +5,151 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; (
|
||||||
#-- c/c++
|
# -*- Data & Configuration Languages -*-#
|
||||||
cmake
|
[
|
||||||
cmake-language-server
|
#-- nix
|
||||||
gnumake
|
nil
|
||||||
checkmake
|
# rnix-lsp
|
||||||
# c/c++ compiler, required by nvim-treesitter!
|
# nixd
|
||||||
gcc
|
statix # Lints and suggestions for the nix programming language
|
||||||
# c/c++ tools with clang-tools, the unwrapped version won't
|
deadnix # Find and remove unused code in .nix source files
|
||||||
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
alejandra # Nix Code Formatter
|
||||||
# llvmPackages.clang-unwrapped
|
|
||||||
clang-tools
|
|
||||||
lldb
|
|
||||||
|
|
||||||
#-- python
|
#-- nickel lang
|
||||||
nodePackages.pyright # python language server
|
nickel
|
||||||
(python311.withPackages (
|
|
||||||
ps:
|
|
||||||
with ps; [
|
|
||||||
ruff-lsp
|
|
||||||
black # python formatter
|
|
||||||
# debugpy
|
|
||||||
|
|
||||||
# my commonly used python packages
|
#-- json like
|
||||||
jupyter
|
# terraform # install via brew on macOS
|
||||||
ipython
|
terraform-ls
|
||||||
pandas
|
jsonnet
|
||||||
requests
|
jsonnet-language-server
|
||||||
pyquery
|
taplo # TOML language server / formatter / validator
|
||||||
pyyaml
|
nodePackages.yaml-language-server
|
||||||
boto3
|
actionlint # GitHub Actions linter
|
||||||
|
|
||||||
## emacs's lsp-bridge dependenciesge
|
#-- dockerfile
|
||||||
# epc
|
hadolint # Dockerfile linter
|
||||||
# orjson
|
nodePackages.dockerfile-language-server-nodejs
|
||||||
# sexpdata
|
|
||||||
# six
|
|
||||||
# setuptools
|
|
||||||
# paramiko
|
|
||||||
# rapidfuzz
|
|
||||||
]
|
|
||||||
))
|
|
||||||
|
|
||||||
#-- rust
|
#-- markdown
|
||||||
rust-analyzer
|
marksman # language server for markdown
|
||||||
cargo # rust package manager
|
glow # markdown previewer
|
||||||
rustfmt
|
pandoc # document converter
|
||||||
|
hugo # static site generator
|
||||||
|
|
||||||
#-- nix
|
#-- sql
|
||||||
nil
|
sqlfluff
|
||||||
# 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
|
|
||||||
|
|
||||||
#-- golang
|
#-- protocol buffer
|
||||||
go
|
buf # linting and formatting
|
||||||
gomodifytags
|
]
|
||||||
iferr # generate error handling code for go
|
++
|
||||||
impl # generate function implementation for go
|
#-*- General Purpose Languages -*-#
|
||||||
gotools # contains tools like: godoc, goimports, etc.
|
[
|
||||||
gopls # go language server
|
#-- c/c++
|
||||||
delve # go debugger
|
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
|
#-- python
|
||||||
jdk17
|
pyright # python language server
|
||||||
gradle
|
(python311.withPackages (
|
||||||
maven
|
ps:
|
||||||
spring-boot-cli
|
with ps; [
|
||||||
|
ruff-lsp
|
||||||
|
black # python formatter
|
||||||
|
# debugpy
|
||||||
|
|
||||||
#-- lua
|
# my commonly used python packages
|
||||||
stylua
|
jupyter
|
||||||
lua-language-server
|
ipython
|
||||||
|
pandas
|
||||||
|
requests
|
||||||
|
pyquery
|
||||||
|
pyyaml
|
||||||
|
boto3
|
||||||
|
|
||||||
#-- bash
|
## emacs's lsp-bridge dependenciesge
|
||||||
nodePackages.bash-language-server
|
# epc
|
||||||
shellcheck
|
# orjson
|
||||||
shfmt
|
# sexpdata
|
||||||
|
# six
|
||||||
|
# setuptools
|
||||||
|
# paramiko
|
||||||
|
# rapidfuzz
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
#-- javascript/typescript --#
|
#-- rust
|
||||||
nodePackages.nodejs
|
rust-analyzer
|
||||||
nodePackages.typescript
|
cargo # rust package manager
|
||||||
nodePackages.typescript-language-server
|
rustfmt
|
||||||
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
|
||||||
nodePackages.vscode-langservers-extracted
|
|
||||||
nodePackages."@tailwindcss/language-server"
|
|
||||||
emmet-ls
|
|
||||||
|
|
||||||
# -- Lisp like Languages
|
#-- golang
|
||||||
guile
|
go
|
||||||
racket-minimal
|
gomodifytags
|
||||||
fnlfmt # fennel
|
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
|
# -- java
|
||||||
taplo # TOML language server / formatter / validator
|
jdk17
|
||||||
nodePackages.yaml-language-server
|
gradle
|
||||||
sqlfluff # SQL linter
|
maven
|
||||||
actionlint # GitHub Actions linter
|
spring-boot-cli
|
||||||
buf # protoc plugin for linting and formatting
|
jdt-language-server
|
||||||
proselint # English prose linter
|
|
||||||
|
|
||||||
#-- Misc
|
#-- zig
|
||||||
tree-sitter # common language parser/highlighter
|
zls
|
||||||
nodePackages.prettier # common code formatter
|
|
||||||
marksman # language server for markdown
|
|
||||||
glow # markdown previewer
|
|
||||||
fzf
|
|
||||||
pandoc # document converter
|
|
||||||
hugo # static site generator
|
|
||||||
|
|
||||||
#-- Optional Requirements:
|
#-- lua
|
||||||
gdu # disk usage analyzer, required by AstroNvim
|
stylua
|
||||||
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
|
lua-language-server
|
||||||
|
|
||||||
#-- CloudNative
|
#-- bash
|
||||||
nodePackages.dockerfile-language-server-nodejs
|
nodePackages.bash-language-server
|
||||||
# terraform # install via brew on macOS
|
shellcheck
|
||||||
terraform-ls
|
shfmt
|
||||||
jsonnet
|
]
|
||||||
jsonnet-language-server
|
#-*- Web Development -*-#
|
||||||
hadolint # Dockerfile linter
|
++ [
|
||||||
|
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
|
#-- verilog / systemverilog
|
||||||
zls
|
verible
|
||||||
#-- verilog / systemverilog
|
|
||||||
verible
|
#-- Optional Requirements:
|
||||||
gdb
|
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/cargo/cargo-completions.nu *
|
||||||
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
||||||
# alias
|
# 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/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, ...}: {
|
{pkgs-stable, ...}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs-stable; [
|
||||||
# https://joplinapp.org/help/
|
# https://joplinapp.org/help/
|
||||||
joplin # joplin-cli
|
joplin # joplin-cli
|
||||||
joplin-desktop
|
joplin-desktop
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## Fix anyrun
|
||||||
|
## https://github.com/anyrun-org/anyrun/issues/153
|
||||||
|
ln -s $XDG_RUNTIME_DIR/hypr /tmp/hypr
|
||||||
|
|
||||||
## Autostart Programs
|
## Autostart Programs
|
||||||
|
|
||||||
# Kill already running process
|
# Kill already running process
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
hyprland,
|
|
||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
package = hyprland.packages.${pkgs.system}.hyprland;
|
package = pkgs.hyprland;
|
||||||
in {
|
in {
|
||||||
# NOTE:
|
# NOTE:
|
||||||
# We have to enable hyprland/i3's systemd user service in home-manager,
|
# We have to enable hyprland/i3's systemd user service in home-manager,
|
||||||
@@ -30,7 +29,10 @@ in {
|
|||||||
};
|
};
|
||||||
extraConfig = builtins.readFile ../conf/hyprland.conf;
|
extraConfig = builtins.readFile ../conf/hyprland.conf;
|
||||||
# gammastep/wallpaper-switcher need this to be enabled.
|
# 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
|
# 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.
|
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. Storage such as git server, file server/browser, torrent downloader,, etc.
|
||||||
1. Backup or sync my personal data to cloud or NAS.
|
1. Backup or sync my personal data to cloud or NAS.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
boot.tmp.cleanOnBoot = true;
|
boot.tmp.cleanOnBoot = true;
|
||||||
boot.initrd = {
|
boot.initrd = {
|
||||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||||
luks.devices."encrypted-nixos" = {
|
luks.devices."crypted-nixos" = {
|
||||||
device = "/dev/nvme0n1p4";
|
device = "/dev/nvme0n1p4";
|
||||||
# the keyfile(or device partition) that should be used as the decryption key for the encrypted device.
|
# 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.
|
# if not specified, you will be prompted for a passphrase instead.
|
||||||
|
|||||||
@@ -272,6 +272,12 @@ routing {
|
|||||||
domain(geosite:openai) -> sg
|
domain(geosite:openai) -> sg
|
||||||
domain(regex:'.+\.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
|
### Media
|
||||||
domain(geosite:netflix) -> 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
|
nvme0n1 259:0 0 1.8T 0 disk
|
||||||
├─nvme0n1p1 259:2 0 598M 0 part /boot
|
├─nvme0n1p1 259:2 0 598M 0 part /boot
|
||||||
└─nvme0n1p2 259:3 0 1.8T 0 part
|
└─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/swapfile
|
||||||
/swap
|
/swap
|
||||||
/snapshots
|
/snapshots
|
||||||
|
|||||||
@@ -41,12 +41,10 @@ in {
|
|||||||
};
|
};
|
||||||
virtualisation.docker.enableNvidia = true; # for nvidia-docker
|
virtualisation.docker.enableNvidia = true; # for nvidia-docker
|
||||||
|
|
||||||
hardware.opengl = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# if hardware.opengl.driSupport is enabled, mesa is installed and provides Vulkan for supported hardware.
|
|
||||||
driSupport = true;
|
|
||||||
# needed by nvidia-docker
|
# needed by nvidia-docker
|
||||||
driSupport32Bit = true;
|
enable32Bit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
boot.initrd = {
|
boot.initrd = {
|
||||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
# 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.
|
# NOTE: DO NOT use device name here(like /dev/sda, /dev/nvme0n1p2, etc), use UUID instead.
|
||||||
# https://github.com/ryan4yin/nix-config/issues/43
|
# https://github.com/ryan4yin/nix-config/issues/43
|
||||||
device = "/dev/disk/by-uuid/a21ca82a-9ee6-4e5c-9d3f-a93e84e4e0f4";
|
device = "/dev/disk/by-uuid/a21ca82a-9ee6-4e5c-9d3f-a93e84e4e0f4";
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ in {
|
|||||||
kubernetes-helm
|
kubernetes-helm
|
||||||
cilium-cli
|
cilium-cli
|
||||||
fluxcd
|
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
|
dive # explore docker layers
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -92,9 +92,10 @@
|
|||||||
substituters = [
|
substituters = [
|
||||||
# cache mirror located in China
|
# cache mirror located in China
|
||||||
# status: https://mirror.sjtu.edu.cn/
|
# 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/
|
# status: https://mirrors.ustc.edu.cn/status/
|
||||||
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||||
|
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||||
|
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
# my own cache server
|
# my own cache server
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
##########################################################################
|
##########################################################################
|
||||||
@@ -80,7 +81,7 @@ in {
|
|||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
environment.shells = [
|
environment.shells = [
|
||||||
pkgs.zsh
|
pkgs.zsh
|
||||||
pkgs.nushellFull # my custom shell
|
pkgs-unstable.nushell # my custom shell
|
||||||
];
|
];
|
||||||
|
|
||||||
# homebrew need to be installed manually, see https://brew.sh
|
# homebrew need to be installed manually, see https://brew.sh
|
||||||
@@ -103,7 +104,7 @@ in {
|
|||||||
Wechat = 836500024;
|
Wechat = 836500024;
|
||||||
QQ = 451108668;
|
QQ = 451108668;
|
||||||
WeCom = 1189898970; # Wechat for Work
|
WeCom = 1189898970; # Wechat for Work
|
||||||
TecentMetting = 1484048379;
|
TecentMeeting = 1484048379;
|
||||||
QQMusic = 595615424;
|
QQMusic = 595615424;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -164,7 +165,7 @@ in {
|
|||||||
# Misc
|
# Misc
|
||||||
"shadowsocksx-ng" # proxy tool
|
"shadowsocksx-ng" # proxy tool
|
||||||
"iina" # video player
|
"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
|
"stats" # beautiful system status monitor in menu bar
|
||||||
# "reaper" # audio editor
|
# "reaper" # audio editor
|
||||||
"sonic-pi" # music programming
|
"sonic-pi" # music programming
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
# Add ability to used TouchID for sudo authentication
|
# Add ability to used TouchID for sudo authentication
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
|
||||||
|
time.timeZone = "Asia/Shanghai";
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
||||||
activationScripts.postUserActivation.text = ''
|
activationScripts.postUserActivation.text = ''
|
||||||
@@ -183,13 +185,7 @@
|
|||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
fonts = {
|
fonts = {
|
||||||
# will be removed after this PR is merged:
|
packages = with pkgs; [
|
||||||
# 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
|
# icon fonts
|
||||||
material-design-icons
|
material-design-icons
|
||||||
|
|||||||
@@ -18,12 +18,19 @@
|
|||||||
|
|
||||||
services.btrbk.instances.btrbk = {
|
services.btrbk.instances.btrbk = {
|
||||||
# How often this btrbk instance is started. See systemd.time(7) for more information about the format.
|
# 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 = {
|
settings = {
|
||||||
# keep daily snapshots for 14 days
|
# how to prune local snapshots:
|
||||||
snapshot_preserve = "14d";
|
# 1. keep daily snapshots for xx days
|
||||||
# keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
|
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";
|
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 = {
|
volume = {
|
||||||
"/btr_pool" = {
|
"/btr_pool" = {
|
||||||
subvolume = {
|
subvolume = {
|
||||||
@@ -31,7 +38,10 @@
|
|||||||
snapshot_create = "always";
|
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,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# add user's shell into /etc/shells
|
# add user's shell into /etc/shells
|
||||||
environment.shells = with pkgs; [
|
environment.shells = with pkgs; [
|
||||||
bashInteractive
|
bashInteractive
|
||||||
nushellFull
|
pkgs-unstable.nushell
|
||||||
];
|
];
|
||||||
# set user's default shell system-wide
|
# set user's default shell system-wide
|
||||||
users.defaultUserShell = pkgs.bashInteractive;
|
users.defaultUserShell = pkgs.bashInteractive;
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
};
|
};
|
||||||
# rtkit is optional but recommended
|
# rtkit is optional but recommended
|
||||||
security.rtkit.enable = true;
|
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.
|
# Disable pulseaudio, it conflicts with pipewire too.
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ cryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --hash sha512 --iter
|
|||||||
cryptsetup luksDump /dev/nvme0n1p2
|
cryptsetup luksDump /dev/nvme0n1p2
|
||||||
|
|
||||||
# open(unlock) the device with the passphrase you just set
|
# 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
|
# show disk status
|
||||||
lsblk
|
lsblk
|
||||||
@@ -110,7 +110,7 @@ Formatting the root partition:
|
|||||||
# NOTE: `cat shoukei.md | grep create-btrfs > btrfs.sh` to generate this script
|
# NOTE: `cat shoukei.md | grep create-btrfs > btrfs.sh` to generate this script
|
||||||
mkfs.fat -F 32 -n ESP /dev/nvme0n1p1 # create-btrfs
|
mkfs.fat -F 32 -n ESP /dev/nvme0n1p1 # create-btrfs
|
||||||
# format the root partition with btrfs and label it
|
# 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 the root partition and create subvolumes
|
||||||
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
||||||
@@ -130,7 +130,7 @@ umount /mnt # create-btrfs
|
|||||||
# 1. Extend the life of the SSD.
|
# 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. improve the performance of disks with low IOPS / RW throughput, such as HDD and SATA SSD.
|
||||||
# 2. Save the disk space.
|
# 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=@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,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
|
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
|
nvme0n1 259:0 0 1.8T 0 disk
|
||||||
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
||||||
└─nvme0n1p2 259:3 0 1.8T 0 part
|
└─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/persistent
|
||||||
/mnt/snapshots
|
/mnt/snapshots
|
||||||
/mnt/nix
|
/mnt/nix
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ cryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --hash sha512 --iter
|
|||||||
cryptsetup luksDump /dev/nvme0n1p4
|
cryptsetup luksDump /dev/nvme0n1p4
|
||||||
|
|
||||||
# open(unlock) the device with the passphrase you just set
|
# 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
|
# show disk status
|
||||||
lsblk
|
lsblk
|
||||||
@@ -90,7 +90,7 @@ Formatting the root partition:
|
|||||||
```bash
|
```bash
|
||||||
# NOTE: `cat shoukei.md | egrep "create-btrfs" > create-btrfs.sh` to generate this script
|
# NOTE: `cat shoukei.md | egrep "create-btrfs" > create-btrfs.sh` to generate this script
|
||||||
# format the root partition with btrfs and label it
|
# 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 the root partition and create subvolumes
|
||||||
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
mount /dev/mapper/crypted-nixos /mnt # create-btrfs
|
||||||
btrfs subvolume create /mnt/@nix # create-btrfs
|
btrfs subvolume create /mnt/@nix # create-btrfs
|
||||||
@@ -139,7 +139,7 @@ $ lsblk
|
|||||||
nvme0n1 259:0 0 1.8T 0 disk
|
nvme0n1 259:0 0 1.8T 0 disk
|
||||||
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
├─nvme0n1p1 259:2 0 600M 0 part /mnt/boot
|
||||||
└─nvme0n1p4 259:3 0 1.8T 0 part
|
└─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/persistent
|
||||||
/mnt/snapshots
|
/mnt/snapshots
|
||||||
/mnt/nix
|
/mnt/nix
|
||||||
|
|||||||
@@ -5,17 +5,24 @@
|
|||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||||
|
nuenv.url = "github:DeterminateSystems/nuenv";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs = inputs @ {
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixos-hardware,
|
nixos-hardware,
|
||||||
|
nuenv,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
ai = nixpkgs.lib.nixosSystem {
|
ai = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = inputs // {myvars.username = "ryan";};
|
specialArgs =
|
||||||
|
inputs
|
||||||
|
// {
|
||||||
|
myvars.username = "ryan";
|
||||||
|
myvars.userfullname = "Ryan Yin";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
{networking.hostName = "ai";}
|
{networking.hostName = "ai";}
|
||||||
|
|
||||||
@@ -33,7 +40,12 @@
|
|||||||
|
|
||||||
shoukei = nixpkgs.lib.nixosSystem {
|
shoukei = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = inputs // {myvars.username = "ryan";};
|
specialArgs =
|
||||||
|
inputs
|
||||||
|
// {
|
||||||
|
myvars.username = "ryan";
|
||||||
|
myvars.userfullname = "Ryan Yin";
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
# Building on a USB installer is buggy, lack of disk space, memory, trublesome to setup substituteers, etc.
|
# 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.
|
# 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
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
# pkgs-stable = import inputs.nixpkgs-stable {
|
pkgs-stable = import inputs.nixpkgs-stable {
|
||||||
# inherit system;
|
inherit system;
|
||||||
# # To use chrome, we need to allow the installation of non-free software
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
# config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is the args for all the haumea modules in this folder.
|
# This is the args for all the haumea modules in this folder.
|
||||||
|
|||||||
Reference in New Issue
Block a user