From 660c9089d43f156d284dc33e20beb550385fcb44 Mon Sep 17 00:00:00 2001 From: Artur Manuel Date: Thu, 16 Jan 2025 00:37:14 +0000 Subject: [PATCH] feat(xonsh): set up ssh-agent --- .envrc | 1 + flake.lock | 8 ++-- flake.nix | 12 +++++ hosts/python/apps.nix | 1 + hosts/python/fonts.nix | 17 +++---- hosts/python/users/configs/river/init | 2 +- .../users/configs/river/scripts/screenshot.sh | 38 --------------- hosts/shared/river.nix | 5 +- hosts/shared/ssh.nix | 5 +- hosts/shared/xonsh.nix | 46 ++++++++++++++++--- overlays/derivations/starship.nix | 12 +++-- 11 files changed, 82 insertions(+), 65 deletions(-) delete mode 100755 hosts/python/users/configs/river/scripts/screenshot.sh diff --git a/.envrc b/.envrc index 3550a30..a0818f4 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ +# shellcheck disable=SC2148 use flake diff --git a/flake.lock b/flake.lock index 473bee9..007a6c0 100644 --- a/flake.lock +++ b/flake.lock @@ -516,11 +516,11 @@ "nvf": "nvf" }, "locked": { - "lastModified": 1736860746, - "narHash": "sha256-ZULQd+0yda7ajs25krTpJJoqXn6kDEMRTh/jBhb6G6M=", + "lastModified": 1736875618, + "narHash": "sha256-Yqflnl+pJWtdFgMaiJAeNkgFHP4+o1vA0TC5KulhnaI=", "ref": "master", - "rev": "8f5f5867bb22c5a4b6eef6f68d4f994bbd2dcc90", - "revCount": 14, + "rev": "e582f612654be987ca1bbeafb60de67f4b09e7d2", + "revCount": 15, "type": "git", "url": "https://codeberg.org/amadaluzia/painless-neovim.git" }, diff --git a/flake.nix b/flake.nix index 9270acc..3568427 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,18 @@ }; }; devShells.default = config.pre-commit.devShell; + devShells.haskell = pkgs.mkShell { + name = "haskell"; + packages = builtins.attrValues { + inherit (pkgs) ghc; + inherit + (pkgs.haskellPackages) + cabal-install + haskell-language-server + ormolu + ; + }; + }; formatter = pkgs.alejandra; }; }; diff --git a/hosts/python/apps.nix b/hosts/python/apps.nix index b579366..e7295f4 100644 --- a/hosts/python/apps.nix +++ b/hosts/python/apps.nix @@ -16,6 +16,7 @@ }; sessionVariables = {EDITOR = "nvim";}; }; + alqueva = { xonsh.enable = true; libvirt.enable = true; diff --git a/hosts/python/fonts.nix b/hosts/python/fonts.nix index 0fb9c5e..0ee74ea 100644 --- a/hosts/python/fonts.nix +++ b/hosts/python/fonts.nix @@ -1,18 +1,19 @@ {pkgs, ...}: { alqueva.fonts = { names = { - sansSerif = ["Inter"]; - monospace = ["Maple Mono"]; + sansSerif = ["Fira Sans"]; + monospace = ["Fira Mono"]; serif = ["ETBembo"]; - emoji = ["OpenMoji Color"]; + emoji = ["Twitter Color Emoji"]; }; packages = { - sansSerif = [pkgs.inter]; - monospace = [pkgs.maple-mono]; - serif = [pkgs.source-serif-pro pkgs.etBook]; - emoji = [pkgs.openmoji-color]; + sansSerif = [pkgs.fira-sans]; + monospace = [pkgs.fira-mono]; + serif = [pkgs.etBook]; + emoji = [pkgs.twemoji-color-font]; extra = [ - pkgs.source-han-sans + pkgs.fira-go + pkgs.noto-fonts pkgs.nerd-fonts.symbols-only ]; }; diff --git a/hosts/python/users/configs/river/init b/hosts/python/users/configs/river/init index e3d4642..98442ce 100755 --- a/hosts/python/users/configs/river/init +++ b/hosts/python/users/configs/river/init @@ -11,7 +11,7 @@ riverctl spawn "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG riverctl map normal "$mod"+Shift Return spawn kitty riverctl map normal "$mod" P spawn "rofi -show drun" -riverctl map normal "$mod" S spawn "$HOME/.config/river/scripts/screenshot.sh savecopy" +riverctl map normal "$mod" S spawn "flameshot gui" riverctl map normal "$mod" Q close riverctl map normal "$mod"+Shift E exit riverctl map normal "$mod"+Shift C spawn "$HOME/.config/river/init" diff --git a/hosts/python/users/configs/river/scripts/screenshot.sh b/hosts/python/users/configs/river/scripts/screenshot.sh deleted file mode 100755 index b231a95..0000000 --- a/hosts/python/users/configs/river/scripts/screenshot.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck disable=SC1091 -source "$HOME/.config/user-dirs.dirs" - -case "$1" in -"copy") - GEOM="$(slurp)" - if [ "$GEOM" == "" ]; then - grim - | wl-copy - else - grim -g "$GEOM" - | wl-copy - fi - echo "Screenshot copied." - ;; -"save") - GEOM="$(slurp)" - if [ "$GEOM" == "" ]; then - grim "$OUT" - else - grim -g "$GEOM" "$OUT" - fi - echo "Screenshot saved. $OUT" - ;; -"savecopy") - GEOM="$(slurp)" - if [ "$GEOM" == "" ]; then - grim - | wl-copy - else - grim -g "$GEOM" - | wl-copy - fi - wl-copy <"$OUT" - echo "Screenshot saved and copied. $OUT" - ;; -*) - echo "Not done!" - ;; -esac diff --git a/hosts/shared/river.nix b/hosts/shared/river.nix index 3c2c17d..1ddeb9b 100644 --- a/hosts/shared/river.nix +++ b/hosts/shared/river.nix @@ -37,13 +37,14 @@ in { environment.systemPackages = builtins.attrValues { inherit (pkgs) - slurp - grim wf-recorder rofi-wayland kitty wl-clipboard ; + flameshot = pkgs.flameshot.override { + enableWlrSupport = true; + }; }; services.gnome.gnome-keyring.enable = true; diff --git a/hosts/shared/ssh.nix b/hosts/shared/ssh.nix index 3470a8c..bc97a13 100644 --- a/hosts/shared/ssh.nix +++ b/hosts/shared/ssh.nix @@ -11,7 +11,10 @@ in { config = lib.mkIf cfg.enable { programs = { - ssh.enableAskPassword = true; + ssh = { + enableAskPassword = true; + startAgent = true; + }; seahorse.enable = true; }; services.openssh.enable = true; diff --git a/hosts/shared/xonsh.nix b/hosts/shared/xonsh.nix index 93f6ed6..d4f5512 100644 --- a/hosts/shared/xonsh.nix +++ b/hosts/shared/xonsh.nix @@ -26,31 +26,65 @@ in { package = pkgs.xonsh.override { extraPackages = ps: [ (let - name = "xontrib-fish-completer"; + pname = "xontrib-fish-completer"; version = "0.0.1"; in ps.buildPythonPackage { - inherit name version; + inherit pname version; src = fetchFromGitHub { owner = "xonsh"; - repo = name; + repo = pname; rev = version; hash = "sha256-PhhdZ3iLPDEIG9uDeR5ctJ9zz2+YORHBhbsiLrJckyA="; }; }) (let - name = "xontrib-prompt-starship"; + pname = "xontrib-prompt-starship"; version = "0.3.6"; in ps.buildPythonPackage { - inherit name version; + inherit pname version; src = fetchFromGitHub { owner = "anki-code"; - repo = name; + repo = pname; tag = version; hash = "sha256-CLOvMa3L4XnH53H/k6/1W9URrPakPjbX1T1U43+eSR0="; }; }) + (let + pname = "xontrib-init-ssh-agent"; + version = "1.0.1"; + in + ps.buildPythonPackage { + inherit pname version; + pyproject = true; + build-system = [ + ps.setuptools + ps.wheel + ]; + dependencies = [ + ps.xonsh + ]; + src = fetchFromGitHub { + owner = "amadaluzia"; + repo = pname; + rev = "cac9cfec70ec15b0ed4f1c8a18154ea9b4f8fb47"; + hash = "sha256-UkRPdaZFNP8qv7lMwsTUalnre3k2UMfqMzmiTveLiBM="; + }; + }) + (let + pname = "xonsh-direnv"; + version = "1.6.5"; + in + ps.buildPythonPackage { + inherit pname version; + src = fetchFromGitHub { + owner = "74th"; + repo = pname; + tag = version; + hash = "sha256-huBJ7WknVCk+WgZaXHlL+Y1sqsn6TYqMP29/fsUPSyU="; + }; + }) ]; }; enable = true; diff --git a/overlays/derivations/starship.nix b/overlays/derivations/starship.nix index dbeeac8..02a4a89 100644 --- a/overlays/derivations/starship.nix +++ b/overlays/derivations/starship.nix @@ -15,6 +15,7 @@ vimcmd_symbol = "[<](bold green)"; }; cmake = {symbol = "cmake ";}; + cmd_duration = {format = "\\[[$duration]($style)\\] ";}; cobol = {symbol = "cobol ";}; conda = {symbol = "conda ";}; crystal = {symbol = "cr ";}; @@ -23,7 +24,7 @@ deno = {symbol = "deno ";}; directory = { read_only = " ro"; - format = ">[$path]($style)< "; + format = ":[$path]($style)\\] "; }; docker_context = {symbol = "docker ";}; dotnet = {symbol = ".NET ";}; @@ -32,7 +33,7 @@ fennel = {symbol = "fnl ";}; fossil_branch = {symbol = "fossil ";}; gcloud = {symbol = "gcp ";}; - git_branch = {symbol = "git ";}; + git_branch = {format = "\\[[$branch(:$remote_branch)]($style)\\] ";}; git_commit = {tag_symbol = " tag ";}; git_status = { ahead = ">"; @@ -40,6 +41,7 @@ deleted = "x"; diverged = "<>"; renamed = "r"; + format = "\\[[$all_status$ahead_behind]($style)\\] "; }; gleam = {symbol = "gleam ";}; golang = {symbol = "go ";}; @@ -54,7 +56,7 @@ meson = {symbol = "meson ";}; nats = {symbol = "nats ";}; nim = {symbol = "nim ";}; - nix_shell = {symbol = "nix ";}; + nix_shell = {format = "\\[[$state( \($name\))]($style)\\] ";}; nodejs = {symbol = "nodejs ";}; ocaml = {symbol = "ml ";}; opa = {symbol = "opa ";}; @@ -132,11 +134,11 @@ zig = {symbol = "zig ";}; username = { show_always = true; - format = "[$user]($style)@"; + format = "\\[[$user]($style)@"; }; hostname = { ssh_only = false; - format = "[$ssh_symbol$hostname]($style) "; + format = "[$ssh_symbol$hostname]($style)"; }; }; in