nixos

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

commit e9a21f63a0a5e75c2892da97fdc1cf405db04adb
parent cfcc4f1ccd39100847a60d104cf04ed1b4ac583a
Author: Toni Brown <me@tb148.eu.org>
Date:   Thu, 25 Sep 2025 21:09:26 +0800

switch to alejandra formatter

Diffstat:
Aalejandra.toml | 1+
Mconfiguration.nix | 333+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mflake.nix | 91+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mhardware-configuration.nix | 114+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mhome.nix | 372+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mrime.yaml | 4++--
Mstarship.nix | 206++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mvesktop.nix | 113+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mwezterm.lua | 4++--
Mzed-editor.nix | 112++++++++++++++++++++++++++++++++++++++++---------------------------------------
10 files changed, 672 insertions(+), 678 deletions(-)

diff --git a/alejandra.toml b/alejandra.toml @@ -0,0 +1 @@ +indentation = "Tabs" diff --git a/configuration.nix b/configuration.nix @@ -1,173 +1,170 @@ # Edit this configuration file to define what should be installed on # 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, - ... -}: - { - 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.prime = { - sync.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; - programs.clash-verge = { - enable = true; - autoStart = true; - tunMode = true; - serviceMode = true; - }; - 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.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? - + 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.prime = { + sync.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; + programs.clash-verge = { + enable = true; + autoStart = true; + tunMode = true; + serviceMode = true; + }; + 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.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.nix b/flake.nix @@ -1,50 +1,49 @@ { - 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-master.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=master&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 = { + # NixOS 官方软件源,这里使用 nixos-unstable 分支 + nixpkgs.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=nixos-unstable&shallow=1"; + nixpkgs-master.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git?ref=master&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; + }; - 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,70 +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,189 +1,187 @@ { - 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; - programs.git.userName = "Toni Brown"; - programs.git.userEmail = "me@tb148.eu.org"; - - 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 # as a carapace bridge - iosevka - jdk8 - jetbrains.idea-community - jupyter - krita - logisim - neocities - nerd-fonts.iosevka - nodejs - pnpm - ponysay - sarasa-gothic - sequoia-sq - unrar - virtualenv - ]; - - programs.bat.enable = true; - - programs.carapace.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.extraConfig = { - init.defaultBranch = "trunk"; - }; - 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.lutris = { - enable = true; - protonPackages = [ pkgs.proton-ge-bin ]; - steamPackage = osConfig.programs.steam.package; - winePackages = [ pkgs.wineWow64Packages.full ]; - }; - - 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.yazi.enable = true; - - programs.zoxide.enable = true; - - 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; + 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; + programs.git.userName = "Toni Brown"; + programs.git.userEmail = "me@tb148.eu.org"; + + 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 # as a carapace bridge + iosevka + jdk8 + jetbrains.idea-community + jupyter + krita + logisim + neocities + nerd-fonts.iosevka + nodejs + pnpm + ponysay + sarasa-gothic + sequoia-sq + unrar + virtualenv + ]; + + programs.bat.enable = true; + + programs.carapace.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.extraConfig = { + init.defaultBranch = "trunk"; + }; + 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.lutris = { + enable = true; + protonPackages = [pkgs.proton-ge-bin]; + steamPackage = osConfig.programs.steam.package; + winePackages = [pkgs.wineWow64Packages.full]; + }; + + 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.yazi.enable = true; + + programs.zoxide.enable = true; + + 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/rime.yaml b/rime.yaml @@ -1,3 +1,3 @@ patch: - __include: rime_ice_suggestion:/ - "menu/page_size": 10 + __include: rime_ice_suggestion:/ + "menu/page_size": 10 diff --git a/starship.nix b/starship.nix @@ -1,105 +1,105 @@ { - config, - lib, - pkgs, - ... -}: -{ - programs.starship = { - enable = true; - settings = { - format = lib.concatStrings [ - "[ ](bg:red)" - "$os" - "$username" - "[ ](bg:peach fg:red)" - "$directory" - "[ ](bg:yellow fg:peach)" - "$git_branch" - "$git_state" - "$git_status" - "[ ](bg:green fg:yellow)" - "$c" - "$cpp" - "$nodejs" - "$python" - "[ ](bg:sapphire fg:green)" - "$time" - "[ ](bg:mauve fg:sapphire)" - "$cmd_duration" - "[](fg:mauve)" - "$line_break" - "$character" - ]; - os = { - disabled = false; - format = "[$symbol]($style)"; - style = "bg:red fg:crust"; - symbols.NixOS = "󱄅 "; - }; - username = { - show_always = true; - format = "[$user ]($style)"; - style_user = "bg:red fg:crust"; - style_root = "bg:red fg:crust"; - }; - directory = { - format = "[$path$read_only ]($style)"; - style = "bg:peach fg:crust"; - read_only = "󰍁 "; - truncation_symbol = "… /"; - }; - git_branch = { - format = "[$symbol$branch(:$remote_branch) ]($style)"; - style = "bg:yellow fg:crust"; - symbol = " "; - }; - git_state = { - format = "[$state ($progress_current/$progress_total )]($style)"; - style = "bg:yellow fg:crust"; - }; - git_status = { - format = "([$all_status$ahead_behind ]($style))"; - style = "bg:yellow fg:crust"; - }; - c = { - format = "[$symbol($version) (\\($name\\) )]($style)"; - style = "bg:green fg:crust"; - symbol = "󰙱 "; - }; - cpp = { - disabled = false; - format = "[$symbol($version) (\\($name\\) )]($style)"; - style = "bg:green fg:crust"; - symbol = "󰙲 "; - }; - nodejs = { - format = "[$symbol($version) ]($style)"; - style = "bg:green fg:crust"; - symbol = "󰎙 "; - }; - python = { - format = "[$symbol($version) (\\($virtualenv\\) )]($style)"; - style = "bg:green fg:crust"; - symbol = "󰌠 "; - }; - time = { - disabled = false; - format = "[󰅐 $time ]($style)"; - style = "bg:sapphire fg:crust"; - }; - cmd_duration = { - format = "[$duration ]($style)"; - style = "bg:mauve fg:crust"; - }; - 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)"; - }; - }; - }; + config, + lib, + pkgs, + ... +}: { + programs.starship = { + enable = true; + settings = { + format = + lib.concatStrings [ + "[ ](bg:red)" + "$os" + "$username" + "[ ](bg:peach fg:red)" + "$directory" + "[ ](bg:yellow fg:peach)" + "$git_branch" + "$git_state" + "$git_status" + "[ ](bg:green fg:yellow)" + "$c" + "$cpp" + "$nodejs" + "$python" + "[ ](bg:sapphire fg:green)" + "$time" + "[ ](bg:mauve fg:sapphire)" + "$cmd_duration" + "[](fg:mauve)" + "$line_break" + "$character" + ]; + os = { + disabled = false; + format = "[$symbol]($style)"; + style = "bg:red fg:crust"; + symbols.NixOS = "󱄅 "; + }; + username = { + show_always = true; + format = "[$user ]($style)"; + style_user = "bg:red fg:crust"; + style_root = "bg:red fg:crust"; + }; + directory = { + format = "[$path$read_only ]($style)"; + style = "bg:peach fg:crust"; + read_only = "󰍁 "; + truncation_symbol = "… /"; + }; + git_branch = { + format = "[$symbol$branch(:$remote_branch) ]($style)"; + style = "bg:yellow fg:crust"; + symbol = " "; + }; + git_state = { + format = "[$state ($progress_current/$progress_total )]($style)"; + style = "bg:yellow fg:crust"; + }; + git_status = { + format = "([$all_status$ahead_behind ]($style))"; + style = "bg:yellow fg:crust"; + }; + c = { + format = "[$symbol($version) (\\($name\\) )]($style)"; + style = "bg:green fg:crust"; + symbol = "󰙱 "; + }; + cpp = { + disabled = false; + format = "[$symbol($version) (\\($name\\) )]($style)"; + style = "bg:green fg:crust"; + symbol = "󰙲 "; + }; + nodejs = { + format = "[$symbol($version) ]($style)"; + style = "bg:green fg:crust"; + symbol = "󰎙 "; + }; + python = { + format = "[$symbol($version) (\\($virtualenv\\) )]($style)"; + style = "bg:green fg:crust"; + symbol = "󰌠 "; + }; + time = { + disabled = false; + format = "[󰅐 $time ]($style)"; + style = "bg:sapphire fg:crust"; + }; + cmd_duration = { + format = "[$duration ]($style)"; + style = "bg:mauve fg:crust"; + }; + 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)"; + }; + }; + }; } diff --git a/vesktop.nix b/vesktop.nix @@ -1,59 +1,58 @@ { - 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; + 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; } diff --git a/wezterm.lua b/wezterm.lua @@ -5,8 +5,8 @@ config.default_prog = { 'nu' } config.initial_cols = 128 config.initial_rows = 32 config.font = wezterm.font_with_fallback { - 'Iosevka Nerd Font', - 'Sarasa Mono SC', + 'Iosevka Nerd Font', + 'Sarasa Mono SC', } config.font_size = 12 config.mux_enable_ssh_agent = false diff --git a/zed-editor.nix b/zed-editor.nix @@ -1,57 +1,59 @@ { - config, - lib, - pkgs, - ... -}: -{ - programs.zed-editor = { - enable = true; - extraPackages = with pkgs; [ - astro-language-server - eslint - jdt-language-server - lua-language-server - nil - nixd - nixfmt - package-version-server - prettier - svelte-language-server - tailwindcss-language-server - taplo - verible - veridian - vscode-json-languageserver - yaml-language-server - ]; - extensions = [ - "astro" - "git-firefly" - "java" - "lua" - "nix" - "nu" - "svelte" - "verilog" - ]; - userSettings = { - 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 = true; - lsp.nixd.settings = { - options = { - nixos.expr = "(builtins.getFlake (builtins.toString /home/tb148/nixos)).nixosConfigurations.nixosion.options"; - home-manager.expr = "(builtins.getFlake (builtins.toString /home/tb148/nixos)).nixosConfigurations.nixosion.options.home-manager.users.type.getSubOptions []"; - }; - diagnostic = { - suppress = [ "sema-unused-def-lambda-noarg-formal" ]; - }; - }; - }; - }; + config, + lib, + pkgs, + ... +}: { + programs.zed-editor = { + enable = true; + extraPackages = with pkgs; [ + alejandra + astro-language-server + eslint + jdt-language-server + lua-language-server + nil + package-version-server + prettier + svelte-language-server + tailwindcss-language-server + taplo + verible + veridian + vscode-json-languageserver + yaml-language-server + ]; + extensions = [ + "astro" + "git-firefly" + "java" + "lua" + "nix" + "nu" + "svelte" + "toml" + "verilog" + ]; + userSettings = { + 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 = true; + languages.Nix.language_servers = [ + "nil" + "!nixd" + ]; + lsp.nil.initialization_options = { + formatting.command = [ + "alejandra" + "--quiet" + "--" + ]; + diagnostics.ignored = ["unused_binding"]; + }; + }; + }; }