Changes
16 changed files (+309/-306)
-
-
@@ -1,8 +1,8 @@# Essential modules: every machine should include this module. # Should covers everything from admin task to daily usages. # Other modules assumes this is included. {catppuccinTheme}: {...}: { xdg = {enable = true;}; { catppuccinTheme }: { ... }: { xdg = { enable = true; }; imports = [ (
-
-
-
@@ -1,8 +1,7 @@{catppuccinTheme}: { config, pkgs, ... }: { { catppuccinTheme }: { config , pkgs , ... }: { programs = { neovim = { enable = true;
-
-
-
@@ -1,8 +1,7 @@{catppuccinTheme}: { config, pkgs, ... }: { { catppuccinTheme }: { config , pkgs , ... }: { programs = { tmux = { enable = true;
-
-
-
@@ -1,8 +1,7 @@{catppuccinTheme}: { config, pkgs, ... }: { { catppuccinTheme }: { config , pkgs , ... }: { home.packages = [ # Must-have networking CLI tool # https://curl.se/
-
@@ -40,28 +39,30 @@ };# A terminal file manager written in Go with a heavy inspiration from ranger file manager. # https://github.com/gokcehan/lf lf = let # Linux: xdg-open # macOS: open openCommand = if pkgs.stdenv.isLinux then "xdg-open" else "open"; in { enable = true; lf = let # Linux: xdg-open # macOS: open openCommand = if pkgs.stdenv.isLinux then "xdg-open" else "open"; in { enable = true; commands = { # Open text files with nvim open = '' ''${{ case $(file --mime-type -Lb $f) in text/*) nvim $fx;; *) for f in $fx; do ${openCommand} $f > /dev/null 2> /dev/null & done;; esac }} ''; commands = { # Open text files with nvim open = '' ''${{ case $(file --mime-type -Lb $f) in text/*) nvim $fx;; *) for f in $fx; do ${openCommand} $f > /dev/null 2> /dev/null & done;; esac }} ''; }; }; }; # JSON view/query tool # https://github.com/jqlang/jq
-
@@ -76,12 +77,13 @@ enable = true;themes = { "catppuccin-${catppuccinTheme}" = builtins.readFile ( pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "bat"; rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; sha256 = "1g2r6j33f4zys853i1c5gnwcdbwb6xv5w6pazfdslxf69904lrg9"; } pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "bat"; rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; sha256 = "1g2r6j33f4zys853i1c5gnwcdbwb6xv5w6pazfdslxf69904lrg9"; } + "/Catppuccin-${catppuccinTheme}.tmTheme" ); };
-
-
-
@@ -1,7 +1,6 @@{ config, pkgs, ... { config , pkgs , ... }: { programs = { zsh = {
-
-
-
@@ -10,129 +10,136 @@ inputs.nixpkgs.follows = "nixpkgs";}; }; outputs = { self, nixpkgs, home-manager, }: let # Catppuccin pallet, one of: "latte", "frappe", "macchiato", "mocha" catppuccinTheme = "mocha"; outputs = { self , nixpkgs , home-manager , }: let # Catppuccin pallet, one of: "latte", "frappe", "macchiato", "mocha" catppuccinTheme = "mocha"; # Pre-defined modules mods = { essentials = import ./essentials { inherit catppuccinTheme; }; # Pre-defined modules mods = { essentials = import ./essentials { inherit catppuccinTheme; }; scm = import ./scm { username = "Shota FUJI"; email = "pockawoooh@gmail.com"; gpgKeyId = "5E5148973E291363"; }; scm = import ./scm { username = "Shota FUJI"; email = "pockawoooh@gmail.com"; gpgKeyId = "5E5148973E291363"; }; wayland-de = import ./wayland-de { inherit catppuccinTheme; }; wayland-de = import ./wayland-de { inherit catppuccinTheme; }; webdev = ./webdev; webdev = ./webdev; macos = import ./macos { inherit catppuccinTheme; macos = import ./macos { inherit catppuccinTheme; }; }; }; mkHomeConfiguration = { # Platform (e.g. x86_64-linux) system, # OS username username, # Modules to include modules ? [mods.essentials], # Timezone of the machine timezone ? "Asia/Tokyo", }: let isDarwin = (builtins.match ".*-darwin$" system) != null; homeDir = if isDarwin then "/Users" else "/home"; in home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.${system}; mkHomeConfiguration = { # Platform (e.g. x86_64-linux) system , # OS username username , # Modules to include modules ? [ mods.essentials ] , # Timezone of the machine timezone ? "Asia/Tokyo" , }: let isDarwin = (builtins.match ".*-darwin$" system) != null; homeDir = if isDarwin then "/Users" else "/home"; in home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.${system}; modules = [ { home = rec { inherit username; homeDirectory = "${homeDir}/${username}"; stateVersion = "23.11"; sessionVariables = { TZ = timezone; modules = [ { home = rec { inherit username; homeDirectory = "${homeDir}/${username}"; stateVersion = "23.11"; sessionVariables = { TZ = timezone; }; }; }; # Turn off Home Manager news bs news.display = "silent"; } ] ++ modules; }; # Turn off Home Manager news bs news.display = "silent"; } ] ++ modules; }; availableSystems = [ "aarch64-darwin" "x86_64-linux" ]; in { homeConfigurations = { dev-linux = mkHomeConfiguration { system = "x86_64-linux"; username = "pocka"; modules = [ mods.essentials mods.scm mods.webdev mods.wayland-de ]; }; availableSystems = [ "aarch64-darwin" "x86_64-linux" ]; in { homeConfigurations = { dev-linux = mkHomeConfiguration { system = "x86_64-linux"; username = "pocka"; modules = [ mods.essentials mods.scm mods.webdev mods.wayland-de ]; }; pixelbook = mkHomeConfiguration { system = "x86_64-linux"; username = "pockawoooh"; modules = [ mods.essentials mods.scm mods.webdev ]; }; pixelbook = mkHomeConfiguration { system = "x86_64-linux"; username = "pockawoooh"; modules = [ mods.essentials mods.scm mods.webdev ]; }; scm-server = mkHomeConfiguration { system = "x86_64-linux"; username = "pocka"; modules = [ mods.essentials mods.scm ]; }; scm-server = mkHomeConfiguration { system = "x86_64-linux"; username = "pocka"; modules = [ mods.essentials mods.scm ]; mbp-m1 = mkHomeConfiguration { system = "aarch64-darwin"; username = "pocka"; modules = [ mods.essentials mods.scm mods.webdev mods.macos ]; }; }; mbp-m1 = mkHomeConfiguration { system = "aarch64-darwin"; username = "pocka"; modules = [ mods.essentials mods.scm mods.webdev mods.macos ]; }; formatter = builtins.listToAttrs ( builtins.map (system: { name = system; value = nixpkgs.legacyPackages.${system}.nixpkgs-fmt; }) availableSystems ); }; formatter = builtins.listToAttrs ( builtins.map (system: { name = system; value = nixpkgs.legacyPackages.${system}.nixpkgs-fmt; }) availableSystems ); }; }
-
-
-
@@ -1,7 +1,7 @@# macOS specific configurations. {catppuccinTheme}: { { catppuccinTheme }: { imports = [ ./os-update-workaround.nix (import ./kitty.nix {inherit catppuccinTheme;}) (import ./kitty.nix { inherit catppuccinTheme; }) ]; }
-
-
-
@@ -1,64 +1,66 @@{catppuccinTheme}: { pkgs, lib, ... }: { programs = let # Convert the input string's first character to upper case. # Example: "foo" -> "Foo" toCapital = with lib; str: let len = builtins.stringLength str; head = strings.toUpper (builtins.substring 0 1 str); tail = builtins.substring 1 (len - 1) str; in { catppuccinTheme }: { pkgs , lib , ... }: { programs = let # Convert the input string's first character to upper case. # Example: "foo" -> "Foo" toCapital = with lib; str: let len = builtins.stringLength str; head = strings.toUpper (builtins.substring 0 1 str); tail = builtins.substring 1 (len - 1) str; in head + tail; in { # The fast, feature-rich, GPU based terminal emulator # https://sw.kovidgoyal.net/kitty/ kitty = { enable = true; in { # The fast, feature-rich, GPU based terminal emulator # https://sw.kovidgoyal.net/kitty/ kitty = { enable = true; font = { name = "Dank Mono"; size = 16; }; font = { name = "Dank Mono"; size = 16; }; # Kitty's customisability is top-notch. keybindings = { "kitty_mod+t" = "new_tab_with_cwd"; "kitty_mod+n" = "new_window_with_cwd"; # Kitty's customisability is top-notch. keybindings = { "kitty_mod+t" = "new_tab_with_cwd"; "kitty_mod+n" = "new_window_with_cwd"; "kitty_mod+r" = "start_resizing_window"; "kitty_mod+s" = "swap_with_window"; "kitty_mod+f" = "focus_visible_window"; "kitty_mod+r" = "start_resizing_window"; "kitty_mod+s" = "swap_with_window"; "kitty_mod+f" = "focus_visible_window"; "kitty_mod+k" = "neighboring_window top"; "kitty_mod+h" = "neighboring_window left"; "kitty_mod+j" = "neighboring_window down"; "kitty_mod+l" = "neighboring_window right"; "kitty_mod+k" = "neighboring_window top"; "kitty_mod+h" = "neighboring_window left"; "kitty_mod+j" = "neighboring_window down"; "kitty_mod+l" = "neighboring_window right"; "kitty_mod+a" = "next_layout"; }; "kitty_mod+a" = "next_layout"; }; settings = { # Background background_opacity = "0.9"; settings = { # Background background_opacity = "0.9"; # Layouts enabled_layouts = "fat,tall,grid,horizontal,vertical,splits"; # Layouts enabled_layouts = "fat,tall,grid,horizontal,vertical,splits"; # Tabs tab_bar_edge = "top"; tab_bar_style = "powerline"; }; # Tabs tab_bar_edge = "top"; tab_bar_style = "powerline"; }; shellIntegration = { enableBashIntegration = true; enableZshIntegration = true; shellIntegration = { enableBashIntegration = true; enableZshIntegration = true; }; theme = "Catppuccin-${toCapital catppuccinTheme}"; }; theme = "Catppuccin-${toCapital catppuccinTheme}"; }; }; }
-
-
-
@@ -1,9 +1,9 @@# SCM module: SCM/VCS tools and their configurations. { username, email, gpgKeyId ? null, }: {...}: { { username , email , gpgKeyId ? null , }: { ... }: { imports = [ ( import ./git.nix {
-
-
-
@@ -1,7 +1,6 @@{ config, pkgs, ... { config , pkgs , ... }: { home.packages = with pkgs; [fossil]; home.packages = with pkgs; [ fossil ]; }
-
-
-
@@ -1,13 +1,12 @@{ username, email, gpgKeyId, }: { config, pkgs, lib, ... }: { { username , email , gpgKeyId , }: { config , pkgs , lib , ... }: { programs = { # Install GnuPG when key ID is provided gpg = lib.mkIf (gpgKeyId != null) {
-
-
-
@@ -1,15 +1,11 @@# Shell for using home-manager & Flakes without installing/configuring. # Based on: # https://github.com/Misterio77/nix-config/blob/68939a161c97bb875fb1ead17c172c36de24bd01/shell.nix { pkgs ? let { pkgs ? let lock = ( builtins.fromJSON (builtins.readFile ./flake.lock) ) .nodes .nixpkgs .locked; ).nodes.nixpkgs.locked; # Pin nixpkgs, so the shell can be invoked without channels nixpkgs = fetchTarball {
-
@@ -17,8 +13,8 @@ url = "https://github.com/${lock.owner}/${lock.repo}/archive/${lock.rev}.tar.gz";sha256 = lock.narHash; }; in import nixpkgs {overlays = [];}, ... import nixpkgs { overlays = [ ]; } , ... }: { default = pkgs.mkShell { shellHook = ''
-
-
-
@@ -1,5 +1,5 @@# Wayland Desktop Environment {catppuccinTheme}: {...}: { { catppuccinTheme }: { ... }: { # I'm not sure this changes behaviour in a meaningful way. targets.genericLinux = { enable = true;
-
-
-
@@ -1,81 +1,83 @@{catppuccinTheme}: { config, pkgs, ... }: { programs = let # Config file of catppuccin/foot is ini file: Nix can't parse that. # To workaround, manually fetch palette JSON and use its token. catppuccinPalette = (builtins.fromJSON (builtins.readFile ( pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "palette"; rev = "205dd54c6158b7648621cf9fd00e91f03888ce7e"; sha256 = "y14fd8lvnG9hNY6CRU0JgxWouexEw91aIEMkr1NaM/4="; } + "/palette.json" ))) ."${catppuccinTheme}"; { catppuccinTheme }: { config , pkgs , ... }: { programs = let # Config file of catppuccin/foot is ini file: Nix can't parse that. # To workaround, manually fetch palette JSON and use its token. catppuccinPalette = (builtins.fromJSON (builtins.readFile ( pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "palette"; rev = "205dd54c6158b7648621cf9fd00e91f03888ce7e"; sha256 = "y14fd8lvnG9hNY6CRU0JgxWouexEw91aIEMkr1NaM/4="; } + "/palette.json" )))."${catppuccinTheme}"; fg = builtins.substring 1 6 catppuccinPalette.surface0.hex; bg = builtins.substring 1 6 catppuccinPalette.text.hex; in { zsh = { # Let Zsh tell Foot a current working directory # https://codeberg.org/dnkl/foot/wiki#user-content-spawning-new-terminal-instances-in-the-current-working-directory initExtra = '' function osc7-pwd() { emulate -L zsh # also sets localoptions for us setopt extendedglob local LC_ALL=C printf '\e]7;file://%s%s\e\' $HOST ''${PWD//(#m)([^@-Za-z&-;_~])/%''${(l:2::0:)$(([##16]#MATCH))}} } fg = builtins.substring 1 6 catppuccinPalette.surface0.hex; bg = builtins.substring 1 6 catppuccinPalette.text.hex; in { zsh = { # Let Zsh tell Foot a current working directory # https://codeberg.org/dnkl/foot/wiki#user-content-spawning-new-terminal-instances-in-the-current-working-directory initExtra = '' function osc7-pwd() { emulate -L zsh # also sets localoptions for us setopt extendedglob local LC_ALL=C printf '\e]7;file://%s%s\e\' $HOST ''${PWD//(#m)([^@-Za-z&-;_~])/%''${(l:2::0:)$(([##16]#MATCH))}} } function chpwd-osc7-pwd() { (( ZSH_SUBSHELL )) || osc7-pwd } autoload -Uz add-zsh-hook add-zsh-hook -Uz chpwd chpwd-osc7-pwd ''; }; function chpwd-osc7-pwd() { (( ZSH_SUBSHELL )) || osc7-pwd } autoload -Uz add-zsh-hook add-zsh-hook -Uz chpwd chpwd-osc7-pwd ''; }; # A fast, lightweight and minimalistic Wayland terminal emulator # https://codeberg.org/dnkl/foot foot = { enable = true; # A fast, lightweight and minimalistic Wayland terminal emulator # https://codeberg.org/dnkl/foot foot = { enable = true; server.enable = true; server.enable = true; settings = { main = { include = "${config.xdg.configHome}/foot/theme.conf"; settings = { main = { include = "${config.xdg.configHome}/foot/theme.conf"; font = "monospace:size=10"; }; font = "monospace:size=10"; }; cursor = { # Foot by default invert fg/bg for cursor. However, this makes # cursor on indent_blankline's indent char/spaces barely visible. color = "${fg} ${bg}"; }; cursor = { # Foot by default invert fg/bg for cursor. However, this makes # cursor on indent_blankline's indent char/spaces barely visible. color = "${fg} ${bg}"; }; colors = { alpha = 0.9; colors = { alpha = 0.9; }; }; }; }; }; xdg = { configFile."foot/theme.conf" = { text = builtins.readFile ( pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "foot"; rev = "009cd57bd3491c65bb718a269951719f94224eb7"; sha256 = "0f0r8d4rn54gibrzfhiy4yr8bi7c8j18ggp1y9lyidc1dmy9kvw0"; } pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "foot"; rev = "009cd57bd3491c65bb718a269951719f94224eb7"; sha256 = "0f0r8d4rn54gibrzfhiy4yr8bi7c8j18ggp1y9lyidc1dmy9kvw0"; } + "/catppuccin-${catppuccinTheme}.conf" ); };
-
-
-
@@ -1,4 +1,4 @@{...}: { { ... }: { imports = [ ./neovim.nix ./rtx.nix
-
-
-
@@ -1,10 +1,9 @@# Language specific tools are not configured in this file because # these tools are project specific. Each project should have Flake # file (provided by the project or manually created by a user). { config, pkgs, ... { config , pkgs , ... }: { programs = { neovim = {
-