nixos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2357a379732c3fbbd33f265e920f0abc3624e2da
parent 4fd271eaedd1614c0f65c3503d3278b1bb2bc436
Author: Toni Brown <me@tb148.net>
Date:   Thu,  4 Dec 2025 23:47:53 +0800

Switch indentation from tabs to spaces and update packages

- Update alejandra formatter config to use four spaces - Update
stable nixpkgs channel from 25.05 to 25.11 - Add devenv to home
packages and clang to system packages - Remove clang-tools from
zed-editor extra packages - Add devenv cache to nix settings

Diffstat:
Malejandra.toml | 2+-
Mconfiguration.nix | 365++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mflake.lock | 10+++++-----
Mflake.nix | 86++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mhardware-configuration.nix | 110++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mhome.nix | 380++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mslang-server.nix | 85+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mstarship.nix | 79+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mvesktop.nix | 110++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mzed-editor.nix | 155+++++++++++++++++++++++++++++++++++++++----------------------------------------
10 files changed, 690 insertions(+), 692 deletions(-)

diff --git a/alejandra.toml b/alejandra.toml @@ -1 +1 @@ -indentation = "Tabs" +indentation = "FourSpaces" diff --git a/configuration.nix b/configuration.nix @@ -2,185 +2,190 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). { - config, - lib, - pkgs, - inputs, - ... + config, + lib, + pkgs, + inputs, + ... }: { - imports = [ - ./hardware-configuration.nix - ]; - - fileSystems."/".options = [ - "subvol=root" - "compress=zstd" - ]; - fileSystems."/home".options = [ - "subvol=home" - "compress=zstd" - ]; - fileSystems."/nix".options = [ - "subvol=nix" - "compress=zstd" - "noatime" - ]; - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - - nixpkgs.config.allowUnfree = true; - - hardware.graphics.enable = true; - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia.open = true; - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; - hardware.nvidia.powerManagement.enable = true; - hardware.nvidia.powerManagement.finegrained = true; - hardware.nvidia.prime = { - offload.enable = true; - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - - hardware.bluetooth.enable = true; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - environment.systemPackages = with pkgs; [ - catppuccin-cursors.mochaMauve - doas-sudo-shim - git - helix - sarasa-gothic - wget - (where-is-my-sddm-theme.override { - themeConfig.General = { - passwordCharacter = "X"; - passwordInputWidth = 2; - passwordInputBackground = "#1e1e2e"; - passwordInputCursorVisible = false; - passwordTextColor = "#cdd6f4"; - backgroundFill = "#1e1e2e"; - basicTextColor = "#cdd6f4"; - hideCursor = true; - font = "等距更纱黑体 SC"; - helpFont = "等距更纱黑体 SC"; - }; - }) - ]; - - services = { - desktopManager.plasma6.enable = true; - displayManager.sddm = { - enable = true; - theme = "where_is_my_sddm_theme"; - wayland.enable = true; - }; - }; - services.pipewire = { - enable = true; - pulse.enable = true; - }; - services.printing.enable = true; - - networking.hostName = "nixosion"; - networking.networkmanager.enable = true; - networking.firewall.enable = false; - - services.mihomo = { - enable = true; - tunMode = true; - webui = pkgs.metacubexd; - configFile = "/home/tb148/mihomo.yaml"; - }; - - nix.settings.substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"]; - - time.timeZone = "Asia/Shanghai"; - services.timesyncd = { - enable = true; - servers = ["ntp.ntsc.ac.cn"]; - }; - - i18n.defaultLocale = "zh_CN.UTF-8"; - services.xserver.xkb.layout = "cn(altgr-pinyin)"; - - services.userborn.enable = true; - users.users.tb148 = { - isNormalUser = true; - home = "/home/tb148"; - description = "Toni Brown"; - extraGroups = ["wheel"]; - }; - - security.sudo.enable = false; - security.doas.enable = true; - security.doas.extraRules = - lib.mkAfter [ - { - groups = ["wheel"]; - persist = true; - setEnv = [ - "SUDO_UID=$UID" - "LANG" - ]; - } - ]; - - catppuccin.enable = true; - catppuccin.flavor = "mocha"; - catppuccin.accent = "mauve"; - catppuccin.sddm.enable = false; - xdg.icons.fallbackCursorThemes = ["catppuccin-mocha-mauve-cursors"]; - - services.searx = { - enable = true; - environmentFile = "/home/tb148/.searxng.env"; - }; - - programs.nix-ld = { - enable = true; - libraries = [ - ## Put here any library that is required when running a package - ## ... - ## Uncomment if you want to use the libraries provided by default in the steam distribution - ## but this is quite far from being exhaustive - ## https://github.com/NixOS/nixpkgs/issues/354513 - (pkgs.runCommand "steamrun-lib" {} "mkdir $out; ln -s ${pkgs.steam-run.fhsenv}/usr/lib64 $out/lib") - ]; - }; - - programs.steam.enable = true; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "25.05"; # Did you read the comment? + imports = [ + ./hardware-configuration.nix + ]; + + fileSystems."/".options = [ + "subvol=root" + "compress=zstd" + ]; + fileSystems."/home".options = [ + "subvol=home" + "compress=zstd" + ]; + fileSystems."/nix".options = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + + nixpkgs.config.allowUnfree = true; + + hardware.graphics.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia.open = true; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + hardware.nvidia.powerManagement.enable = true; + hardware.nvidia.powerManagement.finegrained = true; + hardware.nvidia.prime = { + offload.enable = true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + + hardware.bluetooth.enable = true; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + environment.systemPackages = with pkgs; [ + catppuccin-cursors.mochaMauve + clang + clang-tools + doas-sudo-shim + git + helix + sarasa-gothic + wget + (where-is-my-sddm-theme.override { + themeConfig.General = { + passwordCharacter = "X"; + passwordInputWidth = 2; + passwordInputBackground = "#1e1e2e"; + passwordInputCursorVisible = false; + passwordTextColor = "#cdd6f4"; + backgroundFill = "#1e1e2e"; + basicTextColor = "#cdd6f4"; + hideCursor = true; + font = "等距更纱黑体 SC"; + helpFont = "等距更纱黑体 SC"; + }; + }) + ]; + + services = { + desktopManager.plasma6.enable = true; + displayManager.sddm = { + enable = true; + theme = "where_is_my_sddm_theme"; + wayland.enable = true; + }; + }; + services.pipewire = { + enable = true; + pulse.enable = true; + }; + services.printing.enable = true; + + networking.hostName = "nixosion"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + services.mihomo = { + enable = true; + tunMode = true; + webui = pkgs.metacubexd; + configFile = "/home/tb148/mihomo.yaml"; + }; + + nix.settings.substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"]; + nix.extraOptions = '' + extra-substituters = https://devenv.cachix.org + extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= + ''; + + time.timeZone = "Asia/Shanghai"; + services.timesyncd = { + enable = true; + servers = ["ntp.ntsc.ac.cn"]; + }; + + i18n.defaultLocale = "zh_CN.UTF-8"; + services.xserver.xkb.layout = "cn(altgr-pinyin)"; + + services.userborn.enable = true; + users.users.tb148 = { + isNormalUser = true; + home = "/home/tb148"; + description = "Toni Brown"; + extraGroups = ["wheel"]; + }; + + security.sudo.enable = false; + security.doas.enable = true; + security.doas.extraRules = lib.mkAfter [ + { + groups = ["wheel"]; + persist = true; + setEnv = [ + "SUDO_UID=$UID" + "LANG" + ]; + } + ]; + + catppuccin.enable = true; + catppuccin.flavor = "mocha"; + catppuccin.accent = "mauve"; + catppuccin.sddm.enable = false; + xdg.icons.fallbackCursorThemes = ["catppuccin-mocha-mauve-cursors"]; + + services.searx = { + enable = true; + environmentFile = "/home/tb148/.searxng.env"; + }; + + programs.nix-ld = { + enable = true; + libraries = [ + ## Put here any library that is required when running a package + ## ... + ## Uncomment if you want to use the libraries provided by default in the steam distribution + ## but this is quite far from being exhaustive + ## https://github.com/NixOS/nixpkgs/issues/354513 + (pkgs.runCommand "steamrun-lib" {} "mkdir $out; ln -s ${pkgs.steam-run.fhsenv}/usr/lib64 $out/lib") + ]; + }; + + programs.steam.enable = true; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.05"; # Did you read the comment? } diff --git a/flake.lock b/flake.lock @@ -59,16 +59,16 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1764560356, - "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", - "ref": "nixos-25.05", - "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", + "lastModified": 1764677808, + "narHash": "sha256-H3lC7knbXOBrHI9hITQ7modLuX20mYJVhZORL5ioms0=", + "ref": "nixos-25.11", + "rev": "1aab89277eb2d87823d5b69bae631a2496cff57a", "shallow": true, "type": "git", "url": "https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git" }, "original": { - "ref": "nixos-25.05", + "ref": "nixos-25.11", "shallow": true, "type": "git", "url": "https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git" diff --git a/flake.nix b/flake.nix @@ -1,49 +1,45 @@ { - description = "A simple NixOS flake"; + description = "A simple NixOS flake"; - inputs = { - # NixOS 官方软件源,这里使用 nixos-unstable 分支 - nixpkgs.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-unstable&shallow=1"; - nixpkgs-stable.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-25.05&shallow=1"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - catppuccin.url = "github:catppuccin/nix"; - catppuccin.inputs.nixpkgs.follows = "nixpkgs"; - # midnight.url = "github:refact0r/midnight-discord"; - # midnight.flake = false; - }; + inputs = { + nixpkgs.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-unstable&shallow=1"; + nixpkgs-stable.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-25.11&shallow=1"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + catppuccin.url = "github:catppuccin/nix"; + catppuccin.inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { - self, - nixpkgs, - home-manager, - catppuccin, - ... - } @ inputs: { - nixosConfigurations.nixosion = - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = {inherit inputs;}; - modules = [ - # 这里导入之前我们使用的 configuration.nix, - # 这样旧的配置文件仍然能生效 - ./configuration.nix - catppuccin.nixosModules.catppuccin - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.tb148 = { - imports = [ - ./home.nix - catppuccin.homeModules.catppuccin - ]; - }; - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - home-manager.extraSpecialArgs = {inherit inputs;}; - } - ]; - }; - }; + outputs = { + self, + nixpkgs, + home-manager, + catppuccin, + ... + } @ inputs: { + nixosConfigurations.nixosion = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit inputs;}; + modules = [ + # 这里导入之前我们使用的 configuration.nix, + # 这样旧的配置文件仍然能生效 + ./configuration.nix + catppuccin.nixosModules.catppuccin + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.tb148 = { + imports = [ + ./home.nix + catppuccin.homeModules.catppuccin + ]; + }; + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + home-manager.extraSpecialArgs = {inherit inputs;}; + } + ]; + }; + }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix @@ -2,68 +2,68 @@ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { - config, - lib, - pkgs, - modulesPath, - ... + config, + lib, + pkgs, + modulesPath, + ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "vmd" - "nvme" - "usbhid" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "vmd" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = { - device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; - fsType = "btrfs"; - options = ["subvol=root"]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; + fsType = "btrfs"; + options = ["subvol=root"]; + }; - fileSystems."/home" = { - device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; - fsType = "btrfs"; - options = ["subvol=home"]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; + fsType = "btrfs"; + options = ["subvol=home"]; + }; - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; - fsType = "btrfs"; - options = ["subvol=nix"]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/18af5e11-1470-4fa6-9577-8e8ba513857c"; + fsType = "btrfs"; + options = ["subvol=nix"]; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/7498-1041"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7498-1041"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; - swapDevices = [ - {device = "/dev/disk/by-uuid/3a9c8feb-74f7-47f3-8736-82f3b9d35791";} - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/3a9c8feb-74f7-47f3-8736-82f3b9d35791";} + ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp44s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp44s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/home.nix b/home.nix @@ -1,193 +1,193 @@ { - config, - lib, - pkgs, - inputs, - osConfig, - ... + config, + lib, + pkgs, + inputs, + osConfig, + ... }: { - imports = [ - ./starship.nix - # ./vesktop.nix - ./zed-editor.nix - ]; - - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "tb148"; - home.homeDirectory = "/home/tb148"; - home.file.".face.icon".source = ./avatar.png; - - xdg.userDirs = { - enable = true; - createDirectories = true; - desktop = "${config.home.homeDirectory}/桌面"; - documents = "${config.home.homeDirectory}/文档"; - download = "${config.home.homeDirectory}/下载"; - music = "${config.home.homeDirectory}/音乐"; - pictures = "${config.home.homeDirectory}/图片"; - publicShare = "${config.home.homeDirectory}/公共"; - templates = "${config.home.homeDirectory}/模板"; - videos = "${config.home.homeDirectory}/视频"; - }; - - home.packages = with pkgs; [ - (catppuccin-kde.override { - flavour = ["mocha"]; - accents = ["mauve"]; - winDecStyles = ["classic"]; - }) - (catppuccin-papirus-folders.override { - flavor = "mocha"; - accent = "mauve"; - }) - catppuccinifier-cli - catppuccinifier-gui - clang - dprint - eslint - ffmpeg - fish - gtkwave - jetbrains.idea-ultimate - nerd-fonts.iosevka - iosevka-bin - iverilog - jdk21 - jupyter - krita - libreoffice-qt-fresh - logisim - logisim-evolution - mars-mips - neocities - nodejs - osu-lazer-bin - pnpm - ponysay - proton-pass - protonmail-bridge - inputs.nixpkgs-stable.legacyPackages.x86_64-linux.sageWithDoc - sarasa-gothic - sequoia-sq - thunderbird - unrar - virtualenv - ]; - - programs.bat.enable = true; - - programs.direnv.enable = true; - - programs.fastfetch.enable = true; - - programs.fd.enable = true; - - programs.firefox.enable = true; - programs.firefox.languagePacks = [ - "zh-CN" - "en-US" - ]; - - programs.git.enable = true; - programs.git.settings = { - init.defaultBranch = "trunk"; - user.name = "Toni Brown"; - user.email = "me@tb148.net"; - }; - programs.git.signing.signByDefault = true; - programs.git.signing.key = "53187AD414FDFBCC"; - - programs.gpg.enable = true; - programs.gpg.package = with pkgs; - symlinkJoin { - name = "gnupg-from-sequoia"; - paths = [ - gnupg - sequoia-chameleon-gnupg - ]; - postBuild = '' - mv $out/bin/gpg $out/bin/gpg-g10code - mv $out/bin/gpgv $out/bin/gpgv-g10code - cp -P $out/bin/gpg-sq $out/bin/gpg - cp -P $out/bin/gpgv-sq $out/bin/gpgv - ''; - }; - services.gpg-agent = { - enable = true; - enableSshSupport = true; - pinentry.package = pkgs.pinentry-qt; - pinentry.program = "pinentry-qt"; - sshKeys = ["F2F9CB00ABA433C59C7AF87A67A8D5F74D235760"]; - }; - - programs.helix.enable = true; - - programs.hyfetch.enable = true; - - programs.librewolf.enable = true; - programs.librewolf.languagePacks = ["en" "zh-CN"]; - programs.librewolf.nativeMessagingHosts = [pkgs.kdePackages.plasma-browser-integration]; - - programs.nushell.enable = true; - programs.nushell.configFile.source = ./config.nu; - home.shell.enableNushellIntegration = true; - - programs.pay-respects.enable = true; - - programs.wezterm.enable = true; - programs.wezterm.extraConfig = builtins.readFile ./wezterm.lua; - - programs.zoxide.enable = true; - - # services.protonmail-bridge.enable = true; - # services.protonmail-bridge.extraPackages = [pkgs.kdePackages.kwallet]; - - i18n.inputMethod = { - enable = true; - type = "fcitx5"; - fcitx5 = { - fcitx5-with-addons = pkgs.kdePackages.fcitx5-with-addons; - addons = with pkgs; [ - (fcitx5-rime.override { - rimeDataPkgs = [ - pkgs.rime-ice - ]; - }) - ]; - settings.addons.classicui.globalSection = { - Theme = "catppuccin-mocha-mauve"; - Font = "等距更纱黑体 SC 10"; - }; - waylandFrontend = true; - }; - }; - xdg.dataFile."fcitx5/rime/default.custom.yaml".source = ./rime.yaml; - - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "mauve"; - }; - catppuccin.cursors.enable = true; - catppuccin.fcitx5.enableRounded = true; - qt = { - enable = true; - style.name = "kvantum"; - platformTheme.name = "kvantum"; - }; - catppuccin.vesktop.enable = false; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - home.stateVersion = "25.05"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + imports = [ + ./starship.nix + # ./vesktop.nix + ./zed-editor.nix + ]; + + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "tb148"; + home.homeDirectory = "/home/tb148"; + home.file.".face.icon".source = ./avatar.png; + + xdg.userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/桌面"; + documents = "${config.home.homeDirectory}/文档"; + download = "${config.home.homeDirectory}/下载"; + music = "${config.home.homeDirectory}/音乐"; + pictures = "${config.home.homeDirectory}/图片"; + publicShare = "${config.home.homeDirectory}/公共"; + templates = "${config.home.homeDirectory}/模板"; + videos = "${config.home.homeDirectory}/视频"; + }; + + home.packages = with pkgs; [ + (catppuccin-kde.override { + flavour = ["mocha"]; + accents = ["mauve"]; + winDecStyles = ["classic"]; + }) + (catppuccin-papirus-folders.override { + flavor = "mocha"; + accent = "mauve"; + }) + catppuccinifier-cli + catppuccinifier-gui + devenv + dprint + eslint + ffmpeg + fish + gtkwave + jetbrains.idea-ultimate + nerd-fonts.iosevka + iosevka-bin + iverilog + jdk21 + jupyter + krita + libreoffice-qt-fresh + logisim + logisim-evolution + mars-mips + neocities + nodejs + osu-lazer-bin + pnpm + ponysay + proton-pass + protonmail-bridge + inputs.nixpkgs-stable.legacyPackages.x86_64-linux.sageWithDoc + sarasa-gothic + sequoia-sq + thunderbird + unrar + virtualenv + ]; + + programs.bat.enable = true; + + programs.direnv.enable = true; + + programs.fastfetch.enable = true; + + programs.fd.enable = true; + + programs.firefox.enable = true; + programs.firefox.languagePacks = [ + "zh-CN" + "en-US" + ]; + + programs.git.enable = true; + programs.git.settings = { + init.defaultBranch = "trunk"; + user.name = "Toni Brown"; + user.email = "me@tb148.net"; + }; + programs.git.signing.signByDefault = true; + programs.git.signing.key = "53187AD414FDFBCC"; + + programs.gpg.enable = true; + programs.gpg.package = with pkgs; + symlinkJoin { + name = "gnupg-from-sequoia"; + paths = [ + gnupg + sequoia-chameleon-gnupg + ]; + postBuild = '' + mv $out/bin/gpg $out/bin/gpg-g10code + mv $out/bin/gpgv $out/bin/gpgv-g10code + cp -P $out/bin/gpg-sq $out/bin/gpg + cp -P $out/bin/gpgv-sq $out/bin/gpgv + ''; + }; + services.gpg-agent = { + enable = true; + enableSshSupport = true; + pinentry.package = pkgs.pinentry-qt; + pinentry.program = "pinentry-qt"; + sshKeys = ["F2F9CB00ABA433C59C7AF87A67A8D5F74D235760"]; + }; + + programs.helix.enable = true; + + programs.hyfetch.enable = true; + + programs.librewolf.enable = true; + programs.librewolf.languagePacks = ["en" "zh-CN"]; + programs.librewolf.nativeMessagingHosts = [pkgs.kdePackages.plasma-browser-integration]; + + programs.nushell.enable = true; + programs.nushell.configFile.source = ./config.nu; + home.shell.enableNushellIntegration = true; + + programs.pay-respects.enable = true; + + programs.wezterm.enable = true; + programs.wezterm.extraConfig = builtins.readFile ./wezterm.lua; + + programs.zoxide.enable = true; + + # services.protonmail-bridge.enable = true; + # services.protonmail-bridge.extraPackages = [pkgs.kdePackages.kwallet]; + + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5 = { + fcitx5-with-addons = pkgs.kdePackages.fcitx5-with-addons; + addons = with pkgs; [ + (fcitx5-rime.override { + rimeDataPkgs = [ + pkgs.rime-ice + ]; + }) + ]; + settings.addons.classicui.globalSection = { + Theme = "catppuccin-mocha-mauve"; + Font = "等距更纱黑体 SC 10"; + }; + waylandFrontend = true; + }; + }; + xdg.dataFile."fcitx5/rime/default.custom.yaml".source = ./rime.yaml; + + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "mauve"; + }; + catppuccin.cursors.enable = true; + catppuccin.fcitx5.enableRounded = true; + qt = { + enable = true; + style.name = "kvantum"; + platformTheme.name = "kvantum"; + }; + catppuccin.vesktop.enable = false; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "25.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/slang-server.nix b/slang-server.nix @@ -1,53 +1,52 @@ { - lib, - stdenv, - fetchFromGitHub, - boost, - catch2_3, - cmake, - ninja, - fmt_12, - mimalloc, - python3, + lib, + stdenv, + fetchFromGitHub, + boost, + catch2_3, + cmake, + ninja, + fmt_12, + mimalloc, + python3, }: stdenv.mkDerivation (finalAttrs: { - pname = "slang-server"; - version = "0.2.0"; + pname = "slang-server"; + version = "0.2.0"; - src = - fetchFromGitHub { - owner = "hudson-trading"; - repo = "slang-server"; - tag = "v0.2.0"; - hash = "sha256-FZHV/ezCrhXLwUHGGVTTUSynyw9SA0Roo5KyIpaN7KI="; - fetchSubmodules = true; - }; + src = fetchFromGitHub { + owner = "hudson-trading"; + repo = "slang-server"; + tag = "v0.2.0"; + hash = "sha256-FZHV/ezCrhXLwUHGGVTTUSynyw9SA0Roo5KyIpaN7KI="; + fetchSubmodules = true; + }; - postPatch = '' - substituteInPlace external/slang/external/CMakeLists.txt --replace-fail \ - 'set(mimalloc_min_version "2.2")' \ - 'set(mimalloc_min_version "${lib.versions.majorMinor mimalloc.version}")' - ''; + postPatch = '' + substituteInPlace external/slang/external/CMakeLists.txt --replace-fail \ + 'set(mimalloc_min_version "2.2")' \ + 'set(mimalloc_min_version "${lib.versions.majorMinor mimalloc.version}")' + ''; - cmakeFlags = [ - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_LIBDIR=lib" - ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib" + ]; - nativeBuildInputs = [ - cmake - ninja - python3 - ]; + nativeBuildInputs = [ + cmake + ninja + python3 + ]; - strictDeps = true; + strictDeps = true; - buildInputs = [ - boost - catch2_3 - fmt_12 - mimalloc - ]; + buildInputs = [ + boost + catch2_3 + fmt_12 + mimalloc + ]; - doCheck = true; - }) + doCheck = true; +}) diff --git a/starship.nix b/starship.nix @@ -1,43 +1,42 @@ { - config, - lib, - pkgs, - ... + config, + lib, + pkgs, + ... }: { - programs.starship = { - enable = true; - settings = { - format = - lib.concatStrings [ - "$username" - "$line_break" - "$character" - ]; - right_format = "$git_branch$directory"; - continuation_prompt = "[> ](fg:overlay1)"; - username = { - format = "[$user]($style) says:"; - style_user = "bold fg:mauve"; - style_root = "bold fg:mauve"; - show_always = true; - }; - character = { - success_symbol = "[>](bold fg:green)"; - error_symbol = "[>](bold fg:red)"; - vimcmd_symbol = "[<](bold fg:green)"; - vimcmd_replace_one_symbol = "[<](bold fg:lavender)"; - vimcmd_replace_symbol = "[<](bold fg:lavender)"; - vimcmd_visual_symbol = "[<](bold fg:yellow)"; - }; - git_branch = { - format = "[( $branch of)]($style)"; - style = "fg:overlay1"; - }; - directory = { - format = "[ $path]($style)[( $read_only)]($read_only_style)"; - style = "fg:overlay1"; - read_only_style = "fg:overlay1"; - }; - }; - }; + programs.starship = { + enable = true; + settings = { + format = lib.concatStrings [ + "$username" + "$line_break" + "$character" + ]; + right_format = "$git_branch$directory"; + continuation_prompt = "[> ](fg:overlay1)"; + username = { + format = "[$user]($style) says:"; + style_user = "bold fg:mauve"; + style_root = "bold fg:mauve"; + show_always = true; + }; + character = { + success_symbol = "[>](bold fg:green)"; + error_symbol = "[>](bold fg:red)"; + vimcmd_symbol = "[<](bold fg:green)"; + vimcmd_replace_one_symbol = "[<](bold fg:lavender)"; + vimcmd_replace_symbol = "[<](bold fg:lavender)"; + vimcmd_visual_symbol = "[<](bold fg:yellow)"; + }; + git_branch = { + format = "[( $branch of)]($style)"; + style = "fg:overlay1"; + }; + directory = { + format = "[ $path]($style)[( $read_only)]($read_only_style)"; + style = "fg:overlay1"; + read_only_style = "fg:overlay1"; + }; + }; + }; } diff --git a/vesktop.nix b/vesktop.nix @@ -1,58 +1,58 @@ { - config, - lib, - pkgs, - inputs, - ... + config, + lib, + pkgs, + inputs, + ... }: { - programs.vesktop = { - enable = true; - vencord = { - settings.plugins = { - AlwaysAnimate.enabled = true; - AlwaysTrust.enabled = true; - BetterFolders = { - enabled = true; - closeAllFolders = true; - closeAllHomeButton = true; - closeOthers = true; - forceOpen = true; - showFolderIcon = 0; - }; - BetterUploadButton.enabled = true; - BlurNSFW.enabled = true; - ClearURLs.enabled = true; - CtrlEnterSend.enabled = true; - CopyFileContents.enabled = true; - ImageFilename.enabled = true; - MentionAvatars = { - enabled = true; - showAtSymbol = false; - }; - RoleColorEverywhere = { - enabled = true; - colorChatMessages = true; - }; - ShikiCodeblocks = { - enabled = true; - customTheme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/main/packages/tm-themes/themes/catppuccin-mocha.json"; - }; - ServerInfo.enabled = true; - ShowHiddenChannels.enabled = true; - ShowMeYourName = { - enabled = true; - mode = "nick-user"; - inReplies = true; - }; - TypingTweaks.enabled = true; - WhoReacted.enabled = true; - }; - settings.enabledThemes = [ - "midnight-catppuccin-mocha.theme.css" - ]; - themes."midnight-catppuccin-mocha.theme" = - builtins.readFile "${inputs.midnight}/themes/flavors/midnight-catppuccin-mocha.theme.css"; - }; - }; - xdg.configFile."vesktop/settings/quickCss.css".source = ./quickCss.css; + programs.vesktop = { + enable = true; + vencord = { + settings.plugins = { + AlwaysAnimate.enabled = true; + AlwaysTrust.enabled = true; + BetterFolders = { + enabled = true; + closeAllFolders = true; + closeAllHomeButton = true; + closeOthers = true; + forceOpen = true; + showFolderIcon = 0; + }; + BetterUploadButton.enabled = true; + BlurNSFW.enabled = true; + ClearURLs.enabled = true; + CtrlEnterSend.enabled = true; + CopyFileContents.enabled = true; + ImageFilename.enabled = true; + MentionAvatars = { + enabled = true; + showAtSymbol = false; + }; + RoleColorEverywhere = { + enabled = true; + colorChatMessages = true; + }; + ShikiCodeblocks = { + enabled = true; + customTheme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/main/packages/tm-themes/themes/catppuccin-mocha.json"; + }; + ServerInfo.enabled = true; + ShowHiddenChannels.enabled = true; + ShowMeYourName = { + enabled = true; + mode = "nick-user"; + inReplies = true; + }; + TypingTweaks.enabled = true; + WhoReacted.enabled = true; + }; + settings.enabledThemes = [ + "midnight-catppuccin-mocha.theme.css" + ]; + themes."midnight-catppuccin-mocha.theme" = + builtins.readFile "${inputs.midnight}/themes/flavors/midnight-catppuccin-mocha.theme.css"; + }; + }; + xdg.configFile."vesktop/settings/quickCss.css".source = ./quickCss.css; } diff --git a/zed-editor.nix b/zed-editor.nix @@ -1,81 +1,80 @@ { - config, - lib, - pkgs, - ... + config, + lib, + pkgs, + ... }: { - programs.zed-editor = { - enable = true; - extraPackages = with pkgs; [ - alejandra - astro-language-server - basedpyright - clang-tools - eslint - jdt-language-server - lua-language-server - nil - package-version-server - prettier - ruff - svelte-language-server - tailwindcss-language-server - taplo - verible - (callPackage ./slang-server.nix {}) - vscode-json-languageserver - yaml-language-server - ]; - extensions = [ - "astro" - "git-firefly" - "java" - "lua" - "nix" - "nu" - "svelte" - "toml" - "verilog" - ]; - userSettings = { - preferred_line_length = 64; - buffer_font_family = "Sarasa Mono SC"; - buffer_font_size = 16; - ui_font_family = "Sarasa Mono SC"; - ui_font_size = 16; - hard_tabs = true; - tab_size = 4; - disable_ai = false; - languages = { - Nix.language_servers = [ - "nil" - "!nixd" - ]; - SystemVerilog = { - hard_tabs = false; - formatter = { - language_server = { - name = "verible"; - }; - }; - language_servers = [ - "slang" - "verible" - "!veridian" - ]; - }; - }; - lsp.nil.initialization_options = { - formatting.command = [ - "alejandra" - "--quiet" - "--" - ]; - diagnostics.ignored = ["unused_binding"]; - }; - lsp.ruff.initialization_options.settings.configuration = { - format.indent-style = "tab"; - }; - }; - }; + programs.zed-editor = { + enable = true; + extraPackages = with pkgs; [ + alejandra + astro-language-server + basedpyright + eslint + jdt-language-server + lua-language-server + nil + package-version-server + prettier + ruff + svelte-language-server + tailwindcss-language-server + taplo + verible + (callPackage ./slang-server.nix {}) + vscode-json-languageserver + yaml-language-server + ]; + extensions = [ + "astro" + "git-firefly" + "java" + "lua" + "nix" + "nu" + "svelte" + "toml" + "verilog" + ]; + userSettings = { + preferred_line_length = 64; + buffer_font_family = "Sarasa Mono SC"; + buffer_font_size = 16; + ui_font_family = "Sarasa Mono SC"; + ui_font_size = 16; + hard_tabs = true; + tab_size = 4; + disable_ai = false; + languages = { + Nix.language_servers = [ + "nil" + "!nixd" + ]; + SystemVerilog = { + hard_tabs = false; + formatter = { + language_server = { + name = "verible"; + }; + }; + language_servers = [ + "slang" + "verible" + "!veridian" + ]; + }; + }; + lsp.nil.initialization_options = { + formatting.command = [ + "alejandra" + "--quiet" + "--" + ]; + diagnostics.ignored = ["unused_binding"]; + }; + lsp.ruff.initialization_options.settings.configuration = { + format.indent-style = "tab"; + }; + }; + }; }