From 26b5caa6d047288e4b0c593ec03ac1acd1e94c44 Mon Sep 17 00:00:00 2001 From: luochen570 <1160510664@qq.com> Date: Sat, 28 Feb 2026 11:14:50 +0800 Subject: [PATCH] new file: flake.lock modified: home/git.nix modified: hosts/README.md modified: hosts/virtualbox/README.md modified: hosts/virtualbox/configuration.nix modified: modules/core/users.nix modified: modules/desktop/pkg.nix modified: modules/server/README.md modified: profiles/README.md --- flake.lock | 263 +++++++++++++++++++++++++++++ home/git.nix | 12 +- hosts/README.md | 5 + hosts/virtualbox/README.md | 17 +- hosts/virtualbox/configuration.nix | 5 +- modules/core/users.nix | 21 +-- modules/desktop/pkg.nix | 4 +- modules/server/README.md | 3 +- profiles/README.md | 1 + 9 files changed, 300 insertions(+), 31 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d85cab4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,263 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763992789, + "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.05", + "repo": "home-manager", + "type": "github" + } + }, + "nix4nvchad": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "nvchad-starter": "nvchad-starter" + }, + "locked": { + "lastModified": 1772187015, + "narHash": "sha256-8UA+HVKxRqyv1wuAln4gxskq8ZbW5ttKZg5kDp0R154=", + "owner": "nix-community", + "repo": "nix4nvchad", + "rev": "cde302611dfdcaece9756b48f68eb808645929b5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix4nvchad", + "type": "github" + } + }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1771563879, + "narHash": "sha256-vA5hocvdGhr+jfBN7A7ogeZqIz2qx01EixXwdVsQcnE=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "379d20c55f552e91fb9f3f0382e4a97d3f452943", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1770019141, + "narHash": "sha256-VKS4ZLNx4PNrABoB0L8KUpc1fE7CLpQXQs985tGfaCU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cb369ef2efd432b3cdf8622b0ffc0a97a02f3137", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1682134069, + "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fd901ef4bf93499374c5af385b2943f5801c0833", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nvchad-starter": { + "flake": false, + "locked": { + "lastModified": 1753939018, + "narHash": "sha256-xdLr6tlU9uA+wu0pqha2br0fdVm+1MjgjbB5awz9ICU=", + "owner": "NvChad", + "repo": "starter", + "rev": "e3572e1f5e1c297212c3deeb17b7863139ce663e", + "type": "github" + }, + "original": { + "owner": "NvChad", + "ref": "main", + "repo": "starter", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nix4nvchad": "nix4nvchad", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_2", + "sops-nix": "sops-nix", + "vscode-server": "vscode-server" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772048434, + "narHash": "sha256-/wA0OaH6kZ/pFA+nXR/tvg5oupOmEDmMS5us79JT60o=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "334daa7c273dd8bf7a0cd370e4e16022b64e55e9", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "vscode-server": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1770124655, + "narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=", + "owner": "nix-community", + "repo": "nixos-vscode-server", + "rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-vscode-server", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home/git.nix b/home/git.nix index 75037c2..c575bdf 100644 --- a/home/git.nix +++ b/home/git.nix @@ -2,12 +2,10 @@ { programs.git = { enable = true; - settings = { - user = { - name = "luochen570"; - email = "1160510664@qq.com"; - }; - init.defaultBranch = "main"; - }; + userName = "luochen570"; + userEmail = "1160510664@qq.com"; + extraConfig = { + init.defaultBranch = "main"; + }; }; } diff --git a/hosts/README.md b/hosts/README.md index f09094e..d25f0f7 100644 --- a/hosts/README.md +++ b/hosts/README.md @@ -16,6 +16,11 @@ โ”‚ โ”œโ”€ ๐Ÿงฉ default.nix โ”‚ โ”œโ”€ โš™๏ธ configuration.nix โ”‚ โ””โ”€ ๐Ÿ“ README.md +โ”œโ”€ ๐Ÿ“ฆ virtualbox/ +โ”‚ โ”œโ”€ ๐Ÿงฉ default.nix +โ”‚ โ”œโ”€ โš™๏ธ configuration.nix +โ”‚ โ”œโ”€ ๐Ÿงฑ hardware-configuration.nix +โ”‚ โ””โ”€ ๐Ÿ“ README.md โ””โ”€ ๐ŸชŸ wsl/ โ”œโ”€ ๐Ÿงฉ default.nix โ”œโ”€ โš™๏ธ configuration.nix diff --git a/hosts/virtualbox/README.md b/hosts/virtualbox/README.md index 600d8ec..cfa0f8b 100644 --- a/hosts/virtualbox/README.md +++ b/hosts/virtualbox/README.md @@ -1,11 +1,12 @@ -# hosts/virtualbox +# ๐Ÿ“ฆ hosts/virtualbox -VirtualBox guest host entry. +VirtualBox ่™šๆ‹Ÿๆœบไธปๆœบๅ…ฅๅฃใ€‚ -## Layout +## ๐ŸŒฒ ็›ฎๅฝ•ๆ ‘ ```text -hosts/virtualbox -|- default.nix # host entry, imports configuration.nix -|- configuration.nix # profile + hostName + machine specific options -`- README.md -``` \ No newline at end of file +๐Ÿ“ฆ hosts/virtualbox +โ”œโ”€ ๐Ÿงฉ default.nix # ไธปๆœบๅ…ฅๅฃ๏ผŒๅผ•็”จ configuration.nix ไธŽ็กฌไปถ้…็ฝฎ +โ”œโ”€ โš™๏ธ configuration.nix # profile + hostName + ๆœบๅ™จ็›ธๅ…ณ้…็ฝฎ +โ”œโ”€ ๐Ÿงฑ hardware-configuration.nix # ็”ฑ nixos-generate-config ็”Ÿๆˆ็š„็กฌไปถ้…็ฝฎ +โ””โ”€ ๐Ÿ“ README.md +``` diff --git a/hosts/virtualbox/configuration.nix b/hosts/virtualbox/configuration.nix index 228a715..aea47d4 100644 --- a/hosts/virtualbox/configuration.nix +++ b/hosts/virtualbox/configuration.nix @@ -6,6 +6,9 @@ networking.hostName = "virtualbox"; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # Machine-specific config generated by nixos-generate-config can be # merged here: disk layout, boot loader, filesystem, hardware options. -} \ No newline at end of file +} diff --git a/modules/core/users.nix b/modules/core/users.nix index 7688356..8625719 100644 --- a/modules/core/users.nix +++ b/modules/core/users.nix @@ -7,17 +7,14 @@ isNormalUser = true; extraGroups = [ "wheel" ]; shell = pkgs.zsh; + } + // lib.optionalAttrs (!(config.sops.secrets ? "users/luochen570/passwordHash")) { + initialPassword = "Dly928730@.."; + } + // lib.optionalAttrs (config.sops.secrets ? "users/luochen570/authorized_key") { + openssh.authorizedKeys.keyFiles = [ config.sops.secrets."users/luochen570/authorized_key".path ]; + } + // lib.optionalAttrs (config.sops.secrets ? "users/luochen570/passwordHash") { + hashedPasswordFile = config.sops.secrets."users/luochen570/passwordHash".path; }; - - users.users.${username}.initialPassword = lib.mkIf - (!(config.sops.secrets ? "users/luochen570/passwordHash")) - "Dly928730@.."; - - users.users.${username}.openssh.authorizedKeys.keyFiles = lib.mkIf - (config.sops.secrets ? "users/luochen570/authorized_key") - [ config.sops.secrets."users/luochen570/authorized_key".path ]; - - users.users.${username}.hashedPasswordFile = lib.mkIf - (config.sops.secrets ? "users/luochen570/passwordHash") - config.sops.secrets."users/luochen570/passwordHash".path; } diff --git a/modules/desktop/pkg.nix b/modules/desktop/pkg.nix index f5f4fd7..bb17f04 100644 --- a/modules/desktop/pkg.nix +++ b/modules/desktop/pkg.nix @@ -3,8 +3,8 @@ environment.systemPackages = with pkgs; [ firefox google-chrome - linuxqq - wechat-uos + qq + wechat xterm kdePackages.kate kdePackages.konsole diff --git a/modules/server/README.md b/modules/server/README.md index aee0c7a..fafb744 100644 --- a/modules/server/README.md +++ b/modules/server/README.md @@ -9,5 +9,6 @@ โ”œโ”€ ๐Ÿ“ฆ pkg.nix # ๆœๅŠกๅ™จๅธธ็”จ่ฝฏไปถๅŒ… โ”œโ”€ ๐Ÿ” ssh.nix # OpenSSH ๅ‚ๆ•ฐ โ”œโ”€ ๐Ÿณ docker.nix # Docker ไธŽๆธ…็†็ญ–็•ฅ -โ””โ”€ ๐Ÿง  vscode-server.nix # VS Code Server ๆจกๅ— +โ”œโ”€ ๐Ÿ“ฆ virtualbox-guest.nix # VirtualBox Guest ๅขžๅผบ้…็ฝฎ +โ””โ”€ ๐Ÿง  vscode-server.nix # VS Code Server ๆจกๅ— ``` diff --git a/profiles/README.md b/profiles/README.md index 97f6ef2..18632fd 100644 --- a/profiles/README.md +++ b/profiles/README.md @@ -7,5 +7,6 @@ ๐Ÿ“š profiles โ”œโ”€ ๐Ÿง‘โ€๐Ÿ’ป desktop.nix # core + desktop + drivers โ”œโ”€ ๐Ÿ—„๏ธ server.nix # core + server(default.nix) +โ”œโ”€ ๐Ÿ“ฆ virtualbox.nix # core + desktop + virtualbox guest + ่ฟœ็จ‹ๅผ€ๅ‘ โ””โ”€ ๐ŸชŸ wsl.nix # core + wsl(default.nix) ```