From 4d7fbc33a139d6484ae86c45b570b2c99fc737ef Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Thu, 4 Dec 2025 18:05:00 +0200 Subject: Test --- home/alacritty/default.nix | 79 ------------ home/cargo.nix | 46 +++++++ home/cargo/default.nix | 37 ------ home/chawan.nix | 22 ++++ home/chawan/default.nix | 22 ---- home/default.nix | 33 +++-- home/fast-p/README.md | 5 + home/fast-p/flake.lock | 27 +++++ home/fast-p/flake.nix | 49 ++++++++ home/fast-p/go.mod | 11 ++ home/fast-p/go.sum | 10 ++ home/fast-p/main.go | 147 ++++++++++++++++++++++ home/fast-p/result | 1 + home/fish.nix | 71 +++++++++++ home/fish/default.nix | 71 ----------- home/git.nix | 38 ++++++ home/git/default.nix | 38 ------ home/hyprlock.nix | 72 +++++++++++ home/hyprlock/default.nix | 72 ----------- home/lf.nix | 40 ++++++ home/lf/default.nix | 41 ------- home/mpv.nix | 25 ++++ home/mpv/default.nix | 25 ---- home/newsboat.nix | 59 +++++++++ home/newsboat/default.nix | 59 --------- home/tenere.nix | 16 +++ home/tenere/default.nix | 16 --- home/ticker.nix | 41 +++++++ home/ticker/default.nix | 41 ------- home/vale.nix | 31 +++++ home/vale/default.nix | 31 ----- home/walker.nix | 295 +++++++++++++++++++++++++++++++++++++++++++++ home/walker/default.nix | 295 --------------------------------------------- 33 files changed, 1022 insertions(+), 844 deletions(-) delete mode 100644 home/alacritty/default.nix create mode 100644 home/cargo.nix delete mode 100644 home/cargo/default.nix create mode 100644 home/chawan.nix delete mode 100644 home/chawan/default.nix create mode 100644 home/fast-p/README.md create mode 100644 home/fast-p/flake.lock create mode 100644 home/fast-p/flake.nix create mode 100644 home/fast-p/go.mod create mode 100644 home/fast-p/go.sum create mode 100644 home/fast-p/main.go create mode 120000 home/fast-p/result create mode 100644 home/fish.nix delete mode 100644 home/fish/default.nix create mode 100644 home/git.nix delete mode 100644 home/git/default.nix create mode 100644 home/hyprlock.nix delete mode 100644 home/hyprlock/default.nix create mode 100644 home/lf.nix delete mode 100644 home/lf/default.nix create mode 100644 home/mpv.nix delete mode 100644 home/mpv/default.nix create mode 100644 home/newsboat.nix delete mode 100644 home/newsboat/default.nix create mode 100644 home/tenere.nix delete mode 100644 home/tenere/default.nix create mode 100644 home/ticker.nix delete mode 100644 home/ticker/default.nix create mode 100644 home/vale.nix delete mode 100644 home/vale/default.nix create mode 100644 home/walker.nix delete mode 100644 home/walker/default.nix diff --git a/home/alacritty/default.nix b/home/alacritty/default.nix deleted file mode 100644 index 6fc9031..0000000 --- a/home/alacritty/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ vars, pkgs, ... }: - -{ - programs.alacritty = { - enable = true; - settings = { - general = { - live_config_reload = true; - }; - font = { - normal = { - family = "Fira Code"; - style = "Regular"; - }; - size = 11; - }; - scrolling.multiplier = 9; - selection.save_to_clipboard = true; - window = { - opacity = 0.9; - }; - colors = { - primary = { - background = "#2e3440"; - foreground = "#d8dee9"; - dim_foreground = "#a5abb6"; - }; - cursor = { - text = "#2e3440"; - cursor = "#d8dee9"; - }; - vi_mode_cursor = { - text = "#2e3440"; - cursor = "#d8dee9"; - }; - selection = { - text = "CellForeground"; - background = "#4c566a"; - }; - search = { - matches = { - foreground = "CellBackground"; - background = "#88c0d0"; - }; - }; - normal = { - black = "#3b4252"; - red = "#bf616a"; - green = "#a3be8c"; - yellow = "#ebcb8b"; - blue = "#81a1c1"; - magenta = "#b48ead"; - cyan = "#88c0d0"; - white = "#e5e9f0"; - }; - bright = { - black = "#4c566a"; - red = "#bf616a"; - green = "#a3be8c"; - yellow = "#ebcb8b"; - blue = "#81a1c1"; - magenta = "#b48ead"; - cyan = "#8fbcbb"; - white = "#eceff4"; - }; - dim = { - black = "#373e4d"; - red = "#94545d"; - green = "#809575"; - yellow = "#b29e75"; - blue = "#68809a"; - magenta = "#8c738c"; - cyan = "#6d96a5"; - white = "#aeb3bb"; - }; - }; - }; - }; -} diff --git a/home/cargo.nix b/home/cargo.nix new file mode 100644 index 0000000..d05fbe8 --- /dev/null +++ b/home/cargo.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: +{ + xdg.configFile."/home/petri/.cargo/config.toml".source = + (pkgs.formats.toml { }).generate "cargo-config" + { + registry = { + "global-credential-providers" = [ "cargo:token" ]; + }; + registries = { + "crates-io" = { + protocol = "sparse"; # The protocol to use to access crates.io. + }; + relesoft = { + index = "sparse+https://git.relesoft.io/api/packages/relesoft/cargo/"; + }; + }; + unstable = { + gc = true; + }; + target = { + x86_64-unknown-linux-gnu = { + linker = "${pkgs.clang}/bin/clang"; + rustflags = [ + "-C" + "link-arg=--ld-path=${pkgs.mold}/bin/mold" + ]; + }; + }; + "future-incompat-report" = { + frequency = "always"; # when to display a notification about a future incompat report + }; + cache = { + "auto-clean-frequency" = "1 day"; # How often to perform automatic cache cleaning + }; + term = { + color = "auto"; + hyperlinks = true; # whether cargo inserts links into output + unicode = true; # whether cargo can render output using non-ASCII unicode characters + progress = { + when = "auto"; # whether cargo shows progress bar + width = 80; # width of progress bar + "term-integration" = true; # whether cargo reports progress to terminal emulator + }; + }; + }; +} diff --git a/home/cargo/default.nix b/home/cargo/default.nix deleted file mode 100644 index b01ff1a..0000000 --- a/home/cargo/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, ... }: -{ - xdg.configFile."/home/petri/.cargo/config.toml".source = - (pkgs.formats.toml { }).generate "cargo-config" - { - registry = { - "global-credential-providers" = [ "cargo:token" ]; - }; - registries = { - "crates-io" = { - protocol = "sparse"; # The protocol to use to access crates.io. - }; - relesoft = { - index = "sparse+https://git.relesoft.io/api/packages/relesoft/cargo/"; - }; - }; - unstable = { - gc = true; - }; - "future-incompat-report" = { - frequency = "always"; # when to display a notification about a future incompat report - }; - cache = { - "auto-clean-frequency" = "1 day"; # How often to perform automatic cache cleaning - }; - term = { - color = "auto"; - hyperlinks = true; # whether cargo inserts links into output - unicode = true; # whether cargo can render output using non-ASCII unicode characters - progress = { - when = "auto"; # whether cargo shows progress bar - width = 80; # width of progress bar - "term-integration" = true; # whether cargo reports progress to terminal emulator - }; - }; - }; -} diff --git a/home/chawan.nix b/home/chawan.nix new file mode 100644 index 0000000..b343c11 --- /dev/null +++ b/home/chawan.nix @@ -0,0 +1,22 @@ +{ vars, pkgs, ... }: + +{ + xdg.configFile."/home/petri/.config/chawan/config.toml".text = '' + [buffer] + autofocus = true + images = true + styling = true + scripting = true + history = true + + [input] + vi-numeric-prefix = true + + [page] + # Here, the arrow function will be called with the vi numbered prefix if + # one was input, and with no argument otherwise. + # The numeric prefix can never be zero, so it is safe to test for undefined + # using the ternary operator. + G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()' + ''; +} diff --git a/home/chawan/default.nix b/home/chawan/default.nix deleted file mode 100644 index b343c11..0000000 --- a/home/chawan/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ vars, pkgs, ... }: - -{ - xdg.configFile."/home/petri/.config/chawan/config.toml".text = '' - [buffer] - autofocus = true - images = true - styling = true - scripting = true - history = true - - [input] - vi-numeric-prefix = true - - [page] - # Here, the arrow function will be called with the vi numbered prefix if - # one was input, and with no argument otherwise. - # The numeric prefix can never be zero, so it is safe to test for undefined - # using the ternary operator. - G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()' - ''; -} diff --git a/home/default.nix b/home/default.nix index 4a9fc86..9c86e81 100644 --- a/home/default.nix +++ b/home/default.nix @@ -13,31 +13,30 @@ let in { imports = [ - # ./alacritty # ./conky # ./helix # ./lf # ./quickshell (import ./nvim { inherit unstable; }) - ./cargo - ./chawan + ./cargo.nix + ./chawan.nix ./chromium.nix ./dav ./dunst ./fastfetch.nix ./firefox - ./fish - ./git + ./fish.nix + ./git.nix ./hyprland - ./hyprlock + ./hyprlock.nix ./mail - ./mpv - ./newsboat + ./mpv.nix + ./newsboat.nix ./nushell.nix - ./tenere - ./ticker - ./vale - ./walker + ./tenere.nix + ./ticker.nix + ./vale.nix + ./walker.nix ./wallpapers ./waybar ]; @@ -108,6 +107,7 @@ in }; programs = { + home-manager.enable = true; nix-search-tv = { enable = true; enableTelevisionIntegration = true; @@ -286,11 +286,10 @@ in controlPersist = "10m"; }; }; - - home-manager.enable = true; }; services = { + home-manager.autoExpire.enable = true; ssh-agent = { enable = true; enableFishIntegration = true; @@ -307,7 +306,9 @@ in port = 6600; }; }; - + wl-clip-persist = { + enable = true; + }; psd = { enable = true; backupLimit = 5; @@ -388,7 +389,6 @@ in # gui ghostty # terminal emulator hypridle - hyprlock hyprpaper libreoffice lxqt.pavucontrol-qt @@ -663,7 +663,6 @@ in }; home.file."/.local/bin/bt-notify.sh" = { - executable = true; source = pkgs.writeShellScript "bt-notify" '' set -euo pipefail diff --git a/home/fast-p/README.md b/home/fast-p/README.md new file mode 100644 index 0000000..344c387 --- /dev/null +++ b/home/fast-p/README.md @@ -0,0 +1,5 @@ +Should be run as nushell function + +def p [] { +^fd -e pdf | ^fast-p | ^fzf --read0 --reverse -e -d "\t" --preview-window "down:80%" --preview 'v=$(echo {q} | tr " " "|"); echo -e {1}"\n"{2} | grep -E "^|$v" -i --color=always;' | ^cut -z -f 1 -d "\t" | ^tr -d '\n' | ^xargs -r --null xdg-open > /dev/null err> /dev/null +} diff --git a/home/fast-p/flake.lock b/home/fast-p/flake.lock new file mode 100644 index 0000000..08c2bc9 --- /dev/null +++ b/home/fast-p/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1764677808, + "narHash": "sha256-H3lC7knbXOBrHI9hITQ7modLuX20mYJVhZORL5ioms0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1aab89277eb2d87823d5b69bae631a2496cff57a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home/fast-p/flake.nix b/home/fast-p/flake.nix new file mode 100644 index 0000000..f12cd44 --- /dev/null +++ b/home/fast-p/flake.nix @@ -0,0 +1,49 @@ +{ + description = "A Nix flake for building the fast-p Go binary"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + }; + + outputs = + { self, nixpkgs }: + let + # Support multiple systems + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + # Helper function to generate outputs for each system + forEachSystem = + f: + nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + } + ); + + in + { + packages = forEachSystem ( + { system, pkgs }: + { + default = pkgs.buildGoModule { + pname = "fast-p"; + version = "0.1.0"; + src = ./.; + vendorHash = "sha256-/lKWY6NZrw8aGe1/R2jspT4EZQxAxP0ujckpwZQGn2w="; # Run `nix build` to get actual hash + }; + } + ); + + devShells = forEachSystem ( + { pkgs, ... }: + { + default = pkgs.mkShell { packages = with pkgs; [ go ]; }; + } + ); + }; +} diff --git a/home/fast-p/go.mod b/home/fast-p/go.mod new file mode 100644 index 0000000..2d2c9a3 --- /dev/null +++ b/home/fast-p/go.mod @@ -0,0 +1,11 @@ +module fast-p + +go 1.25.4 + +require ( + github.com/boltdb/bolt v1.3.1 + github.com/cespare/xxhash v1.1.0 + github.com/mitchellh/go-homedir v1.1.0 +) + +require golang.org/x/sys v0.38.0 // indirect diff --git a/home/fast-p/go.sum b/home/fast-p/go.sum new file mode 100644 index 0000000..34025f4 --- /dev/null +++ b/home/fast-p/go.sum @@ -0,0 +1,10 @@ +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= diff --git a/home/fast-p/main.go b/home/fast-p/main.go new file mode 100644 index 0000000..409c2c2 --- /dev/null +++ b/home/fast-p/main.go @@ -0,0 +1,147 @@ +package main + +import ( + "bufio" + "encoding/hex" + "flag" + "fmt" + "github.com/boltdb/bolt" + "github.com/cespare/xxhash" + "github.com/mitchellh/go-homedir" + "io" + "log" + "os" + "os/exec" + "path/filepath" +) + +func hash_file_xxhash(filePath string) (string, error) { + var returnMD5String string + file, err := os.Open(filePath) + if err != nil { + return returnMD5String, err + } + defer file.Close() + hash := xxhash.New() + if _, err := io.Copy(hash, file); err != nil { + return returnMD5String, err + } + hashInBytes := hash.Sum(nil)[:] + returnMD5String = hex.EncodeToString(hashInBytes) + return returnMD5String, nil + +} + +func main() { + flag.Usage = func() { + fmt.Printf(`Usage: fast-p [OPTIONS] + Reads a list of PDF filenames from STDIN and returns a list of null-byte + separated items of the form + filename[TAB]text + where "text" is the text extracted from the first two pages of the PDF + by pdftotext and [TAB] denotes a tab character "\t". + + Common usage of this tool is to pipe the result to FZF with a command in + your .bashrc as explained in https://github.com/bellecp/fast-p. + + +`) + flag.PrintDefaults() + } + version := flag.Bool("version", false, "Display program version") + clearCache := flag.Bool("clear-cache", false, "Delete cache file located at: \n~/.cache/fast-p-pdftotext-output/fast-p_cached_pdftotext_output.db") + flag.Parse() + + if *version != false { + fmt.Printf("v.0.2.5 \nhttps://github.com/bellecp/fast-p\n") + os.Exit(0) + } + + if *clearCache != false { + removePath, err := homedir.Expand("~/.cache/fast-p-pdftotext-output/fast-p_cached_pdftotext_output.db") + if err != nil { + log.Fatal(err) + os.Exit(1) + } + os.Remove(removePath) + os.Exit(0) + } + + // Create ~/.cache folder if does not exist + // https://stackoverflow.com/questions/37932551/mkdir-if-not-exists-using-golang + cachePath, err := homedir.Expand("~/.cache/fast-p-pdftotext-output/") + os.MkdirAll(cachePath, os.ModePerm) + + // open BoltDB cache database + scanner := bufio.NewScanner(os.Stdin) + boltDbFilepath := filepath.Join(cachePath, "fast-p_cached_pdftotext_output.db") + if err != nil { + log.Fatal(err) + } + db, err := bolt.Open(boltDbFilepath, 0600, nil) + bucketName := "fast-p_bucket_for_cached_pdftotext_output" + if err != nil { + log.Fatal(err) + } + defer db.Close() + + nullByte := "\u0000" + + db.Update(func(tx *bolt.Tx) error { + _, err := tx.CreateBucketIfNotExists([]byte(bucketName)) + if err != nil { + return fmt.Errorf("create bucket: %s", err) + } + return nil + }) + + missing := make(map[string]string) + alreadySeen := make(map[string]bool) + + for scanner.Scan() { + filepath := scanner.Text() + hash, err := hash_file_xxhash(filepath) + if alreadySeen[hash] != true { + alreadySeen[hash] = true + if err != nil { + log.Println("err", hash) + } + var content string + found := false + err2 := db.View(func(tx *bolt.Tx) error { + b := tx.Bucket([]byte(bucketName)) + v := b.Get([]byte(hash)) + if v != nil { + found = true + content = string(v) + } + return nil + }) + if err2 != nil { + log.Println(err2) + } + if found == true { + fmt.Println(filepath + "\t" + content + nullByte) + } else { + missing[hash] = filepath + } + } + } + for hash, filepath := range missing { + cmd := exec.Command("pdftotext", "-l", "2", filepath, "-") + out, err := cmd.CombinedOutput() + content := string(out) + if err != nil { + log.Println(err) + } + fmt.Println(filepath + "\t" + content + nullByte) + db.Update(func(tx *bolt.Tx) error { + b := tx.Bucket([]byte(bucketName)) + err := b.Put([]byte(hash), []byte(content)) + if err != nil { + fmt.Println(err) + } + return nil + }) + } +} diff --git a/home/fast-p/result b/home/fast-p/result new file mode 120000 index 0000000..7fb87ab --- /dev/null +++ b/home/fast-p/result @@ -0,0 +1 @@ +/nix/store/d43jc4b5dgpf071kgws69x8jk6ps5rz5-fast-p-0.1.0 \ No newline at end of file diff --git a/home/fish.nix b/home/fish.nix new file mode 100644 index 0000000..65e033a --- /dev/null +++ b/home/fish.nix @@ -0,0 +1,71 @@ +{ pkgs, ... }: + +{ + programs.fish = { + enable = true; + shellAliases = { + browser = "${pkgs.chawan}/bin/cha"; + cat = "${pkgs.gat}/bin/gat"; + fj = "${pkgs.forgejo-cli}/bin/fj --host git.relesoft.io"; + gmail = "${pkgs.himalaya}/himalaya envelope list --account gmail --folder gmail/Inbox 'not flag Seen'"; + grep = "${pkgs.ripgrep}/bin/rg"; + http = "${pkgs.xh}/bin/xh"; + journalctl = "${pkgs.systemd}/bin/journalctl --output=short-iso"; + l = "${pkgs.eza}/bin/eza -l --icons --git -a"; + llm = "${pkgs.tenere}/bin/tenere"; + ls = "${pkgs.eza}/bin/eza -a --group-directories-first"; + lt = "${pkgs.eza}/bin/eza --tree --level=2 --long --icons --git"; + ns = "nix-search-tv print | fzf --preview 'nix-search-tv preview {}' --scheme history"; + relesoft = "${pkgs.himalaya}/himalaya envelope list --account relesoft --folder relesoft/Inbox 'not flag Seen'"; + ssh = "TERM=xterm-256color ${pkgs.openssh}/bin/ssh"; + stocks = "${pkgs.ticker}/bin/ticker --config /home/petri/.config/ticker/config.yaml"; + weather = "${pkgs.wthrr}/bin/wthrr --forecast d"; + wifi = "${pkgs.impala}/bin/impala"; + youtube = "${pkgs.pipe-viewer}/bin/pipe-viewer"; + }; + functions = { + doc = '' + ${pkgs.asciidoctor}/bin/asciidoctor --backend xhtml5 --out-file - "$argv[1]"|${pkgs.chawan}/bin/cha -T application/xhtml+xml + ''; + bookmark = '' + set -l Shiori_URL "https://shiori.tammi.cc" + set -l Username "petri" + set -l token (${pkgs.curl}/bin/curl -s -X POST -H "Content-Type: application/json" -d '{"username": "'$Username'", "password": "'$SHIORI_PASSWORD'", "remember": true}' $Shiori_URL/api/v1/auth/login | string match -r '(?<="token":")[^"]*') + ${pkgs.curl}/bin/curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{ "url": "'$argv[1]'", "createArchive": true, "public": 1 }' $Shiori_URL/api/bookmarks + ''; + share = '' + ${pkgs.curl}/bin/curl -X PUT --data-binary @$argv[1] https://bin.tammi.cc >&2 + ''; + import = '' + ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" $argv + ''; + readdoc = "${pkgs.reader}/bin/reader $argv --markdown-output | ${pkgs.moor}/bin/moor --wrap --lang markdown"; + }; + interactiveShellInit = '' + set -g fish_key_bindings fish_vi_key_bindings + + set -g __fish_git_prompt_show_informative_status 1 + + set -g __fish_git_prompt_color_branch magenta --bold + set -g __fish_git_prompt_showupstream "informative" + set -g __fish_git_prompt_char_upstream_ahead "↑ " + set -g __fish_git_prompt_char_upstream_behind "↓ " + set -g __fish_git_prompt_char_upstream_prefix "" + + set -g __fish_git_prompt_char_stagedstate "● " + set -g __fish_git_prompt_char_dirtystate "✚" + set -g __fish_git_prompt_char_untrackedfiles "…" + set -g __fish_git_prompt_char_conflictedstate "✖" + set -g __fish_git_prompt_char_cleanstate "✔" + + set -g __fish_git_prompt_color_dirtystate blue + set -g __fish_git_prompt_color_stagedstate yellow + set -g __fish_git_prompt_color_invalidstate red + set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal + set -g __fish_git_prompt_color_cleanstate green --bold + + set fish_greeting + ${pkgs.fastfetch}/bin/fastfetch + ''; + }; +} diff --git a/home/fish/default.nix b/home/fish/default.nix deleted file mode 100644 index 65e033a..0000000 --- a/home/fish/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ pkgs, ... }: - -{ - programs.fish = { - enable = true; - shellAliases = { - browser = "${pkgs.chawan}/bin/cha"; - cat = "${pkgs.gat}/bin/gat"; - fj = "${pkgs.forgejo-cli}/bin/fj --host git.relesoft.io"; - gmail = "${pkgs.himalaya}/himalaya envelope list --account gmail --folder gmail/Inbox 'not flag Seen'"; - grep = "${pkgs.ripgrep}/bin/rg"; - http = "${pkgs.xh}/bin/xh"; - journalctl = "${pkgs.systemd}/bin/journalctl --output=short-iso"; - l = "${pkgs.eza}/bin/eza -l --icons --git -a"; - llm = "${pkgs.tenere}/bin/tenere"; - ls = "${pkgs.eza}/bin/eza -a --group-directories-first"; - lt = "${pkgs.eza}/bin/eza --tree --level=2 --long --icons --git"; - ns = "nix-search-tv print | fzf --preview 'nix-search-tv preview {}' --scheme history"; - relesoft = "${pkgs.himalaya}/himalaya envelope list --account relesoft --folder relesoft/Inbox 'not flag Seen'"; - ssh = "TERM=xterm-256color ${pkgs.openssh}/bin/ssh"; - stocks = "${pkgs.ticker}/bin/ticker --config /home/petri/.config/ticker/config.yaml"; - weather = "${pkgs.wthrr}/bin/wthrr --forecast d"; - wifi = "${pkgs.impala}/bin/impala"; - youtube = "${pkgs.pipe-viewer}/bin/pipe-viewer"; - }; - functions = { - doc = '' - ${pkgs.asciidoctor}/bin/asciidoctor --backend xhtml5 --out-file - "$argv[1]"|${pkgs.chawan}/bin/cha -T application/xhtml+xml - ''; - bookmark = '' - set -l Shiori_URL "https://shiori.tammi.cc" - set -l Username "petri" - set -l token (${pkgs.curl}/bin/curl -s -X POST -H "Content-Type: application/json" -d '{"username": "'$Username'", "password": "'$SHIORI_PASSWORD'", "remember": true}' $Shiori_URL/api/v1/auth/login | string match -r '(?<="token":")[^"]*') - ${pkgs.curl}/bin/curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{ "url": "'$argv[1]'", "createArchive": true, "public": 1 }' $Shiori_URL/api/bookmarks - ''; - share = '' - ${pkgs.curl}/bin/curl -X PUT --data-binary @$argv[1] https://bin.tammi.cc >&2 - ''; - import = '' - ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" $argv - ''; - readdoc = "${pkgs.reader}/bin/reader $argv --markdown-output | ${pkgs.moor}/bin/moor --wrap --lang markdown"; - }; - interactiveShellInit = '' - set -g fish_key_bindings fish_vi_key_bindings - - set -g __fish_git_prompt_show_informative_status 1 - - set -g __fish_git_prompt_color_branch magenta --bold - set -g __fish_git_prompt_showupstream "informative" - set -g __fish_git_prompt_char_upstream_ahead "↑ " - set -g __fish_git_prompt_char_upstream_behind "↓ " - set -g __fish_git_prompt_char_upstream_prefix "" - - set -g __fish_git_prompt_char_stagedstate "● " - set -g __fish_git_prompt_char_dirtystate "✚" - set -g __fish_git_prompt_char_untrackedfiles "…" - set -g __fish_git_prompt_char_conflictedstate "✖" - set -g __fish_git_prompt_char_cleanstate "✔" - - set -g __fish_git_prompt_color_dirtystate blue - set -g __fish_git_prompt_color_stagedstate yellow - set -g __fish_git_prompt_color_invalidstate red - set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal - set -g __fish_git_prompt_color_cleanstate green --bold - - set fish_greeting - ${pkgs.fastfetch}/bin/fastfetch - ''; - }; -} diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..d8445cc --- /dev/null +++ b/home/git.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: +{ + programs.diff-so-fancy = { + enable = true; + enableGitIntegration = true; + }; + programs.git = { + enable = true; + signing = { + signByDefault = true; + format = "ssh"; + }; + lfs = { + enable = true; + }; + settings = { + alias = { + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + }; + user = { + email = "petri.hienonen@gmail.com"; + name = "Petri Hienonen"; + signingkey = "~/.ssh/id_ed25519.pub"; + }; + core = { + editor = "${pkgs.neovim}/bin/nvim"; + hooksPath = ".githooks/"; + quotepath = false; + }; + credential.helper = "store"; + init.defaultBranch = "master"; + merge.conflictStyle = "diff3"; + pull.rebase = true; + tag.gpgSign = true; + }; + maintenance.enable = true; + }; +} diff --git a/home/git/default.nix b/home/git/default.nix deleted file mode 100644 index d8445cc..0000000 --- a/home/git/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ pkgs, ... }: -{ - programs.diff-so-fancy = { - enable = true; - enableGitIntegration = true; - }; - programs.git = { - enable = true; - signing = { - signByDefault = true; - format = "ssh"; - }; - lfs = { - enable = true; - }; - settings = { - alias = { - lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; - }; - user = { - email = "petri.hienonen@gmail.com"; - name = "Petri Hienonen"; - signingkey = "~/.ssh/id_ed25519.pub"; - }; - core = { - editor = "${pkgs.neovim}/bin/nvim"; - hooksPath = ".githooks/"; - quotepath = false; - }; - credential.helper = "store"; - init.defaultBranch = "master"; - merge.conflictStyle = "diff3"; - pull.rebase = true; - tag.gpgSign = true; - }; - maintenance.enable = true; - }; -} diff --git a/home/hyprlock.nix b/home/hyprlock.nix new file mode 100644 index 0000000..4627556 --- /dev/null +++ b/home/hyprlock.nix @@ -0,0 +1,72 @@ +{ vars, pkgs, ... }: + +{ + programs.hyprlock = { + enable = true; + settings = { + general = { + grace = 300; + hide_cursor = true; + ignore_empty_input = true; + }; + + animations = { + enabled = true; + bezier = "linear, 1, 1, 0, 0"; + animation = [ + "fadeIn, 1, 5, linear" + "fadeOut, 1, 5, linear" + "inputFieldDots, 1, 2, linear" + ]; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + shadow_passes = 2; + } + ]; + + label = [ + # Clock with seconds + { + monitor = ""; + text = "cmd[update:1000] echo \"$(date +'%H:%M:%S')\""; + color = "rgb(202, 211, 245)"; + font_size = 90; + position = "0, 150"; + halign = "center"; + valign = "center"; + shadow_passes = 2; + } + # Date in ISO format + { + monitor = ""; + text = "cmd[update:1000] echo \"$(date +'%Y-%m-%d')\""; + color = "rgb(202, 211, 245)"; + font_size = 25; + position = "0, 50"; + halign = "center"; + valign = "center"; + shadow_passes = 2; + } + ]; + }; + }; +} diff --git a/home/hyprlock/default.nix b/home/hyprlock/default.nix deleted file mode 100644 index 4627556..0000000 --- a/home/hyprlock/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ vars, pkgs, ... }: - -{ - programs.hyprlock = { - enable = true; - settings = { - general = { - grace = 300; - hide_cursor = true; - ignore_empty_input = true; - }; - - animations = { - enabled = true; - bezier = "linear, 1, 1, 0, 0"; - animation = [ - "fadeIn, 1, 5, linear" - "fadeOut, 1, 5, linear" - "inputFieldDots, 1, 2, linear" - ]; - }; - - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - } - ]; - - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 5; - shadow_passes = 2; - } - ]; - - label = [ - # Clock with seconds - { - monitor = ""; - text = "cmd[update:1000] echo \"$(date +'%H:%M:%S')\""; - color = "rgb(202, 211, 245)"; - font_size = 90; - position = "0, 150"; - halign = "center"; - valign = "center"; - shadow_passes = 2; - } - # Date in ISO format - { - monitor = ""; - text = "cmd[update:1000] echo \"$(date +'%Y-%m-%d')\""; - color = "rgb(202, 211, 245)"; - font_size = 25; - position = "0, 50"; - halign = "center"; - valign = "center"; - shadow_passes = 2; - } - ]; - }; - }; -} diff --git a/home/lf.nix b/home/lf.nix new file mode 100644 index 0000000..4923fcb --- /dev/null +++ b/home/lf.nix @@ -0,0 +1,40 @@ +{ pkgs, ... }: +{ + programs.lf = { + enable = true; + commands = { + editor-open = ''$$EDITOR $f''; + }; + settings = { + preview = true; + hidden = true; + drawbox = true; + icons = true; + ignorecase = true; + timefmt = "2006-01-02T15:04:05.999Z"; + }; + previewer.source = "/home/petri/.config/lf/pv.sh"; + keybindings = { + ee = "editor-open"; + }; + }; + + xdg.configFile."/home/petri/.config/lf/icons".source = ./icons; + xdg.configFile."/home/petri/.config/lf/pv.sh" = { + executable = true; + source = pkgs.writeShellScript "pv" '' + case "$1" in + *.jpg*) timg -I "$1";; + *.png*) timg -I "$1";; + *.webp*) timg -I "$1";; + *.avif*) timg -I "$1";; + *.tar*) tar tf "$1";; + *.zip) unzip -l "$1";; + *.rar) unrar l "$1";; + *.7z) 7z l "$1";; + *.pdf) pdftotext "$1" -;; + *) pistol "$1";; + esac + ''; + }; +} diff --git a/home/lf/default.nix b/home/lf/default.nix deleted file mode 100644 index dae7e7f..0000000 --- a/home/lf/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ pkgs, ... }: -{ - programs.lf = { - enable = true; - commands = { - editor-open = ''$$EDITOR $f''; - }; - settings = { - preview = true; - hidden = true; - drawbox = true; - icons = true; - ignorecase = true; - timefmt = "2006-01-02T15:04:05.999Z"; - }; - previewer.source = "/home/petri/.config/lf/pv.sh"; - keybindings = { - ee = "editor-open"; - }; - }; - - xdg.configFile."/home/petri/.config/lf/icons".source = ./icons; - xdg.configFile."/home/petri/.config/lf/pv.sh" = { - executable = true; - text = '' - #!/bin/sh - case "$1" in - *.jpg*) timg -I "$1";; - *.png*) timg -I "$1";; - *.webp*) timg -I "$1";; - *.avif*) timg -I "$1";; - *.tar*) tar tf "$1";; - *.zip) unzip -l "$1";; - *.rar) unrar l "$1";; - *.7z) 7z l "$1";; - *.pdf) pdftotext "$1" -;; - *) pistol "$1";; - esac - ''; - }; -} diff --git a/home/mpv.nix b/home/mpv.nix new file mode 100644 index 0000000..0c403a7 --- /dev/null +++ b/home/mpv.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + programs.mpv = { + enable = true; + + package = ( + pkgs.mpv-unwrapped.wrapper { + scripts = with pkgs.mpvScripts; [ + uosc + sponsorblock + ]; + + mpv = pkgs.mpv-unwrapped.override { waylandSupport = true; }; + } + ); + + config = { + profile = "high-quality"; + ytdl-format = "bestvideo+bestaudio"; + cache = "yes"; + demuxer-max-bytes = "512MiB"; + demuxer-readahead-secs = "20"; + }; + }; +} diff --git a/home/mpv/default.nix b/home/mpv/default.nix deleted file mode 100644 index 0c403a7..0000000 --- a/home/mpv/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: -{ - programs.mpv = { - enable = true; - - package = ( - pkgs.mpv-unwrapped.wrapper { - scripts = with pkgs.mpvScripts; [ - uosc - sponsorblock - ]; - - mpv = pkgs.mpv-unwrapped.override { waylandSupport = true; }; - } - ); - - config = { - profile = "high-quality"; - ytdl-format = "bestvideo+bestaudio"; - cache = "yes"; - demuxer-max-bytes = "512MiB"; - demuxer-readahead-secs = "20"; - }; - }; -} diff --git a/home/newsboat.nix b/home/newsboat.nix new file mode 100644 index 0000000..c95b95a --- /dev/null +++ b/home/newsboat.nix @@ -0,0 +1,59 @@ +{ + vars, + config, + pkgs, + ... +}: + +{ + xdg.configFile."/home/petri/.config/newsboat/urls".text = '' + "query:Unread Articles:unread = \"yes\"" + ''; + + programs.newsboat = { + enable = true; + autoReload = true; + browser = "\"${pkgs.chawan}/bin/cha %u\""; + reloadTime = 2; + extraConfig = '' + # special + macro o set browser "rdrview -T title,body -B cha %u" ; open-in-browser ; set browser "cha %u" + + # download + prepopulate-query-feeds yes + download-full-page yes + urls-source "miniflux" + miniflux-url "https://flux.tammi.cc" + miniflux-tokenfile ${config.age.secrets.miniflux_api_key.path} + + # operation + goto-next-feed no + miniflux-show-special-feeds "no" + feed-sort-order unreadarticlecount-asc + article-sort-order date-asc + + # keys + bind-key j down + bind-key k up + bind-key j next articlelist + bind-key k prev articlelist + bind-key J next-feed articlelist + bind-key K prev-feed articlelist + bind-key G end + bind-key g home + bind-key d pagedown + bind-key u pageup + bind-key l open + bind-key h quit + bind-key a toggle-article-read + bind-key n next-unread + bind-key N prev-unread + bind-key D pb-download + bind-key U show-urls + bind-key x pb-delete + bind-key o open-in-browser + + include ${pkgs.newsboat}/share/doc/newsboat/contrib/colorschemes/solarized-dark + ''; + }; +} diff --git a/home/newsboat/default.nix b/home/newsboat/default.nix deleted file mode 100644 index c95b95a..0000000 --- a/home/newsboat/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - vars, - config, - pkgs, - ... -}: - -{ - xdg.configFile."/home/petri/.config/newsboat/urls".text = '' - "query:Unread Articles:unread = \"yes\"" - ''; - - programs.newsboat = { - enable = true; - autoReload = true; - browser = "\"${pkgs.chawan}/bin/cha %u\""; - reloadTime = 2; - extraConfig = '' - # special - macro o set browser "rdrview -T title,body -B cha %u" ; open-in-browser ; set browser "cha %u" - - # download - prepopulate-query-feeds yes - download-full-page yes - urls-source "miniflux" - miniflux-url "https://flux.tammi.cc" - miniflux-tokenfile ${config.age.secrets.miniflux_api_key.path} - - # operation - goto-next-feed no - miniflux-show-special-feeds "no" - feed-sort-order unreadarticlecount-asc - article-sort-order date-asc - - # keys - bind-key j down - bind-key k up - bind-key j next articlelist - bind-key k prev articlelist - bind-key J next-feed articlelist - bind-key K prev-feed articlelist - bind-key G end - bind-key g home - bind-key d pagedown - bind-key u pageup - bind-key l open - bind-key h quit - bind-key a toggle-article-read - bind-key n next-unread - bind-key N prev-unread - bind-key D pb-download - bind-key U show-urls - bind-key x pb-delete - bind-key o open-in-browser - - include ${pkgs.newsboat}/share/doc/newsboat/contrib/colorschemes/solarized-dark - ''; - }; -} diff --git a/home/tenere.nix b/home/tenere.nix new file mode 100644 index 0000000..f7cfa29 --- /dev/null +++ b/home/tenere.nix @@ -0,0 +1,16 @@ +{ + config, + inputs, + pkgs, + ... +}: +{ + xdg.configFile."/tenere/config.toml".text = '' + llm = "chatgpt" + + [chatgpt] + openai_api_key = $(${pkgs.coreutils}/bin/cat ${config.age.secrets.openai_auth_token.path}) + model = "gpt-4.1" + url = "https://api.openai.com/v1/chat/completions" + ''; +} diff --git a/home/tenere/default.nix b/home/tenere/default.nix deleted file mode 100644 index f7cfa29..0000000 --- a/home/tenere/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - inputs, - pkgs, - ... -}: -{ - xdg.configFile."/tenere/config.toml".text = '' - llm = "chatgpt" - - [chatgpt] - openai_api_key = $(${pkgs.coreutils}/bin/cat ${config.age.secrets.openai_auth_token.path}) - model = "gpt-4.1" - url = "https://api.openai.com/v1/chat/completions" - ''; -} diff --git a/home/ticker.nix b/home/ticker.nix new file mode 100644 index 0000000..be2f509 --- /dev/null +++ b/home/ticker.nix @@ -0,0 +1,41 @@ +{ inputs, pkgs, ... }: +{ + xdg.configFile."/home/petri/.config/ticker/config.yaml".text = '' + show-summary: true + show-tags: true + show-fundamentals: true + show-separator: true + show-holdings: true + interval: 5 + currency: EUR + currency-summary-only: false + watchlist: + - NET + - TEAM + - ESTC + - BTC-USD # Bitcoin price via Yahoo + - SOL.X # Solana price via CoinGecko + - SAMOYEDCOIN.CG # Samoyed price via CoinGecko + - CARDANO.CC # Samoyed price via CoinCap + lots: + - symbol: "ABNB" + quantity: 35.0 + unit_cost: 146.00 + - symbol: "ARKW" + quantity: 20.0 + unit_cost: 152.25 + - symbol: "ARKW" + quantity: 20.0 + unit_cost: 145.35 + fixed_cost: 7.00 # e.g. brokerage commission fee + groups: + - name: crypto + watchlist: + - SHIB-USD + - VGX-USD + holdings: + - symbol: SOL1-USD + quantity: 17 + unit_cost: 159.10 + ''; +} diff --git a/home/ticker/default.nix b/home/ticker/default.nix deleted file mode 100644 index be2f509..0000000 --- a/home/ticker/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ inputs, pkgs, ... }: -{ - xdg.configFile."/home/petri/.config/ticker/config.yaml".text = '' - show-summary: true - show-tags: true - show-fundamentals: true - show-separator: true - show-holdings: true - interval: 5 - currency: EUR - currency-summary-only: false - watchlist: - - NET - - TEAM - - ESTC - - BTC-USD # Bitcoin price via Yahoo - - SOL.X # Solana price via CoinGecko - - SAMOYEDCOIN.CG # Samoyed price via CoinGecko - - CARDANO.CC # Samoyed price via CoinCap - lots: - - symbol: "ABNB" - quantity: 35.0 - unit_cost: 146.00 - - symbol: "ARKW" - quantity: 20.0 - unit_cost: 152.25 - - symbol: "ARKW" - quantity: 20.0 - unit_cost: 145.35 - fixed_cost: 7.00 # e.g. brokerage commission fee - groups: - - name: crypto - watchlist: - - SHIB-USD - - VGX-USD - holdings: - - symbol: SOL1-USD - quantity: 17 - unit_cost: 159.10 - ''; -} diff --git a/home/vale.nix b/home/vale.nix new file mode 100644 index 0000000..79712ea --- /dev/null +++ b/home/vale.nix @@ -0,0 +1,31 @@ +{ inputs, pkgs, ... }: +{ + + xdg.configFile."/home/petri/.config/vale/.vale.ini".text = '' + MinAlertLevel = suggestion + StylesPath = ${pkgs.valeStyles.microsoft}/share/vale/styles + Packages = Microsoft + # Vocab = myterms does not work because expects styles to be in the same folder + + [asciidoctor] + experimental = YES + attribute-missing = drop + + [*.adoc] + BasedOnStyles = Vale, Microsoft + + [*.{md,rst}] + BasedOnStyles = Vale, Microsoft + ''; + + xdg.configFile."/home/petri/.config/vale/config/vocabularies/myterms/accept.txt".text = '' + Relesoft + ERTMS + ETCS + YAML + TOML + FTIA + GRK + EULYNX + ''; +} diff --git a/home/vale/default.nix b/home/vale/default.nix deleted file mode 100644 index 79712ea..0000000 --- a/home/vale/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ inputs, pkgs, ... }: -{ - - xdg.configFile."/home/petri/.config/vale/.vale.ini".text = '' - MinAlertLevel = suggestion - StylesPath = ${pkgs.valeStyles.microsoft}/share/vale/styles - Packages = Microsoft - # Vocab = myterms does not work because expects styles to be in the same folder - - [asciidoctor] - experimental = YES - attribute-missing = drop - - [*.adoc] - BasedOnStyles = Vale, Microsoft - - [*.{md,rst}] - BasedOnStyles = Vale, Microsoft - ''; - - xdg.configFile."/home/petri/.config/vale/config/vocabularies/myterms/accept.txt".text = '' - Relesoft - ERTMS - ETCS - YAML - TOML - FTIA - GRK - EULYNX - ''; -} diff --git a/home/walker.nix b/home/walker.nix new file mode 100644 index 0000000..6887606 --- /dev/null +++ b/home/walker.nix @@ -0,0 +1,295 @@ +{ config, pkgs, ... }: + +{ + + services.walker = { + enable = true; + systemd.enable = true; + settings = { + app_launch_prefix = ""; + terminal_title_flag = ""; + locale = ""; + close_when_open = false; + theme = "default"; + monitor = ""; + hotreload_theme = false; + as_window = false; + timeout = 0; + disable_click_to_close = false; + force_keyboard_focus = false; + + keys = { + accept_typeahead = [ "tab" ]; + trigger_labels = "lalt"; + next = [ "down" ]; + prev = [ "up" ]; + close = [ "esc" ]; + remove_from_history = [ "shift backspace" ]; + resume_query = [ "ctrl r" ]; + toggle_exact_search = [ "ctrl m" ]; + + activation_modifiers = { + keep_open = "shift"; + alternate = "alt"; + }; + + ai = { + clear_session = [ "ctrl x" ]; + copy_last_response = [ "ctrl c" ]; + resume_session = [ "ctrl r" ]; + run_last_response = [ "ctrl e" ]; + }; + }; + + events = { + on_activate = ""; + on_selection = ""; + on_exit = ""; + on_launch = ""; + on_query_change = ""; + }; + + list = { + dynamic_sub = true; + keyboard_scroll_style = "emacs"; + max_entries = 50; + show_initial_entries = true; + single_click = true; + visibility_threshold = 20; + placeholder = "No Results"; + }; + + search = { + argument_delimiter = "#"; + placeholder = "Search..."; + delay = 0; + resume_last_query = false; + }; + + activation_mode = { + labels = "jkl;asdf"; + }; + + builtins = { + applications = { + weight = 5; + name = "applications"; + placeholder = "Applications"; + prioritize_new = true; + hide_actions_with_empty_query = true; + context_aware = true; + refresh = true; + show_sub_when_single = true; + show_icon_when_single = true; + show_generic = true; + history = true; + + actions = { + enabled = true; + hide_category = false; + hide_without_query = true; + }; + }; + + bookmarks = { + weight = 5; + placeholder = "Bookmarks"; + name = "bookmarks"; + icon = "bookmark"; + switcher_only = true; + + entries = [ + { + label = "Walker"; + url = "https://github.com/abenz1267/walker"; + keywords = [ + "walker" + "github" + ]; + } + ]; + }; + + xdph_picker = { + hidden = true; + weight = 5; + placeholder = "Screen/Window Picker"; + show_sub_when_single = true; + name = "xdphpicker"; + switcher_only = true; + }; + + ai = { + weight = 5; + placeholder = "AI"; + name = "ai"; + icon = "help-browser"; + switcher_only = true; + show_sub_when_single = true; + + anthropic = { + prompts = [ + { + model = "claude-3-7-sonnet-20250219"; + temperature = 1; + max_tokens = 1000; + label = "General Assistant"; + prompt = "You are a helpful general assistant. Keep your answers short and precise."; + } + ]; + }; + }; + + calc = { + require_number = true; + weight = 5; + name = "calc"; + icon = "accessories-calculator"; + placeholder = "Calculator"; + min_chars = 4; + }; + + windows = { + weight = 5; + icon = "view-restore"; + name = "windows"; + placeholder = "Windows"; + show_icon_when_single = true; + }; + + clipboard = { + always_put_new_on_top = true; + exec = "${pkgs.wl-clipboard}/bin/wl-copy"; + weight = 5; + name = "clipboard"; + avoid_line_breaks = true; + placeholder = "Clipboard"; + image_height = 300; + max_entries = 10; + switcher_only = true; + }; + + commands = { + weight = 5; + icon = "utilities-terminal"; + switcher_only = true; + name = "commands"; + placeholder = "Commands"; + }; + + custom_commands = { + weight = 5; + icon = "utilities-terminal"; + name = "custom_commands"; + placeholder = "Custom Commands"; + }; + + emojis = { + exec = "${pkgs.wl-clipboard}/bin/wl-copy"; + weight = 5; + name = "emojis"; + placeholder = "Emojis"; + switcher_only = true; + history = true; + typeahead = true; + show_unqualified = false; + }; + + symbols = { + after_copy = ""; + weight = 5; + name = "symbols"; + placeholder = "Symbols"; + switcher_only = true; + history = true; + typeahead = true; + }; + + finder = { + use_fd = false; + fd_flags = "--ignore-vcs --type file"; + weight = 5; + icon = "file"; + name = "finder"; + placeholder = "Finder"; + switcher_only = true; + ignore_gitignore = true; + refresh = true; + concurrency = 8; + show_icon_when_single = true; + preview_images = false; + }; + + runner = { + eager_loading = true; + weight = 5; + icon = "utilities-terminal"; + name = "runner"; + placeholder = "Runner"; + typeahead = true; + history = true; + generic_entry = false; + refresh = true; + use_fd = false; + }; + + ssh = { + weight = 5; + icon = "preferences-system-network"; + name = "ssh"; + placeholder = "SSH"; + switcher_only = true; + history = true; + refresh = true; + }; + + switcher = { + weight = 5; + name = "switcher"; + placeholder = "Switcher"; + prefix = "/"; + }; + + websearch = { + keep_selection = true; + weight = 5; + icon = "applications-internet"; + name = "websearch"; + placeholder = "Websearch"; + + entries = [ + { + name = "Google"; + url = "https://www.google.com/search?q=%TERM%"; + } + { + name = "DuckDuckGo"; + url = "https://duckduckgo.com/?q=%TERM%"; + switcher_only = true; + } + { + name = "Ecosia"; + url = "https://www.ecosia.org/search?q=%TERM%"; + switcher_only = true; + } + { + name = "Yandex"; + url = "https://yandex.com/search/?text=%TERM%"; + switcher_only = true; + } + ]; + }; + + translation = { + delay = 1000; + weight = 5; + name = "translation"; + icon = "accessories-dictionary"; + placeholder = "Translation"; + switcher_only = true; + provider = "googlefree"; + }; + }; + }; + }; +} diff --git a/home/walker/default.nix b/home/walker/default.nix deleted file mode 100644 index 6887606..0000000 --- a/home/walker/default.nix +++ /dev/null @@ -1,295 +0,0 @@ -{ config, pkgs, ... }: - -{ - - services.walker = { - enable = true; - systemd.enable = true; - settings = { - app_launch_prefix = ""; - terminal_title_flag = ""; - locale = ""; - close_when_open = false; - theme = "default"; - monitor = ""; - hotreload_theme = false; - as_window = false; - timeout = 0; - disable_click_to_close = false; - force_keyboard_focus = false; - - keys = { - accept_typeahead = [ "tab" ]; - trigger_labels = "lalt"; - next = [ "down" ]; - prev = [ "up" ]; - close = [ "esc" ]; - remove_from_history = [ "shift backspace" ]; - resume_query = [ "ctrl r" ]; - toggle_exact_search = [ "ctrl m" ]; - - activation_modifiers = { - keep_open = "shift"; - alternate = "alt"; - }; - - ai = { - clear_session = [ "ctrl x" ]; - copy_last_response = [ "ctrl c" ]; - resume_session = [ "ctrl r" ]; - run_last_response = [ "ctrl e" ]; - }; - }; - - events = { - on_activate = ""; - on_selection = ""; - on_exit = ""; - on_launch = ""; - on_query_change = ""; - }; - - list = { - dynamic_sub = true; - keyboard_scroll_style = "emacs"; - max_entries = 50; - show_initial_entries = true; - single_click = true; - visibility_threshold = 20; - placeholder = "No Results"; - }; - - search = { - argument_delimiter = "#"; - placeholder = "Search..."; - delay = 0; - resume_last_query = false; - }; - - activation_mode = { - labels = "jkl;asdf"; - }; - - builtins = { - applications = { - weight = 5; - name = "applications"; - placeholder = "Applications"; - prioritize_new = true; - hide_actions_with_empty_query = true; - context_aware = true; - refresh = true; - show_sub_when_single = true; - show_icon_when_single = true; - show_generic = true; - history = true; - - actions = { - enabled = true; - hide_category = false; - hide_without_query = true; - }; - }; - - bookmarks = { - weight = 5; - placeholder = "Bookmarks"; - name = "bookmarks"; - icon = "bookmark"; - switcher_only = true; - - entries = [ - { - label = "Walker"; - url = "https://github.com/abenz1267/walker"; - keywords = [ - "walker" - "github" - ]; - } - ]; - }; - - xdph_picker = { - hidden = true; - weight = 5; - placeholder = "Screen/Window Picker"; - show_sub_when_single = true; - name = "xdphpicker"; - switcher_only = true; - }; - - ai = { - weight = 5; - placeholder = "AI"; - name = "ai"; - icon = "help-browser"; - switcher_only = true; - show_sub_when_single = true; - - anthropic = { - prompts = [ - { - model = "claude-3-7-sonnet-20250219"; - temperature = 1; - max_tokens = 1000; - label = "General Assistant"; - prompt = "You are a helpful general assistant. Keep your answers short and precise."; - } - ]; - }; - }; - - calc = { - require_number = true; - weight = 5; - name = "calc"; - icon = "accessories-calculator"; - placeholder = "Calculator"; - min_chars = 4; - }; - - windows = { - weight = 5; - icon = "view-restore"; - name = "windows"; - placeholder = "Windows"; - show_icon_when_single = true; - }; - - clipboard = { - always_put_new_on_top = true; - exec = "${pkgs.wl-clipboard}/bin/wl-copy"; - weight = 5; - name = "clipboard"; - avoid_line_breaks = true; - placeholder = "Clipboard"; - image_height = 300; - max_entries = 10; - switcher_only = true; - }; - - commands = { - weight = 5; - icon = "utilities-terminal"; - switcher_only = true; - name = "commands"; - placeholder = "Commands"; - }; - - custom_commands = { - weight = 5; - icon = "utilities-terminal"; - name = "custom_commands"; - placeholder = "Custom Commands"; - }; - - emojis = { - exec = "${pkgs.wl-clipboard}/bin/wl-copy"; - weight = 5; - name = "emojis"; - placeholder = "Emojis"; - switcher_only = true; - history = true; - typeahead = true; - show_unqualified = false; - }; - - symbols = { - after_copy = ""; - weight = 5; - name = "symbols"; - placeholder = "Symbols"; - switcher_only = true; - history = true; - typeahead = true; - }; - - finder = { - use_fd = false; - fd_flags = "--ignore-vcs --type file"; - weight = 5; - icon = "file"; - name = "finder"; - placeholder = "Finder"; - switcher_only = true; - ignore_gitignore = true; - refresh = true; - concurrency = 8; - show_icon_when_single = true; - preview_images = false; - }; - - runner = { - eager_loading = true; - weight = 5; - icon = "utilities-terminal"; - name = "runner"; - placeholder = "Runner"; - typeahead = true; - history = true; - generic_entry = false; - refresh = true; - use_fd = false; - }; - - ssh = { - weight = 5; - icon = "preferences-system-network"; - name = "ssh"; - placeholder = "SSH"; - switcher_only = true; - history = true; - refresh = true; - }; - - switcher = { - weight = 5; - name = "switcher"; - placeholder = "Switcher"; - prefix = "/"; - }; - - websearch = { - keep_selection = true; - weight = 5; - icon = "applications-internet"; - name = "websearch"; - placeholder = "Websearch"; - - entries = [ - { - name = "Google"; - url = "https://www.google.com/search?q=%TERM%"; - } - { - name = "DuckDuckGo"; - url = "https://duckduckgo.com/?q=%TERM%"; - switcher_only = true; - } - { - name = "Ecosia"; - url = "https://www.ecosia.org/search?q=%TERM%"; - switcher_only = true; - } - { - name = "Yandex"; - url = "https://yandex.com/search/?text=%TERM%"; - switcher_only = true; - } - ]; - }; - - translation = { - delay = 1000; - weight = 5; - name = "translation"; - icon = "accessories-dictionary"; - placeholder = "Translation"; - switcher_only = true; - provider = "googlefree"; - }; - }; - }; - }; -} -- cgit v1.2.3-70-g09d2