├── LICENSE ├── README.md ├── README_en.md ├── config-tmpl.toml ├── flake.lock ├── flake.nix ├── home-manager ├── apps │ ├── docker.nix │ ├── go-example.nix │ ├── k9s.nix │ ├── nvim.nix │ ├── nvimdots.nix │ ├── tmux.nix │ └── zsh.nix ├── configs │ ├── gitconfig.nix │ └── neofetch.nix ├── envs │ └── vars.nix ├── files │ ├── gitconfig │ └── neofetch └── home.nix └── install /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 kevinlin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 🚀 快速部署你的专属开发环境 - 只需5分钟! 3 | 4 | - [English](README_en.md) 5 | 6 | ## 前置要求 7 | - 确保您的系统已安装 curl 和 git。 8 | - 本脚本将自动安装 Nix(如果尚未安装)。 9 | 10 | ## 📋 简要步骤 11 | 只需执行以下命令,一切将自动完成: 12 | ```bash 13 | sh <(curl -L https://raw.githubusercontent.com/kevin1sMe/dev-with-nix/main/install) 14 | ``` 15 | 16 | ## 🔍 安装脚本细节 17 | 1. **检查 Nix 是否已安装:** 如果已安装,则跳过安装步骤;如果未安装,将自动进行安装。 18 | 2. **配置 Nix:** 开启 Nix 的 Flakes 功能。 19 | 3. **克隆项目仓库:** 克隆 `dev-with-nix` 仓库到本地。 20 | 4. **配置个人环境:** 拷贝 `config-templ.toml` 为 `~/.dev-with-nix.toml` 并按需编辑。 21 | 22 | ## 🚀 开始部署 23 | 运行安装脚本后,请根据提示完成以下步骤: 24 | 1. **激活 Nix 配置:** 执行 `source ~/.nix-profile/etc/profile.d/nix.sh`。 25 | 2. **编辑配置文件:** 修改 `~/.dev-with-nix.toml`。 26 | 3. **构建环境:** 在 `dev-with-nix` 目录下执行 `nix run nixpkgs#home-manager -- switch --flake .#dev --impure`。 27 | 4. **启动会话:** 使用 `zsh`。 28 | 29 | ## 🎯 关于 Zsh 30 | 本配置优化了 Zsh 的使用体验,建议尝试。若需设为默认 Shell,可执行: 31 | ```bash 32 | echo "exec zsh" >> ~/.bashrc 33 | ``` 34 | 35 | ## ❓ 常见问题解答 36 | - **Q:** 报 `API rate limit exceeded` 错误? 37 | - **A:** 公司网络可能限制了对 GitHub 的访问,稍后重试即可。 38 | - **Q:** 修改环境变量后未生效? 39 | - **A:** 完全关闭 session 并重新登录。可能与 `__HM_ZSH_SESS_VARS_SOURCED` 相关,我正在研究中。 40 | -------------------------------------------------------------------------------- /README_en.md: -------------------------------------------------------------------------------- 1 | 2 | ## 🚀 Quick Deployment of Your Personal Development Environment - Only Takes 5 Minutes! 3 | 4 | ## Prerequisites 5 | - Ensure your system has curl and git installed. 6 | - This script will automatically install Nix if it's not already installed. 7 | 8 | ## 📋 Quick Start 9 | Simply execute the following command, and everything will be done automatically: 10 | ```bash 11 | sh <(curl -L https://raw.githubusercontent.com/kevin1sMe/dev-with-nix/main/install) 12 | ``` 13 | 14 | ## 🔍 Install Script Details 15 | 1. **Check if Nix is Installed:** If already installed, skip installation; otherwise, it will be automatically installed. 16 | 2. **Configure Nix:** Enable the Flakes feature in Nix. 17 | 3. **Clone the Project Repository:** Clone the `dev-with-nix` repository locally. 18 | 4. **Configure Personal Environment:** Copy `config-templ.toml` to `~/.dev-with-nix.toml` and edit as needed. 19 | 20 | ## 🚀 Start Deployment 21 | After running the install script, follow these steps as prompted: 22 | 1. **Activate Nix Configuration:** Execute `source ~/.nix-profile/etc/profile.d/nix.sh`. 23 | 2. **Edit Configuration File:** Modify `~/.dev-with-nix.toml`. 24 | 3. **Build Environment:** In the `dev-with-nix` directory, run `nix run nixpkgs#home-manager -- switch --flake .#dev --impure`. 25 | 4. **Start Session:** Use `zsh`. 26 | 27 | ## 🎯 About Zsh 28 | This configuration enhances the Zsh experience, highly recommended to try. To set it as the default Shell, execute: 29 | ```bash 30 | echo "exec zsh" >> ~/.bashrc 31 | ``` 32 | 33 | ## ❓ Frequently Asked Questions 34 | - **Q:** Encounter 'API rate limit exceeded' error? 35 | - **A:** The company network may limit access to GitHub, try again later. 36 | - **Q:** Environment variables changes not taking effect? 37 | - **A:** Completely close the session and log in again. It seems to be related to `__HM_ZSH_SESS_VARS_SOURCED`, still investigating. 38 | -------------------------------------------------------------------------------- /config-tmpl.toml: -------------------------------------------------------------------------------- 1 | # 用户信息配置 2 | # 你在本机登录的用户名,及Home目录路径 3 | [user] 4 | name = "" 5 | homeDir = "" 6 | 7 | # git提交信息配置 8 | [gitconfig] 9 | name = "" 10 | email = "" 11 | 12 | # 在这里添加一些希望设定的环境变量 13 | [env] 14 | WELCOME_TO_USE_NIX = "greet from kevin" 15 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "home-manager": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1697838989, 11 | "narHash": "sha256-hwVlO+st8vWJO6iy3/JbMHrUyY4Ak7xUSmffoWqBPUg=", 12 | "owner": "nix-community", 13 | "repo": "home-manager", 14 | "rev": "ae631b0b20f06f7d239d160723d228891ddb2fe0", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "nix-community", 19 | "repo": "home-manager", 20 | "type": "github" 21 | } 22 | }, 23 | "nixpkgs": { 24 | "locked": { 25 | "lastModified": 1697723726, 26 | "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", 27 | "owner": "NixOS", 28 | "repo": "nixpkgs", 29 | "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", 30 | "type": "github" 31 | }, 32 | "original": { 33 | "owner": "NixOS", 34 | "ref": "nixos-unstable", 35 | "repo": "nixpkgs", 36 | "type": "github" 37 | } 38 | }, 39 | "nixpkgs-for-kubectl": { 40 | "locked": { 41 | "lastModified": 1645218075, 42 | "narHash": "sha256-s04EF9cTUmcpgFNAnYiBZrd0dwzHyeKcqx7d156WtOo=", 43 | "owner": "NixOS", 44 | "repo": "nixpkgs", 45 | "rev": "e7e54ace729a1e88177c0121d05f35352b05aed8", 46 | "type": "github" 47 | }, 48 | "original": { 49 | "owner": "NixOS", 50 | "repo": "nixpkgs", 51 | "rev": "e7e54ace729a1e88177c0121d05f35352b05aed8", 52 | "type": "github" 53 | } 54 | }, 55 | "nvimdots": { 56 | "locked": { 57 | "lastModified": 1697880683, 58 | "narHash": "sha256-vPFgLuh3bn6P0XX2DG/GRgnbstByl8vPtyOSAMK1MtE=", 59 | "owner": "ayamir", 60 | "repo": "nvimdots", 61 | "rev": "874b413a4450ab9557380659456587afde2d0418", 62 | "type": "github" 63 | }, 64 | "original": { 65 | "owner": "ayamir", 66 | "repo": "nvimdots", 67 | "type": "github" 68 | } 69 | }, 70 | "root": { 71 | "inputs": { 72 | "home-manager": "home-manager", 73 | "nixpkgs": "nixpkgs", 74 | "nixpkgs-for-kubectl": "nixpkgs-for-kubectl", 75 | "nvimdots": "nvimdots" 76 | } 77 | } 78 | }, 79 | "root": "root", 80 | "version": 7 81 | } 82 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "kevin's HomeManager Flake"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | 7 | # nvimdots 8 | nvimdots.url = "github:ayamir/nvimdots"; 9 | 10 | # 给指定版本的kubectl使用的nixpkgs 11 | nixpkgs-for-kubectl.url = "github:NixOS/nixpkgs/e7e54ace729a1e88177c0121d05f35352b05aed8"; 12 | 13 | # home-manager,用于管理用户配置 14 | home-manager = { 15 | # url = "github:nix-community/home-manager/release-23.05"; 16 | url = "github:nix-community/home-manager"; 17 | inputs.nixpkgs.follows = "nixpkgs"; 18 | }; 19 | 20 | }; 21 | outputs = { self, nixpkgs, nixpkgs-for-kubectl, home-manager, nvimdots, ... } @inputs: 22 | let 23 | userConfigContent = builtins.readFile ~/.dev-with-nix.toml; 24 | userConfig = builtins.fromTOML userConfigContent; 25 | system = "x86_64-linux"; 26 | 27 | pkgs = nixpkgs.legacyPackages.${system}; 28 | specialArgs = { 29 | inherit userConfig nvimdots nixpkgs-for-kubectl; 30 | pkgs-for-kubectl = import nixpkgs-for-kubectl { 31 | system = system; 32 | config.allowUnfree = true; 33 | }; 34 | }; 35 | in { 36 | homeConfigurations = { 37 | dev = home-manager.lib.homeManagerConfiguration { 38 | inherit pkgs ; 39 | modules = [ 40 | ./home-manager/home.nix 41 | ]; 42 | extraSpecialArgs = specialArgs; 43 | }; 44 | }; 45 | 46 | defaultPackage.${system} = self.homeConfigurations.dev.activationPackage; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /home-manager/apps/docker.nix: -------------------------------------------------------------------------------- 1 | { pkgs, user, lib, ... }: 2 | 3 | { 4 | home.activation.addUserToDocker = lib.hm.dag.entryAfter [ "writeBoundary" ] '' 5 | ${pkgs.sudo}/bin/sudo ${pkgs.shadow}/bin/usermod -aG docker ${user} 6 | ''; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /home-manager/apps/go-example.nix: -------------------------------------------------------------------------------- 1 | { lib, buildGoModule, fetchFromGitHub }: 2 | 3 | # 这是一个示例,基于某个仓库编译构建,生成相关的二进制文件 4 | buildGoModule rec { 5 | pname = "go-dnsmasq"; 6 | version = "unstable-2022-07-19"; # 添加实际的提交日期 7 | 8 | src = fetchFromGitHub { 9 | owner = "kevin1sMe"; 10 | repo = pname; 11 | rev = "6505b037c29de3b4cc6e1ddfab570cefd360c395"; # 添加你想要打包的版本的commit hash 12 | sha256 = "sha256-3b4K0kx10SJ9OAv6cEK52PBSRJC/bUuULKdufBFPapA="; # 添加正确的SHA-256哈希 13 | }; 14 | 15 | vendorSha256 = "sha256-0DqS/scc4MD+KVs9lGC6t0hHNCaYLf56k0W1bk5cE9s="; # 添加正确的SHA-256哈希 16 | 17 | subPackages = [ "cmd/dnsmasq" ]; # 打包的子目录路径 18 | 19 | meta = with lib; { 20 | description = "A golang dnsmasq application"; # 添加合适的描述 21 | homepage = "https://github.com/kevin1sMe/go-dnsmasq"; 22 | license = licenses.mit; # 确保许可证匹配实际项目许可证 23 | platforms = platforms.unix; 24 | maintainers = with maintainers; [ kevinlin ]; # 将其替换为你的名字 25 | }; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /home-manager/apps/k9s.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchurl, lib }: 2 | 3 | # 这是一个示例:解释了如何下载一个二进制文件并安装到 $out/bin 目录下 4 | # 安装指定版本的软件 5 | stdenv.mkDerivation rec { 6 | pname = "k9s"; 7 | version = "0.27.4"; 8 | 9 | src = fetchurl { 10 | url = "https://github.com/derailed/k9s/releases/download/v${version}/k9s_Linux_amd64.tar.gz"; 11 | sha256 = "sha256-5QeDHr1fm4wDgPISZp81LG40y3YMkWtJi6uui+g8Q5I="; 12 | }; 13 | 14 | setSourceRoot = "sourceRoot=$(mktemp -d)"; 15 | sourceRoot = "."; 16 | 17 | phases = [ "unpackPhase" "installPhase" ]; 18 | 19 | unpackPhase = '' 20 | tar -xvf $src -C $sourceRoot 21 | ls -al $sourceRoot 22 | ''; 23 | 24 | installPhase = '' 25 | ls -la $sourceRoot 26 | mkdir -p $out/bin 27 | cp -a k9s $out/bin/ 28 | ''; 29 | 30 | meta = with lib; { 31 | description = "Kubernetes CLI To Manage Your Clusters In Style!"; 32 | homepage = "https://github.com/derailed/k9s"; 33 | license = licenses.asl20; 34 | platforms = platforms.linux; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /home-manager/apps/nvim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | # 安装lazygit用于终端管理git 4 | home.packages = with pkgs; [ lazygit ]; 5 | 6 | # 设置一些alias 7 | programs = { 8 | neovim = { 9 | enable = true; 10 | viAlias = true; 11 | vimAlias = true; 12 | }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /home-manager/apps/nvimdots.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: 2 | { 3 | programs.neovim.nvimdots = { 4 | enable = true; 5 | setBuildEnv = true; # Only needed for NixOS 6 | withBuildTools = true; # Only needed for NixOS 7 | }; 8 | } -------------------------------------------------------------------------------- /home-manager/apps/tmux.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | # 一些配置的示例 4 | { 5 | programs.tmux = { 6 | enable = true; 7 | 8 | # 设置tmux插件 9 | plugins = with pkgs.tmuxPlugins; [ 10 | yank # 用于复制到系统剪贴板 11 | prefix-highlight # 高亮显示前缀键 12 | # 添加更多你需要的插件 13 | ]; 14 | 15 | # 设置tmux.conf配置内容 16 | extraConfig = '' 17 | # 绑定 'Ctrl-q' 作为新的前缀键,代替默认的 'Ctrl-b' 18 | set -g prefix C-q 19 | unbind C-b 20 | bind C-q send-prefix 21 | 22 | # 其他一些你喜欢的配置... 23 | ''; 24 | }; 25 | } -------------------------------------------------------------------------------- /home-manager/apps/zsh.nix: -------------------------------------------------------------------------------- 1 | {userConfig}: 2 | { 3 | programs.zsh = { 4 | enable = true; 5 | enableCompletion = true; 6 | enableAutosuggestions = true; 7 | syntaxHighlighting.enable = true; 8 | 9 | oh-my-zsh = { 10 | enable = true; 11 | plugins = [ "vi-mode" "z" "colored-man-pages" "sudo" "last-working-dir" ]; 12 | theme = "dst"; 13 | }; 14 | initExtra = '' 15 | bindkey '^f' autosuggest-accept 16 | neofetch 17 | ''; 18 | 19 | # 设置一些alias 20 | shellAliases = { 21 | k = "kubectl"; 22 | b = "byobu"; 23 | 24 | }; 25 | }; 26 | 27 | programs.fzf = { 28 | enable = true; 29 | enableZshIntegration = true; 30 | }; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /home-manager/configs/gitconfig.nix: -------------------------------------------------------------------------------- 1 | {userConfig, ...}: 2 | # 这是一个示例,如何设置一些用户配置 3 | let 4 | # 设置git配置 5 | gitConfigContent = builtins.readFile ../files/gitconfig; 6 | in 7 | { 8 | #name = REPLACE_NAME_AUTO 9 | #email = REPLACE_EMAIL_AUTO 10 | # 将内容中的name/email替换为用户输入的值 11 | home.file.".gitconfig".text = builtins.replaceStrings ["REPLACE_NAME_AUTO" "REPLACE_EMAIL_AUTO"] [userConfig.gitconfig.name userConfig.gitconfig.email] gitConfigContent; 12 | } 13 | -------------------------------------------------------------------------------- /home-manager/configs/neofetch.nix: -------------------------------------------------------------------------------- 1 | { 2 | home.file.".config/neofetch/config.conf".source = ../files/neofetch; 3 | } 4 | -------------------------------------------------------------------------------- /home-manager/envs/vars.nix: -------------------------------------------------------------------------------- 1 | { userConfig, ... }: 2 | let 3 | envs = builtins.concatStringsSep " + " (builtins.attrNames userConfig.env); 4 | appendEnvs = builtins.trace "user append envs: *** ${envs} ***" userConfig.env; 5 | in 6 | { 7 | home.sessionVariables = { 8 | 9 | # 默认编辑器 10 | EDITOR = "nvim"; 11 | 12 | } // appendEnvs; 13 | } 14 | -------------------------------------------------------------------------------- /home-manager/files/gitconfig: -------------------------------------------------------------------------------- 1 | [color] 2 | branch = auto 3 | diff = auto 4 | grep = auto 5 | status = auto 6 | interactive = auto 7 | ui = true 8 | 9 | [alias] 10 | co = checkout 11 | ci = commit 12 | st = status 13 | br = branch 14 | last = log -5 HEAD 15 | 16 | [push] 17 | default = simple 18 | 19 | [log] 20 | date = local 21 | 22 | [filter "lfs"] 23 | clean = git-lfs clean -- %f 24 | smudge = git-lfs smudge -- %f 25 | process = git-lfs filter-process 26 | required = true 27 | 28 | # User信息是在构建后自动被替换的,你不必修改这里 29 | [user] 30 | name = REPLACE_NAME_AUTO 31 | email = REPLACE_EMAIL_AUTO 32 | 33 | [http] 34 | sslVerify = false 35 | 36 | [credential] 37 | helper = store -------------------------------------------------------------------------------- /home-manager/files/neofetch: -------------------------------------------------------------------------------- 1 | # See this wiki page for more info: 2 | # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info 3 | print_info() { 4 | info title 5 | info underline 6 | 7 | info "OS" distro 8 | info "Host" model 9 | info "Kernel" kernel 10 | info "Uptime" uptime 11 | info "Packages" packages 12 | info "Shell" shell 13 | info "Disk" disk 14 | info "Resolution" resolution 15 | info "DE" de 16 | info "WM" wm 17 | info "WM Theme" wm_theme 18 | info "Theme" theme 19 | info "Icons" icons 20 | info "Terminal" term 21 | info "Terminal Font" term_font 22 | info "CPU" cpu 23 | info "GPU" gpu 24 | info "Memory" memory 25 | info "Local IP" local_ip 26 | 27 | # info "GPU Driver" gpu_driver # Linux/macOS only 28 | # info "CPU Usage" cpu_usage 29 | # info "Battery" battery 30 | # info "Font" font 31 | # info "Song" song 32 | # [[ "$player" ]] && prin "Music Player" "$player" 33 | # info "Public IP" public_ip 34 | # info "Users" users 35 | # info "Locale" locale # This only works on glibc systems. 36 | 37 | info cols 38 | } 39 | 40 | # Title 41 | 42 | 43 | # Hide/Show Fully qualified domain name. 44 | # 45 | # Default: 'off' 46 | # Values: 'on', 'off' 47 | # Flag: --title_fqdn 48 | title_fqdn="off" 49 | 50 | 51 | # Kernel 52 | 53 | 54 | # Shorten the output of the kernel function. 55 | # 56 | # Default: 'on' 57 | # Values: 'on', 'off' 58 | # Flag: --kernel_shorthand 59 | # Supports: Everything except *BSDs (except PacBSD and PC-BSD) 60 | # 61 | # Example: 62 | # on: '4.8.9-1-ARCH' 63 | # off: 'Linux 4.8.9-1-ARCH' 64 | kernel_shorthand="on" 65 | 66 | 67 | # Distro 68 | 69 | 70 | # Shorten the output of the distro function 71 | # 72 | # Default: 'off' 73 | # Values: 'on', 'tiny', 'off' 74 | # Flag: --distro_shorthand 75 | # Supports: Everything except Windows and Haiku 76 | distro_shorthand="off" 77 | 78 | # Show/Hide OS Architecture. 79 | # Show 'x86_64', 'x86' and etc in 'Distro:' output. 80 | # 81 | # Default: 'on' 82 | # Values: 'on', 'off' 83 | # Flag: --os_arch 84 | # 85 | # Example: 86 | # on: 'Arch Linux x86_64' 87 | # off: 'Arch Linux' 88 | os_arch="on" 89 | 90 | 91 | # Uptime 92 | 93 | 94 | # Shorten the output of the uptime function 95 | # 96 | # Default: 'on' 97 | # Values: 'on', 'tiny', 'off' 98 | # Flag: --uptime_shorthand 99 | # 100 | # Example: 101 | # on: '2 days, 10 hours, 3 mins' 102 | # tiny: '2d 10h 3m' 103 | # off: '2 days, 10 hours, 3 minutes' 104 | uptime_shorthand="on" 105 | 106 | 107 | # Memory 108 | 109 | 110 | # Show memory pecentage in output. 111 | # 112 | # Default: 'off' 113 | # Values: 'on', 'off' 114 | # Flag: --memory_percent 115 | # 116 | # Example: 117 | # on: '1801MiB / 7881MiB (22%)' 118 | # off: '1801MiB / 7881MiB' 119 | memory_percent="off" 120 | 121 | 122 | # Packages 123 | 124 | 125 | # Show/Hide Package Manager names. 126 | # 127 | # Default: 'tiny' 128 | # Values: 'on', 'tiny' 'off' 129 | # Flag: --package_managers 130 | # 131 | # Example: 132 | # on: '998 (pacman), 8 (flatpak), 4 (snap)' 133 | # tiny: '908 (pacman, flatpak, snap)' 134 | # off: '908' 135 | package_managers="on" 136 | 137 | 138 | # Shell 139 | 140 | 141 | # Show the path to $SHELL 142 | # 143 | # Default: 'off' 144 | # Values: 'on', 'off' 145 | # Flag: --shell_path 146 | # 147 | # Example: 148 | # on: '/bin/bash' 149 | # off: 'bash' 150 | shell_path="off" 151 | 152 | # Show $SHELL version 153 | # 154 | # Default: 'on' 155 | # Values: 'on', 'off' 156 | # Flag: --shell_version 157 | # 158 | # Example: 159 | # on: 'bash 4.4.5' 160 | # off: 'bash' 161 | shell_version="on" 162 | 163 | 164 | # CPU 165 | 166 | 167 | # CPU speed type 168 | # 169 | # Default: 'bios_limit' 170 | # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. 171 | # Flag: --speed_type 172 | # Supports: Linux with 'cpufreq' 173 | # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. 174 | speed_type="bios_limit" 175 | 176 | # CPU speed shorthand 177 | # 178 | # Default: 'off' 179 | # Values: 'on', 'off'. 180 | # Flag: --speed_shorthand 181 | # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz 182 | # 183 | # Example: 184 | # on: 'i7-6500U (4) @ 3.1GHz' 185 | # off: 'i7-6500U (4) @ 3.100GHz' 186 | speed_shorthand="off" 187 | 188 | # Enable/Disable CPU brand in output. 189 | # 190 | # Default: 'on' 191 | # Values: 'on', 'off' 192 | # Flag: --cpu_brand 193 | # 194 | # Example: 195 | # on: 'Intel i7-6500U' 196 | # off: 'i7-6500U (4)' 197 | cpu_brand="on" 198 | 199 | # CPU Speed 200 | # Hide/Show CPU speed. 201 | # 202 | # Default: 'on' 203 | # Values: 'on', 'off' 204 | # Flag: --cpu_speed 205 | # 206 | # Example: 207 | # on: 'Intel i7-6500U (4) @ 3.1GHz' 208 | # off: 'Intel i7-6500U (4)' 209 | cpu_speed="on" 210 | 211 | # CPU Cores 212 | # Display CPU cores in output 213 | # 214 | # Default: 'logical' 215 | # Values: 'logical', 'physical', 'off' 216 | # Flag: --cpu_cores 217 | # Support: 'physical' doesn't work on BSD. 218 | # 219 | # Example: 220 | # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) 221 | # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) 222 | # off: 'Intel i7-6500U @ 3.1GHz' 223 | cpu_cores="logical" 224 | 225 | # CPU Temperature 226 | # Hide/Show CPU temperature. 227 | # Note the temperature is added to the regular CPU function. 228 | # 229 | # Default: 'off' 230 | # Values: 'C', 'F', 'off' 231 | # Flag: --cpu_temp 232 | # Supports: Linux, BSD 233 | # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable 234 | # coretemp kernel module. This only supports newer Intel processors. 235 | # 236 | # Example: 237 | # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' 238 | # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' 239 | # off: 'Intel i7-6500U (4) @ 3.1GHz' 240 | cpu_temp="off" 241 | 242 | 243 | # GPU 244 | 245 | 246 | # Enable/Disable GPU Brand 247 | # 248 | # Default: 'on' 249 | # Values: 'on', 'off' 250 | # Flag: --gpu_brand 251 | # 252 | # Example: 253 | # on: 'AMD HD 7950' 254 | # off: 'HD 7950' 255 | gpu_brand="on" 256 | 257 | # Which GPU to display 258 | # 259 | # Default: 'all' 260 | # Values: 'all', 'dedicated', 'integrated' 261 | # Flag: --gpu_type 262 | # Supports: Linux 263 | # 264 | # Example: 265 | # all: 266 | # GPU1: AMD HD 7950 267 | # GPU2: Intel Integrated Graphics 268 | # 269 | # dedicated: 270 | # GPU1: AMD HD 7950 271 | # 272 | # integrated: 273 | # GPU1: Intel Integrated Graphics 274 | gpu_type="all" 275 | 276 | 277 | # Resolution 278 | 279 | 280 | # Display refresh rate next to each monitor 281 | # Default: 'off' 282 | # Values: 'on', 'off' 283 | # Flag: --refresh_rate 284 | # Supports: Doesn't work on Windows. 285 | # 286 | # Example: 287 | # on: '1920x1080 @ 60Hz' 288 | # off: '1920x1080' 289 | refresh_rate="off" 290 | 291 | 292 | # Gtk Theme / Icons / Font 293 | 294 | 295 | # Shorten output of GTK Theme / Icons / Font 296 | # 297 | # Default: 'off' 298 | # Values: 'on', 'off' 299 | # Flag: --gtk_shorthand 300 | # 301 | # Example: 302 | # on: 'Numix, Adwaita' 303 | # off: 'Numix [GTK2], Adwaita [GTK3]' 304 | gtk_shorthand="off" 305 | 306 | 307 | # Enable/Disable gtk2 Theme / Icons / Font 308 | # 309 | # Default: 'on' 310 | # Values: 'on', 'off' 311 | # Flag: --gtk2 312 | # 313 | # Example: 314 | # on: 'Numix [GTK2], Adwaita [GTK3]' 315 | # off: 'Adwaita [GTK3]' 316 | gtk2="on" 317 | 318 | # Enable/Disable gtk3 Theme / Icons / Font 319 | # 320 | # Default: 'on' 321 | # Values: 'on', 'off' 322 | # Flag: --gtk3 323 | # 324 | # Example: 325 | # on: 'Numix [GTK2], Adwaita [GTK3]' 326 | # off: 'Numix [GTK2]' 327 | gtk3="on" 328 | 329 | 330 | # IP Address 331 | 332 | 333 | # Website to ping for the public IP 334 | # 335 | # Default: 'http://ident.me' 336 | # Values: 'url' 337 | # Flag: --ip_host 338 | public_ip_host="http://ident.me" 339 | 340 | # Public IP timeout. 341 | # 342 | # Default: '2' 343 | # Values: 'int' 344 | # Flag: --ip_timeout 345 | public_ip_timeout=2 346 | 347 | 348 | # Desktop Environment 349 | 350 | 351 | # Show Desktop Environment version 352 | # 353 | # Default: 'off' 354 | # Values: 'on', 'off' 355 | # Flag: --de_version 356 | de_version="off" 357 | 358 | 359 | # Disk 360 | 361 | 362 | # Which disks to display. 363 | # The values can be any /dev/sdXX, mount point or directory. 364 | # NOTE: By default we only show the disk info for '/'. 365 | # 366 | # Default: '/' 367 | # Values: '/', '/dev/sdXX', '/path/to/drive'. 368 | # Flag: --disk_show 369 | # 370 | # Example: 371 | # disk_show=('/' '/dev/sdb1'): 372 | # 'Disk (/): 74G / 118G (66%)' 373 | # 'Disk (/mnt/Videos): 823G / 893G (93%)' 374 | # 375 | # disk_show=('/'): 376 | # 'Disk (/): 74G / 118G (66%)' 377 | # 378 | disk_show=('/') 379 | 380 | # Disk subtitle. 381 | # What to append to the Disk subtitle. 382 | # 383 | # Default: 'mount' 384 | # Values: 'mount', 'name', 'dir', 'none' 385 | # Flag: --disk_subtitle 386 | # 387 | # Example: 388 | # name: 'Disk (/dev/sda1): 74G / 118G (66%)' 389 | # 'Disk (/dev/sdb2): 74G / 118G (66%)' 390 | # 391 | # mount: 'Disk (/): 74G / 118G (66%)' 392 | # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' 393 | # 'Disk (/mnt/Videos): 74G / 118G (66%)' 394 | # 395 | # dir: 'Disk (/): 74G / 118G (66%)' 396 | # 'Disk (Local Disk): 74G / 118G (66%)' 397 | # 'Disk (Videos): 74G / 118G (66%)' 398 | # 399 | # none: 'Disk: 74G / 118G (66%)' 400 | # 'Disk: 74G / 118G (66%)' 401 | # 'Disk: 74G / 118G (66%)' 402 | disk_subtitle="mount" 403 | 404 | # Disk percent. 405 | # Show/Hide disk percent. 406 | # 407 | # Default: 'on' 408 | # Values: 'on', 'off' 409 | # Flag: --disk_percent 410 | # 411 | # Example: 412 | # on: 'Disk (/): 74G / 118G (66%)' 413 | # off: 'Disk (/): 74G / 118G' 414 | disk_percent="on" 415 | 416 | 417 | # Song 418 | 419 | 420 | # Manually specify a music player. 421 | # 422 | # Default: 'auto' 423 | # Values: 'auto', 'player-name' 424 | # Flag: --music_player 425 | # 426 | # Available values for 'player-name': 427 | # 428 | # amarok 429 | # audacious 430 | # banshee 431 | # bluemindo 432 | # clementine 433 | # cmus 434 | # deadbeef 435 | # deepin-music 436 | # dragon 437 | # elisa 438 | # exaile 439 | # gnome-music 440 | # gmusicbrowser 441 | # gogglesmm 442 | # guayadeque 443 | # io.elementary.music 444 | # iTunes 445 | # juk 446 | # lollypop 447 | # mocp 448 | # mopidy 449 | # mpd 450 | # muine 451 | # netease-cloud-music 452 | # pogo 453 | # pragha 454 | # qmmp 455 | # quodlibet 456 | # rhythmbox 457 | # sayonara 458 | # smplayer 459 | # spotify 460 | # strawberry 461 | # tomahawk 462 | # vlc 463 | # xmms2d 464 | # xnoise 465 | # yarock 466 | music_player="auto" 467 | 468 | # Format to display song information. 469 | # 470 | # Default: '%artist% - %album% - %title%' 471 | # Values: '%artist%', '%album%', '%title%' 472 | # Flag: --song_format 473 | # 474 | # Example: 475 | # default: 'Song: Jet - Get Born - Sgt Major' 476 | song_format="%artist% - %album% - %title%" 477 | 478 | # Print the Artist, Album and Title on separate lines 479 | # 480 | # Default: 'off' 481 | # Values: 'on', 'off' 482 | # Flag: --song_shorthand 483 | # 484 | # Example: 485 | # on: 'Artist: The Fratellis' 486 | # 'Album: Costello Music' 487 | # 'Song: Chelsea Dagger' 488 | # 489 | # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' 490 | song_shorthand="off" 491 | 492 | # 'mpc' arguments (specify a host, password etc). 493 | # 494 | # Default: '' 495 | # Example: mpc_args=(-h HOST -P PASSWORD) 496 | mpc_args=() 497 | 498 | 499 | # Text Colors 500 | 501 | 502 | # Text Colors 503 | # 504 | # Default: 'distro' 505 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 506 | # Flag: --colors 507 | # 508 | # Each number represents a different part of the text in 509 | # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' 510 | # 511 | # Example: 512 | # colors=(distro) - Text is colored based on Distro colors. 513 | # colors=(4 6 1 8 8 6) - Text is colored in the order above. 514 | colors=(distro) 515 | 516 | 517 | # Text Options 518 | 519 | 520 | # Toggle bold text 521 | # 522 | # Default: 'on' 523 | # Values: 'on', 'off' 524 | # Flag: --bold 525 | bold="on" 526 | 527 | # Enable/Disable Underline 528 | # 529 | # Default: 'on' 530 | # Values: 'on', 'off' 531 | # Flag: --underline 532 | underline_enabled="on" 533 | 534 | # Underline character 535 | # 536 | # Default: '-' 537 | # Values: 'string' 538 | # Flag: --underline_char 539 | underline_char="-" 540 | 541 | 542 | # Info Separator 543 | # Replace the default separator with the specified string. 544 | # 545 | # Default: ':' 546 | # Flag: --separator 547 | # 548 | # Example: 549 | # separator="->": 'Shell-> bash' 550 | # separator=" =": 'WM = dwm' 551 | separator=":" 552 | 553 | 554 | # Color Blocks 555 | 556 | 557 | # Color block range 558 | # The range of colors to print. 559 | # 560 | # Default: '0', '15' 561 | # Values: 'num' 562 | # Flag: --block_range 563 | # 564 | # Example: 565 | # 566 | # Display colors 0-7 in the blocks. (8 colors) 567 | # neofetch --block_range 0 7 568 | # 569 | # Display colors 0-15 in the blocks. (16 colors) 570 | # neofetch --block_range 0 15 571 | block_range=(0 15) 572 | 573 | # Toggle color blocks 574 | # 575 | # Default: 'on' 576 | # Values: 'on', 'off' 577 | # Flag: --color_blocks 578 | color_blocks="on" 579 | 580 | # Color block width in spaces 581 | # 582 | # Default: '3' 583 | # Values: 'num' 584 | # Flag: --block_width 585 | block_width=3 586 | 587 | # Color block height in lines 588 | # 589 | # Default: '1' 590 | # Values: 'num' 591 | # Flag: --block_height 592 | block_height=1 593 | 594 | # Color Alignment 595 | # 596 | # Default: 'auto' 597 | # Values: 'auto', 'num' 598 | # Flag: --col_offset 599 | # 600 | # Number specifies how far from the left side of the terminal (in spaces) to 601 | # begin printing the columns, in case you want to e.g. center them under your 602 | # text. 603 | # Example: 604 | # col_offset="auto" - Default behavior of neofetch 605 | # col_offset=7 - Leave 7 spaces then print the colors 606 | col_offset="auto" 607 | 608 | # Progress Bars 609 | 610 | 611 | # Bar characters 612 | # 613 | # Default: '-', '=' 614 | # Values: 'string', 'string' 615 | # Flag: --bar_char 616 | # 617 | # Example: 618 | # neofetch --bar_char 'elapsed' 'total' 619 | # neofetch --bar_char '-' '=' 620 | bar_char_elapsed="-" 621 | bar_char_total="=" 622 | 623 | # Toggle Bar border 624 | # 625 | # Default: 'on' 626 | # Values: 'on', 'off' 627 | # Flag: --bar_border 628 | bar_border="on" 629 | 630 | # Progress bar length in spaces 631 | # Number of chars long to make the progress bars. 632 | # 633 | # Default: '15' 634 | # Values: 'num' 635 | # Flag: --bar_length 636 | bar_length=15 637 | 638 | # Progress bar colors 639 | # When set to distro, uses your distro's logo colors. 640 | # 641 | # Default: 'distro', 'distro' 642 | # Values: 'distro', 'num' 643 | # Flag: --bar_colors 644 | # 645 | # Example: 646 | # neofetch --bar_colors 3 4 647 | # neofetch --bar_colors distro 5 648 | bar_color_elapsed="distro" 649 | bar_color_total="distro" 650 | 651 | 652 | # Info display 653 | # Display a bar with the info. 654 | # 655 | # Default: 'off' 656 | # Values: 'bar', 'infobar', 'barinfo', 'off' 657 | # Flags: --cpu_display 658 | # --memory_display 659 | # --battery_display 660 | # --disk_display 661 | # 662 | # Example: 663 | # bar: '[---=======]' 664 | # infobar: 'info [---=======]' 665 | # barinfo: '[---=======] info' 666 | # off: 'info' 667 | cpu_display="off" 668 | memory_display="off" 669 | battery_display="off" 670 | disk_display="off" 671 | 672 | 673 | # Backend Settings 674 | 675 | 676 | # Image backend. 677 | # 678 | # Default: 'ascii' 679 | # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', 680 | # 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' 681 | # Flag: --backend 682 | image_backend="ascii" 683 | 684 | # Image Source 685 | # 686 | # Which image or ascii file to display. 687 | # 688 | # Default: 'auto' 689 | # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' 690 | # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' 691 | # Flag: --source 692 | # 693 | # NOTE: 'auto' will pick the best image source for whatever image backend is used. 694 | # In ascii mode, distro ascii art will be used and in an image mode, your 695 | # wallpaper will be used. 696 | image_source="auto" 697 | 698 | 699 | # Ascii Options 700 | 701 | 702 | # Ascii distro 703 | # Which distro's ascii art to display. 704 | # 705 | # Default: 'auto' 706 | # Values: 'auto', 'distro_name' 707 | # Flag: --ascii_distro 708 | # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, AOSC, 709 | # Apricity, ArcoLinux, ArchBox, ARCHlabs, ArchStrike, 710 | # XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, Bitrig, 711 | # BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, 712 | # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, 713 | # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, 714 | # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, 715 | # DesaOS, Devuan, DracOS, DragonFly, Drauger, Elementary, 716 | # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, 717 | # FreeMiNT, Frugalware, Funtoo, GalliumOS, Gentoo, Pentoo, 718 | # gNewSense, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, 719 | # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, 720 | # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, 721 | # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, 722 | # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, 723 | # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, 724 | # NuTyX, OBRevenge, OpenBSD, OpenIndiana, OpenMandriva, 725 | # OpenWrt, osmc, Oracle, PacBSD, Parabola, Pardus, Parrot, 726 | # Parsix, TrueOS, PCLinuxOS, Peppermint, popos, Porteus, 727 | # PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, Raspbian, 728 | # Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, Regata, 729 | # Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, Septor, 730 | # SharkLinux, Siduction, Slackware, SliTaz, SmartOS, Solus, 731 | # Source_Mage, Sparky, Star, SteamOS, SunOS, openSUSE_Leap, 732 | # openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, Trisquel, 733 | # Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, Ubuntu, 734 | # Void, Obarun, windows10, Windows7, Xubuntu, Zorin, and IRIX 735 | # have ascii logos 736 | # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. 737 | # Use '{distro name}_old' to use the old logos. 738 | # NOTE: Ubuntu has flavor variants. 739 | # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, 740 | # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. 741 | # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, 742 | # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, 743 | # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, 744 | # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, 745 | # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, 746 | # postmarketOS, and Void have a smaller logo variant. 747 | # Use '{distro name}_small' to use the small variants. 748 | ascii_distro="auto" 749 | 750 | # Ascii Colors 751 | # 752 | # Default: 'distro' 753 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 754 | # Flag: --ascii_colors 755 | # 756 | # Example: 757 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 758 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 759 | ascii_colors=(distro) 760 | 761 | # Bold ascii logo 762 | # Whether or not to bold the ascii logo. 763 | # 764 | # Default: 'on' 765 | # Values: 'on', 'off' 766 | # Flag: --ascii_bold 767 | ascii_bold="on" 768 | 769 | 770 | # Image Options 771 | 772 | 773 | # Image loop 774 | # Setting this to on will make neofetch redraw the image constantly until 775 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 776 | # 777 | # Default: 'off' 778 | # Values: 'on', 'off' 779 | # Flag: --loop 780 | image_loop="off" 781 | 782 | # Thumbnail directory 783 | # 784 | # Default: '~/.cache/thumbnails/neofetch' 785 | # Values: 'dir' 786 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 787 | 788 | # Crop mode 789 | # 790 | # Default: 'normal' 791 | # Values: 'normal', 'fit', 'fill' 792 | # Flag: --crop_mode 793 | # 794 | # See this wiki page to learn about the fit and fill options. 795 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 796 | crop_mode="normal" 797 | 798 | # Crop offset 799 | # Note: Only affects 'normal' crop mode. 800 | # 801 | # Default: 'center' 802 | # Values: 'northwest', 'north', 'northeast', 'west', 'center' 803 | # 'east', 'southwest', 'south', 'southeast' 804 | # Flag: --crop_offset 805 | crop_offset="center" 806 | 807 | # Image size 808 | # The image is half the terminal width by default. 809 | # 810 | # Default: 'auto' 811 | # Values: 'auto', '00px', '00%', 'none' 812 | # Flags: --image_size 813 | # --size 814 | image_size="auto" 815 | 816 | # Gap between image and text 817 | # 818 | # Default: '3' 819 | # Values: 'num', '-num' 820 | # Flag: --gap 821 | gap=3 822 | 823 | # Image offsets 824 | # Only works with the w3m backend. 825 | # 826 | # Default: '0' 827 | # Values: 'px' 828 | # Flags: --xoffset 829 | # --yoffset 830 | yoffset=0 831 | xoffset=0 832 | 833 | # Image background color 834 | # Only works with the w3m backend. 835 | # 836 | # Default: '' 837 | # Values: 'color', 'blue' 838 | # Flag: --bg_color 839 | background_color= 840 | 841 | 842 | # Misc Options 843 | 844 | # Stdout mode 845 | # Turn off all colors and disables image backend (ASCII/Image). 846 | # Useful for piping into another command. 847 | # Default: 'off' 848 | # Values: 'on', 'off' 849 | stdout="off" 850 | -------------------------------------------------------------------------------- /home-manager/home.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, userConfig, lib, nvimdots, pkgs-for-kubectl, ... }: 2 | 3 | let 4 | # 演示打印一些变量 5 | user = userConfig.user.name; 6 | homeDir = userConfig.user.homeDir; 7 | in 8 | rec { 9 | home.username = (builtins.trace "user is ${user}" user ); 10 | home.homeDirectory = (builtins.trace "homeDir is ${homeDir}" homeDir ); 11 | home.stateVersion = "23.05"; 12 | 13 | home.packages = with pkgs; [ 14 | python3 15 | git 16 | openssh 17 | curl 18 | htop 19 | lsof 20 | neofetch 21 | 22 | tmux 23 | byobu 24 | 25 | go 26 | 27 | #k9s 28 | ( import ./apps/k9s.nix { inherit lib stdenv fetchurl; } ) 29 | 30 | # go example 31 | ( import ./apps/go-example.nix { inherit (pkgs) lib buildGoModule fetchFromGitHub; } ) # 显式指明lib/buildGoModule/fetchFromGitHub属于pkgs包 32 | 33 | ] ++ [ 34 | # 这个版本是v1.23.4 35 | pkgs-for-kubectl.kubectl 36 | ]; 37 | 38 | 39 | 40 | imports = [ 41 | nvimdots.nixosModules.nvimdots 42 | (import ./apps/zsh.nix { inherit userConfig; }) 43 | ./apps/nvim.nix 44 | ./apps/nvimdots.nix 45 | # 设置tmux的配置 46 | ./apps/tmux.nix 47 | 48 | # 设置一些环境变量 49 | (import ./envs/vars.nix {inherit userConfig;}) 50 | 51 | # 设置一些配置 52 | (import ./configs/gitconfig.nix {inherit userConfig;}) 53 | ./configs/neofetch.nix 54 | ]; 55 | 56 | # 设置默认shell为zsh 57 | # Notice: hm不提供直接设置登录默认shell. 暂时没有特别好的解决办法。除非手动设置,比如 58 | # 在~/.bash_profile中添加如下行 59 | # exec zsh 60 | 61 | # home.sessionVariables = { 62 | # # SHELL = "${pkgs.zsh}/bin/zsh"; 63 | # SHELL = pkgs.zsh; 64 | # }; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 如果出错则中止 4 | set -e 5 | 6 | # 安装nix 7 | # 如果已经有nix, 则不安装 8 | if [ -d /nix ]; then 9 | # 打印nix版本 10 | nix --version 11 | echo "Nix is already installed, I will skip install" 12 | else 13 | bash <(curl -L https://nixos.org/nix/install) --daemon 14 | fi 15 | 16 | # 修改nix的配置文件 17 | echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf >/dev/null 18 | 19 | # clone仓库 20 | git clone git@github.com:kevin1sMe/dev-with-nix.git 21 | 22 | # 进入仓库 23 | cd dev-with-nix 24 | 25 | # 配置userconfig.toml 26 | cp config-tmpl.toml ${HOME}/.dev-with-nix.toml 27 | 28 | # 提示 29 | echo 30 | 31 | 32 | echo -e "\xF0\x9F\x8E\x89 \e[32mNow only four simple steps:\e[0m\n" 33 | 34 | echo -e "1. \xF0\x9F\x94\xA7 \e[32mSource the Nix profile with:\e[0m \e[33msource ~/.nix-profile/etc/profile.d/nix.sh\e[0m" 35 | 36 | echo -e "2. \xF0\x9F\x93\x82 \e[32mEdit config at \e[0m\e[33m${HOME}/.dev-with-nix.toml\e[0m" 37 | 38 | echo -e "3. \xF0\x9F\x9A\x80 \e[32mCd\e[0m \e[33mdev-with-nix\e[0m \e[32mand build with command:\e[0m \e[33mnix run nixpkgs#home-manager -- switch --flake .#dev --impure\e[0m\e[32m (Grab a coffee for the initial run!)\e[0m" 39 | 40 | echo -e "4. \xF0\x9F\x8E\xAE \e[32mStart your session with:\e[0m \e[33mzsh\e[0m" 41 | --------------------------------------------------------------------------------