From c22aee392716ae49891d1335130c3e237d3f3d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 11 Mar 2026 18:13:34 +0700 Subject: [PATCH] Run nix fmt --- flake.nix | 233 +++++----- home/Aloria.nix | 101 +++-- home/Arendia.nix | 103 ++--- home/Arm.nix | 53 +-- home/Asturia.nix | 65 +-- home/Docker.nix | 16 +- home/Kell.nix | 103 ++--- home/Mallorea.nix | 186 ++++---- home/Pi.nix | 59 +-- home/Riva.nix | 79 ++-- home/Tolnedra.nix | 65 +-- home/Vault.nix | 110 ++--- home/ags/default.nix | 45 +- home/ags/flake.nix | 100 ++--- home/alacritty/default.nix | 222 +++++---- home/bash/default.nix | 139 +++--- home/email/default.nix | 480 ++++++++++---------- home/firefox/default.nix | 191 ++++---- home/foot/default.nix | 73 ++- home/ghostty/default.nix | 84 ++-- home/git/default.nix | 78 ++-- home/helium/default.nix | 113 +++-- home/hyprland/default.nix | 546 +++++++++++------------ home/kitty/default.nix | 114 +++-- home/lf/default.nix | 66 +-- home/mpv/default.nix | 16 +- home/nvim/default.nix | 100 +++-- home/rofi/default.nix | 250 ++++++----- home/ssh/default.nix | 177 ++++---- home/tmux/default.nix | 117 +++-- home/utils/common.nix | 96 ++-- home/utils/desktop.nix | 202 +++++---- home/utils/disk_check.nix | 9 +- home/utils/fzgo_links.nix | 21 +- home/utils/python.nix | 74 +-- home/utils/services.nix | 163 +++---- home/vicinae/default.nix | 25 +- home/walker/default.nix | 24 +- home/waybar/default.nix | 178 ++++---- home/yazi/default.nix | 64 ++- home/zellij/default.nix | 17 +- home/zsh/default.nix | 213 ++++----- hosts/Aloria/default.nix | 326 +++++++------- hosts/Aloria/hardware-configuration.nix | 122 ++--- hosts/Arendia/default.nix | 231 +++++----- hosts/Arendia/hardware-configuration.nix | 61 +-- hosts/Arm/flake.nix | 55 +-- hosts/Asturia/default.nix | 81 ++-- hosts/Asturia/hardware-configuration.nix | 42 +- hosts/Common/default.nix | 251 ++++++----- hosts/Common/desktop.nix | 115 ++--- hosts/Common/nfs.nix | 126 +++--- hosts/Common/nvidia.nix | 45 +- hosts/Common/zfs.nix | 63 ++- hosts/Docker/flake.nix | 65 +-- hosts/Kell/default.nix | 309 ++++++------- hosts/Kell/hardware-configuration.nix | 45 +- hosts/Mallorea/flake.nix | 65 +-- hosts/Pi/flake.nix | 55 +-- hosts/Riva/default.nix | 98 ++-- hosts/Riva/hardware-configuration.nix | 53 +-- hosts/Tolnedra/flake.nix | 55 +-- hosts/Vault/flake.nix | 55 +-- 63 files changed, 3851 insertions(+), 3637 deletions(-) diff --git a/flake.nix b/flake.nix index fa5c8f1..43e7de5 100644 --- a/flake.nix +++ b/flake.nix @@ -1,113 +1,130 @@ { - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nur.url = "github:nix-community/NUR"; - fzgo.url = "git+https://git.thomasave.be/thomasave/fzgo.git"; - vicinae.url = "github:vicinaehq/vicinae"; - worktimer = { - type = "git"; - url = "https://git.thomasave.be/thomasave/WorkTimer"; - ref = "cli"; - }; - astal = { - url = "github:aylur/astal"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - ags = { - url = "github:aylur/ags"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.astal.follows = "astal"; - }; - nixos-06cb-009a-fingerprint-sensor = { - url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor?ref=24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; + fzgo.url = "git+https://git.thomasave.be/thomasave/fzgo.git"; + vicinae.url = "github:vicinaehq/vicinae"; + worktimer = { + type = "git"; + url = "https://git.thomasave.be/thomasave/WorkTimer"; + ref = "cli"; + }; + astal = { + url = "github:aylur/astal"; + inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { nixpkgs, home-manager, nur, nixos-06cb-009a-fingerprint-sensor, ... }@inputs: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - commonModules = host: user: [ - ./hosts/${host}/hardware-configuration.nix - { nixpkgs.overlays = [ - nur.overlays.default - (self: super: { utillinux = super.util-linux; }) - ]; } - { - networking.hostName = host; - time.timeZone = "Asia/Bangkok"; - nix.settings = { - substituters = [ - "https://nix-community.cachix.org" - "https://cuda-maintainers.cachix.org" - "https://vicinae.cachix.org" - ]; - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" - "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" - ]; - experimental-features = [ "nix-command" "flakes" ]; - trusted-users = [ "root" user ]; - auto-optimise-store = true; - }; - users.users.${user} = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAa3tMzSCRuprEACrBsKI0F/o73o6J9L1qR3TaZn/N8 user@Kell" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIByLwLAdJbmoDV5sx4hg5NbzKbOh1GmWEhDOUJ1GQBhK user@Riva" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxMq4kubz4wWr4S8xU3GRkPcn6XRS3y7IP+qylN5QAp user@Aloria" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOAhFTJI49o+eS1kHs5XRrpCLLuhAE+JUCffusudyR88 user@Arendia" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHtzTFdvLEvXpv69qAWLTipl4hgsKgRrRrWJRecsFthG user@Arch" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOxtJRtlAphl8euicVUR/6C7o+tyhpYmcbMBLHnldEIX server@mallorea" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILazQU/Y9I5PkMZoG/Lzc6mDR7s+aRHzqJoFUhYSse4P PocoF1" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOetfiPyIQ8hbU4t87E0ZrgLqFW9YW09+MNNiusXwW0C user@Asturia" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFoUYcVMsDw6tmjfdOuQkwaXx8fohKJs/6/5HoLzTP6x Tablet" - ]; - shell = pkgs.zsh; - }; - system.stateVersion = "23.11"; - } - home-manager.nixosModules.home-manager - { - home-manager = { - extraSpecialArgs = { inherit inputs; }; - useGlobalPkgs = true; - useUserPackages = true; - users.${user} = { imports = [ ./home/${host}.nix ]; }; - backupFileExtension = "bak"; - }; - } - ./hosts/${host} - ]; - mkSystem = host: cfg: - let - system = cfg.system or "x86_64-linux"; - in - nixpkgs.lib.nixosSystem { - modules = (commonModules host cfg.user) ++ (cfg.modules or [ ]) ++ [ - { nixpkgs.hostPlatform = system; } - ]; - specialArgs = inputs; - }; - systems = { - Riva = { user = "user"; }; - Kell = { user = "user"; }; - Aloria = { user = "user"; }; - Arendia = { user = "user"; modules = [ - nixos-06cb-009a-fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor" - ];}; - Asturia = { user = "user"; }; - }; - in - { - nixosConfigurations = nixpkgs.lib.mapAttrs mkSystem systems; + ags = { + url = "github:aylur/ags"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.astal.follows = "astal"; + }; + nixos-06cb-009a-fingerprint-sensor = { + url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor?ref=24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + nixpkgs, + home-manager, + nur, + nixos-06cb-009a-fingerprint-sensor, + ... + } @ inputs: let + supportedSystems = ["x86_64-linux" "aarch64-linux"]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + system = builtins.currentSystem; + pkgs = nixpkgs.legacyPackages.${system}; + commonModules = host: user: [ + ./hosts/${host}/hardware-configuration.nix + { + nixpkgs.overlays = [ + nur.overlays.default + (self: super: {utillinux = super.util-linux;}) + ]; + } + { + networking.hostName = host; + time.timeZone = "Asia/Bangkok"; + nix.settings = { + substituters = [ + "https://nix-community.cachix.org" + "https://cuda-maintainers.cachix.org" + "https://vicinae.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" + ]; + experimental-features = ["nix-command" "flakes"]; + trusted-users = ["root" user]; + auto-optimise-store = true; }; + users.users.${user} = { + isNormalUser = true; + extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAa3tMzSCRuprEACrBsKI0F/o73o6J9L1qR3TaZn/N8 user@Kell" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIByLwLAdJbmoDV5sx4hg5NbzKbOh1GmWEhDOUJ1GQBhK user@Riva" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxMq4kubz4wWr4S8xU3GRkPcn6XRS3y7IP+qylN5QAp user@Aloria" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOAhFTJI49o+eS1kHs5XRrpCLLuhAE+JUCffusudyR88 user@Arendia" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHtzTFdvLEvXpv69qAWLTipl4hgsKgRrRrWJRecsFthG user@Arch" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOxtJRtlAphl8euicVUR/6C7o+tyhpYmcbMBLHnldEIX server@mallorea" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILazQU/Y9I5PkMZoG/Lzc6mDR7s+aRHzqJoFUhYSse4P PocoF1" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOetfiPyIQ8hbU4t87E0ZrgLqFW9YW09+MNNiusXwW0C user@Asturia" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFoUYcVMsDw6tmjfdOuQkwaXx8fohKJs/6/5HoLzTP6x Tablet" + ]; + shell = pkgs.zsh; + }; + system.stateVersion = "23.11"; + } + home-manager.nixosModules.home-manager + { + home-manager = { + extraSpecialArgs = {inherit inputs;}; + useGlobalPkgs = true; + useUserPackages = true; + users.${user} = {imports = [./home/${host}.nix];}; + backupFileExtension = "bak"; + }; + } + ./hosts/${host} + ]; + mkSystem = host: cfg: let + system = cfg.system or "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { + modules = + (commonModules host cfg.user) + ++ (cfg.modules or []) + ++ [ + {nixpkgs.hostPlatform = system;} + ]; + specialArgs = inputs; + }; + systems = { + Riva = {user = "user";}; + Kell = {user = "user";}; + Aloria = {user = "user";}; + Arendia = { + user = "user"; + modules = [ + nixos-06cb-009a-fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor" + ]; + }; + Asturia = {user = "user";}; + }; + in { + nixosConfigurations = nixpkgs.lib.mapAttrs mkSystem systems; + formatter = forAllSystems ( + system: + nixpkgs.legacyPackages.${system}.alejandra + ); + }; } diff --git a/home/Aloria.nix b/home/Aloria.nix index dea4379..8966378 100644 --- a/home/Aloria.nix +++ b/home/Aloria.nix @@ -1,55 +1,58 @@ -{ inputs, config, pkgs, ... }: -let - fzgo_paths = { - files = [ - "/home/user/.dotfiles" - ]; - dirs = [ - "/home/user/.dotfiles" - "/Storage/TrackBox" - ]; - }; -in { - imports = [ - (import ./utils/desktop.nix { inherit inputs config pkgs; }) - (import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; }) + inputs, + config, + pkgs, + ... +}: let + fzgo_paths = { + files = [ + "/home/user/.dotfiles" ]; - - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Aloria/id_ed25519"; - - home.packages = with pkgs; [ - jetbrains.pycharm - rclone - opencode - # zed-editor - google-cloud-sdk - distrobox - gnome-disk-utility - moonlight-qt - vscode - texliveFull - gnome-power-manager - discord - smile - podman-compose + dirs = [ + "/home/user/.dotfiles" + "/Storage/TrackBox" ]; + }; +in { + imports = [ + (import ./utils/desktop.nix {inherit inputs config pkgs;}) + (import ./utils/fzgo_links.nix {inherit config pkgs fzgo_paths;}) + ]; - wayland.windowManager.hyprland.settings = { - monitor = [ - "eDP-1,2880x1800@120.00Hz,480x0,1.2,vrr,1" - "HDMI-A-1,3840x2160@60.00Hz,0x-2160,1" - "DP-3,1920x1080,3840x-540,1" - "DP-1,1920x1080,3840x-540,1" - ]; - bind = [ - ", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${ - ./hyprland/files/rofi-power-menu.sh - }" - ]; - general.gaps_out = 1; - }; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Aloria/id_ed25519"; - programs.alacritty.settings.font.size = 13; - programs.kitty.font.size = 13; + home.packages = with pkgs; [ + jetbrains.pycharm + rclone + opencode + # zed-editor + google-cloud-sdk + distrobox + gnome-disk-utility + moonlight-qt + vscode + texliveFull + gnome-power-manager + discord + smile + podman-compose + ]; + + wayland.windowManager.hyprland.settings = { + monitor = [ + "eDP-1,2880x1800@120.00Hz,480x0,1.2,vrr,1" + "HDMI-A-1,3840x2160@60.00Hz,0x-2160,1" + "DP-3,1920x1080,3840x-540,1" + "DP-1,1920x1080,3840x-540,1" + ]; + bind = [ + ", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${ + ./hyprland/files/rofi-power-menu.sh + }" + ]; + general.gaps_out = 1; + }; + + programs.alacritty.settings.font.size = 13; + programs.kitty.font.size = 13; } diff --git a/home/Arendia.nix b/home/Arendia.nix index d798776..c3fd60e 100644 --- a/home/Arendia.nix +++ b/home/Arendia.nix @@ -1,58 +1,61 @@ -{ inputs, config, pkgs, ... }: -let - fzgo_paths = { - files = [ - "/home/user/.dotfiles" - ]; - dirs = [ - "/home/user/.dotfiles" - "/Storage/TrackBox/" - ]; - }; -in { - imports = [ - (import ./utils/desktop.nix { inherit inputs config pkgs; }) - (import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; }) + inputs, + config, + pkgs, + ... +}: let + fzgo_paths = { + files = [ + "/home/user/.dotfiles" ]; - - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Arendia/id_ed25519"; - - home.packages = with pkgs; [ - distrobox - gnome-disk-utility - moonlight-qt - vscode - texliveFull - gnome-power-manager - # jetbrains.pycharm-professional - discord - smile + dirs = [ + "/home/user/.dotfiles" + "/Storage/TrackBox/" ]; + }; +in { + imports = [ + (import ./utils/desktop.nix {inherit inputs config pkgs;}) + (import ./utils/fzgo_links.nix {inherit config pkgs fzgo_paths;}) + ]; - services.hyprpaper = { - settings = { - wallpaper = [ - "HDMI-A-1,${./hyprland/files/wallpaper.png}" - "eDP-1,${./hyprland/files/wallpaper.png}" - ]; - }; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Arendia/id_ed25519"; + + home.packages = with pkgs; [ + distrobox + gnome-disk-utility + moonlight-qt + vscode + texliveFull + gnome-power-manager + # jetbrains.pycharm-professional + discord + smile + ]; + + services.hyprpaper = { + settings = { + wallpaper = [ + "HDMI-A-1,${./hyprland/files/wallpaper.png}" + "eDP-1,${./hyprland/files/wallpaper.png}" + ]; }; + }; - wayland.windowManager.hyprland.settings = { - monitor = [ - "eDP-1,2560x1440@60.01,0x0,1" - "HDMI-A-1,1920x1080@60,0x-1080,1" - ]; - bind = [ - ", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${ - ./hyprland/files/rofi-power-menu.sh - }" - ]; - general.gaps_out = 1; - }; + wayland.windowManager.hyprland.settings = { + monitor = [ + "eDP-1,2560x1440@60.01,0x0,1" + "HDMI-A-1,1920x1080@60,0x-1080,1" + ]; + bind = [ + ", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${ + ./hyprland/files/rofi-power-menu.sh + }" + ]; + general.gaps_out = 1; + }; - programs.alacritty.settings.font.size = 13; - programs.kitty.font.size = 15; - programs.foot.settings.main.font = pkgs.lib.mkForce "DejaVu Sans Mono:size=15"; + programs.alacritty.settings.font.size = 13; + programs.kitty.font.size = 15; + programs.foot.settings.main.font = pkgs.lib.mkForce "DejaVu Sans Mono:size=15"; } diff --git a/home/Arm.nix b/home/Arm.nix index 2a81fbc..fb8c481 100644 --- a/home/Arm.nix +++ b/home/Arm.nix @@ -1,30 +1,33 @@ -{ inputs, config, pkgs, ... }: -let -in - { - home.username = "ubuntu"; - home.homeDirectory = "/home/ubuntu"; - nix = { - package = pkgs.nix; - settings.use-xdg-base-directories = true; - }; +{ + inputs, + config, + pkgs, + ... +}: let +in { + home.username = "ubuntu"; + home.homeDirectory = "/home/ubuntu"; + nix = { + package = pkgs.nix; + settings.use-xdg-base-directories = true; + }; - xdg.enable = true; + xdg.enable = true; - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - ./ssh - ]; - programs.ssh.matchBlocks."*".identityFile = "/home/ubuntu/.secrets/SSH/Arm/id_ed25519"; + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + ./ssh + ]; + programs.ssh.matchBlocks."*".identityFile = "/home/ubuntu/.secrets/SSH/Arm/id_ed25519"; - home.sessionVariables = { - NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; - LANG = "en_US.UTF-8"; - XDG_RUNTIME_DIR = "/run/ubuntu/$(id -u)"; - }; + home.sessionVariables = { + NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; + LANG = "en_US.UTF-8"; + XDG_RUNTIME_DIR = "/run/ubuntu/$(id -u)"; + }; - programs.zsh.initContent = pkgs.lib.mkAfter '' - LOCAL_SEARCH_DIRS=(~/.dotfiles/) - REMOTE_SEARCH_DIRS=() - ''; + programs.zsh.initContent = pkgs.lib.mkAfter '' + LOCAL_SEARCH_DIRS=(~/.dotfiles/) + REMOTE_SEARCH_DIRS=() + ''; } diff --git a/home/Asturia.nix b/home/Asturia.nix index a8a2685..56a2464 100644 --- a/home/Asturia.nix +++ b/home/Asturia.nix @@ -1,37 +1,40 @@ -{ inputs, config, pkgs, ... }: - { - imports = [ - (import ./utils/desktop.nix { inherit inputs config pkgs; }) - ]; + inputs, + config, + pkgs, + ... +}: { + imports = [ + (import ./utils/desktop.nix {inherit inputs config pkgs;}) + ]; - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Asturia/id_ed25519"; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Asturia/id_ed25519"; - home.packages = with pkgs; [ - distrobox - wl-clipboard - jq - evince + home.packages = with pkgs; [ + distrobox + wl-clipboard + jq + evince + ]; + wayland.windowManager.hyprland.settings = { + "$mainMod" = pkgs.lib.mkForce "ALT_L"; + "$altMod" = pkgs.lib.mkForce "SUPER"; + monitor = [ + "Virtual-1,1920x1080@60,0x0,1" + "DP-1,1920x1080@60,0x0,1" + "HDMI-A-1,1920x1080@60,0x0,1" ]; - wayland.windowManager.hyprland.settings = { - "$mainMod" = pkgs.lib.mkForce "ALT_L"; - "$altMod" = pkgs.lib.mkForce "SUPER"; - monitor = [ - "Virtual-1,1920x1080@60,0x0,1" - "DP-1,1920x1080@60,0x0,1" - "HDMI-A-1,1920x1080@60,0x0,1" - ]; - general.gaps_out = 1; + general.gaps_out = 1; + }; + services.hyprpaper = { + settings = { + wallpaper = [ + "Virtual-1,${./hyprland/files/wallpaper.png}" + "DP-1,${./hyprland/files/wallpaper.png}" + "HDMI-A-1,${./hyprland/files/wallpaper.png}" + ]; }; - services.hyprpaper = { - settings = { - wallpaper = [ - "Virtual-1,${./hyprland/files/wallpaper.png}" - "DP-1,${./hyprland/files/wallpaper.png}" - "HDMI-A-1,${./hyprland/files/wallpaper.png}" - ]; - }; - }; - programs.alacritty.settings.font.size = 12; - programs.kitty.font.size = 12; + }; + programs.alacritty.settings.font.size = 12; + programs.kitty.font.size = 12; } diff --git a/home/Docker.nix b/home/Docker.nix index da990bd..24804d6 100644 --- a/home/Docker.nix +++ b/home/Docker.nix @@ -1,9 +1,13 @@ -{ inputs, config, pkgs, ... }: { - home.username = "user"; - home.homeDirectory = "/home/user"; + inputs, + config, + pkgs, + ... +}: { + home.username = "user"; + home.homeDirectory = "/home/user"; - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - ]; + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + ]; } diff --git a/home/Kell.nix b/home/Kell.nix index cb921e6..b9edec5 100644 --- a/home/Kell.nix +++ b/home/Kell.nix @@ -1,57 +1,60 @@ -{ inputs, config, pkgs, ... }: -let - fzgo_paths = { - files = [ - "/home/user/.dotfiles" - "/home/server/.cache/fzgo/entries/f/|home|user|Workspace" - ]; - dirs = [ - "/home/user/.dotfiles" - "/home/server/.cache/fzgo/entries/d/|home|user|Workspace" - "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Thomas" - "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Shared" - ]; - }; -in { - imports = [ - (import ./utils/desktop.nix { inherit inputs config pkgs; }) - (import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; }) + inputs, + config, + pkgs, + ... +}: let + fzgo_paths = { + files = [ + "/home/user/.dotfiles" + "/home/server/.cache/fzgo/entries/f/|home|user|Workspace" ]; - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Kell/id_ed25519"; - - dconf.settings = { - "org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; - }; - }; - - home.packages = with pkgs; [ - distrobox - gnome-disk-utility - moonlight-qt - vscode - jetbrains.rider - discord + dirs = [ + "/home/user/.dotfiles" + "/home/server/.cache/fzgo/entries/d/|home|user|Workspace" + "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Thomas" + "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Shared" ]; + }; +in { + imports = [ + (import ./utils/desktop.nix {inherit inputs config pkgs;}) + (import ./utils/fzgo_links.nix {inherit config pkgs fzgo_paths;}) + ]; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Kell/id_ed25519"; - services.hyprpaper = { - settings = { - wallpaper = [ - "DP-1,${./hyprland/files/wallpaper.png}" - "DP-2,${./hyprland/files/wallpaper.png}" - "HDMI-A-1,${./hyprland/files/wallpaper.png}" - ]; - }; + dconf.settings = { + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; }; - wayland.windowManager.hyprland.settings = { - monitor = [ - "DP-2,preferred,0x550,1" - "DP-1,preferred,1920x0,1" - "HDMI-A-1,preferred,5760x550,1" - ]; - input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; - # input.kb_options = "compose:rctrl, caps:super"; + }; + + home.packages = with pkgs; [ + distrobox + gnome-disk-utility + moonlight-qt + vscode + jetbrains.rider + discord + ]; + + services.hyprpaper = { + settings = { + wallpaper = [ + "DP-1,${./hyprland/files/wallpaper.png}" + "DP-2,${./hyprland/files/wallpaper.png}" + "HDMI-A-1,${./hyprland/files/wallpaper.png}" + ]; }; + }; + wayland.windowManager.hyprland.settings = { + monitor = [ + "DP-2,preferred,0x550,1" + "DP-1,preferred,1920x0,1" + "HDMI-A-1,preferred,5760x550,1" + ]; + input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; + # input.kb_options = "compose:rctrl, caps:super"; + }; } diff --git a/home/Mallorea.nix b/home/Mallorea.nix index c81b06a..9a4c30f 100644 --- a/home/Mallorea.nix +++ b/home/Mallorea.nix @@ -1,97 +1,101 @@ -{ inputs, config, pkgs, ... }: -let - username = "server"; - home_dir = "/home/${username}"; - scripts = { - disk_check = import ./utils/disk_check.nix { inherit pkgs; }; - # vdirsyncer = { - # when = "*:0/15"; - # script = toString (pkgs.writeShellScript "script" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair ''); - # }; - fzgo = { - when = "*:0/5"; - script = toString (pkgs.writeShellScript "script" '' - ${pkgs.zsh}/bin/zsh -c "source ${./zsh/files/fzgo.zsh} && fzgo_update_cache" - ''); - }; - mbsync = { - when = "*-*-* 00:00:00"; - script = toString (pkgs.writeShellScript "script" '' - BASEDIR=/home/server/Containers/mbsync - # python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json - docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a - ${pkgs.notmuch}/bin/notmuch new - ''); - }; - # sync_vault = { - # when = "*-*-* 02:00:00"; - # script = toString (pkgs.writeShellScript "script" '' - # source $HOME/.secrets/Backup/env.sh - # for _ in {1..2}; do - # OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1); - # if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then - # echo "Key successfully loaded, starting syncoid" - # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace - # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T - # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Emily 10.4.0.1:Vault/Thomas/Encrypted/Storage/N - # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y - # syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers - # ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted - # ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R - # exit 0 - # fi - # done - # - # echo "Found output instead: $OUTPUT" - # echo "Failed to load key: $OUTPUT" | sendmail - # exit 1 - # ''); - # }; - backup = { - when = "*-*-* 04:00:00"; - script = toString (pkgs.writeShellScript "script" '' - ${./scripts/files/backup.sh} - ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0 - ''); - }; +{ + inputs, + config, + pkgs, + ... +}: let + username = "server"; + home_dir = "/home/${username}"; + scripts = { + disk_check = import ./utils/disk_check.nix {inherit pkgs;}; + # vdirsyncer = { + # when = "*:0/15"; + # script = toString (pkgs.writeShellScript "script" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair ''); + # }; + fzgo = { + when = "*:0/5"; + script = toString (pkgs.writeShellScript "script" '' + ${pkgs.zsh}/bin/zsh -c "source ${./zsh/files/fzgo.zsh} && fzgo_update_cache" + ''); }; - fzgo_paths = { - files = [ - "/home/user/Workspace" - "${home_dir}/.dotfiles" - ]; - dirs = [ - "/home/user/Workspace" - "${home_dir}/.dotfiles" - "${home_dir}/Containers" - "${home_dir}/Storage/Thomas" - "${home_dir}/Storage/Shared" - ]; + mbsync = { + when = "*-*-* 00:00:00"; + script = toString (pkgs.writeShellScript "script" '' + BASEDIR=/home/server/Containers/mbsync + # python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json + docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a + ${pkgs.notmuch}/bin/notmuch new + ''); }; -in { - home.username = username; - home.homeDirectory = home_dir; - nix = { - package = pkgs.nix; - settings = { - trusted-users = [ username ]; - use-xdg-base-directories = true; - }; + # sync_vault = { + # when = "*-*-* 02:00:00"; + # script = toString (pkgs.writeShellScript "script" '' + # source $HOME/.secrets/Backup/env.sh + # for _ in {1..2}; do + # OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1); + # if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then + # echo "Key successfully loaded, starting syncoid" + # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace + # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T + # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Emily 10.4.0.1:Vault/Thomas/Encrypted/Storage/N + # syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y + # syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers + # ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted + # ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R + # exit 0 + # fi + # done + # + # echo "Found output instead: $OUTPUT" + # echo "Failed to load key: $OUTPUT" | sendmail + # exit 1 + # ''); + # }; + backup = { + when = "*-*-* 04:00:00"; + script = toString (pkgs.writeShellScript "script" '' + ${./scripts/files/backup.sh} + ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0 + ''); }; - - xdg.enable = true; - - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - (import ./utils/services.nix { inherit pkgs scripts; }) - (import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; }) - ./ssh + }; + fzgo_paths = { + files = [ + "/home/user/Workspace" + "${home_dir}/.dotfiles" ]; - programs.ssh.matchBlocks."*".identityFile = "${home_dir}/.secrets/SSH/Mallorea/id_ed25519"; - - home.sessionVariables = { - NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; - LANG = "en_US.UTF-8"; - XDG_RUNTIME_DIR = "/run/user/$(id -u)"; + dirs = [ + "/home/user/Workspace" + "${home_dir}/.dotfiles" + "${home_dir}/Containers" + "${home_dir}/Storage/Thomas" + "${home_dir}/Storage/Shared" + ]; + }; +in { + home.username = username; + home.homeDirectory = home_dir; + nix = { + package = pkgs.nix; + settings = { + trusted-users = [username]; + use-xdg-base-directories = true; }; + }; + + xdg.enable = true; + + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + (import ./utils/services.nix {inherit pkgs scripts;}) + (import ./utils/fzgo_links.nix {inherit config pkgs fzgo_paths;}) + ./ssh + ]; + programs.ssh.matchBlocks."*".identityFile = "${home_dir}/.secrets/SSH/Mallorea/id_ed25519"; + + home.sessionVariables = { + NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; + LANG = "en_US.UTF-8"; + XDG_RUNTIME_DIR = "/run/user/$(id -u)"; + }; } diff --git a/home/Pi.nix b/home/Pi.nix index 77737b4..e8bad9b 100644 --- a/home/Pi.nix +++ b/home/Pi.nix @@ -1,33 +1,36 @@ -{ inputs, config, pkgs, ... }: -let -in - { - home.username = "user"; - home.homeDirectory = "/home/user"; - nix = { - package = pkgs.nix; - settings.use-xdg-base-directories = true; - }; +{ + inputs, + config, + pkgs, + ... +}: let +in { + home.username = "user"; + home.homeDirectory = "/home/user"; + nix = { + package = pkgs.nix; + settings.use-xdg-base-directories = true; + }; - xdg.enable = true; + xdg.enable = true; - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - ./ssh - ]; - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Pi/id_ed25519"; + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + ./ssh + ]; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Pi/id_ed25519"; - home.sessionVariables = { - NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; - LANG = "en_US.UTF-8"; - XDG_RUNTIME_DIR = "/run/user/$(id -u)"; - }; + home.sessionVariables = { + NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; + LANG = "en_US.UTF-8"; + XDG_RUNTIME_DIR = "/run/user/$(id -u)"; + }; - programs.zsh.initContent = pkgs.lib.mkAfter '' - LOCAL_SEARCH_DIRS=(~/.dotfiles/) - REMOTE_SEARCH_DIRS=() - if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then - . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' - fi - ''; + programs.zsh.initContent = pkgs.lib.mkAfter '' + LOCAL_SEARCH_DIRS=(~/.dotfiles/) + REMOTE_SEARCH_DIRS=() + if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then + . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' + fi + ''; } diff --git a/home/Riva.nix b/home/Riva.nix index 5a379df..5968b69 100644 --- a/home/Riva.nix +++ b/home/Riva.nix @@ -1,43 +1,46 @@ -{ inputs, config, pkgs, ... }: -let - fzgo_paths = { - files = [ - "/home/user/.dotfiles" - "/home/server/.cache/fzgo/entries/f/|home|user|Workspace" - ]; - dirs = [ - "/home/user/.dotfiles" - "/home/server/.cache/fzgo/entries/d/|home|user|Workspace" - "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Thomas" - "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Shared" - ]; - }; -in { - imports = [ - (import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; }) - (import ./utils/desktop.nix { inherit inputs config pkgs; }) - ./ssh + inputs, + config, + pkgs, + ... +}: let + fzgo_paths = { + files = [ + "/home/user/.dotfiles" + "/home/server/.cache/fzgo/entries/f/|home|user|Workspace" ]; - - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Riva/id_ed25519"; - - home.packages = with pkgs; [ - distrobox - jq - rclone + dirs = [ + "/home/user/.dotfiles" + "/home/server/.cache/fzgo/entries/d/|home|user|Workspace" + "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Thomas" + "/home/server/.cache/fzgo/entries/d/|home|server|Storage|Shared" ]; - services.hyprpaper = { - settings = { - wallpaper = [ - "Virtual-1,${./hyprland/files/wallpaper.png}" - ]; - }; - }; - wayland.windowManager.hyprland.settings = { - monitor = [ - "Virtual-1,2560x1440,0x0,1" - ]; - input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; + }; +in { + imports = [ + (import ./utils/fzgo_links.nix {inherit config pkgs fzgo_paths;}) + (import ./utils/desktop.nix {inherit inputs config pkgs;}) + ./ssh + ]; + + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Riva/id_ed25519"; + + home.packages = with pkgs; [ + distrobox + jq + rclone + ]; + services.hyprpaper = { + settings = { + wallpaper = [ + "Virtual-1,${./hyprland/files/wallpaper.png}" + ]; }; + }; + wayland.windowManager.hyprland.settings = { + monitor = [ + "Virtual-1,2560x1440,0x0,1" + ]; + input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; + }; } diff --git a/home/Tolnedra.nix b/home/Tolnedra.nix index 639f3bd..33ded27 100644 --- a/home/Tolnedra.nix +++ b/home/Tolnedra.nix @@ -1,40 +1,43 @@ -{ inputs, config, pkgs, ... }: - { - home.username = "user"; - home.homeDirectory = "/home/user"; - nix = { - package = pkgs.nix; - settings = { - trusted-users = [ "user" ]; - use-xdg-base-directories = true; - }; + inputs, + config, + pkgs, + ... +}: { + home.username = "user"; + home.homeDirectory = "/home/user"; + nix = { + package = pkgs.nix; + settings = { + trusted-users = ["user"]; + use-xdg-base-directories = true; }; + }; - xdg.enable = true; - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - ./alacritty - ./ssh - ]; + xdg.enable = true; + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + ./alacritty + ./ssh + ]; - programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Tolnedra/id_ed25519"; + programs.ssh.matchBlocks."*".identityFile = "/home/user/.secrets/SSH/Tolnedra/id_ed25519"; - home.packages = with pkgs; [ - wl-clipboard - jq - ]; + home.packages = with pkgs; [ + wl-clipboard + jq + ]; - home.sessionVariables = { - NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; - LANG = "en_US.UTF-8"; - XDG_RUNTIME_DIR = "/run/user/$(id -u)"; - }; + home.sessionVariables = { + NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; + LANG = "en_US.UTF-8"; + XDG_RUNTIME_DIR = "/run/user/$(id -u)"; + }; - programs.zsh.initContent = pkgs.lib.mkAfter '' - LOCAL_SEARCH_DIRS=(~/.dotfiles/) - REMOTE_SEARCH_DIRS=() - ''; + programs.zsh.initContent = pkgs.lib.mkAfter '' + LOCAL_SEARCH_DIRS=(~/.dotfiles/) + REMOTE_SEARCH_DIRS=() + ''; - programs.alacritty.settings.window.opacity = 0.8; + programs.alacritty.settings.window.opacity = 0.8; } diff --git a/home/Vault.nix b/home/Vault.nix index d928f2c..a6c2311 100644 --- a/home/Vault.nix +++ b/home/Vault.nix @@ -1,9 +1,13 @@ -{ inputs, config, pkgs, ... }: -let - scripts = { - disk_check = { - when = "*-*-* *:00:00"; - script = toString (pkgs.writeShellScript "script" '' +{ + inputs, + config, + pkgs, + ... +}: let + scripts = { + disk_check = { + when = "*-*-* *:00:00"; + script = toString (pkgs.writeShellScript "script" '' REPORT_EMAIL=email@thomasave.be ZPOOL_STATUS=$(zpool status -x) if [ "$ZPOOL_STATUS" = "all pools are healthy" ] || [ "$ZPOOL_STATUS" = "no pools available" ] @@ -16,63 +20,65 @@ let printf 1 > /var/db/zpool.status fi fi - ''); - }; - restic_etienne = { - when = "*-*-* 01:00:00"; - script = toString (pkgs.writeShellScript "script" '' + ''); + }; + restic_etienne = { + when = "*-*-* 01:00:00"; + script = toString (pkgs.writeShellScript "script" '' /Backup/Restic/Etienne/run.sh ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/zGPrOi0NsJ - ''); - }; - restic_magda_and_etienne = { - when = "*-*-* 03:00:00"; - script = toString (pkgs.writeShellScript "script" '' + ''); + }; + restic_magda_and_etienne = { + when = "*-*-* 03:00:00"; + script = toString (pkgs.writeShellScript "script" '' /Backup/Restic/Magda\ and\ Etienne/run.sh ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/yvBuDgduDd - ''); - }; - restic_backblaze = { - when = "*-*-* 02:00:00"; - script = toString (pkgs.writeShellScript "script" '' + ''); + }; + restic_backblaze = { + when = "*-*-* 02:00:00"; + script = toString (pkgs.writeShellScript "script" '' /Backup/Restic/BackBlaze/run.sh ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/LVruVYTwTn - ''); - }; - mail_sync = { - when = "*-*-* 04:00:00"; - script = toString (pkgs.writeShellScript "script" '' + ''); + }; + mail_sync = { + when = "*-*-* 04:00:00"; + script = toString (pkgs.writeShellScript "script" '' cd /home/server/Containers/Mails && docker compose up sync-etienne sync-magda ${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/eEIPVGyrAx - ''); - }; - }; -in - { - home.username = "server"; - home.homeDirectory = "/home/server"; - nix = { - package = pkgs.nix; - settings.use-xdg-base-directories = true; + ''); }; + }; +in { + home.username = "server"; + home.homeDirectory = "/home/server"; + nix = { + package = pkgs.nix; + settings.use-xdg-base-directories = true; + }; - xdg.enable = true; - imports = [ - (import ./utils/common.nix { inherit inputs config pkgs; }) - (import ./utils/services.nix { inherit pkgs; scripts = scripts; }) - ./ssh - ]; + xdg.enable = true; + imports = [ + (import ./utils/common.nix {inherit inputs config pkgs;}) + (import ./utils/services.nix { + inherit pkgs; + scripts = scripts; + }) + ./ssh + ]; - programs.ssh.matchBlocks."*".identityFile = "/home/server/.secrets/SSH/Vault/id_ed25519"; + programs.ssh.matchBlocks."*".identityFile = "/home/server/.secrets/SSH/Vault/id_ed25519"; - home.sessionVariables = { - NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; - LANG = "en_US.UTF-8"; - XDG_RUNTIME_DIR = "/run/user/$(id -u)"; - }; + home.sessionVariables = { + NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; + LANG = "en_US.UTF-8"; + XDG_RUNTIME_DIR = "/run/user/$(id -u)"; + }; - programs.zsh.initContent = pkgs.lib.mkAfter '' - LOCAL_SEARCH_DIRS=(~/.dotfiles/ ~/Storage/Thomas/ ~/Storage/Etienne/ ~/Storage/Magda\ and\ Etienne/ ~/Containers/) - REMOTE_SEARCH_DIRS=() - ''; + programs.zsh.initContent = pkgs.lib.mkAfter '' + LOCAL_SEARCH_DIRS=(~/.dotfiles/ ~/Storage/Thomas/ ~/Storage/Etienne/ ~/Storage/Magda\ and\ Etienne/ ~/Containers/) + REMOTE_SEARCH_DIRS=() + ''; } diff --git a/home/ags/default.nix b/home/ags/default.nix index 7f60ac0..f6f64c6 100644 --- a/home/ags/default.nix +++ b/home/ags/default.nix @@ -1,26 +1,29 @@ -{ inputs, pkgs, ... }: { - # add the home manager module - imports = [ inputs.ags.homeManagerModules.default ]; - programs.ags = { - enable = true; + inputs, + pkgs, + ... +}: { + # add the home manager module + imports = [inputs.ags.homeManagerModules.default]; + programs.ags = { + enable = true; - configDir = ./files; + configDir = ./files; - extraPackages = with inputs.ags.packages.${pkgs.stdenv.hostPlatform.system}; [ - pkgs.gtksourceview - pkgs.accountsservice - pkgs.libadwaita + extraPackages = with inputs.ags.packages.${pkgs.stdenv.hostPlatform.system}; [ + pkgs.gtksourceview + pkgs.accountsservice + pkgs.libadwaita - battery - hyprland - tray - powerprofiles - wireplumber - mpris - network - apps - notifd - ]; - }; + battery + hyprland + tray + powerprofiles + wireplumber + mpris + network + apps + notifd + ]; + }; } diff --git a/home/ags/flake.nix b/home/ags/flake.nix index 859019d..277e7ab 100644 --- a/home/ags/flake.nix +++ b/home/ags/flake.nix @@ -1,55 +1,55 @@ { - description = "AGS Config"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + description = "AGS Config"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - ags = { - url = "github:aylur/ags"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + ags = { + url = "github:aylur/ags"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + ags, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + extraPackages = with ags.packages.${pkgs.stdenv.hostPlatform.system}; [ + pkgs.gtksourceview + pkgs.accountsservice + + battery + hyprland + tray + powerprofiles + wireplumber + mpris + network + apps + notifd + ]; + in { + packages.${system} = { + default = ags.lib.bundle { + inherit pkgs; + src = ./files; + name = "ags-bar"; + entry = "app.ts"; + extraPackages = extraPackages; + }; }; - outputs = { - self, - nixpkgs, - ags, - }: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - extraPackages = with ags.packages.${pkgs.stdenv.hostPlatform.system}; [ - pkgs.gtksourceview - pkgs.accountsservice - - battery - hyprland - tray - powerprofiles - wireplumber - mpris - network - apps - notifd - ]; - in { - packages.${system} = { - default = ags.lib.bundle { - inherit pkgs; - src = ./files; - name = "ags-bar"; - entry = "app.ts"; - extraPackages = extraPackages; - }; - }; - - devShells.${system} = { - default = pkgs.mkShell { - buildInputs = [ - # ags.packages.${system}.agsFull - (ags.packages.${system}.default.override { - extraPackages = extraPackages; - }) - ]; - }; - }; - }; + devShells.${system} = { + default = pkgs.mkShell { + buildInputs = [ + # ags.packages.${system}.agsFull + (ags.packages.${system}.default.override { + extraPackages = extraPackages; + }) + ]; + }; + }; + }; } diff --git a/home/alacritty/default.nix b/home/alacritty/default.nix index 1556bff..3fee9aa 100644 --- a/home/alacritty/default.nix +++ b/home/alacritty/default.nix @@ -1,115 +1,113 @@ -{ pkgs, ... }: - -{ - programs.alacritty = { - enable = true; - settings = { - scrolling.history = 10000; - window = { - dynamic_padding = true; - dynamic_title = true; - opacity = 0.3; - }; - env = { - TERM = "xterm-256color"; - }; - colors = { - bright = { - black = "#555556"; - blue = "#00afff"; - cyan = "#50cdfe"; - green = "#b0e05e"; - magenta = "#af87ff"; - red = "#f5669c"; - white = "#ffffff"; - yellow = "#fef26c"; - }; - normal = { - black = "#121213"; - blue = "#0f7fcf"; - cyan = "#42a7cf"; - green = "#97e123"; - magenta = "#8700ff"; - red = "#fa2573"; - white = "#bbbbbb"; - yellow = "#dfd460"; - }; - primary = { - background = "#000011"; - foreground = "#F8F8F2"; - }; - }; - font = { - size = pkgs.lib.mkDefault 13; - normal.family = "DejaVu Sans Mono"; - }; - keyboard.bindings = [ - { - action = "ToggleFullscreen"; - key = "F11"; - } - { - action = "ToggleViMode"; - key = "Escape"; - mode = "Vi"; - } - { - action = "ScrollHalfPageUp"; - key = "E"; - mode = "Vi"; - mods = "Control"; - } - { - key = "F"; - mods = "Control|Shift"; - action = "ReceiveChar"; - } - { - chars = "\\u001B[72;6u"; - key = "H"; - mods = "Control|Shift"; - } - { - chars = "\\u001B[74;6u"; - key = "J"; - mods = "Control|Shift"; - } - { - chars = "\\u001B[75;6u"; - key = "K"; - mods = "Control|Shift"; - } - { - chars = "\\u001B[76;6u"; - key = "L"; - mods = "Control|Shift"; - } - { - chars = "\\u001B[105;5u"; - key = "I"; - mods = "Control"; - } - { - chars = "\\u001B[46;5u"; - key = "Period"; - mods = "Control"; - } - { - chars = "\\u001B[44;5u"; - key = "Comma"; - mods = "Control"; - } - { - chars = "\\u001B[59;5u"; - key = "Semicolon"; - mods = "Control"; - } - { - chars = "\\u001B[13;2u"; - key = "Return"; - mods = "Shift"; - } - ]; +{pkgs, ...}: { + programs.alacritty = { + enable = true; + settings = { + scrolling.history = 10000; + window = { + dynamic_padding = true; + dynamic_title = true; + opacity = 0.3; + }; + env = { + TERM = "xterm-256color"; + }; + colors = { + bright = { + black = "#555556"; + blue = "#00afff"; + cyan = "#50cdfe"; + green = "#b0e05e"; + magenta = "#af87ff"; + red = "#f5669c"; + white = "#ffffff"; + yellow = "#fef26c"; }; + normal = { + black = "#121213"; + blue = "#0f7fcf"; + cyan = "#42a7cf"; + green = "#97e123"; + magenta = "#8700ff"; + red = "#fa2573"; + white = "#bbbbbb"; + yellow = "#dfd460"; + }; + primary = { + background = "#000011"; + foreground = "#F8F8F2"; + }; + }; + font = { + size = pkgs.lib.mkDefault 13; + normal.family = "DejaVu Sans Mono"; + }; + keyboard.bindings = [ + { + action = "ToggleFullscreen"; + key = "F11"; + } + { + action = "ToggleViMode"; + key = "Escape"; + mode = "Vi"; + } + { + action = "ScrollHalfPageUp"; + key = "E"; + mode = "Vi"; + mods = "Control"; + } + { + key = "F"; + mods = "Control|Shift"; + action = "ReceiveChar"; + } + { + chars = "\\u001B[72;6u"; + key = "H"; + mods = "Control|Shift"; + } + { + chars = "\\u001B[74;6u"; + key = "J"; + mods = "Control|Shift"; + } + { + chars = "\\u001B[75;6u"; + key = "K"; + mods = "Control|Shift"; + } + { + chars = "\\u001B[76;6u"; + key = "L"; + mods = "Control|Shift"; + } + { + chars = "\\u001B[105;5u"; + key = "I"; + mods = "Control"; + } + { + chars = "\\u001B[46;5u"; + key = "Period"; + mods = "Control"; + } + { + chars = "\\u001B[44;5u"; + key = "Comma"; + mods = "Control"; + } + { + chars = "\\u001B[59;5u"; + key = "Semicolon"; + mods = "Control"; + } + { + chars = "\\u001B[13;2u"; + key = "Return"; + mods = "Shift"; + } + ]; }; + }; } diff --git a/home/bash/default.nix b/home/bash/default.nix index 93486cf..ae01857 100644 --- a/home/bash/default.nix +++ b/home/bash/default.nix @@ -1,77 +1,80 @@ -{ config, inputs, pkgs, ... }: - { - programs.starship = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = false; - settings = { - add_newline = false; - format = "$nix_shell$username$hostname[](bg:#0F7FCF fg:prev_bg)$directory$git_branch$git_status[](fg:prev_bg) "; - right_format = ""; - username = { - show_always = true; - style_user = "bg:#121213"; - style_root = "bg:#EA2C38"; - format = "[ $user]($style)"; - disabled = false; - }; + config, + inputs, + pkgs, + ... +}: { + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = false; + settings = { + add_newline = false; + format = "$nix_shell$username$hostname[](bg:#0F7FCF fg:prev_bg)$directory$git_branch$git_status[](fg:prev_bg) "; + right_format = ""; + username = { + show_always = true; + style_user = "bg:#121213"; + style_root = "bg:#EA2C38"; + format = "[ $user]($style)"; + disabled = false; + }; - hostname = { - disabled = false; - ssh_only = false; - format = "[@$hostname ]($style)"; - style = "bg:#121213"; - }; + hostname = { + disabled = false; + ssh_only = false; + format = "[@$hostname ]($style)"; + style = "bg:#121213"; + }; - directory = { - style = "bg:#0F7FCF fg:#080808"; - format = "[ $path ]($style)"; - truncation_length = 3; - truncation_symbol = ".../"; - }; + directory = { + style = "bg:#0F7FCF fg:#080808"; + format = "[ $path ]($style)"; + truncation_length = 3; + truncation_symbol = ".../"; + }; - git_branch = { - symbol = ""; - style = "bg:#DFD460 fg:#080808"; - format = "[](fg:prev_bg bg:#DFD460)[ $symbol $branch ]($style)"; - }; + git_branch = { + symbol = ""; + style = "bg:#DFD460 fg:#080808"; + format = "[](fg:prev_bg bg:#DFD460)[ $symbol $branch ]($style)"; + }; - git_status = { - style = "bg:#DFD460 fg:#080808"; - format = "[$all_status$ahead_behind ]($style)"; - }; + git_status = { + style = "bg:#DFD460 fg:#080808"; + format = "[$all_status$ahead_behind ]($style)"; + }; - nix_shell = { - symbol = ""; - style = "bg:#0F7FCF fg:#080808"; - format = "[ $symbol ]($style)[](fg:#0F7FCF bg:#121213)"; - disabled = false; - }; - }; + nix_shell = { + symbol = ""; + style = "bg:#0F7FCF fg:#080808"; + format = "[ $symbol ]($style)[](fg:#0F7FCF bg:#121213)"; + disabled = false; + }; }; - programs.bash = { - enable = true; - enableCompletion = true; - historySize = 10000000; - historyFile = "${config.xdg.dataHome}/bash/history"; - initExtra = pkgs.lib.mkAfter '' - bind 'set show-all-if-ambiguous on' - bind 'set completion-ignore-case on' - bind 'TAB:menu-complete' - bind '"\e[A": history-search-backward' - bind '"\e[B": history-search-forward' - ''; - shellAliases = { - ll = "ls -lhat"; - ls = "ls --color=auto"; - lf = ''cd "$(${pkgs.lf}/bin/lf -print-last-dir)"''; - wget = ''wget --hsts-file = "$XDG_DATA_HOME/wget-hsts"''; - python = "python3"; - vim = "nvim"; - v = ''nvim -c ':lua require("oil").open()' && cd "$(cat /tmp/oil_dir 2> /dev/null || pwd)"''; - rg = "rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"; - reset = "tput reset"; - }; + }; + programs.bash = { + enable = true; + enableCompletion = true; + historySize = 10000000; + historyFile = "${config.xdg.dataHome}/bash/history"; + initExtra = pkgs.lib.mkAfter '' + bind 'set show-all-if-ambiguous on' + bind 'set completion-ignore-case on' + bind 'TAB:menu-complete' + bind '"\e[A": history-search-backward' + bind '"\e[B": history-search-forward' + ''; + shellAliases = { + ll = "ls -lhat"; + ls = "ls --color=auto"; + lf = ''cd "$(${pkgs.lf}/bin/lf -print-last-dir)"''; + wget = ''wget --hsts-file = "$XDG_DATA_HOME/wget-hsts"''; + python = "python3"; + vim = "nvim"; + v = ''nvim -c ':lua require("oil").open()' && cd "$(cat /tmp/oil_dir 2> /dev/null || pwd)"''; + rg = "rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"; + reset = "tput reset"; }; + }; } diff --git a/home/email/default.nix b/home/email/default.nix index b8e3363..4a140ef 100644 --- a/home/email/default.nix +++ b/home/email/default.nix @@ -1,252 +1,242 @@ -{ config, pkgs, ... }: - { - home.file = { - ".mailcap".text = - "text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput"; - }; - home.packages = with pkgs; [ mailcap ]; + config, + pkgs, + ... +}: { + home.file = { + ".mailcap".text = "text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput"; + }; + home.packages = with pkgs; [mailcap]; - programs.notmuch = { - enable = true; - extraConfig = { - database = { path = "/home/server/Storage/Thomas/Mail"; }; - user = { - name = "Thomas Avé"; - primary_email = "email@thomasave.be"; - other_email = "Thomas.Ave@uantwerpen.be;Thomas.Ave@imec.be;"; - }; - maildir = { synchronize_flags = "true"; }; - }; + programs.notmuch = { + enable = true; + extraConfig = { + database = {path = "/home/server/Storage/Thomas/Mail";}; + user = { + name = "Thomas Avé"; + primary_email = "email@thomasave.be"; + other_email = "Thomas.Ave@uantwerpen.be;Thomas.Ave@imec.be;"; + }; + maildir = {synchronize_flags = "true";}; }; - programs.aerc = { - enable = true; - extraBinds = { - global = { - "" = ":menu -adc 'fzy -l 30' :cf -a"; - "" = ":next-tab"; - "?" = ":help keys"; - "" = ":check-mail"; - }; - messages = { - "q" = ":q"; - "" = ":q"; - "j" = ":next"; - "k" = ":prev"; - "" = ":prev"; - "g" = ":select 0"; - "G" = ":select -1"; - "J" = ":next-folder"; - "K" = ":prev-folder"; - "v" = ":mark -t"; - "V" = ":mark -v"; - "" = ":read -t"; - "T" = ":toggle-threads"; - "" = ":view"; - "d" = ":prompt 'Really delete this message?' 'delete-message'"; - "D" = ":delete"; - "a" = ":archive flat"; - "A" = ":unmark -a:mark -T:archive flat"; - "f" = ":flag -t"; - "m" = ":compose"; - "rr" = ":reply -a"; - "rq" = ":reply -aq"; - "Rr" = ":reply"; - "Rq" = ":reply -q"; - "c" = ":cf"; - "$" = ":term"; - "!" = ":term"; - "|" = ":pipe"; - "/" = ":search -a"; - "\\" = ":filter -a "; - "n" = ":next-result"; - "N" = ":prev-result"; - "" = ":clear"; - "s" = ":split"; - "S" = ":vsplit"; - "pl" = ":patch list"; - "pa" = ":patch apply "; - "pd" = ":patch drop "; - "pb" = ":patch rebase"; - "pt" = ":patch term"; - "ps" = ":patch switch "; - }; - view = { - "/" = ":toggle-key-passthrough/"; - "q" = ":close"; - "O" = ":open"; - "o" = ":open"; - "S" = ":save"; - "|" = ":pipe"; - "D" = ":delete"; - "A" = ":archive flat"; - "" = ":open-link "; - "f" = ":flag -t"; - "rr" = ":reply -a"; - "rq" = ":reply -aq"; - "Rr" = ":reply"; - "Rq" = ":reply -q"; - "H" = ":toggle-headers"; - "" = ":prev-part"; - "" = ":prev-part"; - "" = ":next-part"; - "" = ":next-part"; - "J" = ":next"; - "" = ":next"; - "K" = ":prev"; - "" = ":prev"; - }; - "view::passthrough" = { - "$noinherit" = "true"; - "$ex" = ""; - "" = ":toggle-key-passthrough"; - }; - compose = { - "$noinherit" = "true"; - "$ex" = ""; - "$complete" = ""; - "" = ":prev-field"; - "" = ":prev-field"; - "" = ":next-field"; - "" = ":next-field"; - "" = ":switch-account -p"; - "" = ":switch-account -p"; - "" = ":switch-account -n"; - "" = ":switch-account -n"; - "" = ":next-field"; - "" = ":prev-field"; - "" = ":prev-tab"; - "" = ":prev-tab"; - "" = ":next-tab"; - "" = ":next-tab"; - }; - "compose::editor" = { - "$noinherit" = "true"; - "$ex" = ""; - "" = ":prev-field"; - "" = ":prev-field"; - "" = ":next-field"; - "" = ":next-field"; - "" = ":prev-tab"; - "" = ":prev-tab"; - "" = ":next-tab"; - "" = ":next-tab"; - }; - "compose::review" = { - "y" = ":send"; - "n" = ":abort"; - "v" = ":preview"; - "p" = ":postpone"; - "q" = ":choose -o d discard abort -o p postpone postpone"; - "e" = ":edit"; - "a" = ":attach"; - "d" = ":detach"; - }; - terminal = { - "$noinherit" = "true"; - "$ex" = ""; - "" = ":prev-tab"; - "" = ":next-tab"; - "" = ":prev-tab"; - "" = ":next-tab"; - }; - }; - templates = { - quoted_reply = '' - {{(index .OriginalFrom 0).Name}}, {{dateFormat (.OriginalDate | toLocal) "Jan 02, 2006 at 15:04"}}: - {{ if eq .OriginalMIMEType "text/html" -}} - {{- exec `${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html` .OriginalText | quote -}} - {{- else -}} - {{- .OriginalText | quote -}} - {{- end}} - ''; - }; - extraConfig = { - general = { - term = "xterm-256color"; - unsafe-accounts-conf = true; - }; - ui = { - border-char-vertical = "│"; - border-char-horizontal = "─"; - styleset-name = "catppuccin-mocha"; - timestamp-format = "2006-01-02 15:04"; - sidebar-width = 30; - mouse-enabled = true; - dirlist-right = "{{if .Unread}}{{humanReadable .Unread}}{{end}}"; - dirlist-tree = true; - }; - viewer = { - pager = - "${pkgs.neovim}/bin/nvim -u ${config.xdg.configHome}/nvim/aerc.lua"; - }; - compose = { address-book-cmd = ''notmuch address "%s"''; }; - multipart-converters = { - "text/html" = - "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; - }; - filters = { - "text/plain" = "cat"; - "text/calendar" = "${pkgs.gnome-calendar}/bin/gnome-calendar"; - "message/delivery-status" = "cat"; - "message/rfc822" = "cat"; - "text/html" = "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; - "application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh"; - }; - }; - extraAccounts = { - Zoho = { - outgoing = "smtps://email%40thomasave.be@smtp.zoho.com"; - outgoing-cred-cmd = "cat ~/.secrets/Aerc/Zoho.key"; - source = - "maildir:///home/server/Storage/Thomas/Mail/email@thomasave.be/"; - check-mail-cmd = - "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; - check-mail-timeout = "60s"; - default = "Inbox"; - from = ''"Thomas Avé" ''; - cache-headers = true; - }; - UAntwerpen = { - outgoing = - "ssh server@192.168.1.2 /home/server/Containers/mbsync/send.sh"; - source = - "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@uantwerpen.be"; - check-mail-cmd = - "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; - check-mail-timeout = "60s"; - default = "Inbox"; - from = ''"Thomas Avé" ''; - cache-headers = true; - }; - IMEC = { - outgoing = "smtp+insecure://ave57%40imec.be@smtp.thomasave.be:1025"; - outgoing-cred-cmd = "cat ~/.secrets/Aerc/IMEC.key"; - source = - "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@imec.be/"; - check-mail-cmd = - "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; - check-mail-timeout = "60s"; - default = "Inbox"; - from = ''"Thomas Avé" ''; - cache-headers = true; - }; - NotMuch = { - source = "notmuch:///home/server/Storage/Thomas/Mail/"; - check-mail-cmd = - "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; - check-mail-timeout = "60s"; - from = ''"Thomas Avé" ''; - query-map = "${config.xdg.configHome}/aerc/map.conf"; - default = "INBOX"; - cache-headers = true; - }; - }; + }; + programs.aerc = { + enable = true; + extraBinds = { + global = { + "" = ":menu -adc 'fzy -l 30' :cf -a"; + "" = ":next-tab"; + "?" = ":help keys"; + "" = ":check-mail"; + }; + messages = { + "q" = ":q"; + "" = ":q"; + "j" = ":next"; + "k" = ":prev"; + "" = ":prev"; + "g" = ":select 0"; + "G" = ":select -1"; + "J" = ":next-folder"; + "K" = ":prev-folder"; + "v" = ":mark -t"; + "V" = ":mark -v"; + "" = ":read -t"; + "T" = ":toggle-threads"; + "" = ":view"; + "d" = ":prompt 'Really delete this message?' 'delete-message'"; + "D" = ":delete"; + "a" = ":archive flat"; + "A" = ":unmark -a:mark -T:archive flat"; + "f" = ":flag -t"; + "m" = ":compose"; + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; + "c" = ":cf"; + "$" = ":term"; + "!" = ":term"; + "|" = ":pipe"; + "/" = ":search -a"; + "\\" = ":filter -a "; + "n" = ":next-result"; + "N" = ":prev-result"; + "" = ":clear"; + "s" = ":split"; + "S" = ":vsplit"; + "pl" = ":patch list"; + "pa" = ":patch apply "; + "pd" = ":patch drop "; + "pb" = ":patch rebase"; + "pt" = ":patch term"; + "ps" = ":patch switch "; + }; + view = { + "/" = ":toggle-key-passthrough/"; + "q" = ":close"; + "O" = ":open"; + "o" = ":open"; + "S" = ":save"; + "|" = ":pipe"; + "D" = ":delete"; + "A" = ":archive flat"; + "" = ":open-link "; + "f" = ":flag -t"; + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; + "H" = ":toggle-headers"; + "" = ":prev-part"; + "" = ":prev-part"; + "" = ":next-part"; + "" = ":next-part"; + "J" = ":next"; + "" = ":next"; + "K" = ":prev"; + "" = ":prev"; + }; + "view::passthrough" = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":toggle-key-passthrough"; + }; + compose = { + "$noinherit" = "true"; + "$ex" = ""; + "$complete" = ""; + "" = ":prev-field"; + "" = ":prev-field"; + "" = ":next-field"; + "" = ":next-field"; + "" = ":switch-account -p"; + "" = ":switch-account -p"; + "" = ":switch-account -n"; + "" = ":switch-account -n"; + "" = ":next-field"; + "" = ":prev-field"; + "" = ":prev-tab"; + "" = ":prev-tab"; + "" = ":next-tab"; + "" = ":next-tab"; + }; + "compose::editor" = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":prev-field"; + "" = ":prev-field"; + "" = ":next-field"; + "" = ":next-field"; + "" = ":prev-tab"; + "" = ":prev-tab"; + "" = ":next-tab"; + "" = ":next-tab"; + }; + "compose::review" = { + "y" = ":send"; + "n" = ":abort"; + "v" = ":preview"; + "p" = ":postpone"; + "q" = ":choose -o d discard abort -o p postpone postpone"; + "e" = ":edit"; + "a" = ":attach"; + "d" = ":detach"; + }; + terminal = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":prev-tab"; + "" = ":next-tab"; + "" = ":prev-tab"; + "" = ":next-tab"; + }; }; + templates = { + quoted_reply = '' + {{(index .OriginalFrom 0).Name}}, {{dateFormat (.OriginalDate | toLocal) "Jan 02, 2006 at 15:04"}}: + {{ if eq .OriginalMIMEType "text/html" -}} + {{- exec `${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html` .OriginalText | quote -}} + {{- else -}} + {{- .OriginalText | quote -}} + {{- end}} + ''; + }; + extraConfig = { + general = { + term = "xterm-256color"; + unsafe-accounts-conf = true; + }; + ui = { + border-char-vertical = "│"; + border-char-horizontal = "─"; + styleset-name = "catppuccin-mocha"; + timestamp-format = "2006-01-02 15:04"; + sidebar-width = 30; + mouse-enabled = true; + dirlist-right = "{{if .Unread}}{{humanReadable .Unread}}{{end}}"; + dirlist-tree = true; + }; + viewer = { + pager = "${pkgs.neovim}/bin/nvim -u ${config.xdg.configHome}/nvim/aerc.lua"; + }; + compose = {address-book-cmd = ''notmuch address "%s"'';}; + multipart-converters = { + "text/html" = "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; + }; + filters = { + "text/plain" = "cat"; + "text/calendar" = "${pkgs.gnome-calendar}/bin/gnome-calendar"; + "message/delivery-status" = "cat"; + "message/rfc822" = "cat"; + "text/html" = "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; + "application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh"; + }; + }; + extraAccounts = { + Zoho = { + outgoing = "smtps://email%40thomasave.be@smtp.zoho.com"; + outgoing-cred-cmd = "cat ~/.secrets/Aerc/Zoho.key"; + source = "maildir:///home/server/Storage/Thomas/Mail/email@thomasave.be/"; + check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; + check-mail-timeout = "60s"; + default = "Inbox"; + from = ''"Thomas Avé" ''; + cache-headers = true; + }; + UAntwerpen = { + outgoing = "ssh server@192.168.1.2 /home/server/Containers/mbsync/send.sh"; + source = "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@uantwerpen.be"; + check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; + check-mail-timeout = "60s"; + default = "Inbox"; + from = ''"Thomas Avé" ''; + cache-headers = true; + }; + IMEC = { + outgoing = "smtp+insecure://ave57%40imec.be@smtp.thomasave.be:1025"; + outgoing-cred-cmd = "cat ~/.secrets/Aerc/IMEC.key"; + source = "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@imec.be/"; + check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; + check-mail-timeout = "60s"; + default = "Inbox"; + from = ''"Thomas Avé" ''; + cache-headers = true; + }; + NotMuch = { + source = "notmuch:///home/server/Storage/Thomas/Mail/"; + check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; + check-mail-timeout = "60s"; + from = ''"Thomas Avé" ''; + query-map = "${config.xdg.configHome}/aerc/map.conf"; + default = "INBOX"; + cache-headers = true; + }; + }; + }; - home.file."${config.xdg.configHome}/aerc/map.conf".text = - "Inbox=tag:inbox and not tag:archived and not tag:deleted"; - home.file."${config.xdg.configHome}/aerc/stylesets/catppuccin-mocha".text = '' + home.file."${config.xdg.configHome}/aerc/map.conf".text = "Inbox=tag:inbox and not tag:archived and not tag:deleted"; + home.file."${config.xdg.configHome}/aerc/stylesets/catppuccin-mocha".text = '' *.default=true *.normal=true @@ -305,5 +295,5 @@ diff_del.fg=#f38ba8 quote_*.fg=#6c7086 quote_1.fg=#9399b2 - ''; + ''; } diff --git a/home/firefox/default.nix b/home/firefox/default.nix index a919b6b..c1795fe 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -1,102 +1,99 @@ -{ pkgs, ... }: -let - lock-false = { - Value = false; - Status = "locked"; - }; -in - { - programs.firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - pkcs11Modules = [ - pkgs.eid-mw - ]; - extraPolicies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - ExtensionSettings = { - "{3e4d2037-d300-4e95-859d-3cba866f46d3}" = { - install_url = - "https://addons.mozilla.org/firefox/downloads/latest/private-internet-access-ext/latest.xpi"; - installation_mode = "force_installed"; - }; - "{c7c120ff-2878-4e59-a5a3-cd4d1655bc13}" = { - install_url = "file://${./files/signed.xpi}"; - installation_mode = "force_installed"; - }; - }; - Preferences = { - "browser.disableResetPrompt" = true; - "browser.download.panel.shown" = true; - "browser.shell.checkDefaultBrowser" = false; - "browser.tabs.inTitlebar" = 0; - "browser.shell.defaultBrowserCheckCount" = 1; - "browser.startup.homepage" = "https://start.duckduckgo.com"; - "browser.compactmode.show" = true; - "browser.uidensity" = 1; - "extensions.update.enabled" = false; - "extensions.pocket.enabled" = lock-false; - "extensions.autoDisableScopes" = 0; - "browser.contentblocking.category" = { - Value = "strict"; - Status = "locked"; - }; - "privacy.trackingprotection.enabled" = true; - }; - }; +{pkgs, ...}: let + lock-false = { + Value = false; + Status = "locked"; + }; +in { + programs.firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + pkcs11Modules = [ + pkgs.eid-mw + ]; + extraPolicies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; }; - profiles = { - default = { - id = 0; - name = "default"; - isDefault = true; - search = { - force = true; - default = "ddg"; - order = [ "ddg" "google" ]; - }; - extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - bitwarden - privacy-badger - beyond-20 - display-_anchors - facebook-container - multi-account-containers - istilldontcareaboutcookies - return-youtube-dislikes - sponsorblock - unpaywall - vimium - google-container - duckduckgo-privacy-essentials - ]; - }; + ExtensionSettings = { + "{3e4d2037-d300-4e95-859d-3cba866f46d3}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/private-internet-access-ext/latest.xpi"; + installation_mode = "force_installed"; + }; + "{c7c120ff-2878-4e59-a5a3-cd4d1655bc13}" = { + install_url = "file://${./files/signed.xpi}"; + installation_mode = "force_installed"; + }; }; + Preferences = { + "browser.disableResetPrompt" = true; + "browser.download.panel.shown" = true; + "browser.shell.checkDefaultBrowser" = false; + "browser.tabs.inTitlebar" = 0; + "browser.shell.defaultBrowserCheckCount" = 1; + "browser.startup.homepage" = "https://start.duckduckgo.com"; + "browser.compactmode.show" = true; + "browser.uidensity" = 1; + "extensions.update.enabled" = false; + "extensions.pocket.enabled" = lock-false; + "extensions.autoDisableScopes" = 0; + "browser.contentblocking.category" = { + Value = "strict"; + Status = "locked"; + }; + "privacy.trackingprotection.enabled" = true; + }; + }; }; + profiles = { + default = { + id = 0; + name = "default"; + isDefault = true; + search = { + force = true; + default = "ddg"; + order = ["ddg" "google"]; + }; + extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + bitwarden + privacy-badger + beyond-20 + display-_anchors + facebook-container + multi-account-containers + istilldontcareaboutcookies + return-youtube-dislikes + sponsorblock + unpaywall + vimium + google-container + duckduckgo-privacy-essentials + ]; + }; + }; + }; - # xdg.mimeApps.defaultApplications = { - # "application/json" = [ "firefox.desktop" ]; - # "application/x-extension-htm" = [ "firefox.desktop" ]; - # "application/x-extension-html" = [ "firefox.desktop" ]; - # "application/x-extension-shtml" = [ "firefox.desktop" ]; - # "application/x-extension-xhtml" = [ "firefox.desktop" ]; - # "application/x-extension-xht" = [ "firefox.desktop" ]; - # "application/xhtml+xml" = [ "firefox.desktop" ]; - # "text/html" = [ "firefox.desktop" ]; - # "text/xml" = [ "firefox.desktop" ]; - # "x-scheme-handler/about" = [ "firefox.desktop" ]; - # "x-scheme-handler/ftp" = [ "firefox.desktop" ]; - # "x-scheme-handler/http" = [ "firefox.desktop" ]; - # "x-scheme-handler/unknown" = [ "firefox.desktop" ]; - # "x-scheme-handler/https" = [ "firefox.desktop" ]; - # }; + # xdg.mimeApps.defaultApplications = { + # "application/json" = [ "firefox.desktop" ]; + # "application/x-extension-htm" = [ "firefox.desktop" ]; + # "application/x-extension-html" = [ "firefox.desktop" ]; + # "application/x-extension-shtml" = [ "firefox.desktop" ]; + # "application/x-extension-xhtml" = [ "firefox.desktop" ]; + # "application/x-extension-xht" = [ "firefox.desktop" ]; + # "application/xhtml+xml" = [ "firefox.desktop" ]; + # "text/html" = [ "firefox.desktop" ]; + # "text/xml" = [ "firefox.desktop" ]; + # "x-scheme-handler/about" = [ "firefox.desktop" ]; + # "x-scheme-handler/ftp" = [ "firefox.desktop" ]; + # "x-scheme-handler/http" = [ "firefox.desktop" ]; + # "x-scheme-handler/unknown" = [ "firefox.desktop" ]; + # "x-scheme-handler/https" = [ "firefox.desktop" ]; + # }; } diff --git a/home/foot/default.nix b/home/foot/default.nix index bc29bd2..0611e1f 100644 --- a/home/foot/default.nix +++ b/home/foot/default.nix @@ -1,39 +1,38 @@ -{ ... }: -{ - programs.foot = { - enable = true; - server.enable = true; - settings = { - main = { - font = "DejaVu Sans Mono:size=13"; - term = "xterm-256color"; - line-height = "18"; - }; - tweak = { - sixel = "yes"; - }; - scrollback.lines = 100000; - colors = { - background = "000010"; - foreground = "F8F8F2"; - regular0 = "121212"; - regular1 = "fa2573"; - regular2 = "97e123"; - regular3 = "dfd460"; - regular4 = "0f7fcf"; - regular5 = "8700ff"; - regular6 = "42a7cf"; - regular7 = "bbbbbb"; - bright0 = "555556"; - bright1 = "f5669c"; - bright2 = "b0e05e"; - bright3 = "fef26c"; - bright4 = "00afff"; - bright5 = "af87ff"; - bright6 = "50cdfe"; - bright7 = "ffffff"; - alpha = "0.3"; - }; - }; +{...}: { + programs.foot = { + enable = true; + server.enable = true; + settings = { + main = { + font = "DejaVu Sans Mono:size=13"; + term = "xterm-256color"; + line-height = "18"; + }; + tweak = { + sixel = "yes"; + }; + scrollback.lines = 100000; + colors-dark = { + background = "000010"; + foreground = "F8F8F2"; + regular0 = "121212"; + regular1 = "fa2573"; + regular2 = "97e123"; + regular3 = "dfd460"; + regular4 = "0f7fcf"; + regular5 = "8700ff"; + regular6 = "42a7cf"; + regular7 = "bbbbbb"; + bright0 = "555556"; + bright1 = "f5669c"; + bright2 = "b0e05e"; + bright3 = "fef26c"; + bright4 = "00afff"; + bright5 = "af87ff"; + bright6 = "50cdfe"; + bright7 = "ffffff"; + alpha = "0.3"; + }; }; + }; } diff --git a/home/ghostty/default.nix b/home/ghostty/default.nix index 0114547..110f573 100644 --- a/home/ghostty/default.nix +++ b/home/ghostty/default.nix @@ -1,45 +1,43 @@ -{ ... }: -{ - programs.ghostty= { - enable = true; - enableZshIntegration = true; - installVimSyntax = true; - themes = { - personal = { - background-opacity = 0.3; - foreground = "#F8F8F2"; - background = "#000010"; - selection-foreground = "#121212"; - selection-background = "#b4d5ff"; - cursor-color = "#bbbbbb"; - palette = [ - "0=#121212" - "8=#545454" - "1=#fa2573" - "9=#f5669c" - "2=#97e123" - "10=#b0e05e" - "3=#dfd460" - "11=#fef26c" - "4=#0f7fcf" - "12=#00afff" - "5=#8700ff" - "13=#af87ff" - "6=#42a7cf" - "14=#50cdfe" - "7=#bbbbbb" - "15=#ffffff" - ]; - }; - }; - settings = { - resize-overlay = "never"; - theme = "personal"; - font-size = 13; - font-family = "JetBrains Mono"; - window-decoration = false; - # adjust-cell-height = "10%"; - - }; +{...}: { + programs.ghostty = { + enable = true; + enableZshIntegration = true; + installVimSyntax = true; + themes = { + personal = { + background-opacity = 0.3; + foreground = "#F8F8F2"; + background = "#000010"; + selection-foreground = "#121212"; + selection-background = "#b4d5ff"; + cursor-color = "#bbbbbb"; + palette = [ + "0=#121212" + "8=#545454" + "1=#fa2573" + "9=#f5669c" + "2=#97e123" + "10=#b0e05e" + "3=#dfd460" + "11=#fef26c" + "4=#0f7fcf" + "12=#00afff" + "5=#8700ff" + "13=#af87ff" + "6=#42a7cf" + "14=#50cdfe" + "7=#bbbbbb" + "15=#ffffff" + ]; + }; }; + settings = { + resize-overlay = "never"; + theme = "personal"; + font-size = 13; + font-family = "JetBrains Mono"; + window-decoration = false; + # adjust-cell-height = "10%"; + }; + }; } diff --git a/home/git/default.nix b/home/git/default.nix index 1f5845c..bf85937 100644 --- a/home/git/default.nix +++ b/home/git/default.nix @@ -1,43 +1,41 @@ -{ pkgs, ... }: - -{ - programs.git = { - enable = true; - lfs.enable = true; - settings = { - alias = { - s = "status"; - a = "add"; - }; - user = { - name = "Thomas Avé"; - email = "email@thomasave.be"; - }; - credentials.helper = "store"; - pull.rebase = false; - push.autoSetupRemove = true; - branch.autoSetupMerge = true; - init.defaultBranch = "master"; - diff.noprefix = true; - color.ui = "auto"; - core = { - excludesfile = "~/.gitignore"; - editor = "${pkgs.neovim}/bin/nvim"; - }; - rerere.enabled = true; - }; - ignores = [ - "*.direnv/" - ".dmypy.json" - ]; +{pkgs, ...}: { + programs.git = { + enable = true; + lfs.enable = true; + settings = { + alias = { + s = "status"; + a = "add"; + }; + user = { + name = "Thomas Avé"; + email = "email@thomasave.be"; + }; + credentials.helper = "store"; + pull.rebase = false; + push.autoSetupRemove = true; + branch.autoSetupMerge = true; + init.defaultBranch = "master"; + diff.noprefix = true; + color.ui = "auto"; + core = { + excludesfile = "~/.gitignore"; + editor = "${pkgs.neovim}/bin/nvim"; + }; + rerere.enabled = true; }; - programs.lazygit = { - enable = true; - settings = { - os = { - editPreset = "nvim"; - autoStageResolvedConflicts = false; - }; - }; + ignores = [ + "*.direnv/" + ".dmypy.json" + ]; + }; + programs.lazygit = { + enable = true; + settings = { + os = { + editPreset = "nvim"; + autoStageResolvedConflicts = false; + }; }; + }; } diff --git a/home/helium/default.nix b/home/helium/default.nix index d9c42ba..2baf678 100644 --- a/home/helium/default.nix +++ b/home/helium/default.nix @@ -1,59 +1,58 @@ -{ pkgs, ... }: -{ - home.packages = [ - (pkgs.appimageTools.wrapType2 { - pname = "Helium"; - version = "0.4.7.1"; - src = pkgs.fetchurl { - url = "https://github.com/imputnet/helium-linux/releases/download/0.8.5.1/helium-0.8.5.1-x86_64.AppImage"; - sha256 = "sha256-jFSLLDsHB/NiJqFmn8S+JpdM8iCy3Zgyq+8l4RkBecM="; - }; - }) - ]; - xdg.desktopEntries = { - helium = { - name = "Helium"; - genericName = "Web Browser"; - comment = "Access the Internet"; - exec = "Helium --enable-features=TouchpadOverscrollHistoryNavigation %U"; - startupNotify = true; - terminal = false; - icon = "chromium"; - type = "Application"; - categories = [ "Network" "WebBrowser" ]; - mimeType = [ - "x-scheme-handler/webcal" - "application/pdf" - "application/rdf+xml" - "application/rss+xml" - "application/xhtml+xml" - "application/xhtml_xml" - "application/xml" - "image/gif" - "image/jpeg" - "image/png" - "image/webp" - "text/html" - "text/xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - ]; - }; - }; - xdg.mimeApps.defaultApplications = { - "application/json" = [ "helium.desktop" ]; - "application/x-extension-htm" = [ "helium.desktop" ]; - "application/x-extension-html" = [ "helium.desktop" ]; - "application/x-extension-shtml" = [ "helium.desktop" ]; - "application/x-extension-xhtml" = [ "helium.desktop" ]; - "application/x-extension-xht" = [ "helium.desktop" ]; - "application/xhtml+xml" = [ "helium.desktop" ]; - "text/html" = [ "helium.desktop" ]; - "text/xml" = [ "helium.desktop" ]; - "x-scheme-handler/about" = [ "helium.desktop" ]; - "x-scheme-handler/ftp" = [ "helium.desktop" ]; - "x-scheme-handler/http" = [ "helium.desktop" ]; - "x-scheme-handler/unknown" = [ "helium.desktop" ]; - "x-scheme-handler/https" = [ "helium.desktop" ]; +{pkgs, ...}: { + home.packages = [ + (pkgs.appimageTools.wrapType2 { + pname = "Helium"; + version = "0.4.7.1"; + src = pkgs.fetchurl { + url = "https://github.com/imputnet/helium-linux/releases/download/0.8.5.1/helium-0.8.5.1-x86_64.AppImage"; + sha256 = "sha256-jFSLLDsHB/NiJqFmn8S+JpdM8iCy3Zgyq+8l4RkBecM="; + }; + }) + ]; + xdg.desktopEntries = { + helium = { + name = "Helium"; + genericName = "Web Browser"; + comment = "Access the Internet"; + exec = "Helium --enable-features=TouchpadOverscrollHistoryNavigation %U"; + startupNotify = true; + terminal = false; + icon = "chromium"; + type = "Application"; + categories = ["Network" "WebBrowser"]; + mimeType = [ + "x-scheme-handler/webcal" + "application/pdf" + "application/rdf+xml" + "application/rss+xml" + "application/xhtml+xml" + "application/xhtml_xml" + "application/xml" + "image/gif" + "image/jpeg" + "image/png" + "image/webp" + "text/html" + "text/xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + ]; }; + }; + xdg.mimeApps.defaultApplications = { + "application/json" = ["helium.desktop"]; + "application/x-extension-htm" = ["helium.desktop"]; + "application/x-extension-html" = ["helium.desktop"]; + "application/x-extension-shtml" = ["helium.desktop"]; + "application/x-extension-xhtml" = ["helium.desktop"]; + "application/x-extension-xht" = ["helium.desktop"]; + "application/xhtml+xml" = ["helium.desktop"]; + "text/html" = ["helium.desktop"]; + "text/xml" = ["helium.desktop"]; + "x-scheme-handler/about" = ["helium.desktop"]; + "x-scheme-handler/ftp" = ["helium.desktop"]; + "x-scheme-handler/http" = ["helium.desktop"]; + "x-scheme-handler/unknown" = ["helium.desktop"]; + "x-scheme-handler/https" = ["helium.desktop"]; + }; } diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index fb477e5..a652e48 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -1,297 +1,297 @@ -{ pkgs, ... }: -let - playerctl = "${pkgs.playerctl}/bin/playerctl"; - nautilus = "${pkgs.nautilus}/bin/nautilus"; - gnome-calendar = "${pkgs.gnome-calendar}/bin/gnome-calendar"; - wpctl = "${pkgs.wireplumber}/bin/wpctl"; - terminal-name = "foot"; - terminal = "${pkgs.foot}/bin/footclient"; - jq = "${pkgs.jq}/bin/jq"; +{pkgs, ...}: let + playerctl = "${pkgs.playerctl}/bin/playerctl"; + nautilus = "${pkgs.nautilus}/bin/nautilus"; + gnome-calendar = "${pkgs.gnome-calendar}/bin/gnome-calendar"; + wpctl = "${pkgs.wireplumber}/bin/wpctl"; + terminal-name = "foot"; + terminal = "${pkgs.foot}/bin/footclient"; + jq = "${pkgs.jq}/bin/jq"; - # Disable split-monitor-workspaces - workspace_command_prefix = ""; - hyprland_plugins = []; + # Disable split-monitor-workspaces + workspace_command_prefix = ""; + hyprland_plugins = []; - launch_terminal = pkgs.writeShellScriptBin "launch_terminal" '' - function find_leaf_pid(){ - local PID - local RET - local NAME - PID=$1 - for CHILD_PID in $(pgrep -P "$PID"); do - RET=$(find_leaf_pid "$CHILD_PID") - if [ "$RET" != "" ]; then - PID="$RET" - fi - done - NAME=$(ps -p "$PID" -o comm=) - if [ "$NAME" == "zsh" ]; then - echo "$PID" - elif [ "$NAME" == "ssh" ]; then - echo "$PID" + launch_terminal = pkgs.writeShellScriptBin "launch_terminal" '' + function find_leaf_pid(){ + local PID + local RET + local NAME + PID=$1 + for CHILD_PID in $(pgrep -P "$PID"); do + RET=$(find_leaf_pid "$CHILD_PID") + if [ "$RET" != "" ]; then + PID="$RET" fi - } + done + NAME=$(ps -p "$PID" -o comm=) + if [ "$NAME" == "zsh" ]; then + echo "$PID" + elif [ "$NAME" == "ssh" ]; then + echo "$PID" + fi + } - LEAF_PID=$(find_leaf_pid "$1") - if [ "$(ps -p "$LEAF_PID" -o comm=)" == "ssh" ]; then - SSH_COMMAND=$(ps -p "$LEAF_PID" -o args --no-headers) - if [[ "$SSH_COMMAND" == *"waypipe"* ]]; then - CLIENT=$(echo "$SSH_COMMAND" | awk '{ print $5 }') - PREVIOUS_SESSION_ID=$(grep -z "SSH_SESSION_ID" "/proc/$LEAF_PID/environ" | xargs -0 -n 1 | grep -oP "[0-9]*") - SSH_SESSION_ID=$RANDOM - ${terminal} -e zsh -c "SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t \"$CLIENT\" env SSH_SESSION_ID=\"$SSH_SESSION_ID\" PREVIOUS_SESSION_ID=\"$PREVIOUS_SESSION_ID\" \"zsh --login\"" - else - ${terminal} -e zsh -c "ssh -t \"$(echo "$SSH_COMMAND" | awk '{ print $2 }')\"" - fi + LEAF_PID=$(find_leaf_pid "$1") + if [ "$(ps -p "$LEAF_PID" -o comm=)" == "ssh" ]; then + SSH_COMMAND=$(ps -p "$LEAF_PID" -o args --no-headers) + if [[ "$SSH_COMMAND" == *"waypipe"* ]]; then + CLIENT=$(echo "$SSH_COMMAND" | awk '{ print $5 }') + PREVIOUS_SESSION_ID=$(grep -z "SSH_SESSION_ID" "/proc/$LEAF_PID/environ" | xargs -0 -n 1 | grep -oP "[0-9]*") + SSH_SESSION_ID=$RANDOM + ${terminal} -e zsh -c "SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t \"$CLIENT\" env SSH_SESSION_ID=\"$SSH_SESSION_ID\" PREVIOUS_SESSION_ID=\"$PREVIOUS_SESSION_ID\" \"zsh --login\"" + else + ${terminal} -e zsh -c "ssh -t \"$(echo "$SSH_COMMAND" | awk '{ print $2 }')\"" + fi - else # Not an ssh session - if [ "$(ps -p "$1" -o comm=)" == "${terminal-name}" ]; then - CWD=$(readlink -e /proc/"$LEAF_PID"/cwd) - if [ "$CWD" != "" ]; then - ${terminal} --working-directory "$CWD" - else - ${terminal} - fi + else # Not an ssh session + if [ "$(ps -p "$1" -o comm=)" == "${terminal-name}" ]; then + CWD=$(readlink -e /proc/"$LEAF_PID"/cwd) + if [ "$CWD" != "" ]; then + ${terminal} --working-directory "$CWD" else ${terminal} fi + else + ${terminal} fi - ''; + fi + ''; in { - home.packages = [ - pkgs.wl-clipboard - pkgs.jq - ]; - services.hyprpaper = { - enable = true; - settings = { - ipc = "on"; - splash = false; - wallpaper = { - path = "${./files/wallpaper.png}"; - monitor = ""; - }; - }; + home.packages = [ + pkgs.wl-clipboard + pkgs.jq + ]; + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + wallpaper = { + path = "${./files/wallpaper.png}"; + monitor = ""; + }; }; + }; - programs.hyprlock = { - enable = true; - settings = { - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = true; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 3; - placeholder_text = "Password..."; - shadow_passes = 2; - } - ]; - general = { - no_fade_in = false; - }; - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - } - ]; - }; + programs.hyprlock = { + enable = true; + settings = { + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = true; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 3; + placeholder_text = "Password..."; + shadow_passes = 2; + } + ]; + general = { + no_fade_in = false; + }; + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; }; + }; - wayland.windowManager.hyprland = { - enable = true; - systemd.enable = false; - xwayland.enable = true; - plugins = [ ] ++ hyprland_plugins; - settings = { - "$mainMod" = pkgs.lib.mkDefault "SUPER_L"; - "$altMod" = pkgs.lib.mkDefault "ALT_L"; - exec-once = [ - "uwsm app -- hyprpaper" - "uwsm app -- foot --server" - "uwsm app -- hyprctl dispatch exec ags run" - "uwsm app -- ${pkgs.mate.mate-polkit}/bin/polkit-mate" - ]; - env = [ - "WLR_NO_HARDWARE_CURSORS,1" - "TERMINAL,${terminal}" - "WLR_RENDERER_ALLOW_SOFTWARE,1" - ]; - debug = { disable_logs = false; }; + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = false; + xwayland.enable = true; + plugins = [] ++ hyprland_plugins; + settings = { + "$mainMod" = pkgs.lib.mkDefault "SUPER_L"; + "$altMod" = pkgs.lib.mkDefault "ALT_L"; + exec-once = [ + "uwsm app -- hyprpaper" + "uwsm app -- foot --server" + "uwsm app -- hyprctl dispatch exec ags run" + "uwsm app -- ${pkgs.mate.mate-polkit}/bin/polkit-mate" + ]; + env = [ + "WLR_NO_HARDWARE_CURSORS,1" + "TERMINAL,${terminal}" + "WLR_RENDERER_ALLOW_SOFTWARE,1" + ]; + debug = {disable_logs = false;}; - # UPDATED: New Window Rule Syntax (0.53.0) - windowrule = [ - "float on, match:title ^(rofi)(.*)$" - "center on, match:title ^(rofi)(.*)$" - "border_size 0, match:title ^(rofi)(.*)$" # 'noborder' is replaced by border_size 0 + # UPDATED: New Window Rule Syntax (0.53.0) + windowrule = [ + "float on, match:title ^(rofi)(.*)$" + "center on, match:title ^(rofi)(.*)$" + "border_size 0, match:title ^(rofi)(.*)$" # 'noborder' is replaced by border_size 0 - # Combined matches (replaces old multi-rule logic) - "stay_focused on, match:title ^()$, match:class ^(steam)$" - "min_size 1 1, match:title ^()$, match:class ^(steam)$" - "stay_focused on, match:title ^()$, match:class ^(steam)$" + # Combined matches (replaces old multi-rule logic) + "stay_focused on, match:title ^()$, match:class ^(steam)$" + "min_size 1 1, match:title ^()$, match:class ^(steam)$" + "stay_focused on, match:title ^()$, match:class ^(steam)$" - "workspace 8, match:class thunderbird" - "workspace 9, match:class spotify" - "workspace 10, match:class Slack" + "workspace 8, match:class thunderbird" + "workspace 9, match:class spotify" + "workspace 10, match:class Slack" - # Windowrulev2-style logic updated to new prop syntax - "border_size 0, match:float 0, match:workspace w[tv1]" - "rounding 0, match:float 0, match:workspace w[tv1]" - "border_size 0, match:float 0, match:workspace f[1]" - "rounding 0, match:float 0, match:workspace f[1]" - ]; + # Windowrulev2-style logic updated to new prop syntax + "border_size 0, match:float 0, match:workspace w[tv1]" + "rounding 0, match:float 0, match:workspace w[tv1]" + "border_size 0, match:float 0, match:workspace f[1]" + "rounding 0, match:float 0, match:workspace f[1]" + ]; - # UPDATED: New Layer Rule Syntax (0.53.0) - # Syntax: effect value, match:namespace regex - layerrule = [ - "no_anim on, match:namespace ags_bar_0" - "no_anim on, match:namespace selection" - "blur on, match:namespace vicinae" - "ignore_alpha 0, match:namespace vicinae" - "no_anim on, match:namespace vicinae" - ]; + # UPDATED: New Layer Rule Syntax (0.53.0) + # Syntax: effect value, match:namespace regex + layerrule = [ + "no_anim on, match:namespace ags_bar_0" + "no_anim on, match:namespace selection" + "blur on, match:namespace vicinae" + "ignore_alpha 0, match:namespace vicinae" + "no_anim on, match:namespace vicinae" + ]; - general = { - gaps_in = 1; - gaps_out = pkgs.lib.mkDefault 5; - border_size = 2; - "col.active_border" = "rgba(002f5fee)"; - "col.inactive_border" = "rgba(ffffff00)"; - layout = "dwindle"; - }; - input = { - kb_layout = "us"; - follow_mouse = 1; - kb_options = pkgs.lib.mkDefault "compose:rctrl, caps:ctrl_modifier"; - numlock_by_default = true; - }; - binds = { scroll_event_delay = 1; }; - xwayland = { force_zero_scaling = true; }; - misc = { - disable_hyprland_logo = 1; - # Removed 'enable_anr_dialog' (deprecated/removed in recent versions) - }; - decoration = { - rounding = 1; - blur = { enabled = false; }; - }; - animations = { - enabled = "yes"; - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - animation = [ - "windows, 1, 2, myBezier" - "windowsOut, 1, 2, default, popin 80%" - "border, 1, 2, default" - "borderangle, 1, 2, default" - "fade, 1, 2, default" - "workspaces, 1, 1, default" - ]; - }; - dwindle = { - preserve_split = "yes"; - force_split = 2; - }; + general = { + gaps_in = 1; + gaps_out = pkgs.lib.mkDefault 5; + border_size = 2; + "col.active_border" = "rgba(002f5fee)"; + "col.inactive_border" = "rgba(ffffff00)"; + layout = "dwindle"; + }; + input = { + kb_layout = "us"; + follow_mouse = 1; + kb_options = pkgs.lib.mkDefault "compose:rctrl, caps:ctrl_modifier"; + numlock_by_default = true; + }; + binds = {scroll_event_delay = 1;}; + xwayland = {force_zero_scaling = true;}; + misc = { + disable_hyprland_logo = 1; + # Removed 'enable_anr_dialog' (deprecated/removed in recent versions) + }; + decoration = { + rounding = 1; + blur = {enabled = false;}; + }; + animations = { + enabled = "yes"; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 2, myBezier" + "windowsOut, 1, 2, default, popin 80%" + "border, 1, 2, default" + "borderangle, 1, 2, default" + "fade, 1, 2, default" + "workspaces, 1, 1, default" + ]; + }; + dwindle = { + preserve_split = "yes"; + force_split = 2; + }; - gesture = [ - "3, horizontal, workspace" - ]; - gestures = { - workspace_swipe_invert = false; - }; - device = [ - { - name = "tpps/2-ibm-trackpoint"; - sensitivity = "+0.5"; - } - { - name = "synaptics-tm3276-022"; - sensitivity = "+0.5"; - } - ]; - workspace = [ - "w[tv1], gapsout:0, gapsin:0" - "f[1], gapsout:0, gapsin:0" - ]; - bindr = [ - "$mainMod, $mainMod, exec, vicinae toggle" - ]; - bindm = [ - "$mainMod, mouse:272, movewindow" - "$mainMod, mouse:273, resizewindow" - ]; - binde = [ - "$mainMod $altMod, L, resizeactive, 20 0" - "$mainMod $altMod, H, resizeactive, -20 0" - "$mainMod $altMod, K, resizeactive, 0 -20" - "$mainMod $altMod, J, resizeactive, 0 20" - ]; - bind = [ - "$mainMod, return, exec, ${launch_terminal}/bin/launch_terminal $(hyprctl activewindow -j | ${jq} .pid)" - "$mainMod SHIFT, return, exec, ${terminal}" - "$mainMod, Q, killactive," - "$mainMod, A, exec, ${nautilus}" - "$mainMod, S, exec, LC_TIME=\"en_GB.UTF-8\" ${gnome-calendar}" - "$mainMod, B, exec, Helium" - "$mainMod, M, fullscreen, 1" - "$mainMod, F11, fullscreen" - "$mainMod, F, togglefloating," - "$mainMod, SPACE, layoutmsg, togglesplit" - "CONTROL_L ALT_L, L, exec, ${pkgs.hyprlock}/bin/hyprlock" - "$mainMod, C, exec, vicinae vicinae://extensions/vicinae/clipboard/history" - "$mainMod, N, exec, vicinae vicinae://extensions/vicinae/wm/switch-windows" - "$mainMod, Escape, exec, vicinae open -q \"Power Management \"" - ",XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set +10%" - ",XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 10%-" - ",XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0" - ",XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%-" - ",XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - # ",mouse:273, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1.0" - # ",mouse:272, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%-" - ",XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" - ",XF86AudioNext, exec, ${playerctl} next" - ",XF86AudioPrev, exec, ${playerctl} previous" - "$mainMod,XF86AudioMute, exec, ${playerctl} play-pause" - "$mainMod,XF86AudioRaiseVolume, exec, ${playerctl} next" - "$mainMod,XF86AudioLowerVolume, exec, ${playerctl} previous" - '', Print, exec, ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp -d)" - | wl-copy'' - '', Pause, exec, systemctl suspend'' - '', XF86Calculator, exec, systemctl suspend'' + gesture = [ + "3, horizontal, workspace" + ]; + gestures = { + workspace_swipe_invert = false; + }; + device = [ + { + name = "tpps/2-ibm-trackpoint"; + sensitivity = "+0.5"; + } + { + name = "synaptics-tm3276-022"; + sensitivity = "+0.5"; + } + ]; + workspace = [ + "w[tv1], gapsout:0, gapsin:0" + "f[1], gapsout:0, gapsin:0" + ]; + bindr = [ + "$mainMod, $mainMod, exec, vicinae toggle" + ]; + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + binde = [ + "$mainMod $altMod, L, resizeactive, 20 0" + "$mainMod $altMod, H, resizeactive, -20 0" + "$mainMod $altMod, K, resizeactive, 0 -20" + "$mainMod $altMod, J, resizeactive, 0 20" + ]; + bind = + [ + "$mainMod, return, exec, ${launch_terminal}/bin/launch_terminal $(hyprctl activewindow -j | ${jq} .pid)" + "$mainMod SHIFT, return, exec, ${terminal}" + "$mainMod, Q, killactive," + "$mainMod, A, exec, ${nautilus}" + "$mainMod, S, exec, LC_TIME=\"en_GB.UTF-8\" ${gnome-calendar}" + "$mainMod, B, exec, Helium" + "$mainMod, M, fullscreen, 1" + "$mainMod, F11, fullscreen" + "$mainMod, F, togglefloating," + "$mainMod, SPACE, layoutmsg, togglesplit" + "CONTROL_L ALT_L, L, exec, ${pkgs.hyprlock}/bin/hyprlock" + "$mainMod, C, exec, vicinae vicinae://extensions/vicinae/clipboard/history" + "$mainMod, N, exec, vicinae vicinae://extensions/vicinae/wm/switch-windows" + "$mainMod, Escape, exec, vicinae open -q \"Power Management \"" + ",XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set +10%" + ",XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 10%-" + ",XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0" + ",XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%-" + ",XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + # ",mouse:273, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1.0" + # ",mouse:272, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%-" + ",XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" + ",XF86AudioNext, exec, ${playerctl} next" + ",XF86AudioPrev, exec, ${playerctl} previous" + "$mainMod,XF86AudioMute, exec, ${playerctl} play-pause" + "$mainMod,XF86AudioRaiseVolume, exec, ${playerctl} next" + "$mainMod,XF86AudioLowerVolume, exec, ${playerctl} previous" + '', Print, exec, ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp -d)" - | wl-copy'' + '', Pause, exec, systemctl suspend'' + '', XF86Calculator, exec, systemctl suspend'' - "$mainMod, H, exec, ${./files/vim-hypr-nav.sh} l" - "$mainMod, L, exec, ${./files/vim-hypr-nav.sh} r" - "$mainMod, K, exec, ${./files/vim-hypr-nav.sh} u" - "$mainMod, J, exec, ${./files/vim-hypr-nav.sh} d" - "$mainMod CONTROL_L, H, swapwindow, l" - "$mainMod CONTROL_L, L, swapwindow, r" - "$mainMod CONTROL_L, K, swapwindow, u" - "$mainMod CONTROL_L, J, swapwindow, d" - "$mainMod SHIFT, H, movewindow, l" - "$mainMod SHIFT, L, movewindow, r" - "$mainMod SHIFT, K, movewindow, u" - "$mainMod SHIFT, J, movewindow, d" - "$mainMod SHIFT, T, ${workspace_command_prefix}movetoworkspace, empty" - "$mainMod, T, ${workspace_command_prefix}workspace, empty" - "$mainMod, TAB, ${workspace_command_prefix}workspace, m+1" - "$mainMod SHIFT, TAB, ${workspace_command_prefix}workspace, m-1" - "$mainMod, Caps_Lock, ${workspace_command_prefix}workspace, m+1" - "$mainMod SHIFT, Caps_Lock, ${workspace_command_prefix}workspace, m-1" - ] ++ ( - # workspaces - builtins.concatLists (builtins.genList (x: - let - ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); - in - [ - "$mainMod, ${ws}, ${workspace_command_prefix}workspace, ${toString (x + 1)}" - "$mainMod SHIFT, ${ws}, ${workspace_command_prefix}movetoworkspace, ${toString (x + 1)}" - ]) 10)); - }; + "$mainMod, H, exec, ${./files/vim-hypr-nav.sh} l" + "$mainMod, L, exec, ${./files/vim-hypr-nav.sh} r" + "$mainMod, K, exec, ${./files/vim-hypr-nav.sh} u" + "$mainMod, J, exec, ${./files/vim-hypr-nav.sh} d" + "$mainMod CONTROL_L, H, swapwindow, l" + "$mainMod CONTROL_L, L, swapwindow, r" + "$mainMod CONTROL_L, K, swapwindow, u" + "$mainMod CONTROL_L, J, swapwindow, d" + "$mainMod SHIFT, H, movewindow, l" + "$mainMod SHIFT, L, movewindow, r" + "$mainMod SHIFT, K, movewindow, u" + "$mainMod SHIFT, J, movewindow, d" + "$mainMod SHIFT, T, ${workspace_command_prefix}movetoworkspace, empty" + "$mainMod, T, ${workspace_command_prefix}workspace, empty" + "$mainMod, TAB, ${workspace_command_prefix}workspace, m+1" + "$mainMod SHIFT, TAB, ${workspace_command_prefix}workspace, m-1" + "$mainMod, Caps_Lock, ${workspace_command_prefix}workspace, m+1" + "$mainMod SHIFT, Caps_Lock, ${workspace_command_prefix}workspace, m-1" + ] + ++ ( + # workspaces + builtins.concatLists (builtins.genList (x: let + ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); + in [ + "$mainMod, ${ws}, ${workspace_command_prefix}workspace, ${toString (x + 1)}" + "$mainMod SHIFT, ${ws}, ${workspace_command_prefix}movetoworkspace, ${toString (x + 1)}" + ]) 10) + ); }; + }; } diff --git a/home/kitty/default.nix b/home/kitty/default.nix index fddc8df..384a416 100644 --- a/home/kitty/default.nix +++ b/home/kitty/default.nix @@ -1,60 +1,58 @@ -{ lib, ... }: - -{ - programs.kitty = { - enable = true; - shellIntegration.enableZshIntegration = true; - font = { - name = "'ZedMono Nerd Font' style='Extended Light' features=+ss05"; - size = lib.mkDefault 13; - }; - keybindings = { - "kitty_mod+h" = "kitty_scrollback_nvim"; - "kitty_mod+g" = "kitty_scrollback_nvim --config ksb_builtin_last_cmd_output"; - "kitty_mod+enter" = "nop"; - "kitty_mod+equal" = "change_font_size current +1.0"; - "kitty_mod+minus" = "change_font_size current -1.0"; - "ctrl+shift+c" = "copy_to_clipboard"; - "ctrl+shift+v" = "paste_from_clipboard"; - }; - settings = { - kitty_mod= "ctrl+alt"; - cursor_shape = "block"; - cursor_beam_thickness = 1; - scrollback_lines = 100000; - scrollback_fill_enlarged_window = "yes"; - enable_audio_bell = "no"; - confirm_os_window_close = 0; - modify_font = "cell_height 115%"; - allow_remote_control = "socket-only"; - listen_on = "unix:/tmp/kitty"; - shell_integration = "enabled"; - action_alias = "kitty_scrollback_nvim kitten /home/user/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py"; - mouse_map = "ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output"; - - # Theme - background = "#000010"; - foreground = "#F8F8F2"; - cursor = "#bbbbbb"; - selection_background = "#b4d5ff"; - color0 = "#121212"; - color8 = "#545454"; - color1 = "#fa2573"; - color9 = "#f5669c"; - color2 = "#97e123"; - color10 = "#b0e05e"; - color3 = "#dfd460"; - color11 = "#fef26c"; - color4 = "#0f7fcf"; - color12 = "#00afff"; - color5 = "#8700ff"; - color13 = "#af87ff"; - color6 = "#42a7cf"; - color14 = "#50cdfe"; - color7 = "#bbbbbb"; - color15 = "#ffffff"; - selection_foreground = "#121212"; - background_opacity = "0.3"; - }; +{lib, ...}: { + programs.kitty = { + enable = true; + shellIntegration.enableZshIntegration = true; + font = { + name = "'ZedMono Nerd Font' style='Extended Light' features=+ss05"; + size = lib.mkDefault 13; }; + keybindings = { + "kitty_mod+h" = "kitty_scrollback_nvim"; + "kitty_mod+g" = "kitty_scrollback_nvim --config ksb_builtin_last_cmd_output"; + "kitty_mod+enter" = "nop"; + "kitty_mod+equal" = "change_font_size current +1.0"; + "kitty_mod+minus" = "change_font_size current -1.0"; + "ctrl+shift+c" = "copy_to_clipboard"; + "ctrl+shift+v" = "paste_from_clipboard"; + }; + settings = { + kitty_mod = "ctrl+alt"; + cursor_shape = "block"; + cursor_beam_thickness = 1; + scrollback_lines = 100000; + scrollback_fill_enlarged_window = "yes"; + enable_audio_bell = "no"; + confirm_os_window_close = 0; + modify_font = "cell_height 115%"; + allow_remote_control = "socket-only"; + listen_on = "unix:/tmp/kitty"; + shell_integration = "enabled"; + action_alias = "kitty_scrollback_nvim kitten /home/user/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py"; + mouse_map = "ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output"; + + # Theme + background = "#000010"; + foreground = "#F8F8F2"; + cursor = "#bbbbbb"; + selection_background = "#b4d5ff"; + color0 = "#121212"; + color8 = "#545454"; + color1 = "#fa2573"; + color9 = "#f5669c"; + color2 = "#97e123"; + color10 = "#b0e05e"; + color3 = "#dfd460"; + color11 = "#fef26c"; + color4 = "#0f7fcf"; + color12 = "#00afff"; + color5 = "#8700ff"; + color13 = "#af87ff"; + color6 = "#42a7cf"; + color14 = "#50cdfe"; + color7 = "#bbbbbb"; + color15 = "#ffffff"; + selection_foreground = "#121212"; + background_opacity = "0.3"; + }; + }; } diff --git a/home/lf/default.nix b/home/lf/default.nix index 918b057..8acdead 100644 --- a/home/lf/default.nix +++ b/home/lf/default.nix @@ -1,20 +1,22 @@ -{ config, pkgs, ... }: - { - home.file."${config.xdg.configHome}/lf" = { - source = ./files; - recursive = true; - }; - programs.lf = { - enable = true; - settings = { - icons = true; - autoquit = true; - mouse = true; - number = true; - relativenumber = true; - cursorpreviewfmt = ""; - previewer = toString (pkgs.writeShellScript "script" '' + config, + pkgs, + ... +}: { + home.file."${config.xdg.configHome}/lf" = { + source = ./files; + recursive = true; + }; + programs.lf = { + enable = true; + settings = { + icons = true; + autoquit = true; + mouse = true; + number = true; + relativenumber = true; + cursorpreviewfmt = ""; + previewer = toString (pkgs.writeShellScript "script" '' case "''$1" in *.tar*) tar tf "''$1";; *.zip) unzip -l "''$1";; @@ -23,25 +25,25 @@ *.pdf) ${pkgs.poppler-utils}/bin/pdftotext "''$1" -;; *) ${pkgs.highlight}/bin/highlight -O ansi "''$1";; esac - ''); - }; - keybindings = { - "" = "quit"; - "" = "half-up"; - "." = "set hidden!"; - "o" = ''$nvim -c "lua require(\"oil\").open(\"$PWD\")"''; - "-" = ''$nvim -c "lua require(\"oil\").open(\"$PWD\")"''; - "" = "open"; - "" = ":jump "; - }; - commands = { - jump = '' + ''); + }; + keybindings = { + "" = "quit"; + "" = "half-up"; + "." = "set hidden!"; + "o" = ''$nvim -c "lua require(\"oil\").open(\"$PWD\")"''; + "-" = ''$nvim -c "lua require(\"oil\").open(\"$PWD\")"''; + "" = "open"; + "" = ":jump "; + }; + commands = { + jump = '' ''${{ res=$(zsh -c "source ${../zsh/files/functions.zsh} && find_global d") lf -remote "send $id cd \"$res\"" }} - ''; - }; - cmdKeybindings = { q = "quit"; }; + ''; }; + cmdKeybindings = {q = "quit";}; + }; } diff --git a/home/mpv/default.nix b/home/mpv/default.nix index 215c33e..f7d15ad 100644 --- a/home/mpv/default.nix +++ b/home/mpv/default.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - { - home.file."${config.xdg.configHome}/mpv" = { - source = ./files; - recursive = true; - }; - programs.mpv = { enable = true; }; + config, + pkgs, + ... +}: { + home.file."${config.xdg.configHome}/mpv" = { + source = ./files; + recursive = true; + }; + programs.mpv = {enable = true;}; } diff --git a/home/nvim/default.nix b/home/nvim/default.nix index 66e638b..e40f892 100644 --- a/home/nvim/default.nix +++ b/home/nvim/default.nix @@ -1,52 +1,54 @@ -{ config, pkgs, ... }: - { - home.packages = with pkgs; [ - # codeium - nixd - clang-tools - llvmPackages.libcxxClang - go - nodejs - luarocks - jre - python313Packages.pip - python313Packages.debugpy - unzip - dotnet-sdk_8 - cargo - neovim-unwrapped - tree-sitter + config, + pkgs, + ... +}: { + home.packages = with pkgs; [ + # codeium + nixd + clang-tools + llvmPackages.libcxxClang + go + nodejs + luarocks + jre + python313Packages.pip + python313Packages.debugpy + unzip + dotnet-sdk_8 + cargo + neovim-unwrapped + tree-sitter - # LSPs - texlab - ltex-ls - basedpyright - # mypy - cmake-language-server - vscode-langservers-extracted - yaml-language-server - bash-language-server - docker-compose-language-service - dockerfile-language-server - lua-language-server - rust-analyzer - gopls - # deno - typescript-language-server - jdt-language-server - emmet-ls - ruff - csharp-ls - tinymist - ]; + # LSPs + texlab + ltex-ls + basedpyright + # mypy + cmake-language-server + vscode-langservers-extracted + yaml-language-server + bash-language-server + docker-compose-language-service + dockerfile-language-server + lua-language-server + rust-analyzer + gopls + # deno + typescript-language-server + jdt-language-server + emmet-ls + ruff + csharp-ls + tinymist + ]; - home.file."${config.xdg.configHome}/nvim" = { - source = ./files; - recursive = true; - }; + home.file."${config.xdg.configHome}/nvim" = { + source = ./files; + recursive = true; + }; - home.file.".clang-tidy".text = '' + home.file.".clang-tidy".text = '' Checks: "*, -abseil-*, -altera-*, @@ -78,8 +80,8 @@ WarningsAsErrors: ''' HeaderFilterRegex: ''' FormatStyle: none - ''; - home.sessionVariables = { - EDITOR = "nvim"; - }; + ''; + home.sessionVariables = { + EDITOR = "nvim"; + }; } diff --git a/home/rofi/default.nix b/home/rofi/default.nix index aa66f41..16f425f 100644 --- a/home/rofi/default.nix +++ b/home/rofi/default.nix @@ -1,128 +1,130 @@ -{ config, pkgs, ... }: - { - home.packages = with pkgs; [ papirus-icon-theme ]; + config, + pkgs, + ... +}: { + home.packages = with pkgs; [papirus-icon-theme]; - programs.rofi = { - enable = true; - package = pkgs.rofi; - font = "SF Pro Rounded 13"; - extraConfig = { - show-icons = true; - icon-theme = "Papirus"; - kb-cancel = "Super_L+XF86Launch5,Escape"; - combi-hide-mode-prefix = true; - }; - theme = - let inherit (config.lib.formats.rasi) mkLiteral; - in { - "*" = { - background = mkLiteral "#0f111a"; - foreground = mkLiteral "#f1f1f1"; - selected = mkLiteral "#0033a1"; - selected-text = mkLiteral "#ffffff"; - }; - - "window" = { - transparency = "real"; - background-color = mkLiteral "@background"; - text-color = mkLiteral "@foreground"; - width = mkLiteral "800px"; - border-radius = mkLiteral "5px"; - }; - - "textbox-prompt-colon" = { - expand = mkLiteral "false"; - background-color = mkLiteral "@background"; - padding = mkLiteral "4px 0px 0px 6px"; - }; - - "inputbar" = { - children = mkLiteral "[ textbox-prompt-colon, entry ]"; - background-color = mkLiteral "@background"; - text-color = mkLiteral "@foreground"; - expand = mkLiteral "false"; - border = mkLiteral "0px 0px 0px 0px"; - border-radius = mkLiteral "0px"; - border-color = mkLiteral "@selected"; - margin = mkLiteral "0px 0px 0px 0px"; - padding = mkLiteral "0px 0px 4px 0px"; - position = mkLiteral "center"; - }; - - "entry" = { - background-color = mkLiteral "@background"; - text-color = mkLiteral "@foreground"; - placeholder-color = mkLiteral "@foreground"; - expand = mkLiteral "true"; - horizontal-align = mkLiteral "0"; - blink = mkLiteral "true"; - padding = mkLiteral "4px 0px 0px 4px"; - font = "SF Pro Rounded 25"; - }; - - "case-indicator" = { - background-color = mkLiteral "@background"; - text-color = mkLiteral "@foreground"; - spacing = mkLiteral "0"; - }; - - "listview" = { - background-color = mkLiteral "@background"; - columns = mkLiteral "1"; - spacing = mkLiteral "5px"; - cycle = mkLiteral "true"; - dynamic = mkLiteral "true"; - layout = mkLiteral "vertical"; - fixed-height = "true"; - lines = mkLiteral "5"; - }; - - "mainbox" = { - background-color = mkLiteral "@background"; - children = mkLiteral "[ inputbar, message, listview ]"; - spacing = mkLiteral "20px"; - padding = mkLiteral "20px 15px 15px 15px"; - }; - - "message" = { - children = mkLiteral "[ textbox ]"; - border-radius = mkLiteral "5px"; - }; - - "textbox" = { - background-color = mkLiteral "@selected"; - text-color = mkLiteral "@foreground"; - padding = mkLiteral "20px 6px 20px 80px"; - }; - - "element" = { - background-color = mkLiteral "@background"; - text-color = mkLiteral "@foreground"; - orientation = mkLiteral "horizontal"; - border-radius = mkLiteral "4px"; - padding = mkLiteral "2px 2px 2px 2px"; - }; - - "element-text, element-icon" = { - background-color = mkLiteral "inherit"; - text-color = mkLiteral "inherit"; - }; - - "element-icon" = { - size = mkLiteral "40px"; - padding = mkLiteral "10px 10px 10px 10px"; - }; - - "element-text" = { padding = mkLiteral "20px 0px 0px 10px"; }; - - "element selected" = { - background-color = mkLiteral "@selected"; - text-color = mkLiteral "@selected-text"; - border = mkLiteral "0px"; - border-radius = mkLiteral "3px"; - border-color = mkLiteral "@selected"; - }; - }; + programs.rofi = { + enable = true; + package = pkgs.rofi; + font = "SF Pro Rounded 13"; + extraConfig = { + show-icons = true; + icon-theme = "Papirus"; + kb-cancel = "Super_L+XF86Launch5,Escape"; + combi-hide-mode-prefix = true; }; + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + in { + "*" = { + background = mkLiteral "#0f111a"; + foreground = mkLiteral "#f1f1f1"; + selected = mkLiteral "#0033a1"; + selected-text = mkLiteral "#ffffff"; + }; + + "window" = { + transparency = "real"; + background-color = mkLiteral "@background"; + text-color = mkLiteral "@foreground"; + width = mkLiteral "800px"; + border-radius = mkLiteral "5px"; + }; + + "textbox-prompt-colon" = { + expand = mkLiteral "false"; + background-color = mkLiteral "@background"; + padding = mkLiteral "4px 0px 0px 6px"; + }; + + "inputbar" = { + children = mkLiteral "[ textbox-prompt-colon, entry ]"; + background-color = mkLiteral "@background"; + text-color = mkLiteral "@foreground"; + expand = mkLiteral "false"; + border = mkLiteral "0px 0px 0px 0px"; + border-radius = mkLiteral "0px"; + border-color = mkLiteral "@selected"; + margin = mkLiteral "0px 0px 0px 0px"; + padding = mkLiteral "0px 0px 4px 0px"; + position = mkLiteral "center"; + }; + + "entry" = { + background-color = mkLiteral "@background"; + text-color = mkLiteral "@foreground"; + placeholder-color = mkLiteral "@foreground"; + expand = mkLiteral "true"; + horizontal-align = mkLiteral "0"; + blink = mkLiteral "true"; + padding = mkLiteral "4px 0px 0px 4px"; + font = "SF Pro Rounded 25"; + }; + + "case-indicator" = { + background-color = mkLiteral "@background"; + text-color = mkLiteral "@foreground"; + spacing = mkLiteral "0"; + }; + + "listview" = { + background-color = mkLiteral "@background"; + columns = mkLiteral "1"; + spacing = mkLiteral "5px"; + cycle = mkLiteral "true"; + dynamic = mkLiteral "true"; + layout = mkLiteral "vertical"; + fixed-height = "true"; + lines = mkLiteral "5"; + }; + + "mainbox" = { + background-color = mkLiteral "@background"; + children = mkLiteral "[ inputbar, message, listview ]"; + spacing = mkLiteral "20px"; + padding = mkLiteral "20px 15px 15px 15px"; + }; + + "message" = { + children = mkLiteral "[ textbox ]"; + border-radius = mkLiteral "5px"; + }; + + "textbox" = { + background-color = mkLiteral "@selected"; + text-color = mkLiteral "@foreground"; + padding = mkLiteral "20px 6px 20px 80px"; + }; + + "element" = { + background-color = mkLiteral "@background"; + text-color = mkLiteral "@foreground"; + orientation = mkLiteral "horizontal"; + border-radius = mkLiteral "4px"; + padding = mkLiteral "2px 2px 2px 2px"; + }; + + "element-text, element-icon" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + + "element-icon" = { + size = mkLiteral "40px"; + padding = mkLiteral "10px 10px 10px 10px"; + }; + + "element-text" = {padding = mkLiteral "20px 0px 0px 10px";}; + + "element selected" = { + background-color = mkLiteral "@selected"; + text-color = mkLiteral "@selected-text"; + border = mkLiteral "0px"; + border-radius = mkLiteral "3px"; + border-color = mkLiteral "@selected"; + }; + }; + }; } diff --git a/home/ssh/default.nix b/home/ssh/default.nix index 70e6865..38820d8 100644 --- a/home/ssh/default.nix +++ b/home/ssh/default.nix @@ -1,90 +1,93 @@ -{ inputs, config, pkgs, ... }: - { - programs.ssh = { - enable = true; - enableDefaultConfig = false; - matchBlocks = { - "*" = { - host = "*"; - }; - mallorea = { - host = "mallorea"; - hostname = "server.thomasave.be"; - port = 22; - user = "server"; - forwardAgent = true; - }; - Mallorea = { - host = "Mallorea"; - hostname = "server.thomasave.be"; - port = 22; - user = "server"; - forwardAgent = true; - }; - Kell = { - host = "Kell"; - hostname = "kell.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - kell = { - host = "kell"; - hostname = "kell.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - Riva = { - host = "Riva"; - hostname = "riva.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - riva = { - host = "riva"; - hostname = "riva.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - Arch = { - host = "Arch"; - hostname = "arch.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - arch = { - host = "arch"; - hostname = "arch.thomasave.be"; - port = 22; - user = "user"; - forwardAgent = true; - }; - Vault = { - host = "Vault"; - hostname = "etienne.thomasave.be"; - port = 22; - user = "server"; - forwardAgent = true; - }; - vault = { - host = "vault"; - hostname = "etienne.thomasave.be"; - port = 22; - user = "server"; - forwardAgent = true; - }; - gcp = { - host = "gcp"; - hostname = "34.126.140.76"; - port = 22; - user = "user"; - forwardAgent = true; - }; - }; + inputs, + config, + pkgs, + ... +}: { + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "*" = { + host = "*"; + }; + mallorea = { + host = "mallorea"; + hostname = "server.thomasave.be"; + port = 22; + user = "server"; + forwardAgent = true; + }; + Mallorea = { + host = "Mallorea"; + hostname = "server.thomasave.be"; + port = 22; + user = "server"; + forwardAgent = true; + }; + Kell = { + host = "Kell"; + hostname = "kell.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + kell = { + host = "kell"; + hostname = "kell.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + Riva = { + host = "Riva"; + hostname = "riva.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + riva = { + host = "riva"; + hostname = "riva.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + Arch = { + host = "Arch"; + hostname = "arch.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + arch = { + host = "arch"; + hostname = "arch.thomasave.be"; + port = 22; + user = "user"; + forwardAgent = true; + }; + Vault = { + host = "Vault"; + hostname = "etienne.thomasave.be"; + port = 22; + user = "server"; + forwardAgent = true; + }; + vault = { + host = "vault"; + hostname = "etienne.thomasave.be"; + port = 22; + user = "server"; + forwardAgent = true; + }; + gcp = { + host = "gcp"; + hostname = "34.126.140.76"; + port = 22; + user = "user"; + forwardAgent = true; + }; }; + }; } diff --git a/home/tmux/default.nix b/home/tmux/default.nix index 62cdc58..5816ffb 100644 --- a/home/tmux/default.nix +++ b/home/tmux/default.nix @@ -1,63 +1,62 @@ -{ pkgs, ... }: -{ - programs.tmux = { - shell = "${pkgs.zsh}/bin/zsh"; - terminal = "screen-256color"; - enable = true; - clock24 = true; - shortcut = "a"; - escapeTime = 0; - newSession = true; - mouse = true; - keyMode = "vi"; - plugins = [ - pkgs.tmuxPlugins.vim-tmux-navigator - pkgs.tmuxPlugins.better-mouse-mode - pkgs.tmuxPlugins.yank - { - plugin = pkgs.tmuxPlugins.catppuccin; - extraConfig = '' - set -ogq @catppuccin_flavor "mocha" - set -ogq @catppuccin_window_status_style "rounded" - set -ogq @catppuccin_pane_border_style "fg=#181825" - set -ogq @catppuccin_pane_active_border_style "fg=#023269" - set -ogq @catppuccin_menu_selected_style "fg=#{@thm_gray},bg=#0F7FCF" - set -g @catppuccin_window_current_number_color "#0F7FCF" - set -g @catppuccin_window_current_text_color "#1F2430" - set -g @catppuccin_window_text_color "#1F2430" - set -g @catppuccin_window_number_color "#707072" - set -ogq status-right "#{E:@catppuccin_status_directory}" - - # Make the status line pretty and add some modules - set -g status-right-length 100 - set -g status-left-length 100 - set -g status-left "" - set -g status-right "#{E:@catppuccin_status_application}" - set -ag status-right "#{E:@catppuccin_status_session}" - ''; - } - ]; - +{pkgs, ...}: { + programs.tmux = { + shell = "${pkgs.zsh}/bin/zsh"; + terminal = "screen-256color"; + enable = true; + clock24 = true; + shortcut = "a"; + escapeTime = 0; + newSession = true; + mouse = true; + keyMode = "vi"; + plugins = [ + pkgs.tmuxPlugins.vim-tmux-navigator + pkgs.tmuxPlugins.better-mouse-mode + pkgs.tmuxPlugins.yank + { + plugin = pkgs.tmuxPlugins.catppuccin; extraConfig = '' - set -ag terminal-overrides ",screen-256color:Tc" - set-window-option -g mode-keys vi - bind-key -T copy-mode-vi 'v' send -X begin-selection - bind-key -T copy-mode-vi 'y' send -X copy-selection + set -ogq @catppuccin_flavor "mocha" + set -ogq @catppuccin_window_status_style "rounded" + set -ogq @catppuccin_pane_border_style "fg=#181825" + set -ogq @catppuccin_pane_active_border_style "fg=#023269" + set -ogq @catppuccin_menu_selected_style "fg=#{@thm_gray},bg=#0F7FCF" + set -g @catppuccin_window_current_number_color "#0F7FCF" + set -g @catppuccin_window_current_text_color "#1F2430" + set -g @catppuccin_window_text_color "#1F2430" + set -g @catppuccin_window_number_color "#707072" + set -ogq status-right "#{E:@catppuccin_status_directory}" - bind | split-window -h -c "#{pane_current_path}" - bind - split-window -v -c "#{pane_current_path}" - bind c new-window -c "#{pane_current_path}" - unbind '"' - unbind % - - # Renumber windows starting from 1 - set -g base-index 1 - setw -g pane-base-index 1 - set-option -g renumber-windows on - - # Transparent bar - set -g status-bg default - set -g status-style "bg=default" + # Make the status line pretty and add some modules + set -g status-right-length 100 + set -g status-left-length 100 + set -g status-left "" + set -g status-right "#{E:@catppuccin_status_application}" + set -ag status-right "#{E:@catppuccin_status_session}" ''; - }; + } + ]; + + extraConfig = '' + set -ag terminal-overrides ",screen-256color:Tc" + set-window-option -g mode-keys vi + bind-key -T copy-mode-vi 'v' send -X begin-selection + bind-key -T copy-mode-vi 'y' send -X copy-selection + + bind | split-window -h -c "#{pane_current_path}" + bind - split-window -v -c "#{pane_current_path}" + bind c new-window -c "#{pane_current_path}" + unbind '"' + unbind % + + # Renumber windows starting from 1 + set -g base-index 1 + setw -g pane-base-index 1 + set-option -g renumber-windows on + + # Transparent bar + set -g status-bg default + set -g status-style "bg=default" + ''; + }; } diff --git a/home/utils/common.nix b/home/utils/common.nix index a7e3609..736bd12 100644 --- a/home/utils/common.nix +++ b/home/utils/common.nix @@ -1,52 +1,54 @@ -{ inputs, config, pkgs, ... }: - { - imports = [ - (import ../zsh { inherit inputs config pkgs; }) - (import ../bash { inherit inputs config pkgs; }) - ../git - ../nvim - ../email - ../lf - ../tmux - ../yazi - ../zellij - ]; + inputs, + config, + pkgs, + ... +}: { + imports = [ + (import ../zsh {inherit inputs config pkgs;}) + (import ../bash {inherit inputs config pkgs;}) + ../git + ../nvim + ../email + ../lf + ../tmux + ../yazi + ../zellij + ]; - home.stateVersion = "24.11"; - targets.genericLinux.enable = true; - programs.home-manager.enable = true; - home.packages = with pkgs; [ - htop - ghostscript - waypipe - inputs.worktimer.packages.${pkgs.stdenv.hostPlatform.system}.default - usbutils - gocryptfs - sshfs - ncdu - ]; - home.sessionVariables = { - XDG_CONFIG_HOME = "${config.xdg.configHome}"; - XDG_CACHE_HOME = "${config.xdg.cacheHome}"; - XDG_DATA_HOME = "${config.xdg.dataHome}"; - XDG_STATE_HOME = "${config.xdg.stateHome}"; + home.stateVersion = "24.11"; + targets.genericLinux.enable = true; + programs.home-manager.enable = true; + home.packages = with pkgs; [ + htop + ghostscript + waypipe + inputs.worktimer.packages.${pkgs.stdenv.hostPlatform.system}.default + usbutils + gocryptfs + sshfs + ncdu + ]; + home.sessionVariables = { + XDG_CONFIG_HOME = "${config.xdg.configHome}"; + XDG_CACHE_HOME = "${config.xdg.cacheHome}"; + XDG_DATA_HOME = "${config.xdg.dataHome}"; + XDG_STATE_HOME = "${config.xdg.stateHome}"; - CUDA_CACHE_PATH = "${config.xdg.cacheHome}/nv"; - DOCKER_CONFIG = "${config.xdg.configHome}/docker"; - LESSHISTFILE = "${config.xdg.cacheHome}/less/history"; - PARALLEL_HOME = "${config.xdg.configHome}/parallel"; - PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc"; - SQLITE_HISTORY = "${config.xdg.cacheHome}/sqlite_history"; - WINEPREFIX = "${config.xdg.dataHome}/wine"; - # XDG_CURRENT_DESKTOP = "GNOME"; - OPENCV_LOG_LEVEL = "ERROR"; - COLORTERM = "truecolor"; - }; - - home.file.".latexmkrc".text = '' - $pdf_mode = 1; - $pdf_previewer = 'evince %O %S'; - ''; + CUDA_CACHE_PATH = "${config.xdg.cacheHome}/nv"; + DOCKER_CONFIG = "${config.xdg.configHome}/docker"; + LESSHISTFILE = "${config.xdg.cacheHome}/less/history"; + PARALLEL_HOME = "${config.xdg.configHome}/parallel"; + PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc"; + SQLITE_HISTORY = "${config.xdg.cacheHome}/sqlite_history"; + WINEPREFIX = "${config.xdg.dataHome}/wine"; + # XDG_CURRENT_DESKTOP = "GNOME"; + OPENCV_LOG_LEVEL = "ERROR"; + COLORTERM = "truecolor"; + }; + home.file.".latexmkrc".text = '' + $pdf_mode = 1; + $pdf_previewer = 'evince %O %S'; + ''; } diff --git a/home/utils/desktop.nix b/home/utils/desktop.nix index 1bd5ec0..c1f89a3 100644 --- a/home/utils/desktop.nix +++ b/home/utils/desktop.nix @@ -1,109 +1,113 @@ -{ inputs, config, pkgs, ... }: { - imports = [ - (import ./common.nix { inherit inputs config pkgs; }) - (import ./python.nix { inherit inputs config pkgs; }) - (import ../hyprland { inherit inputs pkgs; }) - (import ../ags { inherit inputs pkgs; }) - ../rofi - ../vicinae - ../alacritty - ../foot - ../kitty - ../firefox - ../helium - ../ssh - ../mpv - ]; + inputs, + config, + pkgs, + ... +}: { + imports = [ + (import ./common.nix {inherit inputs config pkgs;}) + (import ./python.nix {inherit inputs config pkgs;}) + (import ../hyprland {inherit inputs pkgs;}) + (import ../ags {inherit inputs pkgs;}) + ../rofi + ../vicinae + ../alacritty + ../foot + ../kitty + ../firefox + ../helium + ../ssh + ../mpv + ]; - home.packages = with pkgs; [ - spotify - slack - eid-mw - onlyoffice-desktopeditors - libreoffice - telegram-desktop - signal-desktop - iwgtk - element-desktop - evince - loupe - gimp3 - obs-studio - inkscape - gnome-calendar - file-roller - zip - heroic - cmake - nmap - arp-scan - virt-manager - wol - dig - file - zip - yubioath-flutter - obsidian - nautilus - appimage-run - ]; + home.packages = with pkgs; [ + spotify + slack + eid-mw + onlyoffice-desktopeditors + libreoffice + telegram-desktop + signal-desktop + iwgtk + element-desktop + evince + loupe + gimp3 + obs-studio + inkscape + gnome-calendar + file-roller + zip + heroic + cmake + nmap + arp-scan + virt-manager + wol + dig + file + zip + yubioath-flutter + obsidian + nautilus + appimage-run + ]; - services.kdeconnect = { - enable = true; - package = pkgs.kdePackages.kdeconnect-kde; - indicator = true; + services.kdeconnect = { + enable = true; + package = pkgs.kdePackages.kdeconnect-kde; + indicator = true; + }; + + programs.thunderbird = { + enable = true; + profiles.default.isDefault = true; + }; + + gtk = { + enable = true; + theme = { + package = pkgs.gnome-themes-extra; + name = "Adwaita-dark"; }; - - programs.thunderbird = { - enable = true; - profiles.default.isDefault = true; + iconTheme = { + name = "Papirus"; + package = pkgs.papirus-icon-theme; }; + }; - gtk = { - enable = true; - theme = { - package = pkgs.gnome-themes-extra; - name = "Adwaita-dark"; - }; - iconTheme = { - name = "Papirus"; - package = pkgs.papirus-icon-theme; - }; + home.pointerCursor = { + gtk.enable = true; + name = "Adwaita"; + size = 28; + package = pkgs.adwaita-icon-theme; + }; + + services.mpris-proxy.enable = true; # Bluetooth media control + + xdg.mimeApps = { + enable = true; + defaultApplications = { + "x-scheme-handler/mailto" = "userapp-Thunderbird-7GETV2.desktop"; + "x-scheme-handler/mid" = "userapp-Thunderbird-7GETV2.desktop"; + "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; + "message/rfc822" = "userapp-Thunderbird-7GETV2.desktop"; + "application/pdf" = "org.gnome.Evince.desktop"; + "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; + "video/*" = "mpv.desktop"; + "audio/*" = "mpv.desktop"; + "image/jpeg" = "org.gnome.Loupe.desktop"; + "image/png" = "org.gnome.Loupe.desktop"; }; - - home.pointerCursor = { - gtk.enable = true; - name = "Adwaita"; - size = 28; - package = pkgs.adwaita-icon-theme; + associations.added = { + "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; + "x-scheme-handler/mailto" = "userapp-Thunderbird-7GETV2.desktop"; + "x-scheme-handler/mid" = "userapp-Thunderbird-7GETV2.desktop"; + "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; + "image/jpeg" = "org.gnome.Loupe.desktop"; + "image/png" = "org.gnome.Loupe.desktop"; }; + }; - services.mpris-proxy.enable = true; # Bluetooth media control - - xdg.mimeApps = { - enable = true; - defaultApplications = { - "x-scheme-handler/mailto" = "userapp-Thunderbird-7GETV2.desktop"; - "x-scheme-handler/mid" = "userapp-Thunderbird-7GETV2.desktop"; - "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; - "message/rfc822" = "userapp-Thunderbird-7GETV2.desktop"; - "application/pdf" = "org.gnome.Evince.desktop"; - "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; - "video/*" = "mpv.desktop"; - "audio/*" = "mpv.desktop"; - "image/jpeg" = "org.gnome.Loupe.desktop"; - "image/png" = "org.gnome.Loupe.desktop"; - }; - associations.added = { - "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; - "x-scheme-handler/mailto" = "userapp-Thunderbird-7GETV2.desktop"; - "x-scheme-handler/mid" = "userapp-Thunderbird-7GETV2.desktop"; - "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; - "image/jpeg" = "org.gnome.Loupe.desktop"; - "image/png" = "org.gnome.Loupe.desktop"; - }; - }; - - fonts.fontconfig.enable = true; + fonts.fontconfig.enable = true; } diff --git a/home/utils/disk_check.nix b/home/utils/disk_check.nix index 2c4f230..d0272c2 100644 --- a/home/utils/disk_check.nix +++ b/home/utils/disk_check.nix @@ -1,7 +1,6 @@ -{ pkgs }: -{ - when = "*-*-* *:00:00"; - script = toString (pkgs.writeShellScript "script" '' +{pkgs}: { + when = "*-*-* *:00:00"; + script = toString (pkgs.writeShellScript "script" '' REPORT_EMAIL=email@thomasave.be ZPOOL_STATUS=$(zpool status -x) if [ "$ZPOOL_STATUS" = "all pools are healthy" ] || [ "$ZPOOL_STATUS" = "no pools available" ] @@ -14,5 +13,5 @@ printf 1 > /var/db/zpool.status fi fi - ''); + ''); } diff --git a/home/utils/fzgo_links.nix b/home/utils/fzgo_links.nix index f7b970b..86d0897 100644 --- a/home/utils/fzgo_links.nix +++ b/home/utils/fzgo_links.nix @@ -1,12 +1,15 @@ -{ config, pkgs, fzgo_paths }: -let - mkLink = source_path: file_type: { - "${source_path}-${file_type}" = { - source = config.lib.file.mkOutOfStoreSymlink source_path; - target = ".config/fzgo/entries/${file_type}/${pkgs.lib.strings.replaceStrings [ "/" ] [ "|" ] source_path}"; - }; +{ + config, + pkgs, + fzgo_paths, +}: let + mkLink = source_path: file_type: { + "${source_path}-${file_type}" = { + source = config.lib.file.mkOutOfStoreSymlink source_path; + target = ".config/fzgo/entries/${file_type}/${pkgs.lib.strings.replaceStrings ["/"] ["|"] source_path}"; }; - links = (map (source_path: mkLink source_path "f") fzgo_paths.files) ++ (map (source_path: mkLink source_path "d") fzgo_paths.dirs); + }; + links = (map (source_path: mkLink source_path "f") fzgo_paths.files) ++ (map (source_path: mkLink source_path "d") fzgo_paths.dirs); in { - home.file = pkgs.lib.mkMerge links; + home.file = pkgs.lib.mkMerge links; } diff --git a/home/utils/python.nix b/home/utils/python.nix index 9ead6a9..c7413d4 100644 --- a/home/utils/python.nix +++ b/home/utils/python.nix @@ -1,40 +1,42 @@ -{ pkgs, ... }: -let - pythonldlibpath = pkgs.lib.makeLibraryPath (with pkgs; [ - libGL - glib - zlib - zstd - stdenv.cc.cc - stdenv.cc.cc.lib - curl - openssl - attr - libssh - bzip2 - libxml2 - acl - libsodium - util-linux - xz - systemd - ]); - # Darwin requires a different library path prefix - wrapPrefix = if (!pkgs.stdenv.isDarwin) then "LD_LIBRARY_PATH" else "DYLD_LIBRARY_PATH"; - # pythonOverlay = (pkgs.python313.withPackages (ps: [ - # (ps.torch.override { rocmSupport = true; }) - # ])); +{pkgs, ...}: let + pythonldlibpath = pkgs.lib.makeLibraryPath (with pkgs; [ + libGL + glib + zlib + zstd + stdenv.cc.cc + stdenv.cc.cc.lib + curl + openssl + attr + libssh + bzip2 + libxml2 + acl + libsodium + util-linux + xz + systemd + ]); + # Darwin requires a different library path prefix + wrapPrefix = + if (!pkgs.stdenv.isDarwin) + then "LD_LIBRARY_PATH" + else "DYLD_LIBRARY_PATH"; + # pythonOverlay = (pkgs.python313.withPackages (ps: [ + # (ps.torch.override { rocmSupport = true; }) + # ])); - patchedpython = (pkgs.symlinkJoin { - name = "python"; - paths = [ pkgs.python313 ]; - buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' + patchedpython = pkgs.symlinkJoin { + name = "python"; + paths = [pkgs.python313]; + buildInputs = [pkgs.makeWrapper]; + postBuild = '' wrapProgram "$out/bin/python3.13" --prefix ${wrapPrefix} : "${pythonldlibpath}" - ''; - }); + ''; + }; in { - home.packages = [ - patchedpython - ]; + home.packages = [ + patchedpython + ]; } diff --git a/home/utils/services.nix b/home/utils/services.nix index 1860cdf..bbe1a97 100644 --- a/home/utils/services.nix +++ b/home/utils/services.nix @@ -1,82 +1,85 @@ -{ pkgs, scripts }: -let - notify_script = (pkgs.writers.writePython3Bin "telegram-notify.py" - { - libraries = [ pkgs.python3Packages.python-telegram-bot ]; - } '' - import telegram - import asyncio - import sys - import socket - import json - import subprocess - import tempfile - - - async def run(): - text = subprocess.check_output( - [ - "journalctl", - "--user", - "-u", - sys.argv[1], - "--since", - "-1h", - "--no-pager" - ] - ).decode("utf-8") - - with open("/home/server/.secrets/Telegram/token.json") as f: - credentials = json.load(f) - token = credentials["token"] - chat_id = credentials["chat_id"] - - with open("/home/server/mail.log", "a") as f: - f.write(text) - f.write("\n===========================================\n") - - bot = telegram.Bot(token=token) - hostname = socket.gethostname() - await bot.send_message( - chat_id, - f"{hostname} encountered an error in the service: {sys.argv[1]}" - ) - - with tempfile.NamedTemporaryFile(suffix=".txt") as tmp_file: - tmp_file.write(text.encode("utf-8")) - tmp_file.seek(0) - await bot.send_document(chat_id, document=tmp_file) - - - if __name__ == "__main__": - loop = asyncio.get_event_loop() - loop.run_until_complete(asyncio.wait([loop.create_task(run())])) - loop.close() - ''); - - mkTimer = name: cfg: { - Install.WantedBy = [ "timers.target" ]; - Timer = { - Persistent = true; - OnCalendar = cfg.when; - Unit = "${name}.service"; - }; - }; - mkService = name: cfg: { - Unit.Description = name; - Unit.OnFailure = "status_notify@${name}.service"; - # Install = { WantedBy = [ "default.target" ]; }; - Service = { ExecStart = cfg.script; }; - }; -in +{ + pkgs, + scripts, +}: let + notify_script = + pkgs.writers.writePython3Bin "telegram-notify.py" { - systemd.user.services = pkgs.lib.mapAttrs mkService scripts - // (pkgs.lib.mapAttrs mkService { - "status_notify@" = { - script = "${notify_script}/bin/telegram-notify.py %i"; - }; - }); - systemd.user.timers = pkgs.lib.mapAttrs mkTimer scripts; - # Don't forget to enable these timers! Or reboot, after which it should also be activated automatically - # systemctl --user enable --now