Compare commits

..

45 Commits

Author SHA1 Message Date
Ryan Yin d7c0e7caa6 feat(modules/base.nix): add more cache mirrors 2024-07-23 10:00:11 +08:00
Ryan Yin d8759cc845 feat: darwin - font.packages 2024-07-23 09:49:04 +08:00
Ryan Yin 6c6ada4243 fix: nixos installer 2024-07-23 09:43:46 +08:00
Ryan Yin 95cdd40c77 feat: adjust btrbk's backups preserve policy, and disable backups... 2024-07-21 04:50:09 +08:00
Ryan Yin a04d6dfdf6 feat: adjust btrbk's snapshot timer 2024-07-21 02:13:24 +08:00
Ryan Yin adf1415868 docs: minior update 2024-07-20 17:54:25 +08:00
Ryan Yin b1c6f1b90f Merge pull request #137 from ryan4yin/update
Update dependencies
2024-07-20 12:14:05 +08:00
Ryan Yin 5e9f98e56d fix: anyrun - https://github.com/anyrun-org/anyrun/issues/153 2024-07-20 12:12:57 +08:00
Ryan Yin 885205d9e3 fix: remove non-existent tree sitter 2024-07-20 11:52:56 +08:00
Ryan Yin 385bcd2d87 chore: update graphics config 2024-07-20 11:49:14 +08:00
Ryan Yin b3b55c36d8 fix: hyprland - crash 2024-07-20 11:43:16 +08:00
Ryan Yin 7d6fa4028d chore: debug hyprland 2024-07-20 11:42:01 +08:00
Ryan Yin 0ea8548f37 fix: remove hyprlnad's flake 2024-07-20 11:42:01 +08:00
Ryan Yin c29148fc77 fix: update flake again to fix lanzaboote's error 2024-07-20 11:42:01 +08:00
Ryan Yin 1eecf89793 feat: update dependencies 2024-07-20 11:42:01 +08:00
Ryan Yin 5fcf0d0995 refactor(home/base/tui/edistors): neovim - adjust the classification of lsp/treesitter 2024-07-19 18:28:06 +08:00
Ryan Yin 66949f6b8f feat: neovim - add support for nickel 2024-07-19 15:43:50 +08:00
Ryan Yin 36ba5a4efc feat: remove afdian 2024-07-16 14:44:21 +08:00
Ryan Yin 68285a70d0 feat: add idea for java development 2024-07-12 12:20:54 +08:00
Ryan Yin f97ad2fd1e feat: java language server 2024-07-12 12:09:07 +08:00
Ryan Yin 1d66cf655d feat: add k8s related tools 2024-07-10 15:22:49 +08:00
Ryan Yin 04fa05151a Merge pull request #136 from DataEraserC/patch-11
fix: ignore typo `crypted-nixos`
2024-07-08 09:36:09 +08:00
Sacabambaspis 62d986d1c8 fix: ignore typo crypted-nixos 2024-07-06 18:50:55 +08:00
Ryan Yin 730906ebf2 feat: neovim - add syntax highlight for justfiles 2024-06-28 17:36:40 +08:00
Ryan Yin bcf5b8b1cb feat: add gitleaks 2024-06-24 09:11:43 +08:00
Ryan Yin 1f14f5899c Merge pull request #135 from DataEraserC/patch-9
fix(docs): update url in docs
2024-06-19 09:29:30 +08:00
Sacabambaspis 9732c87d1f fix(docs): update url in docs 2024-06-18 23:02:27 +08:00
Ryan Yin 032f478d2a docs: neovim 2024-06-18 11:08:23 +08:00
Ryan Yin 71cb1cf295 Merge pull request #134 from ryan4yin/rename-luks-device
chore: rename luks device to crypted-nixos
2024-06-18 09:41:09 +08:00
Ryan Yin 09a9e086d8 chore: rename luks device to crypted-nixos 2024-06-18 09:40:00 +08:00
Ryan Yin e903f95a46 Merge pull request #133 from yocoldle/patch-1
docs: fix description about the helix plugin system
2024-06-18 09:37:41 +08:00
Coldle 1239f4549a docs: fix description about the helix plugin system 2024-06-17 22:23:47 +08:00
Ryan Yin 4433e018d9 feat: disable treesitter-wing 2024-06-16 21:38:14 +08:00
Ryan Yin e9ac7d8ddc feat: darwin - timezone 2024-06-16 20:13:53 +08:00
Ryan Yin cf51e77d75 Merge pull request #132 from ryan4yin/update-flake-lock
Update flake lock, adjust nushell
2024-06-15 11:54:09 +08:00
Ryan Yin 095b092e08 feat: adjust nushell 2024-06-15 11:39:20 +08:00
Ryan Yin 4e4eb9a003 feat: update flake.lock 2024-06-14 17:15:42 +08:00
Ryan Yin 1efe489846 feat: add gcloud & doctl 2024-06-14 15:29:58 +08:00
Ryan Yin ea13da3031 feat: add ko for go project 2024-06-14 15:26:30 +08:00
Ryan Yin 47a735d235 feat: add dae rules for steam 2024-06-10 20:53:05 +08:00
Ryan Yin 84c4708b98 feat: add kubebuilder 2024-06-04 11:09:37 +08:00
Ryan Yin 12494d66af Merge pull request #130 from DataEraserC/main
fix(docs): fix partition unmatched
2024-06-03 18:40:51 +08:00
Sacabambaspis 97ff571431 fix(docs): fix docs typo 2024-06-03 18:27:41 +08:00
Ryan Yin c0e3af3fad docs: README 2024-06-03 15:20:19 +08:00
Ryan Yin bbe2e80650 docs: README 2024-06-03 15:07:17 +08:00
38 changed files with 522 additions and 692 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
github: ryan4yin
patreon: ryan4yin
custom: ["https://buymeacoffee.com/ryan4yin", "https://afdian.net/a/ryan4yin"]
custom: ["https://buymeacoffee.com/ryan4yin"]
+1
View File
@@ -10,4 +10,5 @@ extend-ignore-re = [
"iterm2",
"iHgEIBYKACAWIQSizQe9ljFEyyclWmtVhZllwnQrSwUCZZ1T9wIdAAAKCRBVhZll", # crypto keys
"noice", # noice.nvim
"crypted-nixos",
]
+2 -2
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+6 -13
View File
@@ -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
+6 -1
View File
@@ -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 = {
+28 -1
View File
@@ -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.
}
+2 -1
View File
@@ -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
View File
@@ -3,5 +3,8 @@
mitmproxy # http/https proxy tool
insomnia # REST client
wireshark # network analyzer
# IDEs
jetbrains.idea-community
];
}
+5
View File
@@ -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
+1
View File
@@ -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`
+1 -1
View File
@@ -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.
+3 -2
View File
@@ -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
@@ -160,9 +160,10 @@ Provided by mini.surround plugin.
### Miscellaneous
| Action | |
| --------------------- | --------------- |
| --------------------------------- | --------------- |
| Show all Yank History | `:<Space> + yh` |
| Show undo history | `:<Space> + uh` |
| Show the path of the current file | `:!echo $%` |
## Additional Resources
+6 -2
View File
@@ -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,
}
+64 -46
View File
@@ -5,7 +5,48 @@
'';
};
home.packages = with pkgs; [
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
#-- nickel lang
nickel
#-- 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
#-- dockerfile
hadolint # Dockerfile linter
nodePackages.dockerfile-language-server-nodejs
#-- markdown
marksman # language server for markdown
glow # markdown previewer
pandoc # document converter
hugo # static site generator
#-- sql
sqlfluff
#-- protocol buffer
buf # linting and formatting
]
++
#-*- General Purpose Languages -*-#
[
#-- c/c++
cmake
cmake-language-server
@@ -13,6 +54,7 @@
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
@@ -20,7 +62,7 @@
lldb
#-- python
nodePackages.pyright # python language server
pyright # python language server
(python311.withPackages (
ps:
with ps; [
@@ -53,14 +95,6 @@
cargo # rust package manager
rustfmt
#-- 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
#-- golang
go
gomodifytags
@@ -75,6 +109,10 @@
gradle
maven
spring-boot-cli
jdt-language-server
#-- zig
zls
#-- lua
stylua
@@ -84,8 +122,9 @@
nodePackages.bash-language-server
shellcheck
shfmt
#-- javascript/typescript --#
]
#-*- Web Development -*-#
++ [
nodePackages.nodejs
nodePackages.typescript
nodePackages.typescript-language-server
@@ -93,45 +132,24 @@
nodePackages.vscode-langservers-extracted
nodePackages."@tailwindcss/language-server"
emmet-ls
# -- Lisp like Languages
]
# -*- Lisp like Languages -*-#
++ [
guile
racket-minimal
fnlfmt # fennel
#-- 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
#-- 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
#-- Optional Requirements:
gdu # disk usage analyzer, required by AstroNvim
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
#-- CloudNative
nodePackages.dockerfile-language-server-nodejs
# terraform # install via brew on macOS
terraform-ls
jsonnet
jsonnet-language-server
hadolint # Dockerfile linter
#-- zig
zls
#-- verilog / systemverilog
verible
gdb
];
#-- 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
]
);
}
+2 -2
View File
@@ -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 *
'';
};
}
+2 -2
View File
@@ -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
+5 -3
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -4
View File
@@ -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
+1 -1
View File
@@ -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";
+3 -1
View File
@@ -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
View File
@@ -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
+4 -3
View File
@@ -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
+3 -7
View File
@@ -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
+15 -5
View File
@@ -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 -1
View File
@@ -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;
-2
View File
@@ -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;
+4 -4
View File
@@ -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
+3 -3
View File
@@ -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
+14 -2
View File
@@ -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
View File
@@ -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.