From 30bcd84a2656b9519f1f161c35fe60faeab8109e Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:40:20 +0900 Subject: [PATCH 01/95] chore: init repo --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..e69de29b From cbe5a073623b742961dabca4f9804ef5a6271670 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:48:55 +0900 Subject: [PATCH 02/95] feat: add flake files --- flake.lock | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..f5fb9aa5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768530555, + "narHash": "sha256-EBXKDho4t1YSgodAL6C8M3UTm8MGMZNQ9rQnceR5+6c=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d21bee5abf9fb4a42b2fa7728bf671f8bb246ba6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1768305791, + "narHash": "sha256-AIdl6WAn9aymeaH/NvBj0H9qM+XuAuYbGMZaP0zcXAQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1412caf7bf9e660f2f962917c14b1ea1c3bc695e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..d54621a9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Home Manager configuration of himkt"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + homeConfigurations."himkt" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} From d0561bb849ea116f24238c5e99e32b9582c6c218 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:49:05 +0900 Subject: [PATCH 03/95] feat: add home-manager config --- home/nixos.nix | 140 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 home/nixos.nix diff --git a/home/nixos.nix b/home/nixos.nix new file mode 100644 index 00000000..4396e282 --- /dev/null +++ b/home/nixos.nix @@ -0,0 +1,140 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "himkt"; + home.homeDirectory = "/home/himkt"; + + # 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 should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "25.11"; # Please read the comment before changing. + + nixpkgs.config.allowUnfree = true; + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + _1password-gui + ghostty + google-chrome + vscode + + btop + claude-code + gh + ghq + neovim + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/himkt/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + }; + + dconf.settings = { + "org/gnome/mutter" = { + experimental-features = [ "scale-monitor-framebuffer" ]; + }; + + "org/gnome/desktop/input-sources" = { + xkb-options = [ "ctrl:nocaps" ]; + }; + "org/gnome/desktop/peripherals/touchpad" = { + tap-to-click = true; + natural-scroll = true; + speed = 0.0; + }; + "org/gnome/desktop/peripherals/mouse" = { + speed = -1.0; + natural-scroll = true; + }; + "org/gnome/desktop/interface" = { + show-battery-percentage = true; + }; + }; + + fonts.fontconfig = { + enable = true; + defaultFonts = { + monospace = [ + "JetBrains Mono" + "Noto Sans Mono CJK JP" + ]; + sansSerif = [ "Noto Sans CJK JP" ]; + serif = [ "Noto Serif CJK JP" ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + + programs.git = { + enable = true; + settings = { + user = { + name = "himkt"; + email = "himkt@klis.tsukuba.ac.jp"; + }; + credential."https://github.com" = { + helper = "!gh auth git-credential"; + }; + }; + }; + + programs.zsh = { + enable = true; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} From 34480e33d41880ca8521572f68e11655ac1f1bd6 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:49:21 +0900 Subject: [PATCH 04/95] feat: add etc/nixos --- hosts/nixos/configuration.nix | 140 +++++++++++++++++++++++++ hosts/nixos/hardware-configuration.nix | 35 +++++++ 2 files changed, 175 insertions(+) create mode 100644 hosts/nixos/configuration.nix create mode 100644 hosts/nixos/hardware-configuration.nix diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix new file mode 100644 index 00000000..4312c836 --- /dev/null +++ b/hosts/nixos/configuration.nix @@ -0,0 +1,140 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.luks.devices."luks-f47715a3-2a66-448c-9e93-7268419de718".device = "/dev/disk/by-uuid/f47715a3-2a66-448c-9e93-7268419de718"; + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Asia/Tokyo"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "ja_JP.UTF-8"; + LC_IDENTIFICATION = "ja_JP.UTF-8"; + LC_MEASUREMENT = "ja_JP.UTF-8"; + LC_MONETARY = "ja_JP.UTF-8"; + LC_NAME = "ja_JP.UTF-8"; + LC_NUMERIC = "ja_JP.UTF-8"; + LC_PAPER = "ja_JP.UTF-8"; + LC_TELEPHONE = "ja_JP.UTF-8"; + LC_TIME = "ja_JP.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.himkt = { + isNormalUser = true; + description = "himkt"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # thunderbird + ]; + shell = pkgs.zsh; + }; + + # Install firefox. + programs.firefox.enable = true; + programs.zsh.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + fonts.packages = with pkgs; [ + jetbrains-mono + noto-fonts + noto-fonts-color-emoji + noto-fonts-cjk-sans + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.11"; # Did you read the comment? + +} diff --git a/hosts/nixos/hardware-configuration.nix b/hosts/nixos/hardware-configuration.nix new file mode 100644 index 00000000..fed4eeae --- /dev/null +++ b/hosts/nixos/hardware-configuration.nix @@ -0,0 +1,35 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/luks-221ba240-258a-48a9-a316-e2de691f08c8"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-221ba240-258a-48a9-a316-e2de691f08c8".device = "/dev/disk/by-uuid/221ba240-258a-48a9-a316-e2de691f08c8"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FEFA-7EFC"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/mapper/luks-f47715a3-2a66-448c-9e93-7268419de718"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} From 9f98fb4a73f448f412636aa415a1cf91d7fa7544 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:56:27 +0900 Subject: [PATCH 05/95] chore: add README and Makefile --- Makefile | 26 +++++++++++++++++++ README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8c4ccd4c --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +.PHONY: switch build test update clean gc + +# NixOS rebuild and switch +switch: + sudo nixos-rebuild switch --flake .#nixos + +# Build without switching +build: + sudo nixos-rebuild build --flake .#nixos + +# Test configuration (dry-run) +test: + sudo nixos-rebuild dry-build --flake .#nixos + +# Update flake inputs +update: + nix flake update + +# Remove old generations (older than 7 days) +clean: + sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system + sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/per-user/himkt/home-manager + +# Garbage collect nix store +gc: + sudo nix-collect-garbage -d diff --git a/README.md b/README.md index e69de29b..6b1f12f4 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,74 @@ +# nixos-config + +NixOS and Home Manager configuration managed with Nix Flakes. + +## Repository Structure + +``` +nixos-config/ +├── flake.nix # Main flake configuration +├── flake.lock # Locked dependencies +├── Makefile # Build and switch commands +├── hosts/ +│ └── nixos/ # NixOS system configuration +│ ├── configuration.nix +│ └── hardware-configuration.nix +└── home/ + └── nixos.nix # Home Manager configuration +``` + +## Usage + +### Build and Switch + +```bash +# Rebuild and switch NixOS configuration +make switch + +# Build without switching +make build + +# Test configuration (dry-run) +make test +``` + +### Maintenance + +```bash +# Update flake inputs +make update + +# Remove old generations (older than 7 days) +make clean + +# Garbage collect nix store +make gc +``` + +## Initial Setup + +1. Clone this repository: + ```bash + git clone ~/nixos-config + cd ~/nixos-config + ``` + +2. Update hardware configuration if needed: + ```bash + sudo nixos-generate-config --show-hardware-config > hosts/nixos/hardware-configuration.nix + ``` + +3. Review and customize the configuration files: + - `hosts/nixos/configuration.nix` - System-level settings + - `home/nixos.nix` - User-level settings + +4. Build and switch: + ```bash + make switch + ``` + +## Notes + +- This configuration uses `nixos-unstable` channel +- Home Manager is integrated as a NixOS module +- Username is set to `himkt` From 07176b4a2b196c069a6545f40c4adc6d9dab60cb Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 11:56:50 +0900 Subject: [PATCH 06/95] feat: update flake.nix for nixos-config --- flake.nix | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index d54621a9..20e99f66 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ { - description = "Home Manager configuration of himkt"; + description = "NixOS and Home Manager configuration for himkt"; inputs = { - # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -11,21 +11,35 @@ }; outputs = - { nixpkgs, home-manager, ... }: + { + self, + nixpkgs, + home-manager, + ... + }@inputs: let + username = "himkt"; system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; in { - homeConfigurations."himkt" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. - modules = [ ./home.nix ]; + # NixOS configuration + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs username; }; + modules = [ + ./hosts/nixos/configuration.nix - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix + # Home Manager as NixOS module + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.${username} = import ./home/nixos.nix; + home-manager.extraSpecialArgs = { + inherit inputs username; + }; + } + ]; }; }; } From cd1355ae0774345e84e47f14147310ee333a72e0 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:01:29 +0900 Subject: [PATCH 07/95] fix: several warnings in nixos-rebuild --- home/nixos.nix | 2 -- hosts/nixos/configuration.nix | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/home/nixos.nix b/home/nixos.nix index 4396e282..308916bb 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -15,8 +15,6 @@ # release notes. home.stateVersion = "25.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; - # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 4312c836..6d40e157 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -47,8 +47,8 @@ services.xserver.enable = true; # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; # Configure keymap in X11 services.xserver.xkb = { From 0e98ff2badbf37c5945a8c6710fc41baa863cc84 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:15:58 +0900 Subject: [PATCH 08/95] chore: ignore result files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..750baebf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +result-* From 5bf9859d06428fd5514182e52efc8a35603dbf74 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:16:29 +0900 Subject: [PATCH 09/95] feat: add make and uv --- home/nixos.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index 308916bb..cae9f6e5 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -43,7 +43,9 @@ claude-code gh ghq + gnumake neovim + uv ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage From 69722bfeb17bebf2c4dcc6235e8786955dd00596 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:17:05 +0900 Subject: [PATCH 10/95] chore: remove unnecessary comments --- Makefile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Makefile b/Makefile index 8c4ccd4c..9db6694b 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,19 @@ .PHONY: switch build test update clean gc -# NixOS rebuild and switch switch: sudo nixos-rebuild switch --flake .#nixos -# Build without switching build: sudo nixos-rebuild build --flake .#nixos -# Test configuration (dry-run) test: sudo nixos-rebuild dry-build --flake .#nixos -# Update flake inputs update: nix flake update -# Remove old generations (older than 7 days) clean: sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system - sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/per-user/himkt/home-manager -# Garbage collect nix store gc: sudo nix-collect-garbage -d From c532aaf2cff4c90b936c1256b8e4f00acb566f38 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:19:53 +0900 Subject: [PATCH 11/95] chore: use nixos-25.11 channel --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 20e99f66..a105ac5f 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,10 @@ description = "NixOS and Home Manager configuration for himkt"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; }; From 6d180b5f3ba4f62d0e1488d4ade5212ba66fabad Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:27:13 +0900 Subject: [PATCH 12/95] feat: add zsh module --- modules/zsh/default.nix | 24 +++++ modules/zsh/files/zshrc | 188 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 modules/zsh/default.nix create mode 100644 modules/zsh/files/zshrc diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix new file mode 100644 index 00000000..9453d81a --- /dev/null +++ b/modules/zsh/default.nix @@ -0,0 +1,24 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.zsh = { + enable = true; + }; + + # Use custom zshrc from dotfiles + home.file.".zshrc" = { + source = ./files/zshrc; + }; + + # Additional packages needed by zshrc + home.packages = with pkgs; [ + fzf + zoxide + sheldon # ZSH plugin manager + ]; +} diff --git a/modules/zsh/files/zshrc b/modules/zsh/files/zshrc new file mode 100644 index 00000000..528e6f00 --- /dev/null +++ b/modules/zsh/files/zshrc @@ -0,0 +1,188 @@ +# +# .zshrc - The zsh configuration +# + +bindkey -e + +autoload -Uz compinit && compinit +autoload -Uz colors && colors +autoload -Uz zmv && alias zmv='noglob zmv -W' + +setopt auto_cd # cd without cd +setopt extended_history # include timestamp and duration to the history. +setopt share_history # persist history to the file. +setopt magic_equal_subst # expand filename for unquoted arguments. +setopt mark_dirs # insert '/' when directory is expanded via globbing. +setopt no_beep # disable beep in ZLE. +setopt prompt_subst # enable substitution in prompt (needed if we want to show information in PROMPT). + +zstyle ':completion:*:default' menu select=2 # enable menu in completion. + +function ls () { + command ls --color $@ +} + +function date () { + case ${OSTYPE} in + darwin*) + command gdate $@ ;; + linux*) + command date $@ ;; + esac +} + +function retcode () { + echo $? +} + +function git-home () { + cd `git rev-parse --show-toplevel` +} + +# tier1 +export EDITOR=vim +export FZF_DEFAULT_OPTS='--height 50% --reverse --border' +export GOPATH=$HOME/go +export GHQ_ROOT=$HOME/work +export HISTFILE=$HOME/.zsh-history +export HISTSIZE=100000 +export PYTHONDONTWRITEBYTECODE=1 +export SAVEHIST=100000 +export TERM=xterm-256color +export XDG_CONFIG_HOME=$HOME/.config + +# tier2 +export HIMKT_DOTFILES_PRIVATE_CONFIG_DIR=$XDG_CONFIG_HOME/himkt/dotfiles/zsh/config.d +export TIPS_HOME=$GHQ_ROOT/github.com/himkt/tips-data + +language=en_US.UTF-8 +# If `en_US.UTF-8` is not available, fallback to `C.utf8` +if [ "`locale -a | grep $language`" != $language ]; then + language=C.utf8 +fi +export LANG=$language +export LC_CTYPE=$language + +for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.pre.zsh") +do + source $source +done + +case `uname -s` in +Darwin*) + export HOMEBREW_ROOT=/opt/homebrew + export HOMEBREW_CACHE=$HOME/.cache/Homebrew + ;; +Linux*) + export HOMEBREW_ROOT=/home/linuxbrew/.linuxbrew + ;; +esac + +for prefix in $HOMEBREW_ROOT $HOME $HOME/.local $HOME/dotfiles $GOPATH $HOME/.rd; do + export PATH=$PATH:$prefix/bin +done + +if command -v brew > /dev/null; then + export BREW_HOME=$(brew --prefix) + export HOMEBREW_NO_AUTO_UPDATE=1 + eval $(brew shellenv) + + if [ -d "$HOMEBREW_ROOT/opt/xz" ]; then + export CONFIGURE_OPTS="--enable-shared" + export CPPFLAGS="-I$(brew --prefix xz)/include" + export LDFLAGS="-L$(brew --prefix xz)/lib" + fi + + if [ -d "$HOMEBREW_ROOT/opt/openjdk" ]; then + export PATH="$HOMEBREW_ROOT/opt/openjdk/bin:$PATH" + export CPPFLAGS="$CPPFLAGS:-I$HOMEBREW_ROOT/opt/openjdk/include" + fi + + if [ -d "$HOMEBREW_ROOT/opt/libpq/bin" ]; then + export PATH="$HOMEBREW_ROOT/opt/libpq/bin:$PATH" + fi +fi + +export PYTHONSYSTEMPATH=$(which python3) + +# NOTE; Utilities + +function current_context () { + if test -f $XDG_CONFIG_HOME/kubectl-toggle-ctx/hide; then + return + fi + + if ! command -v kubectl > /dev/null; then + return + fi + + current_context=$(command kubectl config current-context) &> /dev/null + if [ "$?" -ne 0 ]; then + return + fi + + echo "[$fg_bold[blue]$current_context$reset_color]" +} + +function current_path () { + echo "[$fg_bold[yellow]%~$reset_color]" +} + +function current_timestamp () { + echo "[$fg_bold[red]$(date +'%H:%M:%S')$reset_color]" +} + +function current_git_status () { + local git_branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)" + if [ -z "$git_branch" ]; then + return + fi + + UNTRACK_STATUS="" + UNTRACK_STATUS+="$fg_bold[red]$(git ls-files --other --exclude-standard | wc -l | awk '{print $1}')$reset_color" + UNTRACK_STATUS+="$fg_bold[yellow]$(git diff --name-only | wc -l | awk '{print $1}')$reset_color" + UNTRACK_STATUS+="$fg_bold[green]$(git diff --name-only --staged | wc -l | awk '{print $1}')$reset_color" + BRANCH_NAME="$fg_bold[red]$git_branch$reset_color" + echo "[$UNTRACK_STATUS$fg_bold[gray]@$BRANCH_NAME$reset_color]" +} + +PROMPT='$(current_timestamp)$(current_context)$(current_path)$(current_git_status)' +PROMPT+=$'\n' +PROMPT+='> ' +SPROMPT="${fg[red]}%r$reset_color is correct? [y, n, a, e]:" + +if command -v fzf > /dev/null; then + source <(fzf --zsh) +fi + +if command -v mise > /dev/null; then + eval "$(mise activate zsh)" +fi + +if command -v nvim > /dev/null; then + alias vim=nvim + export EDITOR=nvim +fi + +if command -v sheldon > /dev/null; then + eval "$(sheldon -q source)" +fi + +if command -v zoxide > /dev/null; then + eval "$(zoxide init zsh)" +fi + +if command -v kubectl > /dev/null; then + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + source <(kubectl completion zsh) + alias k=kubectl +fi + +if [ -f "$HOME/.cargo/env" ]; then + . "$HOME/.cargo/env" +fi + +for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.post.zsh") +do + source $source +done From f4e3d7eadb8e96c50c517a8cd536342df6389dc6 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:35:36 +0900 Subject: [PATCH 13/95] feat: add sheldon module --- modules/sheldon/default.nix | 16 ++++++++++++++++ modules/sheldon/files/plugins.toml | 17 +++++++++++++++++ modules/zsh/default.nix | 7 +------ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 modules/sheldon/default.nix create mode 100644 modules/sheldon/files/plugins.toml diff --git a/modules/sheldon/default.nix b/modules/sheldon/default.nix new file mode 100644 index 00000000..6ac3e11d --- /dev/null +++ b/modules/sheldon/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + sheldon + ]; + + xdg.configFile."sheldon/plugins.toml" = { + source = ./files/plugins.toml; + }; +} diff --git a/modules/sheldon/files/plugins.toml b/modules/sheldon/files/plugins.toml new file mode 100644 index 00000000..d501f3aa --- /dev/null +++ b/modules/sheldon/files/plugins.toml @@ -0,0 +1,17 @@ +shell = "zsh" + +[templates] +macos_source = ''' +if [[ "$OSTYPE" = darwin* ]]; then + {{ hooks?.pre | nl }}{% for file in files %}source "{{ file }}" + {% endfor %}{{ hooks?.post | nl }} +fi +''' + +[plugins.zsh-autosuggestions] +github = 'zsh-users/zsh-autosuggestions' +apply = ['source'] + +[plugins.zsh-syntax-highlighting] +github = 'zsh-users/zsh-syntax-highlighting' +apply = ['source'] diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix index 9453d81a..644820b1 100644 --- a/modules/zsh/default.nix +++ b/modules/zsh/default.nix @@ -8,17 +8,12 @@ { programs.zsh = { enable = true; - }; - - # Use custom zshrc from dotfiles - home.file.".zshrc" = { - source = ./files/zshrc; + initContent = builtins.readFile ./files/zshrc; }; # Additional packages needed by zshrc home.packages = with pkgs; [ fzf zoxide - sheldon # ZSH plugin manager ]; } From 7279467297f62e9b57ea98b9494b0a6240cc5332 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:42:18 +0900 Subject: [PATCH 14/95] feat: add modules for ghostty, git, nvim, tmux, and uv --- modules/ghostty/default.nix | 16 ++++ modules/ghostty/files/config | 25 ++++++ modules/git/default.nix | 35 ++++++++ modules/git/files/config | 47 +++++++++++ modules/git/files/ignore | 22 ++++++ modules/nvim/default.nix | 22 ++++++ modules/nvim/files/init.vim | 57 ++++++++++++++ modules/nvim/files/vimrc | 149 +++++++++++++++++++++++++++++++++++ modules/tmux/default.nix | 13 +++ modules/tmux/files/tmux.conf | 51 ++++++++++++ modules/uv/default.nix | 16 ++++ modules/uv/files/uv.toml | 1 + 12 files changed, 454 insertions(+) create mode 100644 modules/ghostty/default.nix create mode 100644 modules/ghostty/files/config create mode 100644 modules/git/default.nix create mode 100644 modules/git/files/config create mode 100644 modules/git/files/ignore create mode 100644 modules/nvim/default.nix create mode 100644 modules/nvim/files/init.vim create mode 100644 modules/nvim/files/vimrc create mode 100644 modules/tmux/default.nix create mode 100644 modules/tmux/files/tmux.conf create mode 100644 modules/uv/default.nix create mode 100644 modules/uv/files/uv.toml diff --git a/modules/ghostty/default.nix b/modules/ghostty/default.nix new file mode 100644 index 00000000..bda478ce --- /dev/null +++ b/modules/ghostty/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + ghostty + ]; + + xdg.configFile."ghostty/config" = { + source = ./files/config; + }; +} diff --git a/modules/ghostty/files/config b/modules/ghostty/files/config new file mode 100644 index 00000000..749dd0ee --- /dev/null +++ b/modules/ghostty/files/config @@ -0,0 +1,25 @@ +# NOTE(himkt): 18446744073709551615 is usize limit + +# app config +macos-titlebar-style = native +window-theme = dark +window-padding-x = 5 +window-padding-y = 5 +window-padding-balance = true +scrollback-limit = 18446744073709551615 + +# color config +theme = GitHub Dark Default + +# background config +background-opacity = 0.95 +background-blur-radius = 20 + +# font config +font-family = Jetbrains Mono +font-family = Hiragino Kaku Gothic ProN +font-size = 16 +font-feature = -calt, -liga, -dlig +keybind = shift+enter=text:\n + +clipboard-paste-protection = false diff --git a/modules/git/default.nix b/modules/git/default.nix new file mode 100644 index 00000000..4839c445 --- /dev/null +++ b/modules/git/default.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.git = { + enable = true; + userName = "himkt"; + userEmail = "himkt@klis.tsukuba.ac.jp"; + + extraConfig = { + credential."https://github.com" = { + helper = "!gh auth git-credential"; + }; + }; + + # Load additional config from dotfiles + includes = [ + { path = "~/.config/git/config-extra"; } + ]; + }; + + # Additional git config (aliases, format, etc.) + xdg.configFile."git/config-extra" = { + source = ./files/config; + }; + + # Global gitignore + xdg.configFile."git/ignore" = { + source = ./files/ignore; + }; +} diff --git a/modules/git/files/config b/modules/git/files/config new file mode 100644 index 00000000..799b8a54 --- /dev/null +++ b/modules/git/files/config @@ -0,0 +1,47 @@ +[user] + email = himkt@klis.tsukuba.ac.jp + name = himkt + +[pull] + rebase = false + +[alias] + remove-merged = "!f() { \ + if [ -n \"$1\" ]; then \ + BRANCH=\"$1\"; \ + else \ + BRANCH=$(git branch | awk '{print $NF}' | fzf --prompt '(base branch) > '); \ + fi; \ + if [ -z \"$BRANCH\" ]; then \ + echo \"Select valid branch\"; \ + exit 1; \ + fi; \ + echo \"Log: base branch: $BRANCH\"; \ + git branch --merged \"$BRANCH\" | grep -v \"$BRANCH\" | xargs -r git branch -d; \ + }; f" + graph = log --graph --date-order --pretty=format:'<%h> %ad %Cgreen%d%Creset %s %Cblue[%an]%Creset' --all --date=short + +[format] + pretty = format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an] + date = iso +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[column] + ui = auto +[branch] + sort = -committerdate +[tag] + sort = version:refname +[init] + defaultBranch = main +[diff] + colorMoved = plain + mnemonicPrefix = true + renames = true +[credential "https://github.com"] + helper = !/opt/homebrew/bin/gh auth git-credential +[credential "https://gist.github.com"] + helper = !/opt/homebrew/bin/gh auth git-credential diff --git a/modules/git/files/ignore b/modules/git/files/ignore new file mode 100644 index 00000000..27749c83 --- /dev/null +++ b/modules/git/files/ignore @@ -0,0 +1,22 @@ +# editor +.vim +.vscode + +# ruby +.rakeTasks +.rubocop.yml + +# python +.venv +*.egg-info +.mypy_cache + +# jetbrains +.idea + +.DS_Store + +.apple-silicon-platform + +**/.claude +**/CLAUDE.md diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix new file mode 100644 index 00000000..0a44ed31 --- /dev/null +++ b/modules/nvim/default.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + }; + + xdg.configFile."nvim/init.vim" = { + source = ./files/init.vim; + }; + + xdg.configFile."nvim/vimrc" = { + source = ./files/vimrc; + }; +} diff --git a/modules/nvim/files/init.vim b/modules/nvim/files/init.vim new file mode 100644 index 00000000..f3373b96 --- /dev/null +++ b/modules/nvim/files/init.vim @@ -0,0 +1,57 @@ +" vim: ft=vim +" +" --------------------- +" +" NeoVim configuration +" +" @author = 'himkt' +" +" --------------------- +" + +"" disable mouse +set mouse= + +"" use python3 installed globally +let g:python3_host_prog=$PYTHONSYSTEMPATH + +"" load basic vim configuration +source $HOME/dotfiles/nvim/config.d/vimrc + +"" load packages +call plug#begin('~/.config/nvim/plugged') + Plug 'easymotion/vim-easymotion' + Plug 'godlygeek/tabular' + Plug 'junegunn/fzf' + Plug 'junegunn/fzf.vim' + Plug 'nathanaelkane/vim-indent-guides' + Plug 'osyo-manga/vim-anzu' + Plug 'vim-airline/vim-airline' + Plug 'sheerun/vim-polyglot' +call plug#end() + +" material.vim +if (has('nvim')) + let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 +endif + +if (has('termguicolors')) + set termguicolors +endif + +hi Normal guibg=NONE ctermbg=NONE +hi Visual guibg=gray + +" vim-easymotion +let g:EasyMotion_do_mapping = 0 +nmap // (easymotion-sn) + +" fzf +nnoremap :call fzf#vim#files('', fzf#vim#with_preview('right')) +nnoremap :Commands + +" tabular +vnoremap tr : Tabularize / + +" vim-indent-guide +let g:indent_guides_enable_on_vim_startup = 1 diff --git a/modules/nvim/files/vimrc b/modules/nvim/files/vimrc new file mode 100644 index 00000000..f4223433 --- /dev/null +++ b/modules/nvim/files/vimrc @@ -0,0 +1,149 @@ +" +" --------------------- +" +" Vim configuration +" +" @author = 'himkt' +" +" --------------------- +" + +if &compatible + set nocompatible +endif + +filetype plugin indent on +syntax on +colorscheme default + +set background=dark + +if exists('$SHELL') + set shell=$SHELL +else + set shell=/bin/sh +endif + +" open with the cursor in previous session +augroup vimrcEx + au BufRead * if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | endif +augroup END + +"" File encodings +set encoding=utf-8 +set fileencodings=utf-8,iso-2022-jp,euc-jp,ascii +set fileformats=unix,mac,dos + +"" Open a new buffer without saving +set hidden + +"" Show vim title for a window +set title + +set number +set nuw=5 + +"" Show command in status line +set showcmd + +"" Japanese input (TODO check whether if I can remove them) +set ttimeout +set ttimeoutlen=50 + +"" Indent and tab +set expandtab +set nowrap +set autoindent +set smartindent +set smarttab + +"" shift and tab stop +set tabstop=2 +set shiftwidth=2 +autocmd FileType python setl tabstop=8 shiftwidth=4 softtabstop=4 +autocmd FileType cpp setl tabstop=4 shiftwidth=4 softtabstop=4 +autocmd FileType sql setl tabstop=4 shiftwidth=4 softtabstop=4 + +"" Do not create backup and swap files +set noswapfile +set nobackup + +"" Enable incremental and hilighting search +set hlsearch +set incsearch +set shortmess-=S + +"" Hilight a matched bracket +set showmatch +set matchtime=1 + +set backspace=indent,eol,start + +"" colorize pane partition +set fillchars+=vert:│ +hi VertSplit ctermbg=None ctermfg=Blue + +"" Popup color +hi Pmenu ctermbg=235 ctermfg=228 +hi PmenuSel ctermbg=253 ctermfg=232 + +"" Cursor +hi CursorLine gui=underline cterm=underline ctermfg=NONE guifg=NONE + +"" If vertical split -> open a new pane to right, +"" and if horizontal split -> open a new pane to below +set splitbelow +set splitright + +"" Folding config +set foldmethod=marker +set foldlevel=0 + +map ; : +nnoremap x "_x +vnoremap x "_x + +" indent +inoremap +inoremap + +" tab shortcuts +nnoremap : tabnew +nnoremap gT +nnoremap gt + +" window splitting +nnoremap vp : vs +nnoremap sp : sp + +" folding configuration +nnoremap zx :set foldlevel=99 +nnoremap zc :set foldlevel=0 + +" completion configuration +set completeopt=menuone,longest,preview +autocmd CompleteDone * pclose +autocmd FileType * setlocal omnifunc=syntaxcomplete#Complete + + +" tag hilighting +autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|IMPORTANT\)') +autocmd Syntax * call matchadd('Todo', '\W\zs\(BUG\|HACK\|NOTE\|INFO\|IDEA\)') + +" executing script in vim +autocmd FileType cpp nnoremap :sp :exec ':term clang++ --std=c++11 % && ./a.out && rm a.out' +autocmd FileType go nnoremap :sp :exec ':term go run %' +autocmd FileType ruby nnoremap :sp :exec ':term ruby %' +autocmd FileType python nnoremap :sp :exec ':term if [ -e ./.venv ] ; then; poetry run python %; else python3 %; fi' +autocmd FileType rust nnoremap :sp :exec ':term cargo run --bin ' . expand('%:t:r') + +" templates +autocmd BufNewFile *.cc 0r $HOME/dotfiles/nvim/template.d/cc/template.cc +autocmd BufNewFile *.go 0r $HOME/dotfiles/nvim/template.d/go/template.go +autocmd BufNewFile setup.cfg 0r $HOME/dotfiles/nvim/template.d/python/setup.cfg + +if $ATC != "" + autocmd BufNewFile *.rs 0r $HOME/dotfiles/nvim/template.d/rs/atcoder.rs + autocmd FileType rust nnoremap :sp :exec ':term rustc % && ./' . expand('%:t:r') . ' && rm ' . expand('%:t:r') +endif diff --git a/modules/tmux/default.nix b/modules/tmux/default.nix new file mode 100644 index 00000000..b0081458 --- /dev/null +++ b/modules/tmux/default.nix @@ -0,0 +1,13 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.tmux = { + enable = true; + extraConfig = builtins.readFile ./files/tmux.conf; + }; +} diff --git a/modules/tmux/files/tmux.conf b/modules/tmux/files/tmux.conf new file mode 100644 index 00000000..53545447 --- /dev/null +++ b/modules/tmux/files/tmux.conf @@ -0,0 +1,51 @@ +# +# tmux.conf +# +# @author = himkt + +unbind C-b + +# default config +set -g status-interval 2 +set -g default-terminal "screen-256color" +set -g status-justify left + +# enable mouse mode +setw -g mode-keys vi +bind-key -T copy-mode-vi y send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" +bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" + +# color +set -g status-fg colour231 +set -g status-bg colour234 + +# window +window_status_current_format1="#[fg=colour234,bg=colour31] #[fg=colour117,bg=colour31]" +window_status_current_format2="#I #[fg=colour231]#W #[fg=colour31,bg=colour234,nobold]" +window_status_current_format=$window_status_current_format1' '$window_status_current_format2 +set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240] #[default]#W" +set -g window-status-current-format $window_status_current_format + +# take over current directory path +bind-key '"' split-window -c "#{pane_current_path}" +bind-key % split-window -h -c "#{pane_current_path}" +bind-key c new-window -c "#{pane_current_path}" + +# status bar +set -g status-left-length 20 +status_left1="#{?client_prefix,#[fg=colour254]#[bg=colour31],#[fg=colour16]#[bg=colour254]}" +status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}" +set -qg status-left $status_left1' '$status_left2 +set -qg status-right '%H:%M #[fg=colour16,bg=colour254]' + +# tmux config +set -g escape-time 10 +set -g history-limit 50000 + +bind ^h select-layout even-horizontal +bind ^v select-layout even-vertical + +# NOTE Commands `search-xxx-incremental` is new feature, it counldn't use in some environments +# For old tmux, please comment out following statement +bind-key -T copy-mode-vi / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\"" +bind-key -T copy-mode-vi ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\"" diff --git a/modules/uv/default.nix b/modules/uv/default.nix new file mode 100644 index 00000000..25e601ca --- /dev/null +++ b/modules/uv/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + uv + ]; + + xdg.configFile."uv/uv.toml" = { + source = ./files/uv.toml; + }; +} diff --git a/modules/uv/files/uv.toml b/modules/uv/files/uv.toml new file mode 100644 index 00000000..9594492d --- /dev/null +++ b/modules/uv/files/uv.toml @@ -0,0 +1 @@ +python-preference = "only-managed" From 505a8dcb2e8d3f270be35702ed163db30b1ba844 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:52:07 +0900 Subject: [PATCH 15/95] fix: git config --- modules/git/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/git/default.nix b/modules/git/default.nix index 4839c445..da644f2d 100644 --- a/modules/git/default.nix +++ b/modules/git/default.nix @@ -8,10 +8,12 @@ { programs.git = { enable = true; - userName = "himkt"; - userEmail = "himkt@klis.tsukuba.ac.jp"; - extraConfig = { + settings = { + user = { + name = "himkt"; + email = "himkt@klis.tsukuba.ac.jp"; + }; credential."https://github.com" = { helper = "!gh auth git-credential"; }; From d7e00265378258f6067bf6a8156c9931594815fa Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 12:52:50 +0900 Subject: [PATCH 16/95] chore: set XDG variables --- home/nixos.nix | 8 ++++++++ modules/nvim/default.nix | 3 +++ modules/nvim/files/init.vim | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/home/nixos.nix b/home/nixos.nix index cae9f6e5..ef4c0ac8 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -15,6 +15,14 @@ # release notes. home.stateVersion = "25.11"; # Please read the comment before changing. + # XDG Base Directory specification + xdg = { + enable = true; + configHome = "${config.home.homeDirectory}/.config"; + cacheHome = "${config.home.homeDirectory}/.cache"; + dataHome = "${config.home.homeDirectory}/.local/share"; + }; + # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix index 0a44ed31..e0b6bf04 100644 --- a/modules/nvim/default.nix +++ b/modules/nvim/default.nix @@ -10,6 +10,9 @@ enable = true; viAlias = true; vimAlias = true; + plugins = with pkgs.vimPlugins; [ + vim-plug + ]; }; xdg.configFile."nvim/init.vim" = { diff --git a/modules/nvim/files/init.vim b/modules/nvim/files/init.vim index f3373b96..01ff6710 100644 --- a/modules/nvim/files/init.vim +++ b/modules/nvim/files/init.vim @@ -16,7 +16,7 @@ set mouse= let g:python3_host_prog=$PYTHONSYSTEMPATH "" load basic vim configuration -source $HOME/dotfiles/nvim/config.d/vimrc +source $XDG_CONFIG_HOME/nvim/vimrc "" load packages call plug#begin('~/.config/nvim/plugged') From 367f20f7eddf56734641db15d82a931f4b048a32 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 13:04:21 +0900 Subject: [PATCH 17/95] chore: use pkgs.vimPlugins to manage vim packages --- modules/nvim/default.nix | 9 ++++++++- modules/nvim/files/init.vim | 12 ------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix index e0b6bf04..79b224a8 100644 --- a/modules/nvim/default.nix +++ b/modules/nvim/default.nix @@ -10,8 +10,15 @@ enable = true; viAlias = true; vimAlias = true; + plugins = with pkgs.vimPlugins; [ - vim-plug + vim-easymotion + tabular + fzf-vim + vim-indent-guides + vim-anzu + vim-airline + vim-polyglot ]; }; diff --git a/modules/nvim/files/init.vim b/modules/nvim/files/init.vim index 01ff6710..c59030f5 100644 --- a/modules/nvim/files/init.vim +++ b/modules/nvim/files/init.vim @@ -18,18 +18,6 @@ let g:python3_host_prog=$PYTHONSYSTEMPATH "" load basic vim configuration source $XDG_CONFIG_HOME/nvim/vimrc -"" load packages -call plug#begin('~/.config/nvim/plugged') - Plug 'easymotion/vim-easymotion' - Plug 'godlygeek/tabular' - Plug 'junegunn/fzf' - Plug 'junegunn/fzf.vim' - Plug 'nathanaelkane/vim-indent-guides' - Plug 'osyo-manga/vim-anzu' - Plug 'vim-airline/vim-airline' - Plug 'sheerun/vim-polyglot' -call plug#end() - " material.vim if (has('nvim')) let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 From 2dbbd71aa3001281547a2233da28dbdbf9911e3b Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 13:04:37 +0900 Subject: [PATCH 18/95] chore: import modules --- home/nixos.nix | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/home/nixos.nix b/home/nixos.nix index ef4c0ac8..5f1ed924 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -1,6 +1,16 @@ { config, pkgs, ... }: { + imports = [ + ../modules/zsh + ../modules/sheldon + ../modules/tmux + ../modules/nvim + ../modules/git + ../modules/uv + ../modules/ghostty + ]; + # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "himkt"; @@ -43,7 +53,6 @@ # echo "Hello, ${config.home.username}!" # '') _1password-gui - ghostty google-chrome vscode @@ -52,8 +61,6 @@ gh ghq gnumake - neovim - uv ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -126,23 +133,6 @@ }; }; - programs.git = { - enable = true; - settings = { - user = { - name = "himkt"; - email = "himkt@klis.tsukuba.ac.jp"; - }; - credential."https://github.com" = { - helper = "!gh auth git-credential"; - }; - }; - }; - - programs.zsh = { - enable = true; - }; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; } From cf3e9b74fe9360086bc2a6f257ed32555ef8cd9c Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 13:05:17 +0900 Subject: [PATCH 19/95] chore: make update --- flake.lock | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index f5fb9aa5..b110820c 100644 --- a/flake.lock +++ b/flake.lock @@ -7,31 +7,32 @@ ] }, "locked": { - "lastModified": 1768530555, - "narHash": "sha256-EBXKDho4t1YSgodAL6C8M3UTm8MGMZNQ9rQnceR5+6c=", + "lastModified": 1768603898, + "narHash": "sha256-vRV1dWJOCpCal3PRr86wE2WTOMfAhTu6G7bSvOsryUo=", "owner": "nix-community", "repo": "home-manager", - "rev": "d21bee5abf9fb4a42b2fa7728bf671f8bb246ba6", + "rev": "2a63d0e9d2c72ac4d4150ebb242cf8d86f488c8c", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-25.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1768305791, - "narHash": "sha256-AIdl6WAn9aymeaH/NvBj0H9qM+XuAuYbGMZaP0zcXAQ=", + "lastModified": 1768323494, + "narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1412caf7bf9e660f2f962917c14b1ea1c3bc695e", + "rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } From 47498a5cf1084387ae3ed506f8816374e1d7636f Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 14:07:02 +0900 Subject: [PATCH 20/95] chore: additional packages --- home/nixos.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index 5f1ed924..542f91d6 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -52,15 +52,25 @@ # (pkgs.writeShellScriptBin "my-hello" '' # echo "Hello, ${config.home.username}!" # '') + + # GUI _1password-gui google-chrome vscode + # CLI + bazelisk btop claude-code gh ghq gnumake + jq + kubectl + kubectx + kustomize + k9s + libpq ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage From e23e14b31f1128b4dbff5f13a8dac98737e8034b Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 14:07:32 +0900 Subject: [PATCH 21/95] chore: allow uv to use downloaded python executable --- hosts/nixos/configuration.nix | 1 + modules/uv/files/uv.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 6d40e157..6c18803b 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -92,6 +92,7 @@ # Install firefox. programs.firefox.enable = true; programs.zsh.enable = true; + programs.nix-ld.enable = true; # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/modules/uv/files/uv.toml b/modules/uv/files/uv.toml index 9594492d..39128ea0 100644 --- a/modules/uv/files/uv.toml +++ b/modules/uv/files/uv.toml @@ -1 +1 @@ -python-preference = "only-managed" +python-preference = "managed" From 45c61890dc493bd8e9f891a97e82d27706ed2af5 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 14:07:55 +0900 Subject: [PATCH 22/95] chore: enable git-lfs --- modules/git/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/git/default.nix b/modules/git/default.nix index da644f2d..b0c7ec4e 100644 --- a/modules/git/default.nix +++ b/modules/git/default.nix @@ -8,6 +8,7 @@ { programs.git = { enable = true; + lfs.enable = true; settings = { user = { From dafa27425588644bbb478fd1a918938dd0176424 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 16:32:08 +0900 Subject: [PATCH 23/95] feat: add gcc --- home/nixos.nix | 1 + modules/gcc/default.nix | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 modules/gcc/default.nix diff --git a/home/nixos.nix b/home/nixos.nix index 542f91d6..8ea39a7c 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -9,6 +9,7 @@ ../modules/git ../modules/uv ../modules/ghostty + ../modules/gcc ]; # Home Manager needs a bit of information about you and the paths it should diff --git a/modules/gcc/default.nix b/modules/gcc/default.nix new file mode 100644 index 00000000..48905311 --- /dev/null +++ b/modules/gcc/default.nix @@ -0,0 +1,47 @@ +# Copied from https://github.com/momeemt/config. +{ + pkgs, + ... +}: + +let + materialColors = { + red = "38;5;203"; + amber = "38;5;214"; + blue = "38;5;33"; + green = "38;5;71"; + purple = "38;5;127"; + gray = "38;5;245"; + cyan = "38;5;81"; + }; + bold = "01"; +in +{ + programs.gcc = { + enable = true; + package = pkgs.gcc; + colors = { + error = "${bold};${materialColors.red}"; + warning = "${bold};${materialColors.amber}"; + note = "${bold};${materialColors.blue}"; + locus = materialColors.gray; + quote = materialColors.gray; + path = materialColors.cyan; + range1 = materialColors.green; + range2 = materialColors.blue; + fixit-insert = materialColors.green; + fixit-delete = materialColors.red; + diff-filename = "${bold};${materialColors.blue}"; + diff-hunk = materialColors.purple; + diff-delete = materialColors.red; + diff-insert = materialColors.green; + type-diff = "${bold};${materialColors.purple}"; + fnname = "${bold};${materialColors.green}"; + targs = materialColors.purple; + valid = materialColors.green; + invalid = materialColors.red; + highlight-a = "${bold};${materialColors.blue}"; + highlight-b = "${bold};${materialColors.amber}"; + }; + }; +} From 3d482a7e73a7a20f958ad4c164604fadf1d4b4fd Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 16:32:21 +0900 Subject: [PATCH 24/95] chore: additional packages --- home/nixos.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/nixos.nix b/home/nixos.nix index 8ea39a7c..c6d4771f 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -57,6 +57,7 @@ # GUI _1password-gui google-chrome + slack vscode # CLI @@ -71,7 +72,8 @@ kubectx kustomize k9s - libpq + mise + postgresql ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage From 8f8aaced46cfea1cfa619af4b2e1e5599c23209b Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 16:32:50 +0900 Subject: [PATCH 25/95] feat: docker (without automated launch) --- hosts/nixos/configuration.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 6c18803b..5b022b68 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -78,11 +78,18 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. + # Docker + virtualisation.docker = { + enable = true; + enableOnBoot = false; + }; + systemd.sockets.docker.wantedBy = pkgs.lib.mkForce []; + + # Define a user account. Don't forget to set a password with 'passwd'. users.users.himkt = { isNormalUser = true; description = "himkt"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ "networkmanager" "wheel" "docker" ]; packages = with pkgs; [ # thunderbird ]; From 410040516112646dfa29a39cc18a71b8d76ecf4c Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 17:17:04 +0900 Subject: [PATCH 26/95] chore: gpg, python3, cert, and libpq --- home/nixos.nix | 3 +++ hosts/nixos/configuration.nix | 4 ++++ modules/gpg/default.nix | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 modules/gpg/default.nix diff --git a/home/nixos.nix b/home/nixos.nix index c6d4771f..c6c49e5a 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -10,6 +10,7 @@ ../modules/uv ../modules/ghostty ../modules/gcc + ../modules/gpg ]; # Home Manager needs a bit of information about you and the paths it should @@ -74,6 +75,7 @@ k9s mise postgresql + python3 ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -109,6 +111,7 @@ # home.sessionVariables = { EDITOR = "nvim"; + SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; }; dconf.settings = { diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 5b022b68..bf3bbf17 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -101,6 +101,10 @@ programs.zsh.enable = true; programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + postgresql.lib + ]; + # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/modules/gpg/default.nix b/modules/gpg/default.nix new file mode 100644 index 00000000..07b8925f --- /dev/null +++ b/modules/gpg/default.nix @@ -0,0 +1,14 @@ +{ + pkgs, + config, + ... +}: { + programs.gpg = { + enable = true; + package = pkgs.gnupg; + homedir = "${config.xdg.dataHome}/gnupg"; + + mutableKeys = true; + mutableTrust = true; + }; +} From 50910e25abc36c416a3c8d42b86682315c50fb56 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 20:39:22 +0900 Subject: [PATCH 27/95] chore: enable scroll gesture for history navigation --- home/nixos.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index c6c49e5a..35ce08ca 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -91,6 +91,22 @@ # org.gradle.console=verbose # org.gradle.daemon.idletimeout=3600000 # ''; + + # Chrome with touchpad swipe gesture support + ".local/share/applications/google-chrome.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Google Chrome + GenericName=Web Browser + Comment=Access the Internet + Exec=google-chrome-stable --enable-features=TouchpadOverscrollHistoryNavigation %U + StartupNotify=true + Terminal=false + Icon=google-chrome + Type=Application + Categories=Network;WebBrowser; + MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; + ''; }; # Home Manager can also manage your environment variables through From f647ad7dcdc2ee85dcb6381981f668d8c1851961 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:04:45 +0900 Subject: [PATCH 28/95] feat: Japanese IME --- modules/fcitx5/default.nix | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 modules/fcitx5/default.nix diff --git a/modules/fcitx5/default.nix b/modules/fcitx5/default.nix new file mode 100644 index 00000000..5a6decec --- /dev/null +++ b/modules/fcitx5/default.nix @@ -0,0 +1,64 @@ +{ + pkgs, + ... +}: + +{ + # GTK im-module settings for fcitx5 (XWayland apps) + gtk = { + gtk3.extraConfig.gtk-im-module = "fcitx"; + gtk4.extraConfig.gtk-im-module = "fcitx"; + }; + + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5 = { + addons = with pkgs; [ + fcitx5-mozc + fcitx5-gtk + ]; + settings = { + inputMethod = { + "Groups/0" = { + Name = "Default"; + "Default Layout" = "us"; + DefaultIM = "keyboard-us"; + }; + "Groups/0/Items/0" = { + Name = "keyboard-us"; + Layout = ""; + }; + "Groups/0/Items/1" = { + Name = "mozc"; + Layout = ""; + }; + GroupOrder = { + "0" = "Default"; + }; + }; + globalOptions = { + Hotkey = { + EnumerateWithTriggerKeys = "True"; + EnumerateSkipFirst = "False"; + }; + # Ctrl+Shift to switch between English and Japanese + "Hotkey/TriggerKeys" = { + "0" = "Control+Shift+Shift_L"; + }; + Behavior = { + ActiveByDefault = "False"; + PreeditEnabledByDefault = "True"; + ShowInputMethodInformation = "True"; + DefaultPageSize = 5; + }; + }; + addons = { + classicui.globalSection = { + PreferTextIcon = "True"; + }; + }; + }; + }; + }; +} From 750112bfbd0055fb52a34f88ad6d325e98840ec0 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:45:03 +0900 Subject: [PATCH 29/95] fix: specify fcitx in apps --- home/nixos.nix | 7 +++++++ modules/fcitx5/default.nix | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home/nixos.nix b/home/nixos.nix index 35ce08ca..a1b59062 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -11,6 +11,7 @@ ../modules/ghostty ../modules/gcc ../modules/gpg + ../modules/fcitx5 ]; # Home Manager needs a bit of information about you and the paths it should @@ -128,6 +129,12 @@ home.sessionVariables = { EDITOR = "nvim"; SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; + + # fcitx5 IME support + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + GLFW_IM_MODULE = "ibus"; # For some apps that use GLFW }; dconf.settings = { diff --git a/modules/fcitx5/default.nix b/modules/fcitx5/default.nix index 5a6decec..7a4c9dfb 100644 --- a/modules/fcitx5/default.nix +++ b/modules/fcitx5/default.nix @@ -42,9 +42,8 @@ EnumerateWithTriggerKeys = "True"; EnumerateSkipFirst = "False"; }; - # Ctrl+Shift to switch between English and Japanese "Hotkey/TriggerKeys" = { - "0" = "Control+Shift+Shift_L"; + "0" = "Control+space"; }; Behavior = { ActiveByDefault = "False"; From cd2be12702eb52ab4c1d8279762d42b73d2408da Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:45:37 +0900 Subject: [PATCH 30/95] chore: clear GTK_IM_MODULE for ghostty as workaround --- home/nixos.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index a1b59062..e99ef5d2 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -108,6 +108,22 @@ Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; ''; + + # Ghostty with fcitx5 workaround + # See: https://github.com/ghostty-org/ghostty/discussions/3628 + ".local/share/applications/com.mitchellh.ghostty.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Ghostty + GenericName=Terminal + Comment=A terminal emulator + Exec=env GTK_IM_MODULE= ghostty + StartupNotify=true + Terminal=false + Icon=com.mitchellh.ghostty + Type=Application + Categories=System;TerminalEmulator; + ''; }; # Home Manager can also manage your environment variables through From 74c29cb315e845483a022349fa9f5505ec2264e6 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:46:35 +0900 Subject: [PATCH 31/95] feat: introduce fprintd (fingerprint authentication) and enable keyring --- hosts/nixos/configuration.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index bf3bbf17..0af2aefe 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -59,9 +59,21 @@ # Enable CUPS to print documents. services.printing.enable = true; + # Fingerprint reader (Goodix 27c6:658c) + services.fprintd = { + enable = true; + tod = { + enable = true; + driver = pkgs.libfprint-2-tod1-goodix; + }; + }; + # Enable sound with pipewire. services.pulseaudio.enable = false; security.rtkit.enable = true; + + security.pam.services.gdm.enableGnomeKeyring = true; + services.pipewire = { enable = true; alsa.enable = true; From 139a51abe209ade2bdee61bcd0e54503767b7cc4 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:46:53 +0900 Subject: [PATCH 32/95] chore: adjust ghostty font size --- modules/ghostty/files/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ghostty/files/config b/modules/ghostty/files/config index 749dd0ee..913424ed 100644 --- a/modules/ghostty/files/config +++ b/modules/ghostty/files/config @@ -18,7 +18,7 @@ background-blur-radius = 20 # font config font-family = Jetbrains Mono font-family = Hiragino Kaku Gothic ProN -font-size = 16 +font-size = 12 font-feature = -calt, -liga, -dlig keybind = shift+enter=text:\n From d7f669aeb387bdbec34c07682884d4baf8f23574 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 17 Jan 2026 21:50:34 +0900 Subject: [PATCH 33/95] chore: update README --- README.md | 71 ++++++++++--------------------------------------------- 1 file changed, 13 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 6b1f12f4..906c9974 100644 --- a/README.md +++ b/README.md @@ -13,62 +13,17 @@ nixos-config/ │ └── nixos/ # NixOS system configuration │ ├── configuration.nix │ └── hardware-configuration.nix -└── home/ - └── nixos.nix # Home Manager configuration +├── home/ +│ └── nixos.nix # Home Manager configuration +└── modules/ # Modular configurations + ├── fcitx5/ # Japanese IME + ├── gcc/ # GCC with colored output + ├── ghostty/ # Terminal emulator + ├── git/ # Git configuration + ├── gpg/ # GPG configuration + ├── nvim/ # Neovim configuration + ├── sheldon/ # Zsh plugin manager + ├── tmux/ # Tmux configuration + ├── uv/ # Python package manager + └── zsh/ # Zsh configuration ``` - -## Usage - -### Build and Switch - -```bash -# Rebuild and switch NixOS configuration -make switch - -# Build without switching -make build - -# Test configuration (dry-run) -make test -``` - -### Maintenance - -```bash -# Update flake inputs -make update - -# Remove old generations (older than 7 days) -make clean - -# Garbage collect nix store -make gc -``` - -## Initial Setup - -1. Clone this repository: - ```bash - git clone ~/nixos-config - cd ~/nixos-config - ``` - -2. Update hardware configuration if needed: - ```bash - sudo nixos-generate-config --show-hardware-config > hosts/nixos/hardware-configuration.nix - ``` - -3. Review and customize the configuration files: - - `hosts/nixos/configuration.nix` - System-level settings - - `home/nixos.nix` - User-level settings - -4. Build and switch: - ```bash - make switch - ``` - -## Notes - -- This configuration uses `nixos-unstable` channel -- Home Manager is integrated as a NixOS module -- Username is set to `himkt` From f8614a15fb4641823270e0cf8cb60edbb9a25cd1 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 18 Jan 2026 18:54:42 +0900 Subject: [PATCH 34/95] chore: super+t to create tab on Ghostty --- modules/ghostty/files/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ghostty/files/config b/modules/ghostty/files/config index 913424ed..8deb4418 100644 --- a/modules/ghostty/files/config +++ b/modules/ghostty/files/config @@ -18,8 +18,9 @@ background-blur-radius = 20 # font config font-family = Jetbrains Mono font-family = Hiragino Kaku Gothic ProN -font-size = 12 +font-size = 11 font-feature = -calt, -liga, -dlig keybind = shift+enter=text:\n +keybind = super+t=new_tab clipboard-paste-protection = false From 9c25b9de2ad6749cb25a42af8e78df7eda08de27 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 18 Jan 2026 18:55:00 +0900 Subject: [PATCH 35/95] chore: add rustup --- home/nixos.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/nixos.nix b/home/nixos.nix index e99ef5d2..baaac708 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -77,6 +77,7 @@ mise postgresql python3 + rustup ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage From d63c1933a3942100eb765ae51b59e6bddae98a5c Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 18 Jan 2026 18:55:50 +0900 Subject: [PATCH 36/95] fix: vscode (and other electron-based apps) poor rendering --- home/nixos.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index baaac708..b2a074a5 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -125,6 +125,22 @@ Type=Application Categories=System;TerminalEmulator; ''; + + # VSCode with Wayland support for better text rendering + ".local/share/applications/code.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Visual Studio Code + GenericName=Text Editor + Comment=Code Editing. Redefined. + Exec=code --ozone-platform=wayland %F + StartupNotify=true + Terminal=false + Icon=vscode + Type=Application + Categories=Development;IDE;TextEditor; + MimeType=text/plain;inode/directory; + ''; }; # Home Manager can also manage your environment variables through @@ -152,6 +168,10 @@ QT_IM_MODULE = "fcitx"; XMODIFIERS = "@im=fcitx"; GLFW_IM_MODULE = "ibus"; # For some apps that use GLFW + + # Enable Wayland for Electron apps (VSCode, Slack, etc.) + # NIXOS_OZONE_WL = "1"; + ELECTRON_OZONE_PLATFORM_HINT = "auto"; }; dconf.settings = { From a1876db0ea927466a8bd3f904a1ab92afff65906 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 18 Jan 2026 19:12:12 +0900 Subject: [PATCH 37/95] chore: change hostname to neptune --- hosts/nixos/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 0af2aefe..e8944c0a 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -15,7 +15,7 @@ boot.loader.efi.canTouchEfiVariables = true; boot.initrd.luks.devices."luks-f47715a3-2a66-448c-9e93-7268419de718".device = "/dev/disk/by-uuid/f47715a3-2a66-448c-9e93-7268419de718"; - networking.hostName = "nixos"; # Define your hostname. + networking.hostName = "neptune"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary From af4bf0f9e2057fe01893d22dc2a8c52e172f3d91 Mon Sep 17 00:00:00 2001 From: himkt Date: Mon, 19 Jan 2026 23:14:48 +0900 Subject: [PATCH 38/95] feat: introduce inkscape and insomnia --- home/nixos.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index b2a074a5..b13e809c 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -59,6 +59,8 @@ # GUI _1password-gui google-chrome + inkscape + insomnia slack vscode From 3a3b33a5084b8b165d8e911d35c6a8a8e6310f2d Mon Sep 17 00:00:00 2001 From: himkt Date: Mon, 19 Jan 2026 23:42:44 +0900 Subject: [PATCH 39/95] chore: use unstable versions of claude-code, vscode, and 1password --- flake.lock | 25 +++++++++++++++++++++---- flake.nix | 1 + home/nixos.nix | 15 +++++++++++---- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index b110820c..9e572f10 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1768323494, - "narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=", + "lastModified": 1768621446, + "narHash": "sha256-6YwHV1cjv6arXdF/PQc365h1j+Qje3Pydk501Rm4Q+4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a", + "rev": "72ac591e737060deab2b86d6952babd1f896d7c5", "type": "github" }, "original": { @@ -37,10 +37,27 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index a105ac5f..b3a28bdd 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager/release-25.11"; diff --git a/home/nixos.nix b/home/nixos.nix index b13e809c..d56ad52b 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -1,4 +1,11 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: + +let + unstable = import inputs.nixpkgs-unstable { + system = pkgs.system; + config.allowUnfree = true; + }; +in { imports = [ @@ -57,17 +64,16 @@ # '') # GUI - _1password-gui google-chrome inkscape insomnia slack - vscode + unstable._1password-gui + unstable.vscode # CLI bazelisk btop - claude-code gh ghq gnumake @@ -80,6 +86,7 @@ postgresql python3 rustup + unstable.claude-code ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage From a47ddb49af4e37aa8cee6c79b25e5908e5f5a252 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 20 Jan 2026 00:05:57 +0900 Subject: [PATCH 40/95] feat: enable Emacs style key theme --- home/nixos.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/nixos.nix b/home/nixos.nix index d56ad52b..3f56ceba 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -202,6 +202,7 @@ in }; "org/gnome/desktop/interface" = { show-battery-percentage = true; + gtk-key-theme = "Emacs"; }; }; From 7e23906f5f93fd72a04e63aebc11a7dae45239b8 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 20 Jan 2026 00:06:52 +0900 Subject: [PATCH 41/95] fix: hide duplicate chrome app on launcher --- home/nixos.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index 3f56ceba..461ed19b 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -119,6 +119,12 @@ in MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; ''; + # Hide duplicate Chrome entry + ".local/share/applications/com.google.Chrome.desktop".text = '' + [Desktop Entry] + NoDisplay=true + ''; + # Ghostty with fcitx5 workaround # See: https://github.com/ghostty-org/ghostty/discussions/3628 ".local/share/applications/com.mitchellh.ghostty.desktop".text = '' From 5201c65c1a253aecdebfb3b36a1a474948d6f5bc Mon Sep 17 00:00:00 2001 From: himkt Date: Thu, 22 Jan 2026 21:54:46 +0900 Subject: [PATCH 42/95] chore: update flake.lock --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 9e572f10..ff66eb12 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1768603898, - "narHash": "sha256-vRV1dWJOCpCal3PRr86wE2WTOMfAhTu6G7bSvOsryUo=", + "lastModified": 1768949235, + "narHash": "sha256-TtjKgXyg1lMfh374w5uxutd6Vx2P/hU81aEhTxrO2cg=", "owner": "nix-community", "repo": "home-manager", - "rev": "2a63d0e9d2c72ac4d4150ebb242cf8d86f488c8c", + "rev": "75ed713570ca17427119e7e204ab3590cc3bf2a5", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1768621446, - "narHash": "sha256-6YwHV1cjv6arXdF/PQc365h1j+Qje3Pydk501Rm4Q+4=", + "lastModified": 1768940263, + "narHash": "sha256-sJERJIYTKPFXkoz/gBaBtRKke82h4DkX3BBSsKbfbvI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "72ac591e737060deab2b86d6952babd1f896d7c5", + "rev": "3ceaaa8bc963ced4d830e06ea2d0863b6490ff03", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1768564909, - "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "lastModified": 1768886240, + "narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0", "type": "github" }, "original": { From 1b97b2d03c48b494bc41d887478a21479ea56b01 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 25 Jan 2026 19:47:46 +0900 Subject: [PATCH 43/95] chore: trust docker related gateways --- hosts/nixos/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index e8944c0a..e6a01520 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -152,6 +152,7 @@ # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; + networking.firewall.trustedInterfaces = [ "docker0" "br-+" ]; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions From 4362783dad7f300f7dd69ecc2f64346152d578e4 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 25 Jan 2026 19:47:57 +0900 Subject: [PATCH 44/95] chore: make update --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index ff66eb12..63f42a58 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1768940263, - "narHash": "sha256-sJERJIYTKPFXkoz/gBaBtRKke82h4DkX3BBSsKbfbvI=", + "lastModified": 1769089682, + "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3ceaaa8bc963ced4d830e06ea2d0863b6490ff03", + "rev": "078d69f03934859a181e81ba987c2bb033eebfc5", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1768886240, - "narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=", + "lastModified": 1769170682, + "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0", + "rev": "c5296fdd05cfa2c187990dd909864da9658df755", "type": "github" }, "original": { From 62b7a8fb679526d08b3ef57fbc28eb7672a56fe5 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 25 Jan 2026 19:48:12 +0900 Subject: [PATCH 45/95] feat: add gcloud --- home/nixos.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/nixos.nix b/home/nixos.nix index 461ed19b..429e30f8 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -76,6 +76,7 @@ in btop gh ghq + google-cloud-sdk gnumake jq kubectl From 4ca170fc673a176ca6e6facb3bf06493f3f80710 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 25 Jan 2026 19:48:26 +0900 Subject: [PATCH 46/95] chore: stop using Emacs key theme --- home/nixos.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/home/nixos.nix b/home/nixos.nix index 429e30f8..95e12a2c 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -209,7 +209,6 @@ in }; "org/gnome/desktop/interface" = { show-battery-percentage = true; - gtk-key-theme = "Emacs"; }; }; From 449f0bebf09d6bd3a921e47b37c407509334be61 Mon Sep 17 00:00:00 2001 From: himkt Date: Mon, 26 Jan 2026 23:28:06 +0900 Subject: [PATCH 47/95] feat: enable systemd-resolved and change DNS setting using sops-nix --- .sops.yaml | 12 ++++++++++++ flake.lock | 23 ++++++++++++++++++++++- flake.nix | 8 ++++++++ hosts/nixos/configuration.nix | 31 +++++++++++++++++++++++++++++++ secrets/secrets.yaml | 30 ++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 .sops.yaml create mode 100644 secrets/secrets.yaml diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 00000000..efaeb7e4 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,12 @@ +keys: + # User key (from SSH key) + - &user_himkt age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 + # Host key (neptune) + - &host_neptune age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq + +creation_rules: + - path_regex: secrets/secrets\.yaml$ + key_groups: + - age: + - *user_himkt + - *host_neptune diff --git a/flake.lock b/flake.lock index 63f42a58..0620a4ce 100644 --- a/flake.lock +++ b/flake.lock @@ -57,7 +57,28 @@ "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769314333, + "narHash": "sha256-+Uvq9h2eGsbhacXpuS7irYO7fFlz514nrhPCSTkASlw=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "2eb9eed7ef48908e0f02985919f7eb9d33fa758f", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index b3a28bdd..fcd373b6 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -30,6 +35,9 @@ modules = [ ./hosts/nixos/configuration.nix + # sops-nix for secrets management + inputs.sops-nix.nixosModules.sops + # Home Manager as NixOS module home-manager.nixosModules.home-manager { diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index e6a01520..ace4279c 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -25,6 +25,37 @@ # Enable networking networking.networkmanager.enable = true; + # sops-nix secrets + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + age.keyFile = "/var/lib/sops-nix/key.txt"; + secrets.nextdns_id = {}; + secrets.dns_server_ipv4_0 = {}; + secrets.dns_server_ipv4_1 = {}; + secrets.dns_server_ipv6_0 = {}; + secrets.dns_server_ipv6_1 = {}; + templates."99-nextdns.conf" = { + content = '' + [Resolve] + DNS=${config.sops.placeholder.dns_server_ipv4_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv6_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv4_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv6_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + ''; + path = "/etc/systemd/resolved.conf.d/99-nextdns.conf"; + mode = "0644"; + restartUnits = [ "systemd-resolved.service" ]; + }; + }; + + # DNS over TLS with NextDNS + services.resolved = { + enable = true; + dnsovertls = "true"; + fallbackDns = []; + }; + networking.networkmanager.dns = "systemd-resolved"; + # Set your time zone. time.timeZone = "Asia/Tokyo"; diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml new file mode 100644 index 00000000..0334e5f1 --- /dev/null +++ b/secrets/secrets.yaml @@ -0,0 +1,30 @@ +#ENC[AES256_GCM,data:HjKcqrXCAY2skTqI5aopYcMfREo9iKD82FsAXymsEmJ7MFeCBoVTFEVZTm7EEOCo8BWik45zNg==,iv:ELijRN47sRn0BqZKbj2LPh9hhuyH+v56CxrzDL/EYVo=,tag:Wgs0Pmt8UNCk9slnw5gd6w==,type:comment] +nextdns_id: ENC[AES256_GCM,data:8FIzB79/,iv:3t/0V4Chopg5SffE6P1JcB4PNGzLWtrsC3Gio03b5bk=,tag:o30xHwtx3sLMihwtuNUDoQ==,type:str] +dns_server_ipv4_0: ENC[AES256_GCM,data:PksLLL7TivYagw==,iv:/an1zGWRy2AhQBrC9AlJq2bwftHtMe4AQcenPu0GGqk=,tag:vgnre1OAbkcWPPdbpmSrwg==,type:str] +dns_server_ipv4_1: ENC[AES256_GCM,data:yXc1v7Ez978CQQ==,iv:77OcSVmXP4jfZ75xWJj9U+LoA18dBAg3Wrj+q3lz8LY=,tag:Sdfg31yhHNxuMUKRo2Ebgw==,type:str] +dns_server_ipv6_0: ENC[AES256_GCM,data:vrx6yabMcK7PslA=,iv:9wS55xgvcAOdLqYJ1ZDR5NWvBZEyZxgaWWB2EFQbtyg=,tag:tbHL/hAwmLV0Ndmu6Hra6w==,type:str] +dns_server_ipv6_1: ENC[AES256_GCM,data:IfMPanxqDSVlkDk=,iv:JHN2+Es6apKu0yJxwsPaSSJiSNRk/IASTJbo/iRAfjs=,tag:KJcJbPnvxwQTHUepDnAj9g==,type:str] +sops: + age: + - recipient: age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoMGVpSGtHVWdPR0lOTEtC + M0hpbEc3K1ZQS0FHM1FXTzFHWGM1UGZHdkRJCitSK1FsUENoL1hTYlJ6bm1FWklG + TGtHb2JodnZaU1V4QTgxOUVTbHFoTmMKLS0tIEdWNzNIOE1DbkZuU0IxLzU1Q2Rj + aG4yZXZhZmg2cDU2Ym1rdDBUQndabU0K7TUnP0dOb/yDTRPyMbjW5MeB9LHdn7E9 + RDg98FbWKER0Z9JHBRIAFvdvaWl62KEgAsLHb25Jd16/73CedM+W/Q== + -----END AGE ENCRYPTED FILE----- + - recipient: age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiTU8xd1ZPeDNNQVRnd01s + REQ3S2tWTXBiWVQ3eHl5V2FlZHkraEl3OVV3CndQczhKaHB4blRxRTdQMzJLZGRq + MTkvOWZkR2dtalE2UjhXQVplQkM4RE0KLS0tIG5wck0ySFFOTDVOWWU5b3NTWjdx + c3ZqVC9kYXRvR0lFR3hkWjZBQjk0dncKlf1biEZVu8Mx1Cc/NpgcG9S7CvJZWSw9 + Ds0YABw1dJWxfgOMuS+IA9UrDdd61u8SyBgEvM4TKVPfP/4l/5lSbA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-01-26T13:18:11Z" + mac: ENC[AES256_GCM,data:oGw0eA5hAd1yuTVZKDnZfqZUujb90kYlJSJbFlslN08+NjdooeKPgsAb5zwTak8quQE9mKpAhJzxvQDKBUkgSPmZMjX7xaQHhbhgoDXb4aGFWT19clvjQuonUT72fecZNxRhX2Cg+qorN1xZUnmOz001Pqh0+lPvWfJWiHsQJp4=,iv:i0bQ3ijVBcS1SeNrOiPeEWNz2MlIXqXJdEhnc0HvsKo=,tag:vlGSDnpdKgGIUsmTab6m9w==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 From ebee9405ac494c57b4546c3964323e10b6945b34 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 27 Jan 2026 20:32:55 +0900 Subject: [PATCH 48/95] chore: use compiled binary in mise --- home/nixos.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index 95e12a2c..b418cd41 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -188,6 +188,9 @@ in # Enable Wayland for Electron apps (VSCode, Slack, etc.) # NIXOS_OZONE_WL = "1"; ELECTRON_OZONE_PLATFORM_HINT = "auto"; + + # Let mise download binary if possible + MISE_ALL_COMPILE = "0"; }; dconf.settings = { From 3e22ef8c7a1647ecc1dbc84b5263d7b7c5ed11cb Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 27 Jan 2026 20:33:25 +0900 Subject: [PATCH 49/95] feat: enable gnome-keyring daemon --- hosts/nixos/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index ace4279c..a14f0632 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -104,6 +104,7 @@ security.rtkit.enable = true; security.pam.services.gdm.enableGnomeKeyring = true; + services.gnome.gnome-keyring.enable = true; services.pipewire = { enable = true; From 925296efb153af312620d2f748016bd15d62301e Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 27 Jan 2026 20:34:18 +0900 Subject: [PATCH 50/95] chore: open to launch xdg-open --- modules/zsh/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix index 644820b1..b332399e 100644 --- a/modules/zsh/default.nix +++ b/modules/zsh/default.nix @@ -9,6 +9,9 @@ programs.zsh = { enable = true; initContent = builtins.readFile ./files/zshrc; + shellAliases = { + open = "xdg-open"; + }; }; # Additional packages needed by zshrc From dd3dbb7dfd0b48365ea227d9d21933e70a29df46 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 27 Jan 2026 20:35:03 +0900 Subject: [PATCH 51/95] chore: make update --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 0620a4ce..b1e45b99 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769089682, - "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=", + "lastModified": 1769318308, + "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "078d69f03934859a181e81ba987c2bb033eebfc5", + "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", "type": "github" }, "original": { @@ -68,11 +68,11 @@ ] }, "locked": { - "lastModified": 1769314333, - "narHash": "sha256-+Uvq9h2eGsbhacXpuS7irYO7fFlz514nrhPCSTkASlw=", + "lastModified": 1769469829, + "narHash": "sha256-wFcr32ZqspCxk4+FvIxIL0AZktRs6DuF8oOsLt59YBU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "2eb9eed7ef48908e0f02985919f7eb9d33fa758f", + "rev": "c5eebd4eb2e3372fe12a8d70a248a6ee9dd02eff", "type": "github" }, "original": { From dc481b37238d419eac8600deceb0a0eefd6c5317 Mon Sep 17 00:00:00 2001 From: himkt Date: Fri, 30 Jan 2026 19:32:14 +0900 Subject: [PATCH 52/95] chore: make update --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index b1e45b99..15dd6954 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1768949235, - "narHash": "sha256-TtjKgXyg1lMfh374w5uxutd6Vx2P/hU81aEhTxrO2cg=", + "lastModified": 1769580047, + "narHash": "sha256-tNqCP/+2+peAXXQ2V8RwsBkenlfWMERb+Uy6xmevyhM=", "owner": "nix-community", "repo": "home-manager", - "rev": "75ed713570ca17427119e7e204ab3590cc3bf2a5", + "rev": "366d78c2856de6ab3411c15c1cb4fb4c2bf5c826", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769318308, - "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", + "lastModified": 1769598131, + "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", + "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1769170682, - "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", + "lastModified": 1769461804, + "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c5296fdd05cfa2c187990dd909864da9658df755", + "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", "type": "github" }, "original": { From 8c5ee2ba110b025340d8a4065b17305e89d613f2 Mon Sep 17 00:00:00 2001 From: himkt Date: Fri, 30 Jan 2026 23:59:11 +0900 Subject: [PATCH 53/95] chore: move modules to home --- {modules => home/modules}/fcitx5/default.nix | 0 {modules => home/modules}/gcc/default.nix | 0 {modules => home/modules}/ghostty/default.nix | 0 .../modules}/ghostty/files/config | 0 {modules => home/modules}/git/default.nix | 0 {modules => home/modules}/git/files/config | 0 {modules => home/modules}/git/files/ignore | 0 {modules => home/modules}/gpg/default.nix | 0 {modules => home/modules}/nvim/default.nix | 0 {modules => home/modules}/nvim/files/init.vim | 0 {modules => home/modules}/nvim/files/vimrc | 0 {modules => home/modules}/sheldon/default.nix | 0 .../modules}/sheldon/files/plugins.toml | 0 {modules => home/modules}/tmux/default.nix | 0 .../modules}/tmux/files/tmux.conf | 0 {modules => home/modules}/uv/default.nix | 0 {modules => home/modules}/uv/files/uv.toml | 0 {modules => home/modules}/zsh/default.nix | 0 {modules => home/modules}/zsh/files/zshrc | 0 home/nixos.nix | 20 +++++++++---------- 20 files changed, 10 insertions(+), 10 deletions(-) rename {modules => home/modules}/fcitx5/default.nix (100%) rename {modules => home/modules}/gcc/default.nix (100%) rename {modules => home/modules}/ghostty/default.nix (100%) rename {modules => home/modules}/ghostty/files/config (100%) rename {modules => home/modules}/git/default.nix (100%) rename {modules => home/modules}/git/files/config (100%) rename {modules => home/modules}/git/files/ignore (100%) rename {modules => home/modules}/gpg/default.nix (100%) rename {modules => home/modules}/nvim/default.nix (100%) rename {modules => home/modules}/nvim/files/init.vim (100%) rename {modules => home/modules}/nvim/files/vimrc (100%) rename {modules => home/modules}/sheldon/default.nix (100%) rename {modules => home/modules}/sheldon/files/plugins.toml (100%) rename {modules => home/modules}/tmux/default.nix (100%) rename {modules => home/modules}/tmux/files/tmux.conf (100%) rename {modules => home/modules}/uv/default.nix (100%) rename {modules => home/modules}/uv/files/uv.toml (100%) rename {modules => home/modules}/zsh/default.nix (100%) rename {modules => home/modules}/zsh/files/zshrc (100%) diff --git a/modules/fcitx5/default.nix b/home/modules/fcitx5/default.nix similarity index 100% rename from modules/fcitx5/default.nix rename to home/modules/fcitx5/default.nix diff --git a/modules/gcc/default.nix b/home/modules/gcc/default.nix similarity index 100% rename from modules/gcc/default.nix rename to home/modules/gcc/default.nix diff --git a/modules/ghostty/default.nix b/home/modules/ghostty/default.nix similarity index 100% rename from modules/ghostty/default.nix rename to home/modules/ghostty/default.nix diff --git a/modules/ghostty/files/config b/home/modules/ghostty/files/config similarity index 100% rename from modules/ghostty/files/config rename to home/modules/ghostty/files/config diff --git a/modules/git/default.nix b/home/modules/git/default.nix similarity index 100% rename from modules/git/default.nix rename to home/modules/git/default.nix diff --git a/modules/git/files/config b/home/modules/git/files/config similarity index 100% rename from modules/git/files/config rename to home/modules/git/files/config diff --git a/modules/git/files/ignore b/home/modules/git/files/ignore similarity index 100% rename from modules/git/files/ignore rename to home/modules/git/files/ignore diff --git a/modules/gpg/default.nix b/home/modules/gpg/default.nix similarity index 100% rename from modules/gpg/default.nix rename to home/modules/gpg/default.nix diff --git a/modules/nvim/default.nix b/home/modules/nvim/default.nix similarity index 100% rename from modules/nvim/default.nix rename to home/modules/nvim/default.nix diff --git a/modules/nvim/files/init.vim b/home/modules/nvim/files/init.vim similarity index 100% rename from modules/nvim/files/init.vim rename to home/modules/nvim/files/init.vim diff --git a/modules/nvim/files/vimrc b/home/modules/nvim/files/vimrc similarity index 100% rename from modules/nvim/files/vimrc rename to home/modules/nvim/files/vimrc diff --git a/modules/sheldon/default.nix b/home/modules/sheldon/default.nix similarity index 100% rename from modules/sheldon/default.nix rename to home/modules/sheldon/default.nix diff --git a/modules/sheldon/files/plugins.toml b/home/modules/sheldon/files/plugins.toml similarity index 100% rename from modules/sheldon/files/plugins.toml rename to home/modules/sheldon/files/plugins.toml diff --git a/modules/tmux/default.nix b/home/modules/tmux/default.nix similarity index 100% rename from modules/tmux/default.nix rename to home/modules/tmux/default.nix diff --git a/modules/tmux/files/tmux.conf b/home/modules/tmux/files/tmux.conf similarity index 100% rename from modules/tmux/files/tmux.conf rename to home/modules/tmux/files/tmux.conf diff --git a/modules/uv/default.nix b/home/modules/uv/default.nix similarity index 100% rename from modules/uv/default.nix rename to home/modules/uv/default.nix diff --git a/modules/uv/files/uv.toml b/home/modules/uv/files/uv.toml similarity index 100% rename from modules/uv/files/uv.toml rename to home/modules/uv/files/uv.toml diff --git a/modules/zsh/default.nix b/home/modules/zsh/default.nix similarity index 100% rename from modules/zsh/default.nix rename to home/modules/zsh/default.nix diff --git a/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc similarity index 100% rename from modules/zsh/files/zshrc rename to home/modules/zsh/files/zshrc diff --git a/home/nixos.nix b/home/nixos.nix index b418cd41..db2ff081 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -9,16 +9,16 @@ in { imports = [ - ../modules/zsh - ../modules/sheldon - ../modules/tmux - ../modules/nvim - ../modules/git - ../modules/uv - ../modules/ghostty - ../modules/gcc - ../modules/gpg - ../modules/fcitx5 + ./modules/zsh + ./modules/sheldon + ./modules/tmux + ./modules/nvim + ./modules/git + ./modules/uv + ./modules/ghostty + ./modules/gcc + ./modules/gpg + ./modules/fcitx5 ]; # Home Manager needs a bit of information about you and the paths it should From 0beae2a53f36a120abf0cd561952810542d062f5 Mon Sep 17 00:00:00 2001 From: himkt Date: Fri, 30 Jan 2026 23:59:29 +0900 Subject: [PATCH 54/95] feat: add keyd configuration --- hosts/modules/keyd/default.nix | 41 ++++++++++++++++++++++++++++++++++ hosts/nixos/configuration.nix | 1 + 2 files changed, 42 insertions(+) create mode 100644 hosts/modules/keyd/default.nix diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix new file mode 100644 index 00000000..0dc9394f --- /dev/null +++ b/hosts/modules/keyd/default.nix @@ -0,0 +1,41 @@ +{ ... }: + +{ + services.keyd = { + enable = true; + keyboards.default = { + settings = { + main = { + leftmeta = "layer(mac)"; + rightmeta = "layer(mac)"; + }; + + "mac:C" = { + a = "a"; + c = "c"; + v = "v"; + x = "x"; + z = "z"; + s = "s"; + o = "o"; + n = "n"; + p = "p"; + f = "f"; + h = "h"; + t = "t"; + w = "w"; + r = "r"; + l = "l"; + b = "b"; + i = "i"; + u = "u"; + }; + + "mac:C-S" = { + z = "z"; + t = "t"; + }; + }; + }; + }; +} diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index a14f0632..56360fe5 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../modules/keyd ]; # Bootloader. From 23a6b59bd8750461cf92e47cc529bfb94f9ca3d1 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 31 Jan 2026 23:48:12 +0900 Subject: [PATCH 55/95] chore: modify keyd conf to imitate macOS --- hosts/modules/keyd/default.nix | 53 +++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix index 0dc9394f..10911c00 100644 --- a/hosts/modules/keyd/default.nix +++ b/hosts/modules/keyd/default.nix @@ -7,33 +7,40 @@ settings = { main = { leftmeta = "layer(mac)"; - rightmeta = "layer(mac)"; + rightalt = "rightmeta"; }; - "mac:C" = { - a = "a"; - c = "c"; - v = "v"; - x = "x"; - z = "z"; - s = "s"; - o = "o"; - n = "n"; - p = "p"; - f = "f"; - h = "h"; - t = "t"; - w = "w"; - r = "r"; - l = "l"; - b = "b"; - i = "i"; - u = "u"; + mac = { + a = "C-a"; + b = "C-b"; + c = "C-c"; + f = "C-f"; + h = "C-h"; + i = "C-i"; + j = "C-j"; + k = "C-k"; + l = "C-l"; + n = "C-n"; + o = "C-o"; + p = "C-p"; + q = "A-f4"; + r = "C-r"; + s = "C-s"; + t = "C-t"; + u = "C-u"; + v = "C-v"; + w = "C-w"; + x = "C-x"; + z = "C-z"; + enter = "C-enter"; + "`" = "C-`"; + "-" = "C--"; + equal = "C-equal"; }; - "mac:C-S" = { - z = "z"; - t = "t"; + "mac+shift" = { + "[" = "C-S-["; + "]" = "C-S-]"; }; }; }; From 790ae39ff990cada24a3bf5229ca900731c9f5ed Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 1 Feb 2026 16:01:12 +0900 Subject: [PATCH 56/95] chore: install file and tree --- home/nixos.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/nixos.nix b/home/nixos.nix index db2ff081..db9e542f 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -74,6 +74,7 @@ in # CLI bazelisk btop + file gh ghq google-cloud-sdk @@ -87,6 +88,7 @@ in postgresql python3 rustup + tree unstable.claude-code ]; From 3f5b5f78743b6ece311cbce851d7889305abbdcc Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 1 Feb 2026 20:56:41 +0900 Subject: [PATCH 57/95] feat: super+{arrow key} --- hosts/modules/keyd/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix index 10911c00..69b5fbc9 100644 --- a/hosts/modules/keyd/default.nix +++ b/hosts/modules/keyd/default.nix @@ -36,6 +36,10 @@ "`" = "C-`"; "-" = "C--"; equal = "C-equal"; + left = "home"; + right = "end"; + up = "C-home"; + down = "C-end"; }; "mac+shift" = { From 21953c1463663742ca9b4c45e3107d6055954ae7 Mon Sep 17 00:00:00 2001 From: himkt Date: Mon, 2 Feb 2026 00:33:53 +0900 Subject: [PATCH 58/95] fix: give up using fprintd with fixme comment --- hosts/nixos/configuration.nix | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 56360fe5..5ae684e6 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -91,14 +91,20 @@ # Enable CUPS to print documents. services.printing.enable = true; - # Fingerprint reader (Goodix 27c6:658c) - services.fprintd = { - enable = true; - tod = { - enable = true; - driver = pkgs.libfprint-2-tod1-goodix; - }; - }; + # FIXME(himkt); fprint not working so well in some cases. + # when finger print reader is not available, + # the experience is not so good as macOS (waiting until timeout). + # this happens when I use computer in clamshell mode and + # keyboard without fingerprint reader. + # + # Fingerprint reader + # services.fprintd = { + # enable = true; + # tod = { + # enable = true; + # driver = pkgs.libfprint-2-tod1-goodix; # note; Goodix 27c6:658c + # }; + # }; # Enable sound with pipewire. services.pulseaudio.enable = false; From 6b0fc12a0939af8e1d6fa279e9010b0c3ceba1b4 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 4 Feb 2026 22:00:10 +0900 Subject: [PATCH 59/95] chore: additional shortcuts --- hosts/modules/keyd/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix index 69b5fbc9..850e70e3 100644 --- a/hosts/modules/keyd/default.nix +++ b/hosts/modules/keyd/default.nix @@ -32,6 +32,16 @@ w = "C-w"; x = "C-x"; z = "C-z"; + "1" = "C-1"; + "2" = "C-2"; + "3" = "C-3"; + "4" = "C-4"; + "5" = "C-5"; + "6" = "C-6"; + "7" = "C-7"; + "8" = "C-8"; + "9" = "C-9"; + "0" = "C-0"; enter = "C-enter"; "`" = "C-`"; "-" = "C--"; @@ -46,6 +56,11 @@ "[" = "C-S-["; "]" = "C-S-]"; }; + + "mac+alt" = { + left = "C-A-left"; + right = "C-A-right"; + }; }; }; }; From e87c79d7684039c9d2c2d0251ff4127204ed2805 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 7 Feb 2026 14:59:10 +0900 Subject: [PATCH 60/95] feat: introduce pathfinder --- home/nixos.nix | 6 ++++++ home/pkgs/default.nix | 5 +++++ home/pkgs/pathfinder/default.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 home/pkgs/default.nix create mode 100644 home/pkgs/pathfinder/default.nix diff --git a/home/nixos.nix b/home/nixos.nix index db9e542f..2f42158b 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -5,6 +5,9 @@ let system = pkgs.system; config.allowUnfree = true; }; + himkt_pkgs = import ./pkgs { + inherit pkgs; + }; in { @@ -90,6 +93,9 @@ in rustup tree unstable.claude-code + + # my own softwares + himkt_pkgs.pathfinder ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage diff --git a/home/pkgs/default.nix b/home/pkgs/default.nix new file mode 100644 index 00000000..c7849c9a --- /dev/null +++ b/home/pkgs/default.nix @@ -0,0 +1,5 @@ +{ pkgs }: + +{ + pathfinder = pkgs.callPackage ./pathfinder { }; +} diff --git a/home/pkgs/pathfinder/default.nix b/home/pkgs/pathfinder/default.nix new file mode 100644 index 00000000..5a04418d --- /dev/null +++ b/home/pkgs/pathfinder/default.nix @@ -0,0 +1,31 @@ +{ + lib, + stdenv, + fetchurl, + autoPatchelfHook, +}: + +stdenv.mkDerivation rec { + pname = "pathfinder"; + version = "0.1.0"; + + src = fetchurl { + url = "https://github.com/himkt/pathfinder/releases/download/v${version}/pathfinder-x86_64-unknown-linux-gnu.tar.gz"; + sha256 = "18bpvh651i1nk4agkxqqaax22y0fa3nwpfhhanlprzprq08cdvdk"; + }; + + nativeBuildInputs = [ autoPatchelfHook ]; + + sourceRoot = "."; + + installPhase = '' + install -Dm755 pathfinder $out/bin/pathfinder + ''; + + meta = with lib; { + description = "MCP client for jumping to definitions using LSP server"; + homepage = "https://github.com/himkt/pathfinder"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + }; +} From 8550f6b3fe0299feb76188a24ff9aae27bafa995 Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 7 Feb 2026 17:18:50 +0900 Subject: [PATCH 61/95] chore: make update --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 15dd6954..75698fec 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1769580047, - "narHash": "sha256-tNqCP/+2+peAXXQ2V8RwsBkenlfWMERb+Uy6xmevyhM=", + "lastModified": 1770260404, + "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", "owner": "nix-community", "repo": "home-manager", - "rev": "366d78c2856de6ab3411c15c1cb4fb4c2bf5c826", + "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769598131, - "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", + "lastModified": 1770136044, + "narHash": "sha256-tlFqNG/uzz2++aAmn4v8J0vAkV3z7XngeIIB3rM3650=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", + "rev": "e576e3c9cf9bad747afcddd9e34f51d18c855b4e", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1769461804, - "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -68,11 +68,11 @@ ] }, "locked": { - "lastModified": 1769469829, - "narHash": "sha256-wFcr32ZqspCxk4+FvIxIL0AZktRs6DuF8oOsLt59YBU=", + "lastModified": 1770145881, + "narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c5eebd4eb2e3372fe12a8d70a248a6ee9dd02eff", + "rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c", "type": "github" }, "original": { From 0f19d4439c6d374d58be8040e3e47d088a24ce9f Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 7 Feb 2026 17:20:27 +0900 Subject: [PATCH 62/95] fix: pathfinder needs libgcc_s.so.1 --- home/pkgs/pathfinder/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/pkgs/pathfinder/default.nix b/home/pkgs/pathfinder/default.nix index 5a04418d..70fd25ef 100644 --- a/home/pkgs/pathfinder/default.nix +++ b/home/pkgs/pathfinder/default.nix @@ -15,6 +15,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = [ stdenv.cc.cc.lib ]; sourceRoot = "."; From 5076ff7729d82c17711c82ae6fcd177e81ae5b2e Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 7 Feb 2026 17:21:08 +0900 Subject: [PATCH 63/95] chore: super+/ to ctrl+/ --- hosts/modules/keyd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix index 850e70e3..50937c78 100644 --- a/hosts/modules/keyd/default.nix +++ b/hosts/modules/keyd/default.nix @@ -46,6 +46,7 @@ "`" = "C-`"; "-" = "C--"; equal = "C-equal"; + "/" = "C-/"; left = "home"; right = "end"; up = "C-home"; From 641dd915d1bddd44e98b4ab89359444624fb24df Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 7 Feb 2026 21:06:16 +0900 Subject: [PATCH 64/95] feat: use programs.mise --- home/modules/mise/default.nix | 31 +++++++++++++++++++++++++++++++ home/modules/zsh/files/zshrc | 3 --- home/nixos.nix | 3 +-- 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 home/modules/mise/default.nix diff --git a/home/modules/mise/default.nix b/home/modules/mise/default.nix new file mode 100644 index 00000000..e87ed678 --- /dev/null +++ b/home/modules/mise/default.nix @@ -0,0 +1,31 @@ +{ + config, + pkgs, + inputs, + ... +}: + +let + unstable = import inputs.nixpkgs-unstable { + system = pkgs.system; + }; +in + +{ + programs.mise = { + enable = true; + package = unstable.mise; + enableZshIntegration = true; + + globalConfig = { + tools = { + "aqua:anthropics/claude-code" = "latest"; + }; + + settings = { + experimental = true; + disable_backends = [ "asdf" ]; + }; + }; + }; +} diff --git a/home/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc index 528e6f00..c08164c9 100644 --- a/home/modules/zsh/files/zshrc +++ b/home/modules/zsh/files/zshrc @@ -155,9 +155,6 @@ if command -v fzf > /dev/null; then source <(fzf --zsh) fi -if command -v mise > /dev/null; then - eval "$(mise activate zsh)" -fi if command -v nvim > /dev/null; then alias vim=nvim diff --git a/home/nixos.nix b/home/nixos.nix index 2f42158b..c5c0eaf3 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -22,6 +22,7 @@ in ./modules/gcc ./modules/gpg ./modules/fcitx5 + ./modules/mise ]; # Home Manager needs a bit of information about you and the paths it should @@ -87,12 +88,10 @@ in kubectx kustomize k9s - mise postgresql python3 rustup tree - unstable.claude-code # my own softwares himkt_pkgs.pathfinder From 327401884407f59242751e777b5452f9d09448f1 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 10 Feb 2026 11:41:01 +0900 Subject: [PATCH 65/95] refactor: set all_compile entry in mise module --- home/modules/mise/default.nix | 2 +- home/nixos.nix | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/home/modules/mise/default.nix b/home/modules/mise/default.nix index e87ed678..283bd433 100644 --- a/home/modules/mise/default.nix +++ b/home/modules/mise/default.nix @@ -1,5 +1,4 @@ { - config, pkgs, inputs, ... @@ -23,6 +22,7 @@ in }; settings = { + all_compile = false; experimental = true; disable_backends = [ "asdf" ]; }; diff --git a/home/nixos.nix b/home/nixos.nix index c5c0eaf3..4b84683f 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -195,9 +195,6 @@ in # Enable Wayland for Electron apps (VSCode, Slack, etc.) # NIXOS_OZONE_WL = "1"; ELECTRON_OZONE_PLATFORM_HINT = "auto"; - - # Let mise download binary if possible - MISE_ALL_COMPILE = "0"; }; dconf.settings = { From 0d4b9369d3b882d0582c8e5f693292845c143ec4 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 10 Feb 2026 11:41:26 +0900 Subject: [PATCH 66/95] feat: create or attach tmux session on zsh launch --- home/modules/zsh/files/zshrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc index c08164c9..dd5409bc 100644 --- a/home/modules/zsh/files/zshrc +++ b/home/modules/zsh/files/zshrc @@ -2,6 +2,10 @@ # .zshrc - The zsh configuration # +if command -v tmux > /dev/null && [ -z "$TMUX" ] && [[ $- == *i* ]]; then + tmux attach-session 2>/dev/null || tmux new-session +fi + bindkey -e autoload -Uz compinit && compinit From 75618a15b9a6231aa96f2988ca895781da5335c6 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 10 Feb 2026 14:47:57 +0900 Subject: [PATCH 67/95] chore: disable tap-to-click --- home/nixos.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/nixos.nix b/home/nixos.nix index 4b84683f..66e62dd7 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -206,7 +206,7 @@ in xkb-options = [ "ctrl:nocaps" ]; }; "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = true; + tap-to-click = false; natural-scroll = true; speed = 0.0; }; From 0a1aba1c1722cabd81fca3a417a53147e16767b3 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 11 Feb 2026 13:37:26 +0900 Subject: [PATCH 68/95] feat: java21 --- home/modules/java/default.nix | 11 +++++++++++ home/nixos.nix | 1 + 2 files changed, 12 insertions(+) create mode 100644 home/modules/java/default.nix diff --git a/home/modules/java/default.nix b/home/modules/java/default.nix new file mode 100644 index 00000000..9de586f7 --- /dev/null +++ b/home/modules/java/default.nix @@ -0,0 +1,11 @@ +{ + pkgs, + ... +}: + +{ + programs.java = { + enable = true; + package = pkgs.jdk21; + }; +} diff --git a/home/nixos.nix b/home/nixos.nix index 66e62dd7..ede2eacd 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -20,6 +20,7 @@ in ./modules/uv ./modules/ghostty ./modules/gcc + ./modules/java ./modules/gpg ./modules/fcitx5 ./modules/mise From c7778528dde00c40a6e82769658c08c48a2c6fed Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 11 Feb 2026 13:43:17 +0900 Subject: [PATCH 69/95] chore: disable tmux on vscode --- home/modules/zsh/files/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc index dd5409bc..c42dee76 100644 --- a/home/modules/zsh/files/zshrc +++ b/home/modules/zsh/files/zshrc @@ -2,7 +2,7 @@ # .zshrc - The zsh configuration # -if command -v tmux > /dev/null && [ -z "$TMUX" ] && [[ $- == *i* ]]; then +if command -v tmux > /dev/null && [ -z "$TMUX" ] && [ -z "$VSCODE_INJECTION" ] && [[ $- == *i* ]]; then tmux attach-session 2>/dev/null || tmux new-session fi From 1e851474d685c90b5e6a92a72ef2fa4cbe964b99 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 11 Feb 2026 15:11:33 +0900 Subject: [PATCH 70/95] chore: stop using super as ctrl --- home/nixos.nix | 3 -- hosts/modules/keyd/default.nix | 51 ++-------------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/home/nixos.nix b/home/nixos.nix index ede2eacd..08ae0023 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -203,9 +203,6 @@ in experimental-features = [ "scale-monitor-framebuffer" ]; }; - "org/gnome/desktop/input-sources" = { - xkb-options = [ "ctrl:nocaps" ]; - }; "org/gnome/desktop/peripherals/touchpad" = { tap-to-click = false; natural-scroll = true; diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix index 50937c78..133fd8c5 100644 --- a/hosts/modules/keyd/default.nix +++ b/hosts/modules/keyd/default.nix @@ -6,62 +6,15 @@ keyboards.default = { settings = { main = { - leftmeta = "layer(mac)"; - rightalt = "rightmeta"; + capslock = "leftcontrol"; }; - - mac = { - a = "C-a"; - b = "C-b"; - c = "C-c"; - f = "C-f"; - h = "C-h"; - i = "C-i"; - j = "C-j"; - k = "C-k"; - l = "C-l"; - n = "C-n"; - o = "C-o"; - p = "C-p"; + control = { q = "A-f4"; - r = "C-r"; - s = "C-s"; - t = "C-t"; - u = "C-u"; - v = "C-v"; - w = "C-w"; - x = "C-x"; - z = "C-z"; - "1" = "C-1"; - "2" = "C-2"; - "3" = "C-3"; - "4" = "C-4"; - "5" = "C-5"; - "6" = "C-6"; - "7" = "C-7"; - "8" = "C-8"; - "9" = "C-9"; - "0" = "C-0"; - enter = "C-enter"; - "`" = "C-`"; - "-" = "C--"; - equal = "C-equal"; - "/" = "C-/"; left = "home"; right = "end"; up = "C-home"; down = "C-end"; }; - - "mac+shift" = { - "[" = "C-S-["; - "]" = "C-S-]"; - }; - - "mac+alt" = { - left = "C-A-left"; - right = "C-A-right"; - }; }; }; }; From 62c50f1cbf8749918c826f3018c51af29184efb1 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 15 Feb 2026 09:59:04 +0900 Subject: [PATCH 71/95] fix: pbcopy is not needed for Linux --- home/modules/tmux/files/tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/modules/tmux/files/tmux.conf b/home/modules/tmux/files/tmux.conf index 53545447..a2f0b7e0 100644 --- a/home/modules/tmux/files/tmux.conf +++ b/home/modules/tmux/files/tmux.conf @@ -12,8 +12,8 @@ set -g status-justify left # enable mouse mode setw -g mode-keys vi -bind-key -T copy-mode-vi y send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" -bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" +bind-key -T copy-mode-vi y send -X copy-selection-and-cancel +bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel # color set -g status-fg colour231 From 6fb33ed3ca88ee970982de3e4edee3f3e598b533 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 15 Feb 2026 09:59:27 +0900 Subject: [PATCH 72/95] feat: add status bar on top of tmux pane --- home/modules/tmux/files/tmux.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/modules/tmux/files/tmux.conf b/home/modules/tmux/files/tmux.conf index a2f0b7e0..b2e9ea76 100644 --- a/home/modules/tmux/files/tmux.conf +++ b/home/modules/tmux/files/tmux.conf @@ -19,6 +19,12 @@ bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel set -g status-fg colour231 set -g status-bg colour234 +# pane +set -g pane-border-style fg=colour240 +set -g pane-active-border-style fg=colour31 +set -g pane-border-status top +set -g pane-border-format "#{?pane_active,#[fg=colour31] [*] #T ,#[fg=colour240] #T }" + # window window_status_current_format1="#[fg=colour234,bg=colour31] #[fg=colour117,bg=colour31]" window_status_current_format2="#I #[fg=colour231]#W #[fg=colour31,bg=colour234,nobold]" From 471f31ecbbfe4ee806e4529c5a4f14bcf401f90b Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 09:28:56 +0900 Subject: [PATCH 73/95] chore: add node --- home/modules/mise/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/modules/mise/default.nix b/home/modules/mise/default.nix index 283bd433..e0478c5c 100644 --- a/home/modules/mise/default.nix +++ b/home/modules/mise/default.nix @@ -19,6 +19,7 @@ in globalConfig = { tools = { "aqua:anthropics/claude-code" = "latest"; + "core:node" = "latest"; }; settings = { From 257254682183b4ca019af2e1fec1ccdf05e093be Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:13:11 +0900 Subject: [PATCH 74/95] feat: move NixOS files to unified structure (Step 3) --- flake.lock | 87 +++++++++ home/nixos.nix | 235 +++++++++++++++++++++++++ home/pkgs/default.nix | 5 + home/pkgs/pathfinder/default.nix | 32 ++++ hosts/modules/keyd/default.nix | 21 +++ hosts/nixos/configuration.nix | 204 +++++++++++++++++++++ hosts/nixos/hardware-configuration.nix | 35 ++++ secrets/.sops.yaml | 12 ++ secrets/secrets.yaml | 30 ++++ 9 files changed, 661 insertions(+) create mode 100644 flake.lock create mode 100644 home/nixos.nix create mode 100644 home/pkgs/default.nix create mode 100644 home/pkgs/pathfinder/default.nix create mode 100644 hosts/modules/keyd/default.nix create mode 100644 hosts/nixos/configuration.nix create mode 100644 hosts/nixos/hardware-configuration.nix create mode 100644 secrets/.sops.yaml create mode 100644 secrets/secrets.yaml diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..75698fec --- /dev/null +++ b/flake.lock @@ -0,0 +1,87 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770260404, + "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1770136044, + "narHash": "sha256-tlFqNG/uzz2++aAmn4v8J0vAkV3z7XngeIIB3rM3650=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e576e3c9cf9bad747afcddd9e34f51d18c855b4e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770145881, + "narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home/nixos.nix b/home/nixos.nix new file mode 100644 index 00000000..08ae0023 --- /dev/null +++ b/home/nixos.nix @@ -0,0 +1,235 @@ +{ config, pkgs, inputs, ... }: + +let + unstable = import inputs.nixpkgs-unstable { + system = pkgs.system; + config.allowUnfree = true; + }; + himkt_pkgs = import ./pkgs { + inherit pkgs; + }; +in + +{ + imports = [ + ./modules/zsh + ./modules/sheldon + ./modules/tmux + ./modules/nvim + ./modules/git + ./modules/uv + ./modules/ghostty + ./modules/gcc + ./modules/java + ./modules/gpg + ./modules/fcitx5 + ./modules/mise + ]; + + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "himkt"; + home.homeDirectory = "/home/himkt"; + + # 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 should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "25.11"; # Please read the comment before changing. + + # XDG Base Directory specification + xdg = { + enable = true; + configHome = "${config.home.homeDirectory}/.config"; + cacheHome = "${config.home.homeDirectory}/.cache"; + dataHome = "${config.home.homeDirectory}/.local/share"; + }; + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + + # GUI + google-chrome + inkscape + insomnia + slack + unstable._1password-gui + unstable.vscode + + # CLI + bazelisk + btop + file + gh + ghq + google-cloud-sdk + gnumake + jq + kubectl + kubectx + kustomize + k9s + postgresql + python3 + rustup + tree + + # my own softwares + himkt_pkgs.pathfinder + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + + # Chrome with touchpad swipe gesture support + ".local/share/applications/google-chrome.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Google Chrome + GenericName=Web Browser + Comment=Access the Internet + Exec=google-chrome-stable --enable-features=TouchpadOverscrollHistoryNavigation %U + StartupNotify=true + Terminal=false + Icon=google-chrome + Type=Application + Categories=Network;WebBrowser; + MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; + ''; + + # Hide duplicate Chrome entry + ".local/share/applications/com.google.Chrome.desktop".text = '' + [Desktop Entry] + NoDisplay=true + ''; + + # Ghostty with fcitx5 workaround + # See: https://github.com/ghostty-org/ghostty/discussions/3628 + ".local/share/applications/com.mitchellh.ghostty.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Ghostty + GenericName=Terminal + Comment=A terminal emulator + Exec=env GTK_IM_MODULE= ghostty + StartupNotify=true + Terminal=false + Icon=com.mitchellh.ghostty + Type=Application + Categories=System;TerminalEmulator; + ''; + + # VSCode with Wayland support for better text rendering + ".local/share/applications/code.desktop".text = '' + [Desktop Entry] + Version=1.0 + Name=Visual Studio Code + GenericName=Text Editor + Comment=Code Editing. Redefined. + Exec=code --ozone-platform=wayland %F + StartupNotify=true + Terminal=false + Icon=vscode + Type=Application + Categories=Development;IDE;TextEditor; + MimeType=text/plain;inode/directory; + ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/himkt/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; + + # fcitx5 IME support + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + GLFW_IM_MODULE = "ibus"; # For some apps that use GLFW + + # Enable Wayland for Electron apps (VSCode, Slack, etc.) + # NIXOS_OZONE_WL = "1"; + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + }; + + dconf.settings = { + "org/gnome/mutter" = { + experimental-features = [ "scale-monitor-framebuffer" ]; + }; + + "org/gnome/desktop/peripherals/touchpad" = { + tap-to-click = false; + natural-scroll = true; + speed = 0.0; + }; + "org/gnome/desktop/peripherals/mouse" = { + speed = -1.0; + natural-scroll = true; + }; + "org/gnome/desktop/interface" = { + show-battery-percentage = true; + }; + }; + + fonts.fontconfig = { + enable = true; + defaultFonts = { + monospace = [ + "JetBrains Mono" + "Noto Sans Mono CJK JP" + ]; + sansSerif = [ "Noto Sans CJK JP" ]; + serif = [ "Noto Serif CJK JP" ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/home/pkgs/default.nix b/home/pkgs/default.nix new file mode 100644 index 00000000..c7849c9a --- /dev/null +++ b/home/pkgs/default.nix @@ -0,0 +1,5 @@ +{ pkgs }: + +{ + pathfinder = pkgs.callPackage ./pathfinder { }; +} diff --git a/home/pkgs/pathfinder/default.nix b/home/pkgs/pathfinder/default.nix new file mode 100644 index 00000000..70fd25ef --- /dev/null +++ b/home/pkgs/pathfinder/default.nix @@ -0,0 +1,32 @@ +{ + lib, + stdenv, + fetchurl, + autoPatchelfHook, +}: + +stdenv.mkDerivation rec { + pname = "pathfinder"; + version = "0.1.0"; + + src = fetchurl { + url = "https://github.com/himkt/pathfinder/releases/download/v${version}/pathfinder-x86_64-unknown-linux-gnu.tar.gz"; + sha256 = "18bpvh651i1nk4agkxqqaax22y0fa3nwpfhhanlprzprq08cdvdk"; + }; + + nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = [ stdenv.cc.cc.lib ]; + + sourceRoot = "."; + + installPhase = '' + install -Dm755 pathfinder $out/bin/pathfinder + ''; + + meta = with lib; { + description = "MCP client for jumping to definitions using LSP server"; + homepage = "https://github.com/himkt/pathfinder"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/hosts/modules/keyd/default.nix b/hosts/modules/keyd/default.nix new file mode 100644 index 00000000..133fd8c5 --- /dev/null +++ b/hosts/modules/keyd/default.nix @@ -0,0 +1,21 @@ +{ ... }: + +{ + services.keyd = { + enable = true; + keyboards.default = { + settings = { + main = { + capslock = "leftcontrol"; + }; + control = { + q = "A-f4"; + left = "home"; + right = "end"; + up = "C-home"; + down = "C-end"; + }; + }; + }; + }; +} diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix new file mode 100644 index 00000000..5ae684e6 --- /dev/null +++ b/hosts/nixos/configuration.nix @@ -0,0 +1,204 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../modules/keyd + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.luks.devices."luks-f47715a3-2a66-448c-9e93-7268419de718".device = "/dev/disk/by-uuid/f47715a3-2a66-448c-9e93-7268419de718"; + networking.hostName = "neptune"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # sops-nix secrets + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + age.keyFile = "/var/lib/sops-nix/key.txt"; + secrets.nextdns_id = {}; + secrets.dns_server_ipv4_0 = {}; + secrets.dns_server_ipv4_1 = {}; + secrets.dns_server_ipv6_0 = {}; + secrets.dns_server_ipv6_1 = {}; + templates."99-nextdns.conf" = { + content = '' + [Resolve] + DNS=${config.sops.placeholder.dns_server_ipv4_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv6_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv4_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + DNS=${config.sops.placeholder.dns_server_ipv6_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io + ''; + path = "/etc/systemd/resolved.conf.d/99-nextdns.conf"; + mode = "0644"; + restartUnits = [ "systemd-resolved.service" ]; + }; + }; + + # DNS over TLS with NextDNS + services.resolved = { + enable = true; + dnsovertls = "true"; + fallbackDns = []; + }; + networking.networkmanager.dns = "systemd-resolved"; + + # Set your time zone. + time.timeZone = "Asia/Tokyo"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "ja_JP.UTF-8"; + LC_IDENTIFICATION = "ja_JP.UTF-8"; + LC_MEASUREMENT = "ja_JP.UTF-8"; + LC_MONETARY = "ja_JP.UTF-8"; + LC_NAME = "ja_JP.UTF-8"; + LC_NUMERIC = "ja_JP.UTF-8"; + LC_PAPER = "ja_JP.UTF-8"; + LC_TELEPHONE = "ja_JP.UTF-8"; + LC_TIME = "ja_JP.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # FIXME(himkt); fprint not working so well in some cases. + # when finger print reader is not available, + # the experience is not so good as macOS (waiting until timeout). + # this happens when I use computer in clamshell mode and + # keyboard without fingerprint reader. + # + # Fingerprint reader + # services.fprintd = { + # enable = true; + # tod = { + # enable = true; + # driver = pkgs.libfprint-2-tod1-goodix; # note; Goodix 27c6:658c + # }; + # }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + + security.pam.services.gdm.enableGnomeKeyring = true; + services.gnome.gnome-keyring.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Docker + virtualisation.docker = { + enable = true; + enableOnBoot = false; + }; + systemd.sockets.docker.wantedBy = pkgs.lib.mkForce []; + + # Define a user account. Don't forget to set a password with 'passwd'. + users.users.himkt = { + isNormalUser = true; + description = "himkt"; + extraGroups = [ "networkmanager" "wheel" "docker" ]; + packages = with pkgs; [ + # thunderbird + ]; + shell = pkgs.zsh; + }; + + # Install firefox. + programs.firefox.enable = true; + programs.zsh.enable = true; + programs.nix-ld.enable = true; + + programs.nix-ld.libraries = with pkgs; [ + postgresql.lib + ]; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + fonts.packages = with pkgs; [ + jetbrains-mono + noto-fonts + noto-fonts-color-emoji + noto-fonts-cjk-sans + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + networking.firewall.trustedInterfaces = [ "docker0" "br-+" ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.11"; # Did you read the comment? + +} diff --git a/hosts/nixos/hardware-configuration.nix b/hosts/nixos/hardware-configuration.nix new file mode 100644 index 00000000..fed4eeae --- /dev/null +++ b/hosts/nixos/hardware-configuration.nix @@ -0,0 +1,35 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/luks-221ba240-258a-48a9-a316-e2de691f08c8"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-221ba240-258a-48a9-a316-e2de691f08c8".device = "/dev/disk/by-uuid/221ba240-258a-48a9-a316-e2de691f08c8"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FEFA-7EFC"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/mapper/luks-f47715a3-2a66-448c-9e93-7268419de718"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/secrets/.sops.yaml b/secrets/.sops.yaml new file mode 100644 index 00000000..1b9e7d49 --- /dev/null +++ b/secrets/.sops.yaml @@ -0,0 +1,12 @@ +keys: + # User key (from SSH key) + - &user_himkt age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 + # Host key (neptune) + - &host_neptune age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq + +creation_rules: + - path_regex: secrets\.yaml$ + key_groups: + - age: + - *user_himkt + - *host_neptune diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml new file mode 100644 index 00000000..0334e5f1 --- /dev/null +++ b/secrets/secrets.yaml @@ -0,0 +1,30 @@ +#ENC[AES256_GCM,data:HjKcqrXCAY2skTqI5aopYcMfREo9iKD82FsAXymsEmJ7MFeCBoVTFEVZTm7EEOCo8BWik45zNg==,iv:ELijRN47sRn0BqZKbj2LPh9hhuyH+v56CxrzDL/EYVo=,tag:Wgs0Pmt8UNCk9slnw5gd6w==,type:comment] +nextdns_id: ENC[AES256_GCM,data:8FIzB79/,iv:3t/0V4Chopg5SffE6P1JcB4PNGzLWtrsC3Gio03b5bk=,tag:o30xHwtx3sLMihwtuNUDoQ==,type:str] +dns_server_ipv4_0: ENC[AES256_GCM,data:PksLLL7TivYagw==,iv:/an1zGWRy2AhQBrC9AlJq2bwftHtMe4AQcenPu0GGqk=,tag:vgnre1OAbkcWPPdbpmSrwg==,type:str] +dns_server_ipv4_1: ENC[AES256_GCM,data:yXc1v7Ez978CQQ==,iv:77OcSVmXP4jfZ75xWJj9U+LoA18dBAg3Wrj+q3lz8LY=,tag:Sdfg31yhHNxuMUKRo2Ebgw==,type:str] +dns_server_ipv6_0: ENC[AES256_GCM,data:vrx6yabMcK7PslA=,iv:9wS55xgvcAOdLqYJ1ZDR5NWvBZEyZxgaWWB2EFQbtyg=,tag:tbHL/hAwmLV0Ndmu6Hra6w==,type:str] +dns_server_ipv6_1: ENC[AES256_GCM,data:IfMPanxqDSVlkDk=,iv:JHN2+Es6apKu0yJxwsPaSSJiSNRk/IASTJbo/iRAfjs=,tag:KJcJbPnvxwQTHUepDnAj9g==,type:str] +sops: + age: + - recipient: age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoMGVpSGtHVWdPR0lOTEtC + M0hpbEc3K1ZQS0FHM1FXTzFHWGM1UGZHdkRJCitSK1FsUENoL1hTYlJ6bm1FWklG + TGtHb2JodnZaU1V4QTgxOUVTbHFoTmMKLS0tIEdWNzNIOE1DbkZuU0IxLzU1Q2Rj + aG4yZXZhZmg2cDU2Ym1rdDBUQndabU0K7TUnP0dOb/yDTRPyMbjW5MeB9LHdn7E9 + RDg98FbWKER0Z9JHBRIAFvdvaWl62KEgAsLHb25Jd16/73CedM+W/Q== + -----END AGE ENCRYPTED FILE----- + - recipient: age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiTU8xd1ZPeDNNQVRnd01s + REQ3S2tWTXBiWVQ3eHl5V2FlZHkraEl3OVV3CndQczhKaHB4blRxRTdQMzJLZGRq + MTkvOWZkR2dtalE2UjhXQVplQkM4RE0KLS0tIG5wck0ySFFOTDVOWWU5b3NTWjdx + c3ZqVC9kYXRvR0lFR3hkWjZBQjk0dncKlf1biEZVu8Mx1Cc/NpgcG9S7CvJZWSw9 + Ds0YABw1dJWxfgOMuS+IA9UrDdd61u8SyBgEvM4TKVPfP/4l/5lSbA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-01-26T13:18:11Z" + mac: ENC[AES256_GCM,data:oGw0eA5hAd1yuTVZKDnZfqZUujb90kYlJSJbFlslN08+NjdooeKPgsAb5zwTak8quQE9mKpAhJzxvQDKBUkgSPmZMjX7xaQHhbhgoDXb4aGFWT19clvjQuonUT72fecZNxRhX2Cg+qorN1xZUnmOz001Pqh0+lPvWfJWiHsQJp4=,iv:i0bQ3ijVBcS1SeNrOiPeEWNz2MlIXqXJdEhnc0HvsKo=,tag:vlGSDnpdKgGIUsmTab6m9w==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 From 570d9de79ffd89ddf3762f6a756934af9e489b08 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:15:17 +0900 Subject: [PATCH 75/95] feat: create shared Home Manager modules (Step 4) --- home/modules/ghostty/default.nix | 16 ++ home/modules/ghostty/files/config | 26 +++ home/modules/git/default.nix | 38 ++++ home/modules/git/files/config | 43 ++++ home/modules/git/files/ignore | 22 ++ home/modules/nvim/default.nix | 32 +++ home/modules/nvim/files/init.vim | 45 +++++ .../nvim/files/snippet.d/cpp/argsort.snippets | 16 ++ .../files/snippet.d/cpp/bellman_ford.snippets | 28 +++ .../files/snippet.d/cpp/combination.snippets | 25 +++ .../nvim/files/snippet.d/cpp/gcd.snippets | 13 ++ .../nvim/files/snippet.d/cpp/lcm.snippets | 6 + .../nvim/files/snippet.d/cpp/mod.snippets | 79 ++++++++ .../cpp/prime_factorization.snippets | 24 +++ .../files/snippet.d/cpp/union_find.snippets | 48 +++++ .../nvim/files/snippet.d/cpp/utils.snippets | 30 +++ .../snippet.d/python/pylint_click.snippets | 3 + .../rust/prime_factorization.snippets | 25 +++ .../nvim/files/template.d/cc/template.cc | 15 ++ .../nvim/files/template.d/go/template.go | 13 ++ .../nvim/files/template.d/mklatex/Makefile | 15 ++ .../nvim/files/template.d/mklatex/double.tex | 26 +++ .../files/template.d/mklatex/reference.bib | 9 + .../nvim/files/template.d/mklatex/single.tex | 26 +++ .../nvim/files/template.d/mklatex/slide.tex | 27 +++ .../nvim/files/template.d/python/setup.cfg | 5 + .../nvim/files/template.d/rs/atcoder.rs | 51 +++++ home/modules/nvim/files/vimrc | 149 ++++++++++++++ home/modules/sheldon/default.nix | 16 ++ home/modules/sheldon/files/plugins.toml | 17 ++ home/modules/tmux/default.nix | 13 ++ home/modules/tmux/files/tmux.conf | 57 ++++++ home/modules/uv/default.nix | 16 ++ home/modules/uv/files/uv.toml | 1 + home/modules/zsh/default.nix | 19 ++ home/modules/zsh/files/zshrc | 189 ++++++++++++++++++ 36 files changed, 1183 insertions(+) create mode 100644 home/modules/ghostty/default.nix create mode 100644 home/modules/ghostty/files/config create mode 100644 home/modules/git/default.nix create mode 100644 home/modules/git/files/config create mode 100644 home/modules/git/files/ignore create mode 100644 home/modules/nvim/default.nix create mode 100644 home/modules/nvim/files/init.vim create mode 100644 home/modules/nvim/files/snippet.d/cpp/argsort.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/bellman_ford.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/combination.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/gcd.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/lcm.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/mod.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/prime_factorization.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/union_find.snippets create mode 100644 home/modules/nvim/files/snippet.d/cpp/utils.snippets create mode 100644 home/modules/nvim/files/snippet.d/python/pylint_click.snippets create mode 100644 home/modules/nvim/files/snippet.d/rust/prime_factorization.snippets create mode 100644 home/modules/nvim/files/template.d/cc/template.cc create mode 100644 home/modules/nvim/files/template.d/go/template.go create mode 100644 home/modules/nvim/files/template.d/mklatex/Makefile create mode 100644 home/modules/nvim/files/template.d/mklatex/double.tex create mode 100644 home/modules/nvim/files/template.d/mklatex/reference.bib create mode 100644 home/modules/nvim/files/template.d/mklatex/single.tex create mode 100644 home/modules/nvim/files/template.d/mklatex/slide.tex create mode 100644 home/modules/nvim/files/template.d/python/setup.cfg create mode 100644 home/modules/nvim/files/template.d/rs/atcoder.rs create mode 100644 home/modules/nvim/files/vimrc create mode 100644 home/modules/sheldon/default.nix create mode 100644 home/modules/sheldon/files/plugins.toml create mode 100644 home/modules/tmux/default.nix create mode 100644 home/modules/tmux/files/tmux.conf create mode 100644 home/modules/uv/default.nix create mode 100644 home/modules/uv/files/uv.toml create mode 100644 home/modules/zsh/default.nix create mode 100644 home/modules/zsh/files/zshrc diff --git a/home/modules/ghostty/default.nix b/home/modules/ghostty/default.nix new file mode 100644 index 00000000..bda478ce --- /dev/null +++ b/home/modules/ghostty/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + ghostty + ]; + + xdg.configFile."ghostty/config" = { + source = ./files/config; + }; +} diff --git a/home/modules/ghostty/files/config b/home/modules/ghostty/files/config new file mode 100644 index 00000000..8deb4418 --- /dev/null +++ b/home/modules/ghostty/files/config @@ -0,0 +1,26 @@ +# NOTE(himkt): 18446744073709551615 is usize limit + +# app config +macos-titlebar-style = native +window-theme = dark +window-padding-x = 5 +window-padding-y = 5 +window-padding-balance = true +scrollback-limit = 18446744073709551615 + +# color config +theme = GitHub Dark Default + +# background config +background-opacity = 0.95 +background-blur-radius = 20 + +# font config +font-family = Jetbrains Mono +font-family = Hiragino Kaku Gothic ProN +font-size = 11 +font-feature = -calt, -liga, -dlig +keybind = shift+enter=text:\n +keybind = super+t=new_tab + +clipboard-paste-protection = false diff --git a/home/modules/git/default.nix b/home/modules/git/default.nix new file mode 100644 index 00000000..b0c7ec4e --- /dev/null +++ b/home/modules/git/default.nix @@ -0,0 +1,38 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.git = { + enable = true; + lfs.enable = true; + + settings = { + user = { + name = "himkt"; + email = "himkt@klis.tsukuba.ac.jp"; + }; + credential."https://github.com" = { + helper = "!gh auth git-credential"; + }; + }; + + # Load additional config from dotfiles + includes = [ + { path = "~/.config/git/config-extra"; } + ]; + }; + + # Additional git config (aliases, format, etc.) + xdg.configFile."git/config-extra" = { + source = ./files/config; + }; + + # Global gitignore + xdg.configFile."git/ignore" = { + source = ./files/ignore; + }; +} diff --git a/home/modules/git/files/config b/home/modules/git/files/config new file mode 100644 index 00000000..7bb707b5 --- /dev/null +++ b/home/modules/git/files/config @@ -0,0 +1,43 @@ +[user] + email = himkt@klis.tsukuba.ac.jp + name = himkt + +[pull] + rebase = false + +[alias] + remove-merged = "!f() { \ + if [ -n \"$1\" ]; then \ + BRANCH=\"$1\"; \ + else \ + BRANCH=$(git branch | awk '{print $NF}' | fzf --prompt '(base branch) > '); \ + fi; \ + if [ -z \"$BRANCH\" ]; then \ + echo \"Select valid branch\"; \ + exit 1; \ + fi; \ + echo \"Log: base branch: $BRANCH\"; \ + git branch --merged \"$BRANCH\" | grep -v \"$BRANCH\" | xargs -r git branch -d; \ + }; f" + graph = log --graph --date-order --pretty=format:'<%h> %ad %Cgreen%d%Creset %s %Cblue[%an]%Creset' --all --date=short + +[format] + pretty = format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an] + date = iso +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[column] + ui = auto +[branch] + sort = -committerdate +[tag] + sort = version:refname +[init] + defaultBranch = main +[diff] + colorMoved = plain + mnemonicPrefix = true + renames = true diff --git a/home/modules/git/files/ignore b/home/modules/git/files/ignore new file mode 100644 index 00000000..27749c83 --- /dev/null +++ b/home/modules/git/files/ignore @@ -0,0 +1,22 @@ +# editor +.vim +.vscode + +# ruby +.rakeTasks +.rubocop.yml + +# python +.venv +*.egg-info +.mypy_cache + +# jetbrains +.idea + +.DS_Store + +.apple-silicon-platform + +**/.claude +**/CLAUDE.md diff --git a/home/modules/nvim/default.nix b/home/modules/nvim/default.nix new file mode 100644 index 00000000..79b224a8 --- /dev/null +++ b/home/modules/nvim/default.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + + plugins = with pkgs.vimPlugins; [ + vim-easymotion + tabular + fzf-vim + vim-indent-guides + vim-anzu + vim-airline + vim-polyglot + ]; + }; + + xdg.configFile."nvim/init.vim" = { + source = ./files/init.vim; + }; + + xdg.configFile."nvim/vimrc" = { + source = ./files/vimrc; + }; +} diff --git a/home/modules/nvim/files/init.vim b/home/modules/nvim/files/init.vim new file mode 100644 index 00000000..c59030f5 --- /dev/null +++ b/home/modules/nvim/files/init.vim @@ -0,0 +1,45 @@ +" vim: ft=vim +" +" --------------------- +" +" NeoVim configuration +" +" @author = 'himkt' +" +" --------------------- +" + +"" disable mouse +set mouse= + +"" use python3 installed globally +let g:python3_host_prog=$PYTHONSYSTEMPATH + +"" load basic vim configuration +source $XDG_CONFIG_HOME/nvim/vimrc + +" material.vim +if (has('nvim')) + let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 +endif + +if (has('termguicolors')) + set termguicolors +endif + +hi Normal guibg=NONE ctermbg=NONE +hi Visual guibg=gray + +" vim-easymotion +let g:EasyMotion_do_mapping = 0 +nmap // (easymotion-sn) + +" fzf +nnoremap :call fzf#vim#files('', fzf#vim#with_preview('right')) +nnoremap :Commands + +" tabular +vnoremap tr : Tabularize / + +" vim-indent-guide +let g:indent_guides_enable_on_vim_startup = 1 diff --git a/home/modules/nvim/files/snippet.d/cpp/argsort.snippets b/home/modules/nvim/files/snippet.d/cpp/argsort.snippets new file mode 100644 index 00000000..a8071f9a --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/argsort.snippets @@ -0,0 +1,16 @@ +snippet argsort +template +vector argsort(vector input) { + size_t seq_len = input.size(); + + vector> seq(seq_len); + for (int i=0; i result(seq_len); + for (int i=0; i es; + vector d; + void run(int); + int INF = 1001001001; +}; + +void BellmanFord::run(int s) { + for (int i=0; i d[e.from] + e.cost) { + d[e.to] = d[e.from] + e.cost; + update = true; + } + } + if (!update) break; + } +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/combination.snippets b/home/modules/nvim/files/snippet.d/cpp/combination.snippets new file mode 100644 index 00000000..5b32c3e6 --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/combination.snippets @@ -0,0 +1,25 @@ +snippet combination +const int MAX = 2000000; +const int MOD = 1000000000 + 7; + +long long fac[MAX], finv[MAX], inv[MAX]; + + +void COMinit() { + fac[0] = fac[1] = 1; + finv[0] = finv[1] = 1; + inv[1] = 1; + for (int i = 2; i < MAX; i++){ + fac[i] = fac[i - 1] * i % MOD; + inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; + finv[i] = finv[i - 1] * inv[i] % MOD; + } +} + + +long long COM(int n, int k){ + if (n < k) return 0; + if (n < 0 || k < 0) return 0; + return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/gcd.snippets b/home/modules/nvim/files/snippet.d/cpp/gcd.snippets new file mode 100644 index 00000000..b28a4854 --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/gcd.snippets @@ -0,0 +1,13 @@ +snippet gcd +template +integer _gcd(integer a, integer b) { + if (b != 0) return _gcd(b, a%b); + else return a; +} + +template +integer gcd (integer a, integer b) { + if (a > b) return _gcd(a, b); + return _gcd(b, a); +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/lcm.snippets b/home/modules/nvim/files/snippet.d/cpp/lcm.snippets new file mode 100644 index 00000000..12fa7c7e --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/lcm.snippets @@ -0,0 +1,6 @@ +snippet lcm +template +integer lcm(integer a, integer b) { + return (a * b) / gcd(a, b); +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/mod.snippets b/home/modules/nvim/files/snippet.d/cpp/mod.snippets new file mode 100644 index 00000000..d5fa7846 --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/mod.snippets @@ -0,0 +1,79 @@ +# https://github.com/atcoder-live/library/blob/master/mint.cpp + +snippet mod +const int mod = 1e9+7; + + +struct mint { + long long x; // typedef long long long long; + mint(long long x=0):x((x%mod+mod)%mod){} + mint operator-() const { return mint(-x);} + mint& operator+=(const mint a) { + if ((x += a.x) >= mod) x -= mod; + return *this; + } + mint& operator-=(const mint a) { + if ((x += mod-a.x) >= mod) x -= mod; + return *this; + } + mint& operator*=(const mint a) { + (x *= a.x) %= mod; + return *this; + } + mint operator+(const mint a) const { + mint res(*this); + return res+=a; + } + mint operator-(const mint a) const { + mint res(*this); + return res-=a; + } + mint operator*(const mint a) const { + mint res(*this); + return res*=a; + } + mint pow(long long t) const { + if (!t) return 1; + mint a = pow(t>>1); + a *= a; + if (t&1) a *= *this; + return a; + } + + // for prime mod + mint inv() const { + return pow(mod-2); + } + mint& operator/=(const mint a) { + return (*this) *= a.inv(); + } + mint operator/(const mint a) const { + mint res(*this); + return res/=a; + } +}; + + +mint modpow(long long N, long long P) { + if (P == 0) return 1; + + if (P % 2 == 0) { + mint t = modpow(N, P / 2); + return t * t; + } + + mint t = modpow(N, P - 1); + t *= N; + return t; +} + + +mint choose(int n, int a) { + mint x = 1, y = 1; + for (int i=0; i> factor_result; +factor_result factor(long long base) { + vector> fs; + + for (long long i=2; i*i <= base; i++) { + if (base % i == 0) { + long long cnt = 0; + + while (base % i == 0) { + base /= i; + cnt++; + } + + fs.emplace_back(i, cnt); + } + } + if (base > 1) { + fs.emplace_back(base, 1); + } + + return fs; +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/union_find.snippets b/home/modules/nvim/files/snippet.d/cpp/union_find.snippets new file mode 100644 index 00000000..f23792b9 --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/union_find.snippets @@ -0,0 +1,48 @@ +snippet union_find +class UnionFind { + public: + // contain parent node_index + // if the node_id is root, -size(group) + vector parent; + long long root(int); + long long size(int); + + // judging functions + bool join(int, int); + bool same(int, int); + + UnionFind(int x) { + parent = vector(x, -1); + }; + +}; + + +long long UnionFind::root(int node_id) { + if (parent[node_id] < 0) return node_id; + else return parent[node_id] = UnionFind::root(parent[node_id]); +} + + +long long UnionFind::size(int node_id) { + return -parent[UnionFind::root(node_id)]; +} + + +bool UnionFind::same(int source_node_id, int target_node_id) { + return UnionFind::root(source_node_id) == UnionFind::root(target_node_id); +} + + +bool UnionFind::join(int source_node_id, int target_node_id) { + int a = UnionFind::root(source_node_id); + int b = UnionFind::root(target_node_id); + if (a == b) return false; + + if (UnionFind::size(a) < UnionFind::size(b)) swap(a, b); + parent[a] += parent[b]; + parent[b] = a; + + return true; +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/cpp/utils.snippets b/home/modules/nvim/files/snippet.d/cpp/utils.snippets new file mode 100644 index 00000000..bc9593b6 --- /dev/null +++ b/home/modules/nvim/files/snippet.d/cpp/utils.snippets @@ -0,0 +1,30 @@ +snippet utils +namespace utils{ + template void print(vector> mat) { + rep (i, mat.size()) { + rep (j, mat[0].size()) cout << mat[i][j] << ' '; + cout << endl; + } + } + + template void print(vector v) { + rep (i, v.size()) cout << v[i] << ' '; + cout << endl; + } + + template pair shape(vector> mat) { + int d1, d2; + + d1 = mat.size(); + if (d1 > 0) d2 = mat[0].size(); + else int d2 = 0; + cout << "(" << d1 << ", " << d2 << ")" << endl; + return make_pair(0, 0); + } + + template vector> empty(int n, int m) { + vector> mat(n, vector(m)); + return mat; + } +} +endsnippet diff --git a/home/modules/nvim/files/snippet.d/python/pylint_click.snippets b/home/modules/nvim/files/snippet.d/python/pylint_click.snippets new file mode 100644 index 00000000..42dcf0af --- /dev/null +++ b/home/modules/nvim/files/snippet.d/python/pylint_click.snippets @@ -0,0 +1,3 @@ +snippet pylint_click +# pylint: disable=no-value-for-parameter +endsnippet diff --git a/home/modules/nvim/files/snippet.d/rust/prime_factorization.snippets b/home/modules/nvim/files/snippet.d/rust/prime_factorization.snippets new file mode 100644 index 00000000..fffa103c --- /dev/null +++ b/home/modules/nvim/files/snippet.d/rust/prime_factorization.snippets @@ -0,0 +1,25 @@ +snippet factorize +fn factorize(mut base: i64) -> Vec<(i64, i64)> { + let mut fs = Vec::<(i64, i64)>::new(); + let mut i: i64 = 2; + + while i*i <= base { + if base % i == 0 { + let mut cnt: i64 = 0; + + while base % i == 0 { + base /= i; + cnt += 1; + } + fs.push((i, cnt)); + } + i += 1; + } + + if base > 1 { + fs.push((base, 1)); + } + + return fs; +} +endsnippet diff --git a/home/modules/nvim/files/template.d/cc/template.cc b/home/modules/nvim/files/template.d/cc/template.cc new file mode 100644 index 00000000..bef78f35 --- /dev/null +++ b/home/modules/nvim/files/template.d/cc/template.cc @@ -0,0 +1,15 @@ +# include +# include +# include +# include +# include +# include +# include + + +using namespace std; + + +int main() { + return 0; +} diff --git a/home/modules/nvim/files/template.d/go/template.go b/home/modules/nvim/files/template.d/go/template.go new file mode 100644 index 00000000..8cbf123d --- /dev/null +++ b/home/modules/nvim/files/template.d/go/template.go @@ -0,0 +1,13 @@ +package main + + +import ( + // "fmt" + // "strings" + // "strconv" +) + + +func main () { +} + diff --git a/home/modules/nvim/files/template.d/mklatex/Makefile b/home/modules/nvim/files/template.d/mklatex/Makefile new file mode 100644 index 00000000..0e95643f --- /dev/null +++ b/home/modules/nvim/files/template.d/mklatex/Makefile @@ -0,0 +1,15 @@ +all: + xelatex main + pbibtex main + xelatex main + xelatex main +clean: + rm -f main.aux + rm -f main.bbl + rm -f main.blg + rm -f main.dvi + rm -f main.log + rm -f main.nav + rm -f main.out + rm -f main.snm + rm -f main.toc diff --git a/home/modules/nvim/files/template.d/mklatex/double.tex b/home/modules/nvim/files/template.d/mklatex/double.tex new file mode 100644 index 00000000..b65998e7 --- /dev/null +++ b/home/modules/nvim/files/template.d/mklatex/double.tex @@ -0,0 +1,26 @@ +\documentclass[twocolumn]{article} +\usepackage[top=10truemm,bottom=10truemm,left=10truemm,right=10truemm]{geometry} +\usepackage{algorithm} +\usepackage{algpseudocode} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsthm} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{url} +\usepackage{bm} +\usepackage{xeCJK} +\setmainfont{Helvetica} +\setCJKmainfont{YuMincho} +\title{anonymous submission} +\author{anonymous author} +\date{\today} + +\begin{document} +\maketitle +\section{introduction} +hello, world\cite{greenwade93}. + +\bibliographystyle{plain} +\bibliography{reference} +\end{document} diff --git a/home/modules/nvim/files/template.d/mklatex/reference.bib b/home/modules/nvim/files/template.d/mklatex/reference.bib new file mode 100644 index 00000000..108efbe9 --- /dev/null +++ b/home/modules/nvim/files/template.d/mklatex/reference.bib @@ -0,0 +1,9 @@ +@article{greenwade93, + author = "George D. Greenwade", + title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})", + year = "1993", + journal = "TUGBoat", + volume = "14", + number = "3", + pages = "342--351" +} diff --git a/home/modules/nvim/files/template.d/mklatex/single.tex b/home/modules/nvim/files/template.d/mklatex/single.tex new file mode 100644 index 00000000..ab389fac --- /dev/null +++ b/home/modules/nvim/files/template.d/mklatex/single.tex @@ -0,0 +1,26 @@ +\documentclass{article} +\usepackage{algorithm} +\usepackage{algpseudocode} +\usepackage{geometry} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsthm} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{url} +\usepackage{bm} +\usepackage{xeCJK} +\setmainfont{Helvetica} +\setCJKmainfont{YuMincho} +\title{anonymous submission} +\author{anonymous author} +\date{\today} + +\begin{document} +\maketitle +\section{introduction} +hello, world\cite{greenwade93}. + +\bibliographystyle{plain} +\bibliography{reference} +\end{document} diff --git a/home/modules/nvim/files/template.d/mklatex/slide.tex b/home/modules/nvim/files/template.d/mklatex/slide.tex new file mode 100644 index 00000000..3e90ff0f --- /dev/null +++ b/home/modules/nvim/files/template.d/mklatex/slide.tex @@ -0,0 +1,27 @@ +\documentclass{beamer} +\usepackage{xeCJK} +\usepackage{algorithm} +\usepackage{algpseudocode} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsthm} +\usepackage{bm} +\setmainfont{Helvetica} +\setCJKmainfont{YuMincho} +\usetheme{metropolis} +\date{\today} +\title{anonymous submission} +\author{anonymous author} +\institute{anonymous university} +\begin{document} + \maketitle + \section{First Section} + \begin{frame}{First Frame} + Hello, world!\cite{greenwade93} + \end{frame} + + \begin{frame}{references} + \bibliographystyle{plain} + \bibliography{reference} + \end{frame} +\end{document} diff --git a/home/modules/nvim/files/template.d/python/setup.cfg b/home/modules/nvim/files/template.d/python/setup.cfg new file mode 100644 index 00000000..715e3b4a --- /dev/null +++ b/home/modules/nvim/files/template.d/python/setup.cfg @@ -0,0 +1,5 @@ +[isort] +force_single_line=true + +[flake8] +max-line-length=119 diff --git a/home/modules/nvim/files/template.d/rs/atcoder.rs b/home/modules/nvim/files/template.d/rs/atcoder.rs new file mode 100644 index 00000000..36adbf22 --- /dev/null +++ b/home/modules/nvim/files/template.d/rs/atcoder.rs @@ -0,0 +1,51 @@ +#[allow(clippy::needless_range_loop)] +fn main() { + let mut scanner = Scanner::new(); +} + +use std::io::Write; +pub struct Scanner { + buffer: std::collections::VecDeque, + buf: String, +} +#[allow(clippy::new_without_default)] +impl Scanner { + pub fn new() -> Self { + Scanner { + buffer: std::collections::VecDeque::new(), + buf: String::new(), + } + } + pub fn cin(&mut self) -> T { + if !self.buffer.is_empty() { + return self.buffer.pop_front().unwrap().parse::().ok().unwrap(); + } + self.buf.truncate(0); + std::io::stdin().read_line(&mut self.buf).ok(); + self.buf + .to_owned() + .split_whitespace() + .for_each(|x| self.buffer.push_back(String::from(x))); + self.buffer.pop_front().unwrap().parse::().ok().unwrap() + } + pub fn vec(&mut self, n: usize) -> Vec { + (0..n).map(|_| self.cin()).collect() + } + pub fn flush(&self) { + std::io::stdout().flush().unwrap(); + } +} + +#[macro_export] +macro_rules! debug { + () => { + #[cfg(debug_assertions)] + println!(); + }; + ($($arg:tt)*) => { + #[cfg(debug_assertions)] + print!("[debug] "); + #[cfg(debug_assertions)] + println!($($arg)*); + }; +} diff --git a/home/modules/nvim/files/vimrc b/home/modules/nvim/files/vimrc new file mode 100644 index 00000000..61dda849 --- /dev/null +++ b/home/modules/nvim/files/vimrc @@ -0,0 +1,149 @@ +" +" --------------------- +" +" Vim configuration +" +" @author = 'himkt' +" +" --------------------- +" + +if &compatible + set nocompatible +endif + +filetype plugin indent on +syntax on +colorscheme default + +set background=dark + +if exists('$SHELL') + set shell=$SHELL +else + set shell=/bin/sh +endif + +" open with the cursor in previous session +augroup vimrcEx + au BufRead * if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | endif +augroup END + +"" File encodings +set encoding=utf-8 +set fileencodings=utf-8,iso-2022-jp,euc-jp,ascii +set fileformats=unix,mac,dos + +"" Open a new buffer without saving +set hidden + +"" Show vim title for a window +set title + +set number +set nuw=5 + +"" Show command in status line +set showcmd + +"" Japanese input (TODO check whether if I can remove them) +set ttimeout +set ttimeoutlen=50 + +"" Indent and tab +set expandtab +set nowrap +set autoindent +set smartindent +set smarttab + +"" shift and tab stop +set tabstop=2 +set shiftwidth=2 +autocmd FileType python setl tabstop=8 shiftwidth=4 softtabstop=4 +autocmd FileType cpp setl tabstop=4 shiftwidth=4 softtabstop=4 +autocmd FileType sql setl tabstop=4 shiftwidth=4 softtabstop=4 + +"" Do not create backup and swap files +set noswapfile +set nobackup + +"" Enable incremental and hilighting search +set hlsearch +set incsearch +set shortmess-=S + +"" Hilight a matched bracket +set showmatch +set matchtime=1 + +set backspace=indent,eol,start + +"" colorize pane partition +set fillchars+=vert:│ +hi VertSplit ctermbg=None ctermfg=Blue + +"" Popup color +hi Pmenu ctermbg=235 ctermfg=228 +hi PmenuSel ctermbg=253 ctermfg=232 + +"" Cursor +hi CursorLine gui=underline cterm=underline ctermfg=NONE guifg=NONE + +"" If vertical split -> open a new pane to right, +"" and if horizontal split -> open a new pane to below +set splitbelow +set splitright + +"" Folding config +set foldmethod=marker +set foldlevel=0 + +map ; : +nnoremap x "_x +vnoremap x "_x + +" indent +inoremap +inoremap + +" tab shortcuts +nnoremap : tabnew +nnoremap gT +nnoremap gt + +" window splitting +nnoremap vp : vs +nnoremap sp : sp + +" folding configuration +nnoremap zx :set foldlevel=99 +nnoremap zc :set foldlevel=0 + +" completion configuration +set completeopt=menuone,longest,preview +autocmd CompleteDone * pclose +autocmd FileType * setlocal omnifunc=syntaxcomplete#Complete + + +" tag hilighting +autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|IMPORTANT\)') +autocmd Syntax * call matchadd('Todo', '\W\zs\(BUG\|HACK\|NOTE\|INFO\|IDEA\)') + +" executing script in vim +autocmd FileType cpp nnoremap :sp :exec ':term clang++ --std=c++11 % && ./a.out && rm a.out' +autocmd FileType go nnoremap :sp :exec ':term go run %' +autocmd FileType ruby nnoremap :sp :exec ':term ruby %' +autocmd FileType python nnoremap :sp :exec ':term if [ -e ./.venv ] ; then; poetry run python %; else python3 %; fi' +autocmd FileType rust nnoremap :sp :exec ':term cargo run --bin ' . expand('%:t:r') + +" templates +autocmd BufNewFile *.cc 0r $HOME/dotfiles/home/modules/nvim/files/template.d/cc/template.cc +autocmd BufNewFile *.go 0r $HOME/dotfiles/home/modules/nvim/files/template.d/go/template.go +autocmd BufNewFile setup.cfg 0r $HOME/dotfiles/home/modules/nvim/files/template.d/python/setup.cfg + +if $ATC != "" + autocmd BufNewFile *.rs 0r $HOME/dotfiles/home/modules/nvim/files/template.d/rs/atcoder.rs + autocmd FileType rust nnoremap :sp :exec ':term rustc % && ./' . expand('%:t:r') . ' && rm ' . expand('%:t:r') +endif diff --git a/home/modules/sheldon/default.nix b/home/modules/sheldon/default.nix new file mode 100644 index 00000000..6ac3e11d --- /dev/null +++ b/home/modules/sheldon/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + sheldon + ]; + + xdg.configFile."sheldon/plugins.toml" = { + source = ./files/plugins.toml; + }; +} diff --git a/home/modules/sheldon/files/plugins.toml b/home/modules/sheldon/files/plugins.toml new file mode 100644 index 00000000..d501f3aa --- /dev/null +++ b/home/modules/sheldon/files/plugins.toml @@ -0,0 +1,17 @@ +shell = "zsh" + +[templates] +macos_source = ''' +if [[ "$OSTYPE" = darwin* ]]; then + {{ hooks?.pre | nl }}{% for file in files %}source "{{ file }}" + {% endfor %}{{ hooks?.post | nl }} +fi +''' + +[plugins.zsh-autosuggestions] +github = 'zsh-users/zsh-autosuggestions' +apply = ['source'] + +[plugins.zsh-syntax-highlighting] +github = 'zsh-users/zsh-syntax-highlighting' +apply = ['source'] diff --git a/home/modules/tmux/default.nix b/home/modules/tmux/default.nix new file mode 100644 index 00000000..b0081458 --- /dev/null +++ b/home/modules/tmux/default.nix @@ -0,0 +1,13 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.tmux = { + enable = true; + extraConfig = builtins.readFile ./files/tmux.conf; + }; +} diff --git a/home/modules/tmux/files/tmux.conf b/home/modules/tmux/files/tmux.conf new file mode 100644 index 00000000..b2e9ea76 --- /dev/null +++ b/home/modules/tmux/files/tmux.conf @@ -0,0 +1,57 @@ +# +# tmux.conf +# +# @author = himkt + +unbind C-b + +# default config +set -g status-interval 2 +set -g default-terminal "screen-256color" +set -g status-justify left + +# enable mouse mode +setw -g mode-keys vi +bind-key -T copy-mode-vi y send -X copy-selection-and-cancel +bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel + +# color +set -g status-fg colour231 +set -g status-bg colour234 + +# pane +set -g pane-border-style fg=colour240 +set -g pane-active-border-style fg=colour31 +set -g pane-border-status top +set -g pane-border-format "#{?pane_active,#[fg=colour31] [*] #T ,#[fg=colour240] #T }" + +# window +window_status_current_format1="#[fg=colour234,bg=colour31] #[fg=colour117,bg=colour31]" +window_status_current_format2="#I #[fg=colour231]#W #[fg=colour31,bg=colour234,nobold]" +window_status_current_format=$window_status_current_format1' '$window_status_current_format2 +set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240] #[default]#W" +set -g window-status-current-format $window_status_current_format + +# take over current directory path +bind-key '"' split-window -c "#{pane_current_path}" +bind-key % split-window -h -c "#{pane_current_path}" +bind-key c new-window -c "#{pane_current_path}" + +# status bar +set -g status-left-length 20 +status_left1="#{?client_prefix,#[fg=colour254]#[bg=colour31],#[fg=colour16]#[bg=colour254]}" +status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}" +set -qg status-left $status_left1' '$status_left2 +set -qg status-right '%H:%M #[fg=colour16,bg=colour254]' + +# tmux config +set -g escape-time 10 +set -g history-limit 50000 + +bind ^h select-layout even-horizontal +bind ^v select-layout even-vertical + +# NOTE Commands `search-xxx-incremental` is new feature, it counldn't use in some environments +# For old tmux, please comment out following statement +bind-key -T copy-mode-vi / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\"" +bind-key -T copy-mode-vi ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\"" diff --git a/home/modules/uv/default.nix b/home/modules/uv/default.nix new file mode 100644 index 00000000..25e601ca --- /dev/null +++ b/home/modules/uv/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + home.packages = with pkgs; [ + uv + ]; + + xdg.configFile."uv/uv.toml" = { + source = ./files/uv.toml; + }; +} diff --git a/home/modules/uv/files/uv.toml b/home/modules/uv/files/uv.toml new file mode 100644 index 00000000..39128ea0 --- /dev/null +++ b/home/modules/uv/files/uv.toml @@ -0,0 +1 @@ +python-preference = "managed" diff --git a/home/modules/zsh/default.nix b/home/modules/zsh/default.nix new file mode 100644 index 00000000..644820b1 --- /dev/null +++ b/home/modules/zsh/default.nix @@ -0,0 +1,19 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.zsh = { + enable = true; + initContent = builtins.readFile ./files/zshrc; + }; + + # Additional packages needed by zshrc + home.packages = with pkgs; [ + fzf + zoxide + ]; +} diff --git a/home/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc new file mode 100644 index 00000000..c42dee76 --- /dev/null +++ b/home/modules/zsh/files/zshrc @@ -0,0 +1,189 @@ +# +# .zshrc - The zsh configuration +# + +if command -v tmux > /dev/null && [ -z "$TMUX" ] && [ -z "$VSCODE_INJECTION" ] && [[ $- == *i* ]]; then + tmux attach-session 2>/dev/null || tmux new-session +fi + +bindkey -e + +autoload -Uz compinit && compinit +autoload -Uz colors && colors +autoload -Uz zmv && alias zmv='noglob zmv -W' + +setopt auto_cd # cd without cd +setopt extended_history # include timestamp and duration to the history. +setopt share_history # persist history to the file. +setopt magic_equal_subst # expand filename for unquoted arguments. +setopt mark_dirs # insert '/' when directory is expanded via globbing. +setopt no_beep # disable beep in ZLE. +setopt prompt_subst # enable substitution in prompt (needed if we want to show information in PROMPT). + +zstyle ':completion:*:default' menu select=2 # enable menu in completion. + +function ls () { + command ls --color $@ +} + +function date () { + case ${OSTYPE} in + darwin*) + command gdate $@ ;; + linux*) + command date $@ ;; + esac +} + +function retcode () { + echo $? +} + +function git-home () { + cd `git rev-parse --show-toplevel` +} + +# tier1 +export EDITOR=vim +export FZF_DEFAULT_OPTS='--height 50% --reverse --border' +export GOPATH=$HOME/go +export GHQ_ROOT=$HOME/work +export HISTFILE=$HOME/.zsh-history +export HISTSIZE=100000 +export PYTHONDONTWRITEBYTECODE=1 +export SAVEHIST=100000 +export TERM=xterm-256color +export XDG_CONFIG_HOME=$HOME/.config + +# tier2 +export HIMKT_DOTFILES_PRIVATE_CONFIG_DIR=$XDG_CONFIG_HOME/himkt/dotfiles/zsh/config.d +export TIPS_HOME=$GHQ_ROOT/github.com/himkt/tips-data + +language=en_US.UTF-8 +# If `en_US.UTF-8` is not available, fallback to `C.utf8` +if [ "`locale -a | grep $language`" != $language ]; then + language=C.utf8 +fi +export LANG=$language +export LC_CTYPE=$language + +for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.pre.zsh") +do + source $source +done + +case `uname -s` in +Darwin*) + export HOMEBREW_ROOT=/opt/homebrew + export HOMEBREW_CACHE=$HOME/.cache/Homebrew + ;; +Linux*) + export HOMEBREW_ROOT=/home/linuxbrew/.linuxbrew + ;; +esac + +for prefix in $HOMEBREW_ROOT $HOME $HOME/.local $HOME/dotfiles $GOPATH $HOME/.rd; do + export PATH=$PATH:$prefix/bin +done + +if command -v brew > /dev/null; then + export BREW_HOME=$(brew --prefix) + export HOMEBREW_NO_AUTO_UPDATE=1 + eval $(brew shellenv) + + if [ -d "$HOMEBREW_ROOT/opt/xz" ]; then + export CONFIGURE_OPTS="--enable-shared" + export CPPFLAGS="-I$(brew --prefix xz)/include" + export LDFLAGS="-L$(brew --prefix xz)/lib" + fi + + if [ -d "$HOMEBREW_ROOT/opt/openjdk" ]; then + export PATH="$HOMEBREW_ROOT/opt/openjdk/bin:$PATH" + export CPPFLAGS="$CPPFLAGS:-I$HOMEBREW_ROOT/opt/openjdk/include" + fi + + if [ -d "$HOMEBREW_ROOT/opt/libpq/bin" ]; then + export PATH="$HOMEBREW_ROOT/opt/libpq/bin:$PATH" + fi +fi + +export PYTHONSYSTEMPATH=$(which python3) + +# NOTE; Utilities + +function current_context () { + if test -f $XDG_CONFIG_HOME/kubectl-toggle-ctx/hide; then + return + fi + + if ! command -v kubectl > /dev/null; then + return + fi + + current_context=$(command kubectl config current-context) &> /dev/null + if [ "$?" -ne 0 ]; then + return + fi + + echo "[$fg_bold[blue]$current_context$reset_color]" +} + +function current_path () { + echo "[$fg_bold[yellow]%~$reset_color]" +} + +function current_timestamp () { + echo "[$fg_bold[red]$(date +'%H:%M:%S')$reset_color]" +} + +function current_git_status () { + local git_branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)" + if [ -z "$git_branch" ]; then + return + fi + + UNTRACK_STATUS="" + UNTRACK_STATUS+="$fg_bold[red]$(git ls-files --other --exclude-standard | wc -l | awk '{print $1}')$reset_color" + UNTRACK_STATUS+="$fg_bold[yellow]$(git diff --name-only | wc -l | awk '{print $1}')$reset_color" + UNTRACK_STATUS+="$fg_bold[green]$(git diff --name-only --staged | wc -l | awk '{print $1}')$reset_color" + BRANCH_NAME="$fg_bold[red]$git_branch$reset_color" + echo "[$UNTRACK_STATUS$fg_bold[gray]@$BRANCH_NAME$reset_color]" +} + +PROMPT='$(current_timestamp)$(current_context)$(current_path)$(current_git_status)' +PROMPT+=$'\n' +PROMPT+='> ' +SPROMPT="${fg[red]}%r$reset_color is correct? [y, n, a, e]:" + +if command -v fzf > /dev/null; then + source <(fzf --zsh) +fi + + +if command -v nvim > /dev/null; then + alias vim=nvim + export EDITOR=nvim +fi + +if command -v sheldon > /dev/null; then + eval "$(sheldon -q source)" +fi + +if command -v zoxide > /dev/null; then + eval "$(zoxide init zsh)" +fi + +if command -v kubectl > /dev/null; then + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + source <(kubectl completion zsh) + alias k=kubectl +fi + +if [ -f "$HOME/.cargo/env" ]; then + . "$HOME/.cargo/env" +fi + +for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.post.zsh") +do + source $source +done From fa9168843d74057b5899d5f28eec555ef4defbab Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:16:32 +0900 Subject: [PATCH 76/95] feat: create platform-specific modules (Step 5) --- home/modules/fcitx5/default.nix | 63 +++++++++++++++++++++++++++++++++ home/modules/gcc/default.nix | 47 ++++++++++++++++++++++++ home/modules/gpg/default.nix | 14 ++++++++ home/modules/java/default.nix | 11 ++++++ home/modules/mise/default.nix | 19 ++++++++++ 5 files changed, 154 insertions(+) create mode 100644 home/modules/fcitx5/default.nix create mode 100644 home/modules/gcc/default.nix create mode 100644 home/modules/gpg/default.nix create mode 100644 home/modules/java/default.nix create mode 100644 home/modules/mise/default.nix diff --git a/home/modules/fcitx5/default.nix b/home/modules/fcitx5/default.nix new file mode 100644 index 00000000..7a4c9dfb --- /dev/null +++ b/home/modules/fcitx5/default.nix @@ -0,0 +1,63 @@ +{ + pkgs, + ... +}: + +{ + # GTK im-module settings for fcitx5 (XWayland apps) + gtk = { + gtk3.extraConfig.gtk-im-module = "fcitx"; + gtk4.extraConfig.gtk-im-module = "fcitx"; + }; + + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5 = { + addons = with pkgs; [ + fcitx5-mozc + fcitx5-gtk + ]; + settings = { + inputMethod = { + "Groups/0" = { + Name = "Default"; + "Default Layout" = "us"; + DefaultIM = "keyboard-us"; + }; + "Groups/0/Items/0" = { + Name = "keyboard-us"; + Layout = ""; + }; + "Groups/0/Items/1" = { + Name = "mozc"; + Layout = ""; + }; + GroupOrder = { + "0" = "Default"; + }; + }; + globalOptions = { + Hotkey = { + EnumerateWithTriggerKeys = "True"; + EnumerateSkipFirst = "False"; + }; + "Hotkey/TriggerKeys" = { + "0" = "Control+space"; + }; + Behavior = { + ActiveByDefault = "False"; + PreeditEnabledByDefault = "True"; + ShowInputMethodInformation = "True"; + DefaultPageSize = 5; + }; + }; + addons = { + classicui.globalSection = { + PreferTextIcon = "True"; + }; + }; + }; + }; + }; +} diff --git a/home/modules/gcc/default.nix b/home/modules/gcc/default.nix new file mode 100644 index 00000000..48905311 --- /dev/null +++ b/home/modules/gcc/default.nix @@ -0,0 +1,47 @@ +# Copied from https://github.com/momeemt/config. +{ + pkgs, + ... +}: + +let + materialColors = { + red = "38;5;203"; + amber = "38;5;214"; + blue = "38;5;33"; + green = "38;5;71"; + purple = "38;5;127"; + gray = "38;5;245"; + cyan = "38;5;81"; + }; + bold = "01"; +in +{ + programs.gcc = { + enable = true; + package = pkgs.gcc; + colors = { + error = "${bold};${materialColors.red}"; + warning = "${bold};${materialColors.amber}"; + note = "${bold};${materialColors.blue}"; + locus = materialColors.gray; + quote = materialColors.gray; + path = materialColors.cyan; + range1 = materialColors.green; + range2 = materialColors.blue; + fixit-insert = materialColors.green; + fixit-delete = materialColors.red; + diff-filename = "${bold};${materialColors.blue}"; + diff-hunk = materialColors.purple; + diff-delete = materialColors.red; + diff-insert = materialColors.green; + type-diff = "${bold};${materialColors.purple}"; + fnname = "${bold};${materialColors.green}"; + targs = materialColors.purple; + valid = materialColors.green; + invalid = materialColors.red; + highlight-a = "${bold};${materialColors.blue}"; + highlight-b = "${bold};${materialColors.amber}"; + }; + }; +} diff --git a/home/modules/gpg/default.nix b/home/modules/gpg/default.nix new file mode 100644 index 00000000..07b8925f --- /dev/null +++ b/home/modules/gpg/default.nix @@ -0,0 +1,14 @@ +{ + pkgs, + config, + ... +}: { + programs.gpg = { + enable = true; + package = pkgs.gnupg; + homedir = "${config.xdg.dataHome}/gnupg"; + + mutableKeys = true; + mutableTrust = true; + }; +} diff --git a/home/modules/java/default.nix b/home/modules/java/default.nix new file mode 100644 index 00000000..9de586f7 --- /dev/null +++ b/home/modules/java/default.nix @@ -0,0 +1,11 @@ +{ + pkgs, + ... +}: + +{ + programs.java = { + enable = true; + package = pkgs.jdk21; + }; +} diff --git a/home/modules/mise/default.nix b/home/modules/mise/default.nix new file mode 100644 index 00000000..7a19f9ed --- /dev/null +++ b/home/modules/mise/default.nix @@ -0,0 +1,19 @@ +{ + pkgs, + inputs, + ... +}: + +let + unstable = import inputs.nixpkgs-unstable { + system = pkgs.system; + }; +in + +{ + programs.mise = { + enable = true; + package = unstable.mise; + enableZshIntegration = true; + }; +} From de7027d02b4eec334d9905b14118eae4af1e70f9 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:18:13 +0900 Subject: [PATCH 77/95] feat: create entry point files - flake.nix, nixos.nix, macos.nix, darwin-configuration.nix (Step 6) --- flake.nix | 72 +++++++++++++++++++ home/macos.nix | 59 ++++++++++++++++ home/nixos.nix | 101 +++++++-------------------- hosts/macos/darwin-configuration.nix | 25 +++++++ 4 files changed, 181 insertions(+), 76 deletions(-) create mode 100644 flake.nix create mode 100644 home/macos.nix create mode 100644 hosts/macos/darwin-configuration.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..ec4439f2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + description = "NixOS and nix-darwin configuration for himkt"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-darwin = { + url = "github:LnL7/nix-darwin/nix-darwin-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + nixpkgs, + home-manager, + nix-darwin, + ... + }@inputs: + { + # NixOS configuration + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; username = "himkt"; }; + modules = [ + ./hosts/nixos/configuration.nix + inputs.sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.himkt = import ./home/nixos.nix; + home-manager.extraSpecialArgs = { + inherit inputs; + username = "himkt"; + }; + } + ]; + }; + + # nix-darwin configuration + darwinConfigurations.macos = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + specialArgs = { inherit inputs; username = "himkt"; }; + modules = [ + ./hosts/macos/darwin-configuration.nix + home-manager.darwinModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.himkt = import ./home/macos.nix; + home-manager.extraSpecialArgs = { + inherit inputs; + username = "himkt"; + }; + } + ]; + }; + }; +} diff --git a/home/macos.nix b/home/macos.nix new file mode 100644 index 00000000..3d8031da --- /dev/null +++ b/home/macos.nix @@ -0,0 +1,59 @@ +{ config, pkgs, lib, inputs, ... }: + +{ + imports = [ + # Shared modules (same 7 as NixOS) + ./modules/zsh + ./modules/sheldon + ./modules/tmux + ./modules/nvim + ./modules/git + ./modules/uv + ./modules/ghostty + # macOS-specific modules + ./modules/mise + ]; + + home.username = "himkt"; + home.homeDirectory = "/Users/himkt"; + home.stateVersion = "25.11"; + + xdg = { + enable = true; + configHome = "${config.home.homeDirectory}/.config"; + cacheHome = "${config.home.homeDirectory}/.cache"; + dataHome = "${config.home.homeDirectory}/.local/share"; + }; + + home.packages = with pkgs; [ + ghq + python3 + rustup + tree + ]; + + home.sessionVariables = { + EDITOR = "nvim"; + }; + + # macOS-specific platform overrides + programs.git.settings.credential."https://github.com".helper = + lib.mkForce "!/opt/homebrew/bin/gh auth git-credential"; + + programs.tmux.extraConfig = lib.mkAfter '' + # macOS clipboard integration + bind-key -T copy-mode-vi y send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" + bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" + ''; + + programs.mise.globalConfig = { + tools = { + gcloud = "latest"; + }; + settings = { + idiomatic_version_file_enable_tools = []; + }; + }; + + programs.home-manager.enable = true; +} diff --git a/home/nixos.nix b/home/nixos.nix index 08ae0023..32d84c65 100644 --- a/home/nixos.nix +++ b/home/nixos.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, ... }: +{ config, pkgs, lib, inputs, ... }: let unstable = import inputs.nixpkgs-unstable { @@ -12,6 +12,7 @@ in { imports = [ + # Shared modules ./modules/zsh ./modules/sheldon ./modules/tmux @@ -19,6 +20,7 @@ in ./modules/git ./modules/uv ./modules/ghostty + # NixOS-only modules ./modules/gcc ./modules/java ./modules/gpg @@ -26,21 +28,10 @@ in ./modules/mise ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. home.username = "himkt"; home.homeDirectory = "/home/himkt"; + home.stateVersion = "25.11"; - # 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 should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "25.11"; # Please read the comment before changing. - - # XDG Base Directory specification xdg = { enable = true; configHome = "${config.home.homeDirectory}/.config"; @@ -48,26 +39,7 @@ in dataHome = "${config.home.homeDirectory}/.local/share"; }; - # The home.packages option allows you to install Nix packages into your - # environment. home.packages = with pkgs; [ - # # Adds the 'hello' command to your environment. It prints a friendly - # # "Hello, world!" when run. - # pkgs.hello - - # # It is sometimes useful to fine-tune packages, for example, by applying - # # overrides. You can do that directly here, just don't forget the - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of - # # fonts? - # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - - # # You can also create simple shell scripts directly inside your - # # configuration. For example, this adds a command 'my-hello' to your - # # environment: - # (pkgs.writeShellScriptBin "my-hello" '' - # echo "Hello, ${config.home.username}!" - # '') - # GUI google-chrome inkscape @@ -94,24 +66,11 @@ in rustup tree - # my own softwares + # Custom packages himkt_pkgs.pathfinder ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - # Chrome with touchpad swipe gesture support ".local/share/applications/google-chrome.desktop".text = '' [Desktop Entry] @@ -135,7 +94,6 @@ in ''; # Ghostty with fcitx5 workaround - # See: https://github.com/ghostty-org/ghostty/discussions/3628 ".local/share/applications/com.mitchellh.ghostty.desktop".text = '' [Desktop Entry] Version=1.0 @@ -150,7 +108,7 @@ in Categories=System;TerminalEmulator; ''; - # VSCode with Wayland support for better text rendering + # VSCode with Wayland support ".local/share/applications/code.desktop".text = '' [Desktop Entry] Version=1.0 @@ -167,34 +125,13 @@ in ''; }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/himkt/etc/profile.d/hm-session-vars.sh - # home.sessionVariables = { EDITOR = "nvim"; SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; - - # fcitx5 IME support GTK_IM_MODULE = "fcitx"; QT_IM_MODULE = "fcitx"; XMODIFIERS = "@im=fcitx"; - GLFW_IM_MODULE = "ibus"; # For some apps that use GLFW - - # Enable Wayland for Electron apps (VSCode, Slack, etc.) - # NIXOS_OZONE_WL = "1"; + GLFW_IM_MODULE = "ibus"; ELECTRON_OZONE_PLATFORM_HINT = "auto"; }; @@ -202,7 +139,6 @@ in "org/gnome/mutter" = { experimental-features = [ "scale-monitor-framebuffer" ]; }; - "org/gnome/desktop/peripherals/touchpad" = { tap-to-click = false; natural-scroll = true; @@ -220,16 +156,29 @@ in fonts.fontconfig = { enable = true; defaultFonts = { - monospace = [ - "JetBrains Mono" - "Noto Sans Mono CJK JP" - ]; + monospace = [ "JetBrains Mono" "Noto Sans Mono CJK JP" ]; sansSerif = [ "Noto Sans CJK JP" ]; serif = [ "Noto Serif CJK JP" ]; emoji = [ "Noto Color Emoji" ]; }; }; - # Let Home Manager install and manage itself. + # NixOS-specific platform overrides + programs.zsh.shellAliases = { + open = "xdg-open"; + }; + + programs.mise.globalConfig = { + tools = { + "aqua:anthropics/claude-code" = "latest"; + "core:node" = "latest"; + }; + settings = { + all_compile = false; + experimental = true; + disable_backends = [ "asdf" ]; + }; + }; + programs.home-manager.enable = true; } diff --git a/hosts/macos/darwin-configuration.nix b/hosts/macos/darwin-configuration.nix new file mode 100644 index 00000000..90c32157 --- /dev/null +++ b/hosts/macos/darwin-configuration.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: + +{ + # System-level settings (replaces darwin/bin/setup.sh) + system.defaults = { + NSGlobalDomain = { + KeyRepeat = 2; + InitialKeyRepeat = 20; + ApplePressAndHoldEnabled = false; + "com.apple.keyboard.fnState" = false; + }; + trackpad.Clicking = true; + dock = { + orientation = "left"; + autohide = true; + }; + }; + + # Enable Touch ID for sudo + security.pam.services.sudo_local.touchIdAuth = true; + + # Note: verify this value before first activation. + # See https://daiderd.com/nix-darwin/manual/ for stateVersion documentation. + system.stateVersion = 5; +} From da6ce13c1542a40ef7f2856d0426d6e2289d0d56 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:19:58 +0900 Subject: [PATCH 78/95] feat: create root Makefile, .gitignore, CI workflow, README (Step 7) --- .github/workflows/macos.yml | 28 ++------- .gitignore | 21 +------ Makefile | 121 ++++++------------------------------ README.md | 73 +++++++++++++++++++--- 4 files changed, 91 insertions(+), 152 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2260ebb0..9cc98183 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,30 +1,14 @@ -name: macOS test +name: macOS nix-darwin build check on: push: branches: - main pull_request: jobs: - main: + build: runs-on: macos-latest steps: - - uses: actions/checkout@v4 - - name: uninstall builtin homebrew on macOS - run: | - sudo rm -rf /opt/homebrew - - name: setup dotfiles - run: | - cp -r $GITHUB_WORKSPACE $HOME/dotfiles - cd $HOME/dotfiles - make - make brew - - name: install packages - run: | - source $HOME/.zshrc - make brew-base - shell: zsh {0} - - name: brew doctor on macOS - run: | - # NOTE(himkt); skip this on Ubuntu since brew doctor won't succeed - # due to the installation path. - brew doctor + - uses: actions/checkout@v6 + - uses: DeterminateSystems/nix-installer-action@main + - name: Build nix-darwin configuration (dry run) + run: nix build --dry-run .#darwinConfigurations.macos.system diff --git a/.gitignore b/.gitignore index 21af8de6..01bbe042 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,4 @@ .* !.gitignore -!.gitmodules -!.amethyst -!.bashrc -!.zshrc -!.vimrc -!.tmux.conf -!.osx.tmux.conf -!.octaverc -!.vim -!.zsh -!.keep - -*private* -*secret* - -# https://github.com/himkt/omoide -/bin/omoide -# https://github.com/himkt/auto-release -/bin/auto-release +!.github/ +result diff --git a/Makefile b/Makefile index 1c73de76..8221b282 100644 --- a/Makefile +++ b/Makefile @@ -1,113 +1,30 @@ -# Makefile for dotfile configs -RED := $(shell tput setaf 1) -NOCOLOR := $(shell tput sgr0) +.PHONY: macos-switch macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-switch nixos-update nixos-clean nixos-gc -.PHONY: \ - all docs brew \ - base cli darwin gui \ - git ghostty nvim sheldon tmux uv zsh +# macOS targets +macos-switch: + darwin-rebuild switch --flake .#macos -all: git tmux zsh docs -optional: all darwin ghostty git mise nvim sheldon uv - -# ========================= - -brew: - $(PWD)/brew/bin/setup.sh - -brew-base: +macos-brew: brew bundle --verbose --file=$(PWD)/brew/config.d/base/Brewfile -brew-optional: - brew bundle --verbose --file=$(PWD)/brew/config.d/optional/Brewfile - -brew-gui: +macos-brew-gui: brew bundle --verbose --file=$(PWD)/brew/config.d/gui/Brewfile -brew-himkt: - brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile - -krew-base: - kubectl krew install open-svc ns images ctx stern neat - -# ========================= - -darwin: - $(PWD)/darwin/bin/setup.sh - -ghostty: ghostty_clean - $(PWD)/ghostty/bin/setup.sh - -git: git_clean - $(PWD)/git/bin/setup.sh - -mise: mise_clean - $(PWD)/mise/bin/setup.sh - -nvim: nvim_clean - $(PWD)/nvim/bin/setup.sh - -sheldon: sheldon_clean - $(PWD)/sheldon/bin/setup.sh - -tmux: tmux_clean - $(PWD)/tmux/bin/setup.sh - -uv: uv_clean - $(PWD)/uv/bin/setup.sh - -zsh: zsh_clean - $(PWD)/zsh/bin/setup.sh - -# ========================= - -ghostty_clean: - rm -rf $(HOME)/.config/ghostty - -git_clean: - rm -rf $(HOME)/.config/git/config - rm -rf $(HOME)/.config/git/ignore - -mise_clean: - rm -rf $(HOME)/.config/mise - -nvim_clean: - rm -rf $(HOME)/.vimrc - rm -rf $(HOME)/.vim - rm -rf $(HOME)/.config/nvim - -sheldon_clean: - rm -rf $(HOME)/.config/sheldon +macos-brew-optional: + brew bundle --verbose --file=$(PWD)/brew/config.d/optional/Brewfile -tmux_clean: - rm -rf $(HOME)/.tmux.conf +macos-brew-himkt: + brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile -uv_clean: - rm -rf $(HOME)/.local/bin/uv $(HOME)/.local/bin/uvx - rm -rf $(HOME)/.config/uv +# NixOS targets +nixos-switch: + sudo nixos-rebuild switch --flake .#nixos -zsh_clean: - rm -rf $(HOME)/.zshrc +nixos-update: + nix flake update -# ========================= +nixos-clean: + sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system -docs: - @echo "" - @echo "### Finish installing dotfiles!" - @echo "Please run $(RED)source $$HOME/.zshrc$(NOCOLOR) on zsh to enable configures." - @echo "- If you want to use nvim with extensions, please run $(RED)make nvim$(NOCOLOR) (which needs pyenv)." - @echo "- If you want to install pyenv using brew, please read the Python section below." - @echo "" - @echo "---" - @echo "" - @echo "### Packages" - @echo "- If you want to use linuxbrew/homebrew, please run $(RED)make brew-cui$(NOCOLOR)." - @echo "- Please run $(RED)make brew$(NOCOLOR) before if you have not installed brew yet" - @echo "- Additionally, $(RED)make brew-optional$(NOCOLOR) installs optional packages" - @echo "" - @echo "---" - @echo "" - @echo "### Python" - @echo "- After $(RED)make brew, make brew-cui, source $$HOME/.zshrc$(NOCOLOR)," - @echo " you can run $(RED)make nvim$(NOCOLOR) to install Python and the nvim library" - @echo "" +nixos-gc: + sudo nix-collect-garbage -d diff --git a/README.md b/README.md index d3571698..03600825 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,72 @@ -## dotfiles +# dotfiles -[![macOS test](https://github.com/himkt/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/himkt/dotfiles/actions/workflows/macos.yml) +Unified Nix-based configuration for macOS (nix-darwin) and NixOS. -## Installation +## Structure ``` -git clone git@github.com:himkt/dotfiles $HOME/dotfiles -cd $HOME/dotfiles && make +dotfiles/ +├── flake.nix # Unified flake (NixOS + nix-darwin) +├── Makefile # All targets for both platforms +├── hosts/ +│ ├── nixos/ # NixOS system configuration +│ ├── macos/ # nix-darwin system configuration +│ └── modules/ # System-level modules (keyd) +├── home/ +│ ├── nixos.nix # NixOS Home Manager entry point +│ ├── macos.nix # macOS Home Manager entry point +│ ├── pkgs/ # Custom packages +│ └── modules/ # Home Manager modules +│ ├── git/ # (shared) +│ ├── sheldon/ # (shared) +│ ├── nvim/ # (shared) +│ ├── zsh/ # (shared) +│ ├── tmux/ # (shared) +│ ├── ghostty/ # (shared) +│ ├── uv/ # (shared) +│ ├── mise/ # (platform-specific config) +│ ├── gcc/ # (NixOS-only) +│ ├── java/ # (NixOS-only) +│ ├── gpg/ # (NixOS-only) +│ └── fcitx5/ # (NixOS-only) +├── brew/ # Homebrew Brewfiles (macOS) +└── secrets/ # sops-nix encrypted secrets ``` -### Homebrew/Linuxbrew +## Setup -If you don't have `brew`, you have to run `make brew` in advance. +### macOS -- `make brew-base`: install essential tools -- `make brew-gui`: install GUI apps for macOS +1. Install [Nix](https://nixos.org/download/) via the [Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer) +2. Clone this repository to `~/dotfiles` +3. Apply the nix-darwin configuration: + ``` + make macos-switch + ``` +4. Install Homebrew packages: + ``` + make macos-brew + make macos-brew-gui + ``` + +### NixOS + +1. Clone this repository to `~/dotfiles` +2. Apply the NixOS configuration: + ``` + make nixos-switch + ``` + +## Makefile Targets + +| Target | Description | +|--------|-------------| +| `macos-switch` | Apply nix-darwin + Home Manager configuration | +| `macos-brew` | Install base Homebrew packages | +| `macos-brew-gui` | Install GUI Homebrew packages | +| `macos-brew-optional` | Install optional Homebrew packages | +| `macos-brew-himkt` | Install personal Homebrew packages | +| `nixos-switch` | Apply NixOS + Home Manager configuration | +| `nixos-update` | Update flake inputs | +| `nixos-clean` | Delete old NixOS generations (keep last 7) | +| `nixos-gc` | Run Nix garbage collection | From a96087e7546c7eb7bef49e6fb48c670a0d590411 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:22:07 +0900 Subject: [PATCH 79/95] feat: remove old files and directories (Step 8) --- .github/workflows/ubuntu.yml | 27 -- LICENSE | 2 +- darwin/bin/setup.sh | 50 ---- ghostty/bin/setup.sh | 7 - ghostty/config.d/config | 25 -- git/bin/setup.sh | 9 - git/config.d/config | 47 ---- git/config.d/ignore | 22 -- mise/bin/setup.sh | 5 - mise/config.d/config.toml | 7 - nixos/.gitignore | 2 - nixos/.sops.yaml | 12 - nixos/Makefile | 19 -- nixos/README.md | 29 --- nixos/flake.lock | 87 ------- nixos/flake.nix | 54 ---- nixos/home/modules/fcitx5/default.nix | 63 ----- nixos/home/modules/gcc/default.nix | 47 ---- nixos/home/modules/ghostty/default.nix | 16 -- nixos/home/modules/ghostty/files/config | 26 -- nixos/home/modules/git/default.nix | 38 --- nixos/home/modules/git/files/config | 47 ---- nixos/home/modules/git/files/ignore | 22 -- nixos/home/modules/gpg/default.nix | 14 -- nixos/home/modules/java/default.nix | 11 - nixos/home/modules/mise/default.nix | 32 --- nixos/home/modules/nvim/default.nix | 32 --- nixos/home/modules/nvim/files/init.vim | 45 ---- nixos/home/modules/nvim/files/vimrc | 149 ----------- nixos/home/modules/sheldon/default.nix | 16 -- nixos/home/modules/sheldon/files/plugins.toml | 17 -- nixos/home/modules/tmux/default.nix | 13 - nixos/home/modules/tmux/files/tmux.conf | 57 ----- nixos/home/modules/uv/default.nix | 16 -- nixos/home/modules/uv/files/uv.toml | 1 - nixos/home/modules/zsh/default.nix | 22 -- nixos/home/modules/zsh/files/zshrc | 189 -------------- nixos/home/nixos.nix | 235 ------------------ nixos/home/pkgs/default.nix | 5 - nixos/home/pkgs/pathfinder/default.nix | 32 --- nixos/hosts/modules/keyd/default.nix | 21 -- nixos/hosts/nixos/configuration.nix | 204 --------------- nixos/hosts/nixos/hardware-configuration.nix | 35 --- nixos/secrets/secrets.yaml | 30 --- nvim/bin/setup.sh | 19 -- nvim/config.d/init.vim | 57 ----- nvim/config.d/vimrc | 149 ----------- nvim/snippet.d/cpp/argsort.snippets | 16 -- nvim/snippet.d/cpp/bellman_ford.snippets | 28 --- nvim/snippet.d/cpp/combination.snippets | 25 -- nvim/snippet.d/cpp/gcd.snippets | 13 - nvim/snippet.d/cpp/lcm.snippets | 6 - nvim/snippet.d/cpp/mod.snippets | 79 ------ .../cpp/prime_factorization.snippets | 24 -- nvim/snippet.d/cpp/union_find.snippets | 48 ---- nvim/snippet.d/cpp/utils.snippets | 30 --- nvim/snippet.d/python/pylint_click.snippets | 3 - .../rust/prime_factorization.snippets | 25 -- nvim/template.d/cc/template.cc | 15 -- nvim/template.d/go/template.go | 13 - nvim/template.d/mklatex/Makefile | 15 -- nvim/template.d/mklatex/double.tex | 26 -- nvim/template.d/mklatex/reference.bib | 9 - nvim/template.d/mklatex/single.tex | 26 -- nvim/template.d/mklatex/slide.tex | 27 -- nvim/template.d/python/setup.cfg | 5 - nvim/template.d/rs/atcoder.rs | 51 ---- sheldon/bin/setup.sh | 4 - sheldon/config.d/plugins.toml | 17 -- tmux/bin/setup.sh | 3 - tmux/config.d/tmux.conf | 51 ---- uv/bin/setup.sh | 5 - uv/config.d/uv.toml | 1 - zsh/bin/setup.sh | 4 - zsh/config.d/zshrc | 188 -------------- 75 files changed, 1 insertion(+), 2820 deletions(-) delete mode 100644 .github/workflows/ubuntu.yml delete mode 100755 darwin/bin/setup.sh delete mode 100755 ghostty/bin/setup.sh delete mode 100644 ghostty/config.d/config delete mode 100755 git/bin/setup.sh delete mode 100644 git/config.d/config delete mode 100644 git/config.d/ignore delete mode 100755 mise/bin/setup.sh delete mode 100644 mise/config.d/config.toml delete mode 100644 nixos/.gitignore delete mode 100644 nixos/.sops.yaml delete mode 100644 nixos/Makefile delete mode 100644 nixos/README.md delete mode 100644 nixos/flake.lock delete mode 100644 nixos/flake.nix delete mode 100644 nixos/home/modules/fcitx5/default.nix delete mode 100644 nixos/home/modules/gcc/default.nix delete mode 100644 nixos/home/modules/ghostty/default.nix delete mode 100644 nixos/home/modules/ghostty/files/config delete mode 100644 nixos/home/modules/git/default.nix delete mode 100644 nixos/home/modules/git/files/config delete mode 100644 nixos/home/modules/git/files/ignore delete mode 100644 nixos/home/modules/gpg/default.nix delete mode 100644 nixos/home/modules/java/default.nix delete mode 100644 nixos/home/modules/mise/default.nix delete mode 100644 nixos/home/modules/nvim/default.nix delete mode 100644 nixos/home/modules/nvim/files/init.vim delete mode 100644 nixos/home/modules/nvim/files/vimrc delete mode 100644 nixos/home/modules/sheldon/default.nix delete mode 100644 nixos/home/modules/sheldon/files/plugins.toml delete mode 100644 nixos/home/modules/tmux/default.nix delete mode 100644 nixos/home/modules/tmux/files/tmux.conf delete mode 100644 nixos/home/modules/uv/default.nix delete mode 100644 nixos/home/modules/uv/files/uv.toml delete mode 100644 nixos/home/modules/zsh/default.nix delete mode 100644 nixos/home/modules/zsh/files/zshrc delete mode 100644 nixos/home/nixos.nix delete mode 100644 nixos/home/pkgs/default.nix delete mode 100644 nixos/home/pkgs/pathfinder/default.nix delete mode 100644 nixos/hosts/modules/keyd/default.nix delete mode 100644 nixos/hosts/nixos/configuration.nix delete mode 100644 nixos/hosts/nixos/hardware-configuration.nix delete mode 100644 nixos/secrets/secrets.yaml delete mode 100755 nvim/bin/setup.sh delete mode 100644 nvim/config.d/init.vim delete mode 100644 nvim/config.d/vimrc delete mode 100644 nvim/snippet.d/cpp/argsort.snippets delete mode 100644 nvim/snippet.d/cpp/bellman_ford.snippets delete mode 100644 nvim/snippet.d/cpp/combination.snippets delete mode 100644 nvim/snippet.d/cpp/gcd.snippets delete mode 100644 nvim/snippet.d/cpp/lcm.snippets delete mode 100644 nvim/snippet.d/cpp/mod.snippets delete mode 100644 nvim/snippet.d/cpp/prime_factorization.snippets delete mode 100644 nvim/snippet.d/cpp/union_find.snippets delete mode 100644 nvim/snippet.d/cpp/utils.snippets delete mode 100644 nvim/snippet.d/python/pylint_click.snippets delete mode 100644 nvim/snippet.d/rust/prime_factorization.snippets delete mode 100644 nvim/template.d/cc/template.cc delete mode 100644 nvim/template.d/go/template.go delete mode 100644 nvim/template.d/mklatex/Makefile delete mode 100644 nvim/template.d/mklatex/double.tex delete mode 100644 nvim/template.d/mklatex/reference.bib delete mode 100644 nvim/template.d/mklatex/single.tex delete mode 100644 nvim/template.d/mklatex/slide.tex delete mode 100644 nvim/template.d/python/setup.cfg delete mode 100644 nvim/template.d/rs/atcoder.rs delete mode 100755 sheldon/bin/setup.sh delete mode 100644 sheldon/config.d/plugins.toml delete mode 100755 tmux/bin/setup.sh delete mode 100644 tmux/config.d/tmux.conf delete mode 100755 uv/bin/setup.sh delete mode 100644 uv/config.d/uv.toml delete mode 100755 zsh/bin/setup.sh delete mode 100644 zsh/config.d/zshrc diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 9d023705..00000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Ubuntu test -on: - push: - branches: - - main - pull_request: -jobs: - main: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: setup zsh for ubuntu-latest - run: | - sudo apt update -y - sudo apt install -y zsh - sudo chsh -s $(which zsh) - - name: setup dotfiles - run: | - cp -r $GITHUB_WORKSPACE $HOME/dotfiles - cd $HOME/dotfiles - make - make brew - - name: install packages - run: | - source $HOME/.zshrc - make brew-base - shell: zsh {0} diff --git a/LICENSE b/LICENSE index bd4af4c3..a052733e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2025 himkt +Copyright (c) 2017-2026 himkt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/darwin/bin/setup.sh b/darwin/bin/setup.sh deleted file mode 100755 index 40dc8346..00000000 --- a/darwin/bin/setup.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# https://macos-defaults.com/ - -# keyboard -# -# https://linkarzu.com/posts/2024-macos-workflow/macos-keyrepeat-rate/ -# -# * (todo) remap caps to control -# * key repeat rate -# * delay until repeat -# * F1, F2, ...etc behave as macOS defined function keys -# -defaults write -g KeyRepeat -int 2 -defaults write -g InitialKeyRepeat -int 20 -defaults write -g ApplePressAndHoldEnabled -bool false -defaults write NSGlobalDomain com.apple.keyboard.fnState -bool false - -# trackpad -defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1 -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -int 1 - -# dock -# -# autohide = true -# show-recents = false -# orientation = bottom -# -defaults write com.apple.dock orientation -string left -defaults write com.apple.dock autohide -bool true -killall Dock - -# menu bar -# -# only show = [Wi-Fi, VPN, Battery] -# - -# finder -# - -# login window -# -# guest login = false -# - -# pam -sudo rm -rf /etc/pam.d/sudo_local -cat /etc/pam.d/sudo_local.template \ - | sed -e 's/#auth/auth/g' \ - | sudo tee /etc/pam.d/sudo_local >/dev/null diff --git a/ghostty/bin/setup.sh b/ghostty/bin/setup.sh deleted file mode 100755 index eb7499ba..00000000 --- a/ghostty/bin/setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -mkdir -p $HOME/.config/ghostty - -ln -s \ - $HOME/dotfiles/ghostty/config.d/config \ - $HOME/.config/ghostty/config diff --git a/ghostty/config.d/config b/ghostty/config.d/config deleted file mode 100644 index 749dd0ee..00000000 --- a/ghostty/config.d/config +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE(himkt): 18446744073709551615 is usize limit - -# app config -macos-titlebar-style = native -window-theme = dark -window-padding-x = 5 -window-padding-y = 5 -window-padding-balance = true -scrollback-limit = 18446744073709551615 - -# color config -theme = GitHub Dark Default - -# background config -background-opacity = 0.95 -background-blur-radius = 20 - -# font config -font-family = Jetbrains Mono -font-family = Hiragino Kaku Gothic ProN -font-size = 16 -font-feature = -calt, -liga, -dlig -keybind = shift+enter=text:\n - -clipboard-paste-protection = false diff --git a/git/bin/setup.sh b/git/bin/setup.sh deleted file mode 100755 index 28a5af77..00000000 --- a/git/bin/setup.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -mkdir -p $HOME/.config/git - -rm -rf $HOME/.config/git/config -rm -rf $HOME/.config/git/ignore - -ln -s $HOME/dotfiles/git/config.d/config $HOME/.config/git/config -ln -s $HOME/dotfiles/git/config.d/ignore $HOME/.config/git/ignore diff --git a/git/config.d/config b/git/config.d/config deleted file mode 100644 index 799b8a54..00000000 --- a/git/config.d/config +++ /dev/null @@ -1,47 +0,0 @@ -[user] - email = himkt@klis.tsukuba.ac.jp - name = himkt - -[pull] - rebase = false - -[alias] - remove-merged = "!f() { \ - if [ -n \"$1\" ]; then \ - BRANCH=\"$1\"; \ - else \ - BRANCH=$(git branch | awk '{print $NF}' | fzf --prompt '(base branch) > '); \ - fi; \ - if [ -z \"$BRANCH\" ]; then \ - echo \"Select valid branch\"; \ - exit 1; \ - fi; \ - echo \"Log: base branch: $BRANCH\"; \ - git branch --merged \"$BRANCH\" | grep -v \"$BRANCH\" | xargs -r git branch -d; \ - }; f" - graph = log --graph --date-order --pretty=format:'<%h> %ad %Cgreen%d%Creset %s %Cblue[%an]%Creset' --all --date=short - -[format] - pretty = format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an] - date = iso -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true -[column] - ui = auto -[branch] - sort = -committerdate -[tag] - sort = version:refname -[init] - defaultBranch = main -[diff] - colorMoved = plain - mnemonicPrefix = true - renames = true -[credential "https://github.com"] - helper = !/opt/homebrew/bin/gh auth git-credential -[credential "https://gist.github.com"] - helper = !/opt/homebrew/bin/gh auth git-credential diff --git a/git/config.d/ignore b/git/config.d/ignore deleted file mode 100644 index 27749c83..00000000 --- a/git/config.d/ignore +++ /dev/null @@ -1,22 +0,0 @@ -# editor -.vim -.vscode - -# ruby -.rakeTasks -.rubocop.yml - -# python -.venv -*.egg-info -.mypy_cache - -# jetbrains -.idea - -.DS_Store - -.apple-silicon-platform - -**/.claude -**/CLAUDE.md diff --git a/mise/bin/setup.sh b/mise/bin/setup.sh deleted file mode 100755 index 288b151f..00000000 --- a/mise/bin/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -mkdir -p $HOME/.config/mise - -ln -s $HOME/dotfiles/mise/config.d/config.toml $HOME/.config/mise diff --git a/mise/config.d/config.toml b/mise/config.d/config.toml deleted file mode 100644 index f42057fd..00000000 --- a/mise/config.d/config.toml +++ /dev/null @@ -1,7 +0,0 @@ - -[settings] -idiomatic_version_file_enable_tools = [] - -[tools] -gcloud = "latest" - diff --git a/nixos/.gitignore b/nixos/.gitignore deleted file mode 100644 index 750baebf..00000000 --- a/nixos/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -result -result-* diff --git a/nixos/.sops.yaml b/nixos/.sops.yaml deleted file mode 100644 index efaeb7e4..00000000 --- a/nixos/.sops.yaml +++ /dev/null @@ -1,12 +0,0 @@ -keys: - # User key (from SSH key) - - &user_himkt age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 - # Host key (neptune) - - &host_neptune age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq - -creation_rules: - - path_regex: secrets/secrets\.yaml$ - key_groups: - - age: - - *user_himkt - - *host_neptune diff --git a/nixos/Makefile b/nixos/Makefile deleted file mode 100644 index 9db6694b..00000000 --- a/nixos/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.PHONY: switch build test update clean gc - -switch: - sudo nixos-rebuild switch --flake .#nixos - -build: - sudo nixos-rebuild build --flake .#nixos - -test: - sudo nixos-rebuild dry-build --flake .#nixos - -update: - nix flake update - -clean: - sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system - -gc: - sudo nix-collect-garbage -d diff --git a/nixos/README.md b/nixos/README.md deleted file mode 100644 index 906c9974..00000000 --- a/nixos/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# nixos-config - -NixOS and Home Manager configuration managed with Nix Flakes. - -## Repository Structure - -``` -nixos-config/ -├── flake.nix # Main flake configuration -├── flake.lock # Locked dependencies -├── Makefile # Build and switch commands -├── hosts/ -│ └── nixos/ # NixOS system configuration -│ ├── configuration.nix -│ └── hardware-configuration.nix -├── home/ -│ └── nixos.nix # Home Manager configuration -└── modules/ # Modular configurations - ├── fcitx5/ # Japanese IME - ├── gcc/ # GCC with colored output - ├── ghostty/ # Terminal emulator - ├── git/ # Git configuration - ├── gpg/ # GPG configuration - ├── nvim/ # Neovim configuration - ├── sheldon/ # Zsh plugin manager - ├── tmux/ # Tmux configuration - ├── uv/ # Python package manager - └── zsh/ # Zsh configuration -``` diff --git a/nixos/flake.lock b/nixos/flake.lock deleted file mode 100644 index 75698fec..00000000 --- a/nixos/flake.lock +++ /dev/null @@ -1,87 +0,0 @@ -{ - "nodes": { - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1770260404, - "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-25.11", - "repo": "home-manager", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1770136044, - "narHash": "sha256-tlFqNG/uzz2++aAmn4v8J0vAkV3z7XngeIIB3rM3650=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e576e3c9cf9bad747afcddd9e34f51d18c855b4e", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-25.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1770197578, - "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "sops-nix": "sops-nix" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1770145881, - "narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/nixos/flake.nix b/nixos/flake.nix deleted file mode 100644 index fcd373b6..00000000 --- a/nixos/flake.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - description = "NixOS and Home Manager configuration for himkt"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - - home-manager = { - url = "github:nix-community/home-manager/release-25.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = - { - self, - nixpkgs, - home-manager, - ... - }@inputs: - let - username = "himkt"; - system = "x86_64-linux"; - in - { - # NixOS configuration - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { inherit inputs username; }; - modules = [ - ./hosts/nixos/configuration.nix - - # sops-nix for secrets management - inputs.sops-nix.nixosModules.sops - - # Home Manager as NixOS module - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.${username} = import ./home/nixos.nix; - home-manager.extraSpecialArgs = { - inherit inputs username; - }; - } - ]; - }; - }; -} diff --git a/nixos/home/modules/fcitx5/default.nix b/nixos/home/modules/fcitx5/default.nix deleted file mode 100644 index 7a4c9dfb..00000000 --- a/nixos/home/modules/fcitx5/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - pkgs, - ... -}: - -{ - # GTK im-module settings for fcitx5 (XWayland apps) - gtk = { - gtk3.extraConfig.gtk-im-module = "fcitx"; - gtk4.extraConfig.gtk-im-module = "fcitx"; - }; - - i18n.inputMethod = { - enable = true; - type = "fcitx5"; - fcitx5 = { - addons = with pkgs; [ - fcitx5-mozc - fcitx5-gtk - ]; - settings = { - inputMethod = { - "Groups/0" = { - Name = "Default"; - "Default Layout" = "us"; - DefaultIM = "keyboard-us"; - }; - "Groups/0/Items/0" = { - Name = "keyboard-us"; - Layout = ""; - }; - "Groups/0/Items/1" = { - Name = "mozc"; - Layout = ""; - }; - GroupOrder = { - "0" = "Default"; - }; - }; - globalOptions = { - Hotkey = { - EnumerateWithTriggerKeys = "True"; - EnumerateSkipFirst = "False"; - }; - "Hotkey/TriggerKeys" = { - "0" = "Control+space"; - }; - Behavior = { - ActiveByDefault = "False"; - PreeditEnabledByDefault = "True"; - ShowInputMethodInformation = "True"; - DefaultPageSize = 5; - }; - }; - addons = { - classicui.globalSection = { - PreferTextIcon = "True"; - }; - }; - }; - }; - }; -} diff --git a/nixos/home/modules/gcc/default.nix b/nixos/home/modules/gcc/default.nix deleted file mode 100644 index 48905311..00000000 --- a/nixos/home/modules/gcc/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -# Copied from https://github.com/momeemt/config. -{ - pkgs, - ... -}: - -let - materialColors = { - red = "38;5;203"; - amber = "38;5;214"; - blue = "38;5;33"; - green = "38;5;71"; - purple = "38;5;127"; - gray = "38;5;245"; - cyan = "38;5;81"; - }; - bold = "01"; -in -{ - programs.gcc = { - enable = true; - package = pkgs.gcc; - colors = { - error = "${bold};${materialColors.red}"; - warning = "${bold};${materialColors.amber}"; - note = "${bold};${materialColors.blue}"; - locus = materialColors.gray; - quote = materialColors.gray; - path = materialColors.cyan; - range1 = materialColors.green; - range2 = materialColors.blue; - fixit-insert = materialColors.green; - fixit-delete = materialColors.red; - diff-filename = "${bold};${materialColors.blue}"; - diff-hunk = materialColors.purple; - diff-delete = materialColors.red; - diff-insert = materialColors.green; - type-diff = "${bold};${materialColors.purple}"; - fnname = "${bold};${materialColors.green}"; - targs = materialColors.purple; - valid = materialColors.green; - invalid = materialColors.red; - highlight-a = "${bold};${materialColors.blue}"; - highlight-b = "${bold};${materialColors.amber}"; - }; - }; -} diff --git a/nixos/home/modules/ghostty/default.nix b/nixos/home/modules/ghostty/default.nix deleted file mode 100644 index bda478ce..00000000 --- a/nixos/home/modules/ghostty/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - home.packages = with pkgs; [ - ghostty - ]; - - xdg.configFile."ghostty/config" = { - source = ./files/config; - }; -} diff --git a/nixos/home/modules/ghostty/files/config b/nixos/home/modules/ghostty/files/config deleted file mode 100644 index 8deb4418..00000000 --- a/nixos/home/modules/ghostty/files/config +++ /dev/null @@ -1,26 +0,0 @@ -# NOTE(himkt): 18446744073709551615 is usize limit - -# app config -macos-titlebar-style = native -window-theme = dark -window-padding-x = 5 -window-padding-y = 5 -window-padding-balance = true -scrollback-limit = 18446744073709551615 - -# color config -theme = GitHub Dark Default - -# background config -background-opacity = 0.95 -background-blur-radius = 20 - -# font config -font-family = Jetbrains Mono -font-family = Hiragino Kaku Gothic ProN -font-size = 11 -font-feature = -calt, -liga, -dlig -keybind = shift+enter=text:\n -keybind = super+t=new_tab - -clipboard-paste-protection = false diff --git a/nixos/home/modules/git/default.nix b/nixos/home/modules/git/default.nix deleted file mode 100644 index b0c7ec4e..00000000 --- a/nixos/home/modules/git/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - programs.git = { - enable = true; - lfs.enable = true; - - settings = { - user = { - name = "himkt"; - email = "himkt@klis.tsukuba.ac.jp"; - }; - credential."https://github.com" = { - helper = "!gh auth git-credential"; - }; - }; - - # Load additional config from dotfiles - includes = [ - { path = "~/.config/git/config-extra"; } - ]; - }; - - # Additional git config (aliases, format, etc.) - xdg.configFile."git/config-extra" = { - source = ./files/config; - }; - - # Global gitignore - xdg.configFile."git/ignore" = { - source = ./files/ignore; - }; -} diff --git a/nixos/home/modules/git/files/config b/nixos/home/modules/git/files/config deleted file mode 100644 index 799b8a54..00000000 --- a/nixos/home/modules/git/files/config +++ /dev/null @@ -1,47 +0,0 @@ -[user] - email = himkt@klis.tsukuba.ac.jp - name = himkt - -[pull] - rebase = false - -[alias] - remove-merged = "!f() { \ - if [ -n \"$1\" ]; then \ - BRANCH=\"$1\"; \ - else \ - BRANCH=$(git branch | awk '{print $NF}' | fzf --prompt '(base branch) > '); \ - fi; \ - if [ -z \"$BRANCH\" ]; then \ - echo \"Select valid branch\"; \ - exit 1; \ - fi; \ - echo \"Log: base branch: $BRANCH\"; \ - git branch --merged \"$BRANCH\" | grep -v \"$BRANCH\" | xargs -r git branch -d; \ - }; f" - graph = log --graph --date-order --pretty=format:'<%h> %ad %Cgreen%d%Creset %s %Cblue[%an]%Creset' --all --date=short - -[format] - pretty = format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an] - date = iso -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true -[column] - ui = auto -[branch] - sort = -committerdate -[tag] - sort = version:refname -[init] - defaultBranch = main -[diff] - colorMoved = plain - mnemonicPrefix = true - renames = true -[credential "https://github.com"] - helper = !/opt/homebrew/bin/gh auth git-credential -[credential "https://gist.github.com"] - helper = !/opt/homebrew/bin/gh auth git-credential diff --git a/nixos/home/modules/git/files/ignore b/nixos/home/modules/git/files/ignore deleted file mode 100644 index 27749c83..00000000 --- a/nixos/home/modules/git/files/ignore +++ /dev/null @@ -1,22 +0,0 @@ -# editor -.vim -.vscode - -# ruby -.rakeTasks -.rubocop.yml - -# python -.venv -*.egg-info -.mypy_cache - -# jetbrains -.idea - -.DS_Store - -.apple-silicon-platform - -**/.claude -**/CLAUDE.md diff --git a/nixos/home/modules/gpg/default.nix b/nixos/home/modules/gpg/default.nix deleted file mode 100644 index 07b8925f..00000000 --- a/nixos/home/modules/gpg/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - pkgs, - config, - ... -}: { - programs.gpg = { - enable = true; - package = pkgs.gnupg; - homedir = "${config.xdg.dataHome}/gnupg"; - - mutableKeys = true; - mutableTrust = true; - }; -} diff --git a/nixos/home/modules/java/default.nix b/nixos/home/modules/java/default.nix deleted file mode 100644 index 9de586f7..00000000 --- a/nixos/home/modules/java/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - pkgs, - ... -}: - -{ - programs.java = { - enable = true; - package = pkgs.jdk21; - }; -} diff --git a/nixos/home/modules/mise/default.nix b/nixos/home/modules/mise/default.nix deleted file mode 100644 index e0478c5c..00000000 --- a/nixos/home/modules/mise/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - pkgs, - inputs, - ... -}: - -let - unstable = import inputs.nixpkgs-unstable { - system = pkgs.system; - }; -in - -{ - programs.mise = { - enable = true; - package = unstable.mise; - enableZshIntegration = true; - - globalConfig = { - tools = { - "aqua:anthropics/claude-code" = "latest"; - "core:node" = "latest"; - }; - - settings = { - all_compile = false; - experimental = true; - disable_backends = [ "asdf" ]; - }; - }; - }; -} diff --git a/nixos/home/modules/nvim/default.nix b/nixos/home/modules/nvim/default.nix deleted file mode 100644 index 79b224a8..00000000 --- a/nixos/home/modules/nvim/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - - plugins = with pkgs.vimPlugins; [ - vim-easymotion - tabular - fzf-vim - vim-indent-guides - vim-anzu - vim-airline - vim-polyglot - ]; - }; - - xdg.configFile."nvim/init.vim" = { - source = ./files/init.vim; - }; - - xdg.configFile."nvim/vimrc" = { - source = ./files/vimrc; - }; -} diff --git a/nixos/home/modules/nvim/files/init.vim b/nixos/home/modules/nvim/files/init.vim deleted file mode 100644 index c59030f5..00000000 --- a/nixos/home/modules/nvim/files/init.vim +++ /dev/null @@ -1,45 +0,0 @@ -" vim: ft=vim -" -" --------------------- -" -" NeoVim configuration -" -" @author = 'himkt' -" -" --------------------- -" - -"" disable mouse -set mouse= - -"" use python3 installed globally -let g:python3_host_prog=$PYTHONSYSTEMPATH - -"" load basic vim configuration -source $XDG_CONFIG_HOME/nvim/vimrc - -" material.vim -if (has('nvim')) - let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 -endif - -if (has('termguicolors')) - set termguicolors -endif - -hi Normal guibg=NONE ctermbg=NONE -hi Visual guibg=gray - -" vim-easymotion -let g:EasyMotion_do_mapping = 0 -nmap // (easymotion-sn) - -" fzf -nnoremap :call fzf#vim#files('', fzf#vim#with_preview('right')) -nnoremap :Commands - -" tabular -vnoremap tr : Tabularize / - -" vim-indent-guide -let g:indent_guides_enable_on_vim_startup = 1 diff --git a/nixos/home/modules/nvim/files/vimrc b/nixos/home/modules/nvim/files/vimrc deleted file mode 100644 index f4223433..00000000 --- a/nixos/home/modules/nvim/files/vimrc +++ /dev/null @@ -1,149 +0,0 @@ -" -" --------------------- -" -" Vim configuration -" -" @author = 'himkt' -" -" --------------------- -" - -if &compatible - set nocompatible -endif - -filetype plugin indent on -syntax on -colorscheme default - -set background=dark - -if exists('$SHELL') - set shell=$SHELL -else - set shell=/bin/sh -endif - -" open with the cursor in previous session -augroup vimrcEx - au BufRead * if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | endif -augroup END - -"" File encodings -set encoding=utf-8 -set fileencodings=utf-8,iso-2022-jp,euc-jp,ascii -set fileformats=unix,mac,dos - -"" Open a new buffer without saving -set hidden - -"" Show vim title for a window -set title - -set number -set nuw=5 - -"" Show command in status line -set showcmd - -"" Japanese input (TODO check whether if I can remove them) -set ttimeout -set ttimeoutlen=50 - -"" Indent and tab -set expandtab -set nowrap -set autoindent -set smartindent -set smarttab - -"" shift and tab stop -set tabstop=2 -set shiftwidth=2 -autocmd FileType python setl tabstop=8 shiftwidth=4 softtabstop=4 -autocmd FileType cpp setl tabstop=4 shiftwidth=4 softtabstop=4 -autocmd FileType sql setl tabstop=4 shiftwidth=4 softtabstop=4 - -"" Do not create backup and swap files -set noswapfile -set nobackup - -"" Enable incremental and hilighting search -set hlsearch -set incsearch -set shortmess-=S - -"" Hilight a matched bracket -set showmatch -set matchtime=1 - -set backspace=indent,eol,start - -"" colorize pane partition -set fillchars+=vert:│ -hi VertSplit ctermbg=None ctermfg=Blue - -"" Popup color -hi Pmenu ctermbg=235 ctermfg=228 -hi PmenuSel ctermbg=253 ctermfg=232 - -"" Cursor -hi CursorLine gui=underline cterm=underline ctermfg=NONE guifg=NONE - -"" If vertical split -> open a new pane to right, -"" and if horizontal split -> open a new pane to below -set splitbelow -set splitright - -"" Folding config -set foldmethod=marker -set foldlevel=0 - -map ; : -nnoremap x "_x -vnoremap x "_x - -" indent -inoremap -inoremap - -" tab shortcuts -nnoremap : tabnew -nnoremap gT -nnoremap gt - -" window splitting -nnoremap vp : vs -nnoremap sp : sp - -" folding configuration -nnoremap zx :set foldlevel=99 -nnoremap zc :set foldlevel=0 - -" completion configuration -set completeopt=menuone,longest,preview -autocmd CompleteDone * pclose -autocmd FileType * setlocal omnifunc=syntaxcomplete#Complete - - -" tag hilighting -autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|IMPORTANT\)') -autocmd Syntax * call matchadd('Todo', '\W\zs\(BUG\|HACK\|NOTE\|INFO\|IDEA\)') - -" executing script in vim -autocmd FileType cpp nnoremap :sp :exec ':term clang++ --std=c++11 % && ./a.out && rm a.out' -autocmd FileType go nnoremap :sp :exec ':term go run %' -autocmd FileType ruby nnoremap :sp :exec ':term ruby %' -autocmd FileType python nnoremap :sp :exec ':term if [ -e ./.venv ] ; then; poetry run python %; else python3 %; fi' -autocmd FileType rust nnoremap :sp :exec ':term cargo run --bin ' . expand('%:t:r') - -" templates -autocmd BufNewFile *.cc 0r $HOME/dotfiles/nvim/template.d/cc/template.cc -autocmd BufNewFile *.go 0r $HOME/dotfiles/nvim/template.d/go/template.go -autocmd BufNewFile setup.cfg 0r $HOME/dotfiles/nvim/template.d/python/setup.cfg - -if $ATC != "" - autocmd BufNewFile *.rs 0r $HOME/dotfiles/nvim/template.d/rs/atcoder.rs - autocmd FileType rust nnoremap :sp :exec ':term rustc % && ./' . expand('%:t:r') . ' && rm ' . expand('%:t:r') -endif diff --git a/nixos/home/modules/sheldon/default.nix b/nixos/home/modules/sheldon/default.nix deleted file mode 100644 index 6ac3e11d..00000000 --- a/nixos/home/modules/sheldon/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - home.packages = with pkgs; [ - sheldon - ]; - - xdg.configFile."sheldon/plugins.toml" = { - source = ./files/plugins.toml; - }; -} diff --git a/nixos/home/modules/sheldon/files/plugins.toml b/nixos/home/modules/sheldon/files/plugins.toml deleted file mode 100644 index d501f3aa..00000000 --- a/nixos/home/modules/sheldon/files/plugins.toml +++ /dev/null @@ -1,17 +0,0 @@ -shell = "zsh" - -[templates] -macos_source = ''' -if [[ "$OSTYPE" = darwin* ]]; then - {{ hooks?.pre | nl }}{% for file in files %}source "{{ file }}" - {% endfor %}{{ hooks?.post | nl }} -fi -''' - -[plugins.zsh-autosuggestions] -github = 'zsh-users/zsh-autosuggestions' -apply = ['source'] - -[plugins.zsh-syntax-highlighting] -github = 'zsh-users/zsh-syntax-highlighting' -apply = ['source'] diff --git a/nixos/home/modules/tmux/default.nix b/nixos/home/modules/tmux/default.nix deleted file mode 100644 index b0081458..00000000 --- a/nixos/home/modules/tmux/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - programs.tmux = { - enable = true; - extraConfig = builtins.readFile ./files/tmux.conf; - }; -} diff --git a/nixos/home/modules/tmux/files/tmux.conf b/nixos/home/modules/tmux/files/tmux.conf deleted file mode 100644 index b2e9ea76..00000000 --- a/nixos/home/modules/tmux/files/tmux.conf +++ /dev/null @@ -1,57 +0,0 @@ -# -# tmux.conf -# -# @author = himkt - -unbind C-b - -# default config -set -g status-interval 2 -set -g default-terminal "screen-256color" -set -g status-justify left - -# enable mouse mode -setw -g mode-keys vi -bind-key -T copy-mode-vi y send -X copy-selection-and-cancel -bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel - -# color -set -g status-fg colour231 -set -g status-bg colour234 - -# pane -set -g pane-border-style fg=colour240 -set -g pane-active-border-style fg=colour31 -set -g pane-border-status top -set -g pane-border-format "#{?pane_active,#[fg=colour31] [*] #T ,#[fg=colour240] #T }" - -# window -window_status_current_format1="#[fg=colour234,bg=colour31] #[fg=colour117,bg=colour31]" -window_status_current_format2="#I #[fg=colour231]#W #[fg=colour31,bg=colour234,nobold]" -window_status_current_format=$window_status_current_format1' '$window_status_current_format2 -set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240] #[default]#W" -set -g window-status-current-format $window_status_current_format - -# take over current directory path -bind-key '"' split-window -c "#{pane_current_path}" -bind-key % split-window -h -c "#{pane_current_path}" -bind-key c new-window -c "#{pane_current_path}" - -# status bar -set -g status-left-length 20 -status_left1="#{?client_prefix,#[fg=colour254]#[bg=colour31],#[fg=colour16]#[bg=colour254]}" -status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}" -set -qg status-left $status_left1' '$status_left2 -set -qg status-right '%H:%M #[fg=colour16,bg=colour254]' - -# tmux config -set -g escape-time 10 -set -g history-limit 50000 - -bind ^h select-layout even-horizontal -bind ^v select-layout even-vertical - -# NOTE Commands `search-xxx-incremental` is new feature, it counldn't use in some environments -# For old tmux, please comment out following statement -bind-key -T copy-mode-vi / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\"" -bind-key -T copy-mode-vi ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\"" diff --git a/nixos/home/modules/uv/default.nix b/nixos/home/modules/uv/default.nix deleted file mode 100644 index 25e601ca..00000000 --- a/nixos/home/modules/uv/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - home.packages = with pkgs; [ - uv - ]; - - xdg.configFile."uv/uv.toml" = { - source = ./files/uv.toml; - }; -} diff --git a/nixos/home/modules/uv/files/uv.toml b/nixos/home/modules/uv/files/uv.toml deleted file mode 100644 index 39128ea0..00000000 --- a/nixos/home/modules/uv/files/uv.toml +++ /dev/null @@ -1 +0,0 @@ -python-preference = "managed" diff --git a/nixos/home/modules/zsh/default.nix b/nixos/home/modules/zsh/default.nix deleted file mode 100644 index b332399e..00000000 --- a/nixos/home/modules/zsh/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - programs.zsh = { - enable = true; - initContent = builtins.readFile ./files/zshrc; - shellAliases = { - open = "xdg-open"; - }; - }; - - # Additional packages needed by zshrc - home.packages = with pkgs; [ - fzf - zoxide - ]; -} diff --git a/nixos/home/modules/zsh/files/zshrc b/nixos/home/modules/zsh/files/zshrc deleted file mode 100644 index c42dee76..00000000 --- a/nixos/home/modules/zsh/files/zshrc +++ /dev/null @@ -1,189 +0,0 @@ -# -# .zshrc - The zsh configuration -# - -if command -v tmux > /dev/null && [ -z "$TMUX" ] && [ -z "$VSCODE_INJECTION" ] && [[ $- == *i* ]]; then - tmux attach-session 2>/dev/null || tmux new-session -fi - -bindkey -e - -autoload -Uz compinit && compinit -autoload -Uz colors && colors -autoload -Uz zmv && alias zmv='noglob zmv -W' - -setopt auto_cd # cd without cd -setopt extended_history # include timestamp and duration to the history. -setopt share_history # persist history to the file. -setopt magic_equal_subst # expand filename for unquoted arguments. -setopt mark_dirs # insert '/' when directory is expanded via globbing. -setopt no_beep # disable beep in ZLE. -setopt prompt_subst # enable substitution in prompt (needed if we want to show information in PROMPT). - -zstyle ':completion:*:default' menu select=2 # enable menu in completion. - -function ls () { - command ls --color $@ -} - -function date () { - case ${OSTYPE} in - darwin*) - command gdate $@ ;; - linux*) - command date $@ ;; - esac -} - -function retcode () { - echo $? -} - -function git-home () { - cd `git rev-parse --show-toplevel` -} - -# tier1 -export EDITOR=vim -export FZF_DEFAULT_OPTS='--height 50% --reverse --border' -export GOPATH=$HOME/go -export GHQ_ROOT=$HOME/work -export HISTFILE=$HOME/.zsh-history -export HISTSIZE=100000 -export PYTHONDONTWRITEBYTECODE=1 -export SAVEHIST=100000 -export TERM=xterm-256color -export XDG_CONFIG_HOME=$HOME/.config - -# tier2 -export HIMKT_DOTFILES_PRIVATE_CONFIG_DIR=$XDG_CONFIG_HOME/himkt/dotfiles/zsh/config.d -export TIPS_HOME=$GHQ_ROOT/github.com/himkt/tips-data - -language=en_US.UTF-8 -# If `en_US.UTF-8` is not available, fallback to `C.utf8` -if [ "`locale -a | grep $language`" != $language ]; then - language=C.utf8 -fi -export LANG=$language -export LC_CTYPE=$language - -for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.pre.zsh") -do - source $source -done - -case `uname -s` in -Darwin*) - export HOMEBREW_ROOT=/opt/homebrew - export HOMEBREW_CACHE=$HOME/.cache/Homebrew - ;; -Linux*) - export HOMEBREW_ROOT=/home/linuxbrew/.linuxbrew - ;; -esac - -for prefix in $HOMEBREW_ROOT $HOME $HOME/.local $HOME/dotfiles $GOPATH $HOME/.rd; do - export PATH=$PATH:$prefix/bin -done - -if command -v brew > /dev/null; then - export BREW_HOME=$(brew --prefix) - export HOMEBREW_NO_AUTO_UPDATE=1 - eval $(brew shellenv) - - if [ -d "$HOMEBREW_ROOT/opt/xz" ]; then - export CONFIGURE_OPTS="--enable-shared" - export CPPFLAGS="-I$(brew --prefix xz)/include" - export LDFLAGS="-L$(brew --prefix xz)/lib" - fi - - if [ -d "$HOMEBREW_ROOT/opt/openjdk" ]; then - export PATH="$HOMEBREW_ROOT/opt/openjdk/bin:$PATH" - export CPPFLAGS="$CPPFLAGS:-I$HOMEBREW_ROOT/opt/openjdk/include" - fi - - if [ -d "$HOMEBREW_ROOT/opt/libpq/bin" ]; then - export PATH="$HOMEBREW_ROOT/opt/libpq/bin:$PATH" - fi -fi - -export PYTHONSYSTEMPATH=$(which python3) - -# NOTE; Utilities - -function current_context () { - if test -f $XDG_CONFIG_HOME/kubectl-toggle-ctx/hide; then - return - fi - - if ! command -v kubectl > /dev/null; then - return - fi - - current_context=$(command kubectl config current-context) &> /dev/null - if [ "$?" -ne 0 ]; then - return - fi - - echo "[$fg_bold[blue]$current_context$reset_color]" -} - -function current_path () { - echo "[$fg_bold[yellow]%~$reset_color]" -} - -function current_timestamp () { - echo "[$fg_bold[red]$(date +'%H:%M:%S')$reset_color]" -} - -function current_git_status () { - local git_branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)" - if [ -z "$git_branch" ]; then - return - fi - - UNTRACK_STATUS="" - UNTRACK_STATUS+="$fg_bold[red]$(git ls-files --other --exclude-standard | wc -l | awk '{print $1}')$reset_color" - UNTRACK_STATUS+="$fg_bold[yellow]$(git diff --name-only | wc -l | awk '{print $1}')$reset_color" - UNTRACK_STATUS+="$fg_bold[green]$(git diff --name-only --staged | wc -l | awk '{print $1}')$reset_color" - BRANCH_NAME="$fg_bold[red]$git_branch$reset_color" - echo "[$UNTRACK_STATUS$fg_bold[gray]@$BRANCH_NAME$reset_color]" -} - -PROMPT='$(current_timestamp)$(current_context)$(current_path)$(current_git_status)' -PROMPT+=$'\n' -PROMPT+='> ' -SPROMPT="${fg[red]}%r$reset_color is correct? [y, n, a, e]:" - -if command -v fzf > /dev/null; then - source <(fzf --zsh) -fi - - -if command -v nvim > /dev/null; then - alias vim=nvim - export EDITOR=nvim -fi - -if command -v sheldon > /dev/null; then - eval "$(sheldon -q source)" -fi - -if command -v zoxide > /dev/null; then - eval "$(zoxide init zsh)" -fi - -if command -v kubectl > /dev/null; then - export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - source <(kubectl completion zsh) - alias k=kubectl -fi - -if [ -f "$HOME/.cargo/env" ]; then - . "$HOME/.cargo/env" -fi - -for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.post.zsh") -do - source $source -done diff --git a/nixos/home/nixos.nix b/nixos/home/nixos.nix deleted file mode 100644 index 08ae0023..00000000 --- a/nixos/home/nixos.nix +++ /dev/null @@ -1,235 +0,0 @@ -{ config, pkgs, inputs, ... }: - -let - unstable = import inputs.nixpkgs-unstable { - system = pkgs.system; - config.allowUnfree = true; - }; - himkt_pkgs = import ./pkgs { - inherit pkgs; - }; -in - -{ - imports = [ - ./modules/zsh - ./modules/sheldon - ./modules/tmux - ./modules/nvim - ./modules/git - ./modules/uv - ./modules/ghostty - ./modules/gcc - ./modules/java - ./modules/gpg - ./modules/fcitx5 - ./modules/mise - ]; - - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "himkt"; - home.homeDirectory = "/home/himkt"; - - # 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 should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "25.11"; # Please read the comment before changing. - - # XDG Base Directory specification - xdg = { - enable = true; - configHome = "${config.home.homeDirectory}/.config"; - cacheHome = "${config.home.homeDirectory}/.cache"; - dataHome = "${config.home.homeDirectory}/.local/share"; - }; - - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - # # Adds the 'hello' command to your environment. It prints a friendly - # # "Hello, world!" when run. - # pkgs.hello - - # # It is sometimes useful to fine-tune packages, for example, by applying - # # overrides. You can do that directly here, just don't forget the - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of - # # fonts? - # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - - # # You can also create simple shell scripts directly inside your - # # configuration. For example, this adds a command 'my-hello' to your - # # environment: - # (pkgs.writeShellScriptBin "my-hello" '' - # echo "Hello, ${config.home.username}!" - # '') - - # GUI - google-chrome - inkscape - insomnia - slack - unstable._1password-gui - unstable.vscode - - # CLI - bazelisk - btop - file - gh - ghq - google-cloud-sdk - gnumake - jq - kubectl - kubectx - kustomize - k9s - postgresql - python3 - rustup - tree - - # my own softwares - himkt_pkgs.pathfinder - ]; - - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - - # Chrome with touchpad swipe gesture support - ".local/share/applications/google-chrome.desktop".text = '' - [Desktop Entry] - Version=1.0 - Name=Google Chrome - GenericName=Web Browser - Comment=Access the Internet - Exec=google-chrome-stable --enable-features=TouchpadOverscrollHistoryNavigation %U - StartupNotify=true - Terminal=false - Icon=google-chrome - Type=Application - Categories=Network;WebBrowser; - MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; - ''; - - # Hide duplicate Chrome entry - ".local/share/applications/com.google.Chrome.desktop".text = '' - [Desktop Entry] - NoDisplay=true - ''; - - # Ghostty with fcitx5 workaround - # See: https://github.com/ghostty-org/ghostty/discussions/3628 - ".local/share/applications/com.mitchellh.ghostty.desktop".text = '' - [Desktop Entry] - Version=1.0 - Name=Ghostty - GenericName=Terminal - Comment=A terminal emulator - Exec=env GTK_IM_MODULE= ghostty - StartupNotify=true - Terminal=false - Icon=com.mitchellh.ghostty - Type=Application - Categories=System;TerminalEmulator; - ''; - - # VSCode with Wayland support for better text rendering - ".local/share/applications/code.desktop".text = '' - [Desktop Entry] - Version=1.0 - Name=Visual Studio Code - GenericName=Text Editor - Comment=Code Editing. Redefined. - Exec=code --ozone-platform=wayland %F - StartupNotify=true - Terminal=false - Icon=vscode - Type=Application - Categories=Development;IDE;TextEditor; - MimeType=text/plain;inode/directory; - ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/himkt/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - EDITOR = "nvim"; - SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; - - # fcitx5 IME support - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - GLFW_IM_MODULE = "ibus"; # For some apps that use GLFW - - # Enable Wayland for Electron apps (VSCode, Slack, etc.) - # NIXOS_OZONE_WL = "1"; - ELECTRON_OZONE_PLATFORM_HINT = "auto"; - }; - - dconf.settings = { - "org/gnome/mutter" = { - experimental-features = [ "scale-monitor-framebuffer" ]; - }; - - "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = false; - natural-scroll = true; - speed = 0.0; - }; - "org/gnome/desktop/peripherals/mouse" = { - speed = -1.0; - natural-scroll = true; - }; - "org/gnome/desktop/interface" = { - show-battery-percentage = true; - }; - }; - - fonts.fontconfig = { - enable = true; - defaultFonts = { - monospace = [ - "JetBrains Mono" - "Noto Sans Mono CJK JP" - ]; - sansSerif = [ "Noto Sans CJK JP" ]; - serif = [ "Noto Serif CJK JP" ]; - emoji = [ "Noto Color Emoji" ]; - }; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/nixos/home/pkgs/default.nix b/nixos/home/pkgs/default.nix deleted file mode 100644 index c7849c9a..00000000 --- a/nixos/home/pkgs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs }: - -{ - pathfinder = pkgs.callPackage ./pathfinder { }; -} diff --git a/nixos/home/pkgs/pathfinder/default.nix b/nixos/home/pkgs/pathfinder/default.nix deleted file mode 100644 index 70fd25ef..00000000 --- a/nixos/home/pkgs/pathfinder/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - autoPatchelfHook, -}: - -stdenv.mkDerivation rec { - pname = "pathfinder"; - version = "0.1.0"; - - src = fetchurl { - url = "https://github.com/himkt/pathfinder/releases/download/v${version}/pathfinder-x86_64-unknown-linux-gnu.tar.gz"; - sha256 = "18bpvh651i1nk4agkxqqaax22y0fa3nwpfhhanlprzprq08cdvdk"; - }; - - nativeBuildInputs = [ autoPatchelfHook ]; - buildInputs = [ stdenv.cc.cc.lib ]; - - sourceRoot = "."; - - installPhase = '' - install -Dm755 pathfinder $out/bin/pathfinder - ''; - - meta = with lib; { - description = "MCP client for jumping to definitions using LSP server"; - homepage = "https://github.com/himkt/pathfinder"; - license = licenses.mit; - platforms = [ "x86_64-linux" ]; - }; -} diff --git a/nixos/hosts/modules/keyd/default.nix b/nixos/hosts/modules/keyd/default.nix deleted file mode 100644 index 133fd8c5..00000000 --- a/nixos/hosts/modules/keyd/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: - -{ - services.keyd = { - enable = true; - keyboards.default = { - settings = { - main = { - capslock = "leftcontrol"; - }; - control = { - q = "A-f4"; - left = "home"; - right = "end"; - up = "C-home"; - down = "C-end"; - }; - }; - }; - }; -} diff --git a/nixos/hosts/nixos/configuration.nix b/nixos/hosts/nixos/configuration.nix deleted file mode 100644 index 5ae684e6..00000000 --- a/nixos/hosts/nixos/configuration.nix +++ /dev/null @@ -1,204 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../modules/keyd - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - boot.initrd.luks.devices."luks-f47715a3-2a66-448c-9e93-7268419de718".device = "/dev/disk/by-uuid/f47715a3-2a66-448c-9e93-7268419de718"; - networking.hostName = "neptune"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # sops-nix secrets - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - age.keyFile = "/var/lib/sops-nix/key.txt"; - secrets.nextdns_id = {}; - secrets.dns_server_ipv4_0 = {}; - secrets.dns_server_ipv4_1 = {}; - secrets.dns_server_ipv6_0 = {}; - secrets.dns_server_ipv6_1 = {}; - templates."99-nextdns.conf" = { - content = '' - [Resolve] - DNS=${config.sops.placeholder.dns_server_ipv4_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io - DNS=${config.sops.placeholder.dns_server_ipv6_0}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io - DNS=${config.sops.placeholder.dns_server_ipv4_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io - DNS=${config.sops.placeholder.dns_server_ipv6_1}#${config.sops.placeholder.nextdns_id}.dns.nextdns.io - ''; - path = "/etc/systemd/resolved.conf.d/99-nextdns.conf"; - mode = "0644"; - restartUnits = [ "systemd-resolved.service" ]; - }; - }; - - # DNS over TLS with NextDNS - services.resolved = { - enable = true; - dnsovertls = "true"; - fallbackDns = []; - }; - networking.networkmanager.dns = "systemd-resolved"; - - # Set your time zone. - time.timeZone = "Asia/Tokyo"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "ja_JP.UTF-8"; - LC_IDENTIFICATION = "ja_JP.UTF-8"; - LC_MEASUREMENT = "ja_JP.UTF-8"; - LC_MONETARY = "ja_JP.UTF-8"; - LC_NAME = "ja_JP.UTF-8"; - LC_NUMERIC = "ja_JP.UTF-8"; - LC_PAPER = "ja_JP.UTF-8"; - LC_TELEPHONE = "ja_JP.UTF-8"; - LC_TIME = "ja_JP.UTF-8"; - }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the GNOME Desktop Environment. - services.displayManager.gdm.enable = true; - services.desktopManager.gnome.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # FIXME(himkt); fprint not working so well in some cases. - # when finger print reader is not available, - # the experience is not so good as macOS (waiting until timeout). - # this happens when I use computer in clamshell mode and - # keyboard without fingerprint reader. - # - # Fingerprint reader - # services.fprintd = { - # enable = true; - # tod = { - # enable = true; - # driver = pkgs.libfprint-2-tod1-goodix; # note; Goodix 27c6:658c - # }; - # }; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - - security.pam.services.gdm.enableGnomeKeyring = true; - services.gnome.gnome-keyring.enable = true; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Docker - virtualisation.docker = { - enable = true; - enableOnBoot = false; - }; - systemd.sockets.docker.wantedBy = pkgs.lib.mkForce []; - - # Define a user account. Don't forget to set a password with 'passwd'. - users.users.himkt = { - isNormalUser = true; - description = "himkt"; - extraGroups = [ "networkmanager" "wheel" "docker" ]; - packages = with pkgs; [ - # thunderbird - ]; - shell = pkgs.zsh; - }; - - # Install firefox. - programs.firefox.enable = true; - programs.zsh.enable = true; - programs.nix-ld.enable = true; - - programs.nix-ld.libraries = with pkgs; [ - postgresql.lib - ]; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - ]; - - fonts.packages = with pkgs; [ - jetbrains-mono - noto-fonts - noto-fonts-color-emoji - noto-fonts-cjk-sans - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - networking.firewall.trustedInterfaces = [ "docker0" "br-+" ]; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "25.11"; # Did you read the comment? - -} diff --git a/nixos/hosts/nixos/hardware-configuration.nix b/nixos/hosts/nixos/hardware-configuration.nix deleted file mode 100644 index fed4eeae..00000000 --- a/nixos/hosts/nixos/hardware-configuration.nix +++ /dev/null @@ -1,35 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/mapper/luks-221ba240-258a-48a9-a316-e2de691f08c8"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-221ba240-258a-48a9-a316-e2de691f08c8".device = "/dev/disk/by-uuid/221ba240-258a-48a9-a316-e2de691f08c8"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/FEFA-7EFC"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/mapper/luks-f47715a3-2a66-448c-9e93-7268419de718"; } - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/nixos/secrets/secrets.yaml b/nixos/secrets/secrets.yaml deleted file mode 100644 index 0334e5f1..00000000 --- a/nixos/secrets/secrets.yaml +++ /dev/null @@ -1,30 +0,0 @@ -#ENC[AES256_GCM,data:HjKcqrXCAY2skTqI5aopYcMfREo9iKD82FsAXymsEmJ7MFeCBoVTFEVZTm7EEOCo8BWik45zNg==,iv:ELijRN47sRn0BqZKbj2LPh9hhuyH+v56CxrzDL/EYVo=,tag:Wgs0Pmt8UNCk9slnw5gd6w==,type:comment] -nextdns_id: ENC[AES256_GCM,data:8FIzB79/,iv:3t/0V4Chopg5SffE6P1JcB4PNGzLWtrsC3Gio03b5bk=,tag:o30xHwtx3sLMihwtuNUDoQ==,type:str] -dns_server_ipv4_0: ENC[AES256_GCM,data:PksLLL7TivYagw==,iv:/an1zGWRy2AhQBrC9AlJq2bwftHtMe4AQcenPu0GGqk=,tag:vgnre1OAbkcWPPdbpmSrwg==,type:str] -dns_server_ipv4_1: ENC[AES256_GCM,data:yXc1v7Ez978CQQ==,iv:77OcSVmXP4jfZ75xWJj9U+LoA18dBAg3Wrj+q3lz8LY=,tag:Sdfg31yhHNxuMUKRo2Ebgw==,type:str] -dns_server_ipv6_0: ENC[AES256_GCM,data:vrx6yabMcK7PslA=,iv:9wS55xgvcAOdLqYJ1ZDR5NWvBZEyZxgaWWB2EFQbtyg=,tag:tbHL/hAwmLV0Ndmu6Hra6w==,type:str] -dns_server_ipv6_1: ENC[AES256_GCM,data:IfMPanxqDSVlkDk=,iv:JHN2+Es6apKu0yJxwsPaSSJiSNRk/IASTJbo/iRAfjs=,tag:KJcJbPnvxwQTHUepDnAj9g==,type:str] -sops: - age: - - recipient: age1p35h8xyy545vjzjledqsvlvy935zdzl97tyjeejq6qxnh3c2uq5qllurj3 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoMGVpSGtHVWdPR0lOTEtC - M0hpbEc3K1ZQS0FHM1FXTzFHWGM1UGZHdkRJCitSK1FsUENoL1hTYlJ6bm1FWklG - TGtHb2JodnZaU1V4QTgxOUVTbHFoTmMKLS0tIEdWNzNIOE1DbkZuU0IxLzU1Q2Rj - aG4yZXZhZmg2cDU2Ym1rdDBUQndabU0K7TUnP0dOb/yDTRPyMbjW5MeB9LHdn7E9 - RDg98FbWKER0Z9JHBRIAFvdvaWl62KEgAsLHb25Jd16/73CedM+W/Q== - -----END AGE ENCRYPTED FILE----- - - recipient: age1ngnflnwfkmadkqugc80qx2z550cpgany2dmsump0mvp0htgvnd8qg8hdjq - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiTU8xd1ZPeDNNQVRnd01s - REQ3S2tWTXBiWVQ3eHl5V2FlZHkraEl3OVV3CndQczhKaHB4blRxRTdQMzJLZGRq - MTkvOWZkR2dtalE2UjhXQVplQkM4RE0KLS0tIG5wck0ySFFOTDVOWWU5b3NTWjdx - c3ZqVC9kYXRvR0lFR3hkWjZBQjk0dncKlf1biEZVu8Mx1Cc/NpgcG9S7CvJZWSw9 - Ds0YABw1dJWxfgOMuS+IA9UrDdd61u8SyBgEvM4TKVPfP/4l/5lSbA== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2026-01-26T13:18:11Z" - mac: ENC[AES256_GCM,data:oGw0eA5hAd1yuTVZKDnZfqZUujb90kYlJSJbFlslN08+NjdooeKPgsAb5zwTak8quQE9mKpAhJzxvQDKBUkgSPmZMjX7xaQHhbhgoDXb4aGFWT19clvjQuonUT72fecZNxRhX2Cg+qorN1xZUnmOz001Pqh0+lPvWfJWiHsQJp4=,iv:i0bQ3ijVBcS1SeNrOiPeEWNz2MlIXqXJdEhnc0HvsKo=,tag:vlGSDnpdKgGIUsmTab6m9w==,type:str] - unencrypted_suffix: _unencrypted - version: 3.11.0 diff --git a/nvim/bin/setup.sh b/nvim/bin/setup.sh deleted file mode 100755 index 33c79ba4..00000000 --- a/nvim/bin/setup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -ln -s $HOME/dotfiles/nvim/config.d/vimrc $HOME/.vimrc - -if type "nvim" > /dev/null 2>&1; then - echo 'neovim found' - mkdir -p $HOME/.config/nvim - - ln -s $HOME/dotfiles/nvim/config.d/init.vim $HOME/.config/nvim/init.vim - - curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - - nvim --headless -u $PWD/nvim/config.d/init.vim +PlugInstall +qall - echo 'Plugin installed' - nvim --headless -u $PWD/nvim/config.d/init.vim +UpdateRemotePlugins +qall - - echo 'Finish creating the neovim environment!' -fi diff --git a/nvim/config.d/init.vim b/nvim/config.d/init.vim deleted file mode 100644 index f3373b96..00000000 --- a/nvim/config.d/init.vim +++ /dev/null @@ -1,57 +0,0 @@ -" vim: ft=vim -" -" --------------------- -" -" NeoVim configuration -" -" @author = 'himkt' -" -" --------------------- -" - -"" disable mouse -set mouse= - -"" use python3 installed globally -let g:python3_host_prog=$PYTHONSYSTEMPATH - -"" load basic vim configuration -source $HOME/dotfiles/nvim/config.d/vimrc - -"" load packages -call plug#begin('~/.config/nvim/plugged') - Plug 'easymotion/vim-easymotion' - Plug 'godlygeek/tabular' - Plug 'junegunn/fzf' - Plug 'junegunn/fzf.vim' - Plug 'nathanaelkane/vim-indent-guides' - Plug 'osyo-manga/vim-anzu' - Plug 'vim-airline/vim-airline' - Plug 'sheerun/vim-polyglot' -call plug#end() - -" material.vim -if (has('nvim')) - let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 -endif - -if (has('termguicolors')) - set termguicolors -endif - -hi Normal guibg=NONE ctermbg=NONE -hi Visual guibg=gray - -" vim-easymotion -let g:EasyMotion_do_mapping = 0 -nmap // (easymotion-sn) - -" fzf -nnoremap :call fzf#vim#files('', fzf#vim#with_preview('right')) -nnoremap :Commands - -" tabular -vnoremap tr : Tabularize / - -" vim-indent-guide -let g:indent_guides_enable_on_vim_startup = 1 diff --git a/nvim/config.d/vimrc b/nvim/config.d/vimrc deleted file mode 100644 index f4223433..00000000 --- a/nvim/config.d/vimrc +++ /dev/null @@ -1,149 +0,0 @@ -" -" --------------------- -" -" Vim configuration -" -" @author = 'himkt' -" -" --------------------- -" - -if &compatible - set nocompatible -endif - -filetype plugin indent on -syntax on -colorscheme default - -set background=dark - -if exists('$SHELL') - set shell=$SHELL -else - set shell=/bin/sh -endif - -" open with the cursor in previous session -augroup vimrcEx - au BufRead * if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | endif -augroup END - -"" File encodings -set encoding=utf-8 -set fileencodings=utf-8,iso-2022-jp,euc-jp,ascii -set fileformats=unix,mac,dos - -"" Open a new buffer without saving -set hidden - -"" Show vim title for a window -set title - -set number -set nuw=5 - -"" Show command in status line -set showcmd - -"" Japanese input (TODO check whether if I can remove them) -set ttimeout -set ttimeoutlen=50 - -"" Indent and tab -set expandtab -set nowrap -set autoindent -set smartindent -set smarttab - -"" shift and tab stop -set tabstop=2 -set shiftwidth=2 -autocmd FileType python setl tabstop=8 shiftwidth=4 softtabstop=4 -autocmd FileType cpp setl tabstop=4 shiftwidth=4 softtabstop=4 -autocmd FileType sql setl tabstop=4 shiftwidth=4 softtabstop=4 - -"" Do not create backup and swap files -set noswapfile -set nobackup - -"" Enable incremental and hilighting search -set hlsearch -set incsearch -set shortmess-=S - -"" Hilight a matched bracket -set showmatch -set matchtime=1 - -set backspace=indent,eol,start - -"" colorize pane partition -set fillchars+=vert:│ -hi VertSplit ctermbg=None ctermfg=Blue - -"" Popup color -hi Pmenu ctermbg=235 ctermfg=228 -hi PmenuSel ctermbg=253 ctermfg=232 - -"" Cursor -hi CursorLine gui=underline cterm=underline ctermfg=NONE guifg=NONE - -"" If vertical split -> open a new pane to right, -"" and if horizontal split -> open a new pane to below -set splitbelow -set splitright - -"" Folding config -set foldmethod=marker -set foldlevel=0 - -map ; : -nnoremap x "_x -vnoremap x "_x - -" indent -inoremap -inoremap - -" tab shortcuts -nnoremap : tabnew -nnoremap gT -nnoremap gt - -" window splitting -nnoremap vp : vs -nnoremap sp : sp - -" folding configuration -nnoremap zx :set foldlevel=99 -nnoremap zc :set foldlevel=0 - -" completion configuration -set completeopt=menuone,longest,preview -autocmd CompleteDone * pclose -autocmd FileType * setlocal omnifunc=syntaxcomplete#Complete - - -" tag hilighting -autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|IMPORTANT\)') -autocmd Syntax * call matchadd('Todo', '\W\zs\(BUG\|HACK\|NOTE\|INFO\|IDEA\)') - -" executing script in vim -autocmd FileType cpp nnoremap :sp :exec ':term clang++ --std=c++11 % && ./a.out && rm a.out' -autocmd FileType go nnoremap :sp :exec ':term go run %' -autocmd FileType ruby nnoremap :sp :exec ':term ruby %' -autocmd FileType python nnoremap :sp :exec ':term if [ -e ./.venv ] ; then; poetry run python %; else python3 %; fi' -autocmd FileType rust nnoremap :sp :exec ':term cargo run --bin ' . expand('%:t:r') - -" templates -autocmd BufNewFile *.cc 0r $HOME/dotfiles/nvim/template.d/cc/template.cc -autocmd BufNewFile *.go 0r $HOME/dotfiles/nvim/template.d/go/template.go -autocmd BufNewFile setup.cfg 0r $HOME/dotfiles/nvim/template.d/python/setup.cfg - -if $ATC != "" - autocmd BufNewFile *.rs 0r $HOME/dotfiles/nvim/template.d/rs/atcoder.rs - autocmd FileType rust nnoremap :sp :exec ':term rustc % && ./' . expand('%:t:r') . ' && rm ' . expand('%:t:r') -endif diff --git a/nvim/snippet.d/cpp/argsort.snippets b/nvim/snippet.d/cpp/argsort.snippets deleted file mode 100644 index a8071f9a..00000000 --- a/nvim/snippet.d/cpp/argsort.snippets +++ /dev/null @@ -1,16 +0,0 @@ -snippet argsort -template -vector argsort(vector input) { - size_t seq_len = input.size(); - - vector> seq(seq_len); - for (int i=0; i result(seq_len); - for (int i=0; i es; - vector d; - void run(int); - int INF = 1001001001; -}; - -void BellmanFord::run(int s) { - for (int i=0; i d[e.from] + e.cost) { - d[e.to] = d[e.from] + e.cost; - update = true; - } - } - if (!update) break; - } -} -endsnippet diff --git a/nvim/snippet.d/cpp/combination.snippets b/nvim/snippet.d/cpp/combination.snippets deleted file mode 100644 index 5b32c3e6..00000000 --- a/nvim/snippet.d/cpp/combination.snippets +++ /dev/null @@ -1,25 +0,0 @@ -snippet combination -const int MAX = 2000000; -const int MOD = 1000000000 + 7; - -long long fac[MAX], finv[MAX], inv[MAX]; - - -void COMinit() { - fac[0] = fac[1] = 1; - finv[0] = finv[1] = 1; - inv[1] = 1; - for (int i = 2; i < MAX; i++){ - fac[i] = fac[i - 1] * i % MOD; - inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; - finv[i] = finv[i - 1] * inv[i] % MOD; - } -} - - -long long COM(int n, int k){ - if (n < k) return 0; - if (n < 0 || k < 0) return 0; - return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; -} -endsnippet diff --git a/nvim/snippet.d/cpp/gcd.snippets b/nvim/snippet.d/cpp/gcd.snippets deleted file mode 100644 index b28a4854..00000000 --- a/nvim/snippet.d/cpp/gcd.snippets +++ /dev/null @@ -1,13 +0,0 @@ -snippet gcd -template -integer _gcd(integer a, integer b) { - if (b != 0) return _gcd(b, a%b); - else return a; -} - -template -integer gcd (integer a, integer b) { - if (a > b) return _gcd(a, b); - return _gcd(b, a); -} -endsnippet diff --git a/nvim/snippet.d/cpp/lcm.snippets b/nvim/snippet.d/cpp/lcm.snippets deleted file mode 100644 index 12fa7c7e..00000000 --- a/nvim/snippet.d/cpp/lcm.snippets +++ /dev/null @@ -1,6 +0,0 @@ -snippet lcm -template -integer lcm(integer a, integer b) { - return (a * b) / gcd(a, b); -} -endsnippet diff --git a/nvim/snippet.d/cpp/mod.snippets b/nvim/snippet.d/cpp/mod.snippets deleted file mode 100644 index d5fa7846..00000000 --- a/nvim/snippet.d/cpp/mod.snippets +++ /dev/null @@ -1,79 +0,0 @@ -# https://github.com/atcoder-live/library/blob/master/mint.cpp - -snippet mod -const int mod = 1e9+7; - - -struct mint { - long long x; // typedef long long long long; - mint(long long x=0):x((x%mod+mod)%mod){} - mint operator-() const { return mint(-x);} - mint& operator+=(const mint a) { - if ((x += a.x) >= mod) x -= mod; - return *this; - } - mint& operator-=(const mint a) { - if ((x += mod-a.x) >= mod) x -= mod; - return *this; - } - mint& operator*=(const mint a) { - (x *= a.x) %= mod; - return *this; - } - mint operator+(const mint a) const { - mint res(*this); - return res+=a; - } - mint operator-(const mint a) const { - mint res(*this); - return res-=a; - } - mint operator*(const mint a) const { - mint res(*this); - return res*=a; - } - mint pow(long long t) const { - if (!t) return 1; - mint a = pow(t>>1); - a *= a; - if (t&1) a *= *this; - return a; - } - - // for prime mod - mint inv() const { - return pow(mod-2); - } - mint& operator/=(const mint a) { - return (*this) *= a.inv(); - } - mint operator/(const mint a) const { - mint res(*this); - return res/=a; - } -}; - - -mint modpow(long long N, long long P) { - if (P == 0) return 1; - - if (P % 2 == 0) { - mint t = modpow(N, P / 2); - return t * t; - } - - mint t = modpow(N, P - 1); - t *= N; - return t; -} - - -mint choose(int n, int a) { - mint x = 1, y = 1; - for (int i=0; i> factor_result; -factor_result factor(long long base) { - vector> fs; - - for (long long i=2; i*i <= base; i++) { - if (base % i == 0) { - long long cnt = 0; - - while (base % i == 0) { - base /= i; - cnt++; - } - - fs.emplace_back(i, cnt); - } - } - if (base > 1) { - fs.emplace_back(base, 1); - } - - return fs; -} -endsnippet diff --git a/nvim/snippet.d/cpp/union_find.snippets b/nvim/snippet.d/cpp/union_find.snippets deleted file mode 100644 index f23792b9..00000000 --- a/nvim/snippet.d/cpp/union_find.snippets +++ /dev/null @@ -1,48 +0,0 @@ -snippet union_find -class UnionFind { - public: - // contain parent node_index - // if the node_id is root, -size(group) - vector parent; - long long root(int); - long long size(int); - - // judging functions - bool join(int, int); - bool same(int, int); - - UnionFind(int x) { - parent = vector(x, -1); - }; - -}; - - -long long UnionFind::root(int node_id) { - if (parent[node_id] < 0) return node_id; - else return parent[node_id] = UnionFind::root(parent[node_id]); -} - - -long long UnionFind::size(int node_id) { - return -parent[UnionFind::root(node_id)]; -} - - -bool UnionFind::same(int source_node_id, int target_node_id) { - return UnionFind::root(source_node_id) == UnionFind::root(target_node_id); -} - - -bool UnionFind::join(int source_node_id, int target_node_id) { - int a = UnionFind::root(source_node_id); - int b = UnionFind::root(target_node_id); - if (a == b) return false; - - if (UnionFind::size(a) < UnionFind::size(b)) swap(a, b); - parent[a] += parent[b]; - parent[b] = a; - - return true; -} -endsnippet diff --git a/nvim/snippet.d/cpp/utils.snippets b/nvim/snippet.d/cpp/utils.snippets deleted file mode 100644 index bc9593b6..00000000 --- a/nvim/snippet.d/cpp/utils.snippets +++ /dev/null @@ -1,30 +0,0 @@ -snippet utils -namespace utils{ - template void print(vector> mat) { - rep (i, mat.size()) { - rep (j, mat[0].size()) cout << mat[i][j] << ' '; - cout << endl; - } - } - - template void print(vector v) { - rep (i, v.size()) cout << v[i] << ' '; - cout << endl; - } - - template pair shape(vector> mat) { - int d1, d2; - - d1 = mat.size(); - if (d1 > 0) d2 = mat[0].size(); - else int d2 = 0; - cout << "(" << d1 << ", " << d2 << ")" << endl; - return make_pair(0, 0); - } - - template vector> empty(int n, int m) { - vector> mat(n, vector(m)); - return mat; - } -} -endsnippet diff --git a/nvim/snippet.d/python/pylint_click.snippets b/nvim/snippet.d/python/pylint_click.snippets deleted file mode 100644 index 42dcf0af..00000000 --- a/nvim/snippet.d/python/pylint_click.snippets +++ /dev/null @@ -1,3 +0,0 @@ -snippet pylint_click -# pylint: disable=no-value-for-parameter -endsnippet diff --git a/nvim/snippet.d/rust/prime_factorization.snippets b/nvim/snippet.d/rust/prime_factorization.snippets deleted file mode 100644 index fffa103c..00000000 --- a/nvim/snippet.d/rust/prime_factorization.snippets +++ /dev/null @@ -1,25 +0,0 @@ -snippet factorize -fn factorize(mut base: i64) -> Vec<(i64, i64)> { - let mut fs = Vec::<(i64, i64)>::new(); - let mut i: i64 = 2; - - while i*i <= base { - if base % i == 0 { - let mut cnt: i64 = 0; - - while base % i == 0 { - base /= i; - cnt += 1; - } - fs.push((i, cnt)); - } - i += 1; - } - - if base > 1 { - fs.push((base, 1)); - } - - return fs; -} -endsnippet diff --git a/nvim/template.d/cc/template.cc b/nvim/template.d/cc/template.cc deleted file mode 100644 index bef78f35..00000000 --- a/nvim/template.d/cc/template.cc +++ /dev/null @@ -1,15 +0,0 @@ -# include -# include -# include -# include -# include -# include -# include - - -using namespace std; - - -int main() { - return 0; -} diff --git a/nvim/template.d/go/template.go b/nvim/template.d/go/template.go deleted file mode 100644 index 8cbf123d..00000000 --- a/nvim/template.d/go/template.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - - -import ( - // "fmt" - // "strings" - // "strconv" -) - - -func main () { -} - diff --git a/nvim/template.d/mklatex/Makefile b/nvim/template.d/mklatex/Makefile deleted file mode 100644 index 0e95643f..00000000 --- a/nvim/template.d/mklatex/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -all: - xelatex main - pbibtex main - xelatex main - xelatex main -clean: - rm -f main.aux - rm -f main.bbl - rm -f main.blg - rm -f main.dvi - rm -f main.log - rm -f main.nav - rm -f main.out - rm -f main.snm - rm -f main.toc diff --git a/nvim/template.d/mklatex/double.tex b/nvim/template.d/mklatex/double.tex deleted file mode 100644 index b65998e7..00000000 --- a/nvim/template.d/mklatex/double.tex +++ /dev/null @@ -1,26 +0,0 @@ -\documentclass[twocolumn]{article} -\usepackage[top=10truemm,bottom=10truemm,left=10truemm,right=10truemm]{geometry} -\usepackage{algorithm} -\usepackage{algpseudocode} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{amsthm} -\usepackage{graphicx} -\usepackage{booktabs} -\usepackage{url} -\usepackage{bm} -\usepackage{xeCJK} -\setmainfont{Helvetica} -\setCJKmainfont{YuMincho} -\title{anonymous submission} -\author{anonymous author} -\date{\today} - -\begin{document} -\maketitle -\section{introduction} -hello, world\cite{greenwade93}. - -\bibliographystyle{plain} -\bibliography{reference} -\end{document} diff --git a/nvim/template.d/mklatex/reference.bib b/nvim/template.d/mklatex/reference.bib deleted file mode 100644 index 108efbe9..00000000 --- a/nvim/template.d/mklatex/reference.bib +++ /dev/null @@ -1,9 +0,0 @@ -@article{greenwade93, - author = "George D. Greenwade", - title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})", - year = "1993", - journal = "TUGBoat", - volume = "14", - number = "3", - pages = "342--351" -} diff --git a/nvim/template.d/mklatex/single.tex b/nvim/template.d/mklatex/single.tex deleted file mode 100644 index ab389fac..00000000 --- a/nvim/template.d/mklatex/single.tex +++ /dev/null @@ -1,26 +0,0 @@ -\documentclass{article} -\usepackage{algorithm} -\usepackage{algpseudocode} -\usepackage{geometry} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{amsthm} -\usepackage{graphicx} -\usepackage{booktabs} -\usepackage{url} -\usepackage{bm} -\usepackage{xeCJK} -\setmainfont{Helvetica} -\setCJKmainfont{YuMincho} -\title{anonymous submission} -\author{anonymous author} -\date{\today} - -\begin{document} -\maketitle -\section{introduction} -hello, world\cite{greenwade93}. - -\bibliographystyle{plain} -\bibliography{reference} -\end{document} diff --git a/nvim/template.d/mklatex/slide.tex b/nvim/template.d/mklatex/slide.tex deleted file mode 100644 index 3e90ff0f..00000000 --- a/nvim/template.d/mklatex/slide.tex +++ /dev/null @@ -1,27 +0,0 @@ -\documentclass{beamer} -\usepackage{xeCJK} -\usepackage{algorithm} -\usepackage{algpseudocode} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{amsthm} -\usepackage{bm} -\setmainfont{Helvetica} -\setCJKmainfont{YuMincho} -\usetheme{metropolis} -\date{\today} -\title{anonymous submission} -\author{anonymous author} -\institute{anonymous university} -\begin{document} - \maketitle - \section{First Section} - \begin{frame}{First Frame} - Hello, world!\cite{greenwade93} - \end{frame} - - \begin{frame}{references} - \bibliographystyle{plain} - \bibliography{reference} - \end{frame} -\end{document} diff --git a/nvim/template.d/python/setup.cfg b/nvim/template.d/python/setup.cfg deleted file mode 100644 index 715e3b4a..00000000 --- a/nvim/template.d/python/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[isort] -force_single_line=true - -[flake8] -max-line-length=119 diff --git a/nvim/template.d/rs/atcoder.rs b/nvim/template.d/rs/atcoder.rs deleted file mode 100644 index 36adbf22..00000000 --- a/nvim/template.d/rs/atcoder.rs +++ /dev/null @@ -1,51 +0,0 @@ -#[allow(clippy::needless_range_loop)] -fn main() { - let mut scanner = Scanner::new(); -} - -use std::io::Write; -pub struct Scanner { - buffer: std::collections::VecDeque, - buf: String, -} -#[allow(clippy::new_without_default)] -impl Scanner { - pub fn new() -> Self { - Scanner { - buffer: std::collections::VecDeque::new(), - buf: String::new(), - } - } - pub fn cin(&mut self) -> T { - if !self.buffer.is_empty() { - return self.buffer.pop_front().unwrap().parse::().ok().unwrap(); - } - self.buf.truncate(0); - std::io::stdin().read_line(&mut self.buf).ok(); - self.buf - .to_owned() - .split_whitespace() - .for_each(|x| self.buffer.push_back(String::from(x))); - self.buffer.pop_front().unwrap().parse::().ok().unwrap() - } - pub fn vec(&mut self, n: usize) -> Vec { - (0..n).map(|_| self.cin()).collect() - } - pub fn flush(&self) { - std::io::stdout().flush().unwrap(); - } -} - -#[macro_export] -macro_rules! debug { - () => { - #[cfg(debug_assertions)] - println!(); - }; - ($($arg:tt)*) => { - #[cfg(debug_assertions)] - print!("[debug] "); - #[cfg(debug_assertions)] - println!($($arg)*); - }; -} diff --git a/sheldon/bin/setup.sh b/sheldon/bin/setup.sh deleted file mode 100755 index fd6b5ef6..00000000 --- a/sheldon/bin/setup.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -mkdir -p "$HOME/.config/sheldon" -ln -s "$PWD/sheldon/config.d/plugins.toml" "$HOME/.config/sheldon/plugins.toml" diff --git a/sheldon/config.d/plugins.toml b/sheldon/config.d/plugins.toml deleted file mode 100644 index d501f3aa..00000000 --- a/sheldon/config.d/plugins.toml +++ /dev/null @@ -1,17 +0,0 @@ -shell = "zsh" - -[templates] -macos_source = ''' -if [[ "$OSTYPE" = darwin* ]]; then - {{ hooks?.pre | nl }}{% for file in files %}source "{{ file }}" - {% endfor %}{{ hooks?.post | nl }} -fi -''' - -[plugins.zsh-autosuggestions] -github = 'zsh-users/zsh-autosuggestions' -apply = ['source'] - -[plugins.zsh-syntax-highlighting] -github = 'zsh-users/zsh-syntax-highlighting' -apply = ['source'] diff --git a/tmux/bin/setup.sh b/tmux/bin/setup.sh deleted file mode 100755 index 45916f9f..00000000 --- a/tmux/bin/setup.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ln -s $PWD/tmux/config.d/tmux.conf $HOME/.tmux.conf diff --git a/tmux/config.d/tmux.conf b/tmux/config.d/tmux.conf deleted file mode 100644 index 53545447..00000000 --- a/tmux/config.d/tmux.conf +++ /dev/null @@ -1,51 +0,0 @@ -# -# tmux.conf -# -# @author = himkt - -unbind C-b - -# default config -set -g status-interval 2 -set -g default-terminal "screen-256color" -set -g status-justify left - -# enable mouse mode -setw -g mode-keys vi -bind-key -T copy-mode-vi y send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" -bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save -|pbcopy" - -# color -set -g status-fg colour231 -set -g status-bg colour234 - -# window -window_status_current_format1="#[fg=colour234,bg=colour31] #[fg=colour117,bg=colour31]" -window_status_current_format2="#I #[fg=colour231]#W #[fg=colour31,bg=colour234,nobold]" -window_status_current_format=$window_status_current_format1' '$window_status_current_format2 -set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240] #[default]#W" -set -g window-status-current-format $window_status_current_format - -# take over current directory path -bind-key '"' split-window -c "#{pane_current_path}" -bind-key % split-window -h -c "#{pane_current_path}" -bind-key c new-window -c "#{pane_current_path}" - -# status bar -set -g status-left-length 20 -status_left1="#{?client_prefix,#[fg=colour254]#[bg=colour31],#[fg=colour16]#[bg=colour254]}" -status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}" -set -qg status-left $status_left1' '$status_left2 -set -qg status-right '%H:%M #[fg=colour16,bg=colour254]' - -# tmux config -set -g escape-time 10 -set -g history-limit 50000 - -bind ^h select-layout even-horizontal -bind ^v select-layout even-vertical - -# NOTE Commands `search-xxx-incremental` is new feature, it counldn't use in some environments -# For old tmux, please comment out following statement -bind-key -T copy-mode-vi / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\"" -bind-key -T copy-mode-vi ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\"" diff --git a/uv/bin/setup.sh b/uv/bin/setup.sh deleted file mode 100755 index 81e37f49..00000000 --- a/uv/bin/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -mkdir -p $HOME/.config/uv - -ln -s $HOME/dotfiles/uv/config.d/uv.toml $HOME/.config/uv diff --git a/uv/config.d/uv.toml b/uv/config.d/uv.toml deleted file mode 100644 index 9594492d..00000000 --- a/uv/config.d/uv.toml +++ /dev/null @@ -1 +0,0 @@ -python-preference = "only-managed" diff --git a/zsh/bin/setup.sh b/zsh/bin/setup.sh deleted file mode 100755 index 98a77193..00000000 --- a/zsh/bin/setup.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -ln -s $PWD/zsh/config.d/zshrc $HOME/.zshrc -mkdir -p $HOME/.config/himkt/dotfiles/zsh/config.d diff --git a/zsh/config.d/zshrc b/zsh/config.d/zshrc deleted file mode 100644 index 528e6f00..00000000 --- a/zsh/config.d/zshrc +++ /dev/null @@ -1,188 +0,0 @@ -# -# .zshrc - The zsh configuration -# - -bindkey -e - -autoload -Uz compinit && compinit -autoload -Uz colors && colors -autoload -Uz zmv && alias zmv='noglob zmv -W' - -setopt auto_cd # cd without cd -setopt extended_history # include timestamp and duration to the history. -setopt share_history # persist history to the file. -setopt magic_equal_subst # expand filename for unquoted arguments. -setopt mark_dirs # insert '/' when directory is expanded via globbing. -setopt no_beep # disable beep in ZLE. -setopt prompt_subst # enable substitution in prompt (needed if we want to show information in PROMPT). - -zstyle ':completion:*:default' menu select=2 # enable menu in completion. - -function ls () { - command ls --color $@ -} - -function date () { - case ${OSTYPE} in - darwin*) - command gdate $@ ;; - linux*) - command date $@ ;; - esac -} - -function retcode () { - echo $? -} - -function git-home () { - cd `git rev-parse --show-toplevel` -} - -# tier1 -export EDITOR=vim -export FZF_DEFAULT_OPTS='--height 50% --reverse --border' -export GOPATH=$HOME/go -export GHQ_ROOT=$HOME/work -export HISTFILE=$HOME/.zsh-history -export HISTSIZE=100000 -export PYTHONDONTWRITEBYTECODE=1 -export SAVEHIST=100000 -export TERM=xterm-256color -export XDG_CONFIG_HOME=$HOME/.config - -# tier2 -export HIMKT_DOTFILES_PRIVATE_CONFIG_DIR=$XDG_CONFIG_HOME/himkt/dotfiles/zsh/config.d -export TIPS_HOME=$GHQ_ROOT/github.com/himkt/tips-data - -language=en_US.UTF-8 -# If `en_US.UTF-8` is not available, fallback to `C.utf8` -if [ "`locale -a | grep $language`" != $language ]; then - language=C.utf8 -fi -export LANG=$language -export LC_CTYPE=$language - -for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.pre.zsh") -do - source $source -done - -case `uname -s` in -Darwin*) - export HOMEBREW_ROOT=/opt/homebrew - export HOMEBREW_CACHE=$HOME/.cache/Homebrew - ;; -Linux*) - export HOMEBREW_ROOT=/home/linuxbrew/.linuxbrew - ;; -esac - -for prefix in $HOMEBREW_ROOT $HOME $HOME/.local $HOME/dotfiles $GOPATH $HOME/.rd; do - export PATH=$PATH:$prefix/bin -done - -if command -v brew > /dev/null; then - export BREW_HOME=$(brew --prefix) - export HOMEBREW_NO_AUTO_UPDATE=1 - eval $(brew shellenv) - - if [ -d "$HOMEBREW_ROOT/opt/xz" ]; then - export CONFIGURE_OPTS="--enable-shared" - export CPPFLAGS="-I$(brew --prefix xz)/include" - export LDFLAGS="-L$(brew --prefix xz)/lib" - fi - - if [ -d "$HOMEBREW_ROOT/opt/openjdk" ]; then - export PATH="$HOMEBREW_ROOT/opt/openjdk/bin:$PATH" - export CPPFLAGS="$CPPFLAGS:-I$HOMEBREW_ROOT/opt/openjdk/include" - fi - - if [ -d "$HOMEBREW_ROOT/opt/libpq/bin" ]; then - export PATH="$HOMEBREW_ROOT/opt/libpq/bin:$PATH" - fi -fi - -export PYTHONSYSTEMPATH=$(which python3) - -# NOTE; Utilities - -function current_context () { - if test -f $XDG_CONFIG_HOME/kubectl-toggle-ctx/hide; then - return - fi - - if ! command -v kubectl > /dev/null; then - return - fi - - current_context=$(command kubectl config current-context) &> /dev/null - if [ "$?" -ne 0 ]; then - return - fi - - echo "[$fg_bold[blue]$current_context$reset_color]" -} - -function current_path () { - echo "[$fg_bold[yellow]%~$reset_color]" -} - -function current_timestamp () { - echo "[$fg_bold[red]$(date +'%H:%M:%S')$reset_color]" -} - -function current_git_status () { - local git_branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)" - if [ -z "$git_branch" ]; then - return - fi - - UNTRACK_STATUS="" - UNTRACK_STATUS+="$fg_bold[red]$(git ls-files --other --exclude-standard | wc -l | awk '{print $1}')$reset_color" - UNTRACK_STATUS+="$fg_bold[yellow]$(git diff --name-only | wc -l | awk '{print $1}')$reset_color" - UNTRACK_STATUS+="$fg_bold[green]$(git diff --name-only --staged | wc -l | awk '{print $1}')$reset_color" - BRANCH_NAME="$fg_bold[red]$git_branch$reset_color" - echo "[$UNTRACK_STATUS$fg_bold[gray]@$BRANCH_NAME$reset_color]" -} - -PROMPT='$(current_timestamp)$(current_context)$(current_path)$(current_git_status)' -PROMPT+=$'\n' -PROMPT+='> ' -SPROMPT="${fg[red]}%r$reset_color is correct? [y, n, a, e]:" - -if command -v fzf > /dev/null; then - source <(fzf --zsh) -fi - -if command -v mise > /dev/null; then - eval "$(mise activate zsh)" -fi - -if command -v nvim > /dev/null; then - alias vim=nvim - export EDITOR=nvim -fi - -if command -v sheldon > /dev/null; then - eval "$(sheldon -q source)" -fi - -if command -v zoxide > /dev/null; then - eval "$(zoxide init zsh)" -fi - -if command -v kubectl > /dev/null; then - export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - source <(kubectl completion zsh) - alias k=kubectl -fi - -if [ -f "$HOME/.cargo/env" ]; then - . "$HOME/.cargo/env" -fi - -for source in $(find $HIMKT_DOTFILES_PRIVATE_CONFIG_DIR -name "*.post.zsh") -do - source $source -done From bb2147ae5f162622f6d96589e7b741a26b80be69 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:22:20 +0900 Subject: [PATCH 80/95] feat: add NixOS build check CI workflow --- .github/workflows/nixos.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/nixos.yml diff --git a/.github/workflows/nixos.yml b/.github/workflows/nixos.yml new file mode 100644 index 00000000..36eff94b --- /dev/null +++ b/.github/workflows/nixos.yml @@ -0,0 +1,14 @@ +name: NixOS build check +on: + push: + branches: + - main + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: DeterminateSystems/nix-installer-action@main + - name: Build NixOS configuration (dry run) + run: nix build --dry-run .#nixosConfigurations.nixos.config.system.build.toplevel From 6a02e54bc4c8617d5beab02e5c5742cbd7e0b305 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:25:38 +0900 Subject: [PATCH 81/95] feat: validate flake and NixOS build (Step 9) --- flake.lock | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/flake.lock b/flake.lock index 75698fec..b5be3298 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767634391, + "narHash": "sha256-owcSz2ICqTSvhBbhPP+1eWzi88e54rRZtfCNE5E/wwg=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "08585aacc3d6d6c280a02da195fdbd4b9cf083c2", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "nix-darwin-25.11", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1770136044, @@ -56,6 +77,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix" From 02545046c42da0416bd8f180940a0213acc13d79 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:31:30 +0900 Subject: [PATCH 82/95] chore: add design-docs to global gitignore --- home/modules/git/files/ignore | 1 + 1 file changed, 1 insertion(+) diff --git a/home/modules/git/files/ignore b/home/modules/git/files/ignore index 27749c83..c9d5db3f 100644 --- a/home/modules/git/files/ignore +++ b/home/modules/git/files/ignore @@ -20,3 +20,4 @@ **/.claude **/CLAUDE.md +**/design-docs From dcdd1caf0fd77dd18abdcba3fd15ebb1df376bda Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:43:53 +0900 Subject: [PATCH 83/95] fix: declare user in darwin-configuration to fix CI evaluation --- hosts/macos/darwin-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/macos/darwin-configuration.nix b/hosts/macos/darwin-configuration.nix index 90c32157..9ffcb179 100644 --- a/hosts/macos/darwin-configuration.nix +++ b/hosts/macos/darwin-configuration.nix @@ -16,6 +16,10 @@ }; }; + users.users.himkt = { + home = "/Users/himkt"; + }; + # Enable Touch ID for sudo security.pam.services.sudo_local.touchIdAuth = true; From 884e0f97557035a636ba9971968dab092d61b397 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 20:52:09 +0900 Subject: [PATCH 84/95] feat: add make build targets and use them in CI --- .github/workflows/macos.yml | 4 ++-- .github/workflows/nixos.yml | 4 ++-- Makefile | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9cc98183..58c57d8d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,5 +10,5 @@ jobs: steps: - uses: actions/checkout@v6 - uses: DeterminateSystems/nix-installer-action@main - - name: Build nix-darwin configuration (dry run) - run: nix build --dry-run .#darwinConfigurations.macos.system + - name: Build nix-darwin configuration + run: make macos-build diff --git a/.github/workflows/nixos.yml b/.github/workflows/nixos.yml index 36eff94b..b0efe79f 100644 --- a/.github/workflows/nixos.yml +++ b/.github/workflows/nixos.yml @@ -10,5 +10,5 @@ jobs: steps: - uses: actions/checkout@v6 - uses: DeterminateSystems/nix-installer-action@main - - name: Build NixOS configuration (dry run) - run: nix build --dry-run .#nixosConfigurations.nixos.config.system.build.toplevel + - name: Build NixOS configuration + run: make nixos-build diff --git a/Makefile b/Makefile index 8221b282..45770401 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ -.PHONY: macos-switch macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-switch nixos-update nixos-clean nixos-gc +.PHONY: macos-build macos-switch macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-build nixos-switch nixos-update nixos-clean nixos-gc # macOS targets +macos-build: + nix build .#darwinConfigurations.macos.system + macos-switch: darwin-rebuild switch --flake .#macos @@ -17,6 +20,9 @@ macos-brew-himkt: brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile # NixOS targets +nixos-build: + nix build .#nixosConfigurations.nixos.config.system.build.toplevel + nixos-switch: sudo nixos-rebuild switch --flake .#nixos From 6705f9aef5874324adf62351405873ff42477174 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 21:05:25 +0900 Subject: [PATCH 85/95] fix: add system.primaryUser required by nix-darwin --- hosts/macos/darwin-configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/macos/darwin-configuration.nix b/hosts/macos/darwin-configuration.nix index 9ffcb179..643ada7a 100644 --- a/hosts/macos/darwin-configuration.nix +++ b/hosts/macos/darwin-configuration.nix @@ -16,6 +16,8 @@ }; }; + system.primaryUser = "himkt"; + users.users.himkt = { home = "/Users/himkt"; }; From 37dba466b4ff16a6c974962e1a744dd4073c155d Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 21:13:20 +0900 Subject: [PATCH 86/95] fix: make ghostty package Linux-only (not available on darwin) --- home/modules/ghostty/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/modules/ghostty/default.nix b/home/modules/ghostty/default.nix index bda478ce..37f40820 100644 --- a/home/modules/ghostty/default.nix +++ b/home/modules/ghostty/default.nix @@ -6,8 +6,8 @@ }: { - home.packages = with pkgs; [ - ghostty + home.packages = lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + pkgs.ghostty ]; xdg.configFile."ghostty/config" = { From e7de057a410de4de1886c99654db489fbeb8d97c Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 21:27:44 +0900 Subject: [PATCH 87/95] fix: remove duplicate [user] from git config, add macos-brew-install target --- Makefile | 5 ++++- home/modules/git/files/config | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 45770401..8fe1b706 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: macos-build macos-switch macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-build nixos-switch nixos-update nixos-clean nixos-gc +.PHONY: macos-build macos-switch macos-brew-install macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-build nixos-switch nixos-update nixos-clean nixos-gc # macOS targets macos-build: @@ -7,6 +7,9 @@ macos-build: macos-switch: darwin-rebuild switch --flake .#macos +macos-brew-install: + $(PWD)/brew/bin/setup.sh + macos-brew: brew bundle --verbose --file=$(PWD)/brew/config.d/base/Brewfile diff --git a/home/modules/git/files/config b/home/modules/git/files/config index 7bb707b5..562b6791 100644 --- a/home/modules/git/files/config +++ b/home/modules/git/files/config @@ -1,7 +1,3 @@ -[user] - email = himkt@klis.tsukuba.ac.jp - name = himkt - [pull] rebase = false From e67a73a0f7ea69eda5b47bf4d17925a4076bd85c Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 21:57:58 +0900 Subject: [PATCH 88/95] chore: simplify README and add macOS update/clean/gc targets --- Makefile | 11 ++++++++++- README.md | 34 +++++++++------------------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 8fe1b706..e176385b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: macos-build macos-switch macos-brew-install macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt nixos-build nixos-switch nixos-update nixos-clean nixos-gc +.PHONY: macos-build macos-switch macos-brew-install macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt macos-update macos-clean macos-gc nixos-build nixos-switch nixos-update nixos-clean nixos-gc # macOS targets macos-build: @@ -22,6 +22,15 @@ macos-brew-optional: macos-brew-himkt: brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile +macos-update: + nix flake update + +macos-clean: + nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system-profiles/darwin + +macos-gc: + nix-collect-garbage -d + # NixOS targets nixos-build: nix build .#nixosConfigurations.nixos.config.system.build.toplevel diff --git a/README.md b/README.md index 03600825..d1a39303 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,20 @@ # dotfiles +[![macOS](https://github.com/himkt/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/himkt/dotfiles/actions/workflows/macos.yml) +[![NixOS](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml/badge.svg)](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml) + Unified Nix-based configuration for macOS (nix-darwin) and NixOS. ## Structure ``` dotfiles/ -├── flake.nix # Unified flake (NixOS + nix-darwin) -├── Makefile # All targets for both platforms -├── hosts/ -│ ├── nixos/ # NixOS system configuration -│ ├── macos/ # nix-darwin system configuration -│ └── modules/ # System-level modules (keyd) -├── home/ -│ ├── nixos.nix # NixOS Home Manager entry point -│ ├── macos.nix # macOS Home Manager entry point -│ ├── pkgs/ # Custom packages -│ └── modules/ # Home Manager modules -│ ├── git/ # (shared) -│ ├── sheldon/ # (shared) -│ ├── nvim/ # (shared) -│ ├── zsh/ # (shared) -│ ├── tmux/ # (shared) -│ ├── ghostty/ # (shared) -│ ├── uv/ # (shared) -│ ├── mise/ # (platform-specific config) -│ ├── gcc/ # (NixOS-only) -│ ├── java/ # (NixOS-only) -│ ├── gpg/ # (NixOS-only) -│ └── fcitx5/ # (NixOS-only) -├── brew/ # Homebrew Brewfiles (macOS) -└── secrets/ # sops-nix encrypted secrets +├── flake.nix # Unified flake (NixOS + nix-darwin) +├── Makefile # Build and setup targets +├── hosts/ # System-level configuration per platform +├── home/ # Home Manager configuration and modules +├── brew/ # Homebrew Brewfiles (macOS) +└── secrets/ # sops-nix encrypted secrets ``` ## Setup From 3ccaa86d435c316a356a9559d6a4c27ec90218fd Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 22:00:35 +0900 Subject: [PATCH 89/95] chore: update README with platform logos and detailed structure --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d1a39303..c73b2711 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dotfiles -[![macOS](https://github.com/himkt/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/himkt/dotfiles/actions/workflows/macos.yml) -[![NixOS](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml/badge.svg)](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml) +[![macOS](https://img.shields.io/github/actions/workflow/status/himkt/dotfiles/macos.yml?label=macOS&logo=apple)](https://github.com/himkt/dotfiles/actions/workflows/macos.yml) +[![NixOS](https://img.shields.io/github/actions/workflow/status/himkt/dotfiles/nixos.yml?label=NixOS&logo=nixos)](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml) Unified Nix-based configuration for macOS (nix-darwin) and NixOS. @@ -11,8 +11,13 @@ Unified Nix-based configuration for macOS (nix-darwin) and NixOS. dotfiles/ ├── flake.nix # Unified flake (NixOS + nix-darwin) ├── Makefile # Build and setup targets -├── hosts/ # System-level configuration per platform -├── home/ # Home Manager configuration and modules +├── hosts/ +│ ├── nixos/ # NixOS system configuration +│ └── macos/ # nix-darwin system configuration +├── home/ +│ ├── nixos.nix # NixOS Home Manager entry point +│ ├── macos.nix # macOS Home Manager entry point +│ └── modules/ # Shared and platform-specific modules ├── brew/ # Homebrew Brewfiles (macOS) └── secrets/ # sops-nix encrypted secrets ``` From 116ebd30d59955764af0fe6d2a2bd16fe9a6caf4 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 22:02:00 +0900 Subject: [PATCH 90/95] chore: fix NixOS badge logo color --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c73b2711..c05262e9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dotfiles [![macOS](https://img.shields.io/github/actions/workflow/status/himkt/dotfiles/macos.yml?label=macOS&logo=apple)](https://github.com/himkt/dotfiles/actions/workflows/macos.yml) -[![NixOS](https://img.shields.io/github/actions/workflow/status/himkt/dotfiles/nixos.yml?label=NixOS&logo=nixos)](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml) +[![NixOS](https://img.shields.io/github/actions/workflow/status/himkt/dotfiles/nixos.yml?label=NixOS&logo=nixos&logoColor=white)](https://github.com/himkt/dotfiles/actions/workflows/nixos.yml) Unified Nix-based configuration for macOS (nix-darwin) and NixOS. From bcba647acbeda79ecf78f545e73055dd0270842b Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 22:04:14 +0900 Subject: [PATCH 91/95] docs: use official Nix installer link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c05262e9..85a884b4 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ dotfiles/ ### macOS -1. Install [Nix](https://nixos.org/download/) via the [Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer) +1. Install [Nix](https://nixos.org/download/) 2. Clone this repository to `~/dotfiles` 3. Apply the nix-darwin configuration: ``` From 83c9f75daaf2be3fe892c1ed2eb34501b474a0fb Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 17 Feb 2026 22:44:41 +0900 Subject: [PATCH 92/95] chore: migrate duplicate Homebrew packages to Nix and fix macOS sudo targets --- Makefile | 6 +++--- brew/config.d/base/Brewfile | 5 ----- brew/config.d/himkt/Brewfile | 1 - brew/config.d/optional/Brewfile | 4 ---- home/macos.nix | 7 +++++++ home/pkgs/pathfinder/default.nix | 24 +++++++++++++++++------- hosts/macos/darwin-configuration.nix | 2 ++ 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index e176385b..94d5ca4a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ macos-build: nix build .#darwinConfigurations.macos.system macos-switch: - darwin-rebuild switch --flake .#macos + sudo darwin-rebuild switch --flake .#macos macos-brew-install: $(PWD)/brew/bin/setup.sh @@ -26,10 +26,10 @@ macos-update: nix flake update macos-clean: - nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system-profiles/darwin + sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system-profiles/darwin macos-gc: - nix-collect-garbage -d + sudo nix-collect-garbage -d # NixOS targets nixos-build: diff --git a/brew/config.d/base/Brewfile b/brew/config.d/base/Brewfile index 78f5132a..414623c2 100644 --- a/brew/config.d/base/Brewfile +++ b/brew/config.d/base/Brewfile @@ -1,10 +1,5 @@ brew 'coreutils' -brew 'fzf' brew 'gh' -brew 'git-lfs' brew 'jq' -brew 'sheldon' -brew 'tree' -brew 'zoxide' cask 'corretto@17' diff --git a/brew/config.d/himkt/Brewfile b/brew/config.d/himkt/Brewfile index b6d9f2fd..1f6b5c92 100644 --- a/brew/config.d/himkt/Brewfile +++ b/brew/config.d/himkt/Brewfile @@ -1,4 +1,3 @@ tap 'himkt/tap' -brew 'himkt/tap/pathfinder' brew 'himkt/tap/tips-cli' cask 'himkt/tap/voicevox' diff --git a/brew/config.d/optional/Brewfile b/brew/config.d/optional/Brewfile index 7a7453e2..d2dc356c 100644 --- a/brew/config.d/optional/Brewfile +++ b/brew/config.d/optional/Brewfile @@ -4,9 +4,5 @@ brew 'btop' brew 'krew' brew 'kubernetes-cli' brew 'libpq' -brew 'mise' -brew 'tmux' -brew 'uv' - tap 'derailed/k9s' brew 'derailed/k9s/k9s' diff --git a/home/macos.nix b/home/macos.nix index 3d8031da..a30b753f 100644 --- a/home/macos.nix +++ b/home/macos.nix @@ -1,5 +1,11 @@ { config, pkgs, lib, inputs, ... }: +let + himkt_pkgs = import ./pkgs { + inherit pkgs; + }; +in + { imports = [ # Shared modules (same 7 as NixOS) @@ -30,6 +36,7 @@ python3 rustup tree + himkt_pkgs.pathfinder ]; home.sessionVariables = { diff --git a/home/pkgs/pathfinder/default.nix b/home/pkgs/pathfinder/default.nix index 70fd25ef..5258a5c6 100644 --- a/home/pkgs/pathfinder/default.nix +++ b/home/pkgs/pathfinder/default.nix @@ -5,17 +5,27 @@ autoPatchelfHook, }: +let + sources = { + x86_64-linux = { + url = "https://github.com/himkt/pathfinder/releases/download/v0.1.0/pathfinder-x86_64-unknown-linux-gnu.tar.gz"; + sha256 = "18bpvh651i1nk4agkxqqaax22y0fa3nwpfhhanlprzprq08cdvdk"; + }; + aarch64-darwin = { + url = "https://github.com/himkt/pathfinder/releases/download/v0.1.0/pathfinder-aarch64-apple-darwin.tar.gz"; + sha256 = "1q50ipvfg9gy1s86j5i8393xyyfjqjif3i89sxhbyhxm8kvhl0gg"; + }; + }; +in + stdenv.mkDerivation rec { pname = "pathfinder"; version = "0.1.0"; - src = fetchurl { - url = "https://github.com/himkt/pathfinder/releases/download/v${version}/pathfinder-x86_64-unknown-linux-gnu.tar.gz"; - sha256 = "18bpvh651i1nk4agkxqqaax22y0fa3nwpfhhanlprzprq08cdvdk"; - }; + src = fetchurl sources.${stdenv.hostPlatform.system}; - nativeBuildInputs = [ autoPatchelfHook ]; - buildInputs = [ stdenv.cc.cc.lib ]; + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ stdenv.cc.cc.lib ]; sourceRoot = "."; @@ -27,6 +37,6 @@ stdenv.mkDerivation rec { description = "MCP client for jumping to definitions using LSP server"; homepage = "https://github.com/himkt/pathfinder"; license = licenses.mit; - platforms = [ "x86_64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-darwin" ]; }; } diff --git a/hosts/macos/darwin-configuration.nix b/hosts/macos/darwin-configuration.nix index 643ada7a..d48ce527 100644 --- a/hosts/macos/darwin-configuration.nix +++ b/hosts/macos/darwin-configuration.nix @@ -25,6 +25,8 @@ # Enable Touch ID for sudo security.pam.services.sudo_local.touchIdAuth = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + # Note: verify this value before first activation. # See https://daiderd.com/nix-darwin/manual/ for stateVersion documentation. system.stateVersion = 5; From 2a5797c6fef19b1c7e3905978df9ea2bd97ddb06 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 18 Feb 2026 17:13:00 +0900 Subject: [PATCH 93/95] chore: use java managed by nix --- brew/config.d/base/Brewfile | 2 -- home/macos.nix | 2 ++ home/modules/zsh/files/zshrc | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/brew/config.d/base/Brewfile b/brew/config.d/base/Brewfile index 414623c2..7b2c620d 100644 --- a/brew/config.d/base/Brewfile +++ b/brew/config.d/base/Brewfile @@ -1,5 +1,3 @@ brew 'coreutils' brew 'gh' brew 'jq' - -cask 'corretto@17' diff --git a/home/macos.nix b/home/macos.nix index a30b753f..d6bf5e7f 100644 --- a/home/macos.nix +++ b/home/macos.nix @@ -16,6 +16,8 @@ in ./modules/git ./modules/uv ./modules/ghostty + ./modules/gcc + ./modules/java # macOS-specific modules ./modules/mise ]; diff --git a/home/modules/zsh/files/zshrc b/home/modules/zsh/files/zshrc index c42dee76..c526d5ef 100644 --- a/home/modules/zsh/files/zshrc +++ b/home/modules/zsh/files/zshrc @@ -97,11 +97,6 @@ if command -v brew > /dev/null; then export LDFLAGS="-L$(brew --prefix xz)/lib" fi - if [ -d "$HOMEBREW_ROOT/opt/openjdk" ]; then - export PATH="$HOMEBREW_ROOT/opt/openjdk/bin:$PATH" - export CPPFLAGS="$CPPFLAGS:-I$HOMEBREW_ROOT/opt/openjdk/include" - fi - if [ -d "$HOMEBREW_ROOT/opt/libpq/bin" ]; then export PATH="$HOMEBREW_ROOT/opt/libpq/bin:$PATH" fi From ea951678e9b799b0f11e25396b71309b7cabb3f4 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 18 Feb 2026 17:37:42 +0900 Subject: [PATCH 94/95] chore: update README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 85a884b4..07e9268d 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,17 @@ dotfiles/ | Target | Description | |--------|-------------| +| `macos-build` | Build nix-darwin configuration (dry run) | | `macos-switch` | Apply nix-darwin + Home Manager configuration | +| `macos-brew-install` | Install Homebrew | | `macos-brew` | Install base Homebrew packages | | `macos-brew-gui` | Install GUI Homebrew packages | | `macos-brew-optional` | Install optional Homebrew packages | | `macos-brew-himkt` | Install personal Homebrew packages | +| `macos-update` | Update flake inputs | +| `macos-clean` | Delete old macOS generations (keep last 7) | +| `macos-gc` | Run Nix garbage collection | +| `nixos-build` | Build NixOS configuration (dry run) | | `nixos-switch` | Apply NixOS + Home Manager configuration | | `nixos-update` | Update flake inputs | | `nixos-clean` | Delete old NixOS generations (keep last 7) | From 242ea0f6bbf111024c8abb34b05dae397a4e70b0 Mon Sep 17 00:00:00 2001 From: himkt Date: Wed, 18 Feb 2026 17:38:07 +0900 Subject: [PATCH 95/95] refactor: install fonts using nix on macOS --- brew/config.d/gui/Brewfile | 1 - home/modules/ghostty/files/config | 2 +- hosts/macos/darwin-configuration.nix | 5 +++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/brew/config.d/gui/Brewfile b/brew/config.d/gui/Brewfile index 65366d2d..3cc2ee87 100644 --- a/brew/config.d/gui/Brewfile +++ b/brew/config.d/gui/Brewfile @@ -1,6 +1,5 @@ cask 'claude-code' cask 'codex' -cask 'font-jetbrains-mono' cask 'ghostty' cask 'google-chrome' cask 'netron' diff --git a/home/modules/ghostty/files/config b/home/modules/ghostty/files/config index 8deb4418..172702c8 100644 --- a/home/modules/ghostty/files/config +++ b/home/modules/ghostty/files/config @@ -17,7 +17,7 @@ background-blur-radius = 20 # font config font-family = Jetbrains Mono -font-family = Hiragino Kaku Gothic ProN +font-family = Noto Sans Mono CJK JP font-size = 11 font-feature = -calt, -liga, -dlig keybind = shift+enter=text:\n diff --git a/hosts/macos/darwin-configuration.nix b/hosts/macos/darwin-configuration.nix index d48ce527..091dc640 100644 --- a/hosts/macos/darwin-configuration.nix +++ b/hosts/macos/darwin-configuration.nix @@ -25,6 +25,11 @@ # Enable Touch ID for sudo security.pam.services.sudo_local.touchIdAuth = true; + fonts.packages = with pkgs; [ + jetbrains-mono + noto-fonts-cjk-sans + ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Note: verify this value before first activation.