From cb05d6aa18f2884fb3cf6e2b6becd80d270e3e9b Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sun, 9 Jun 2024 12:25:16 +0200 Subject: [PATCH] add some cli tools --- .ideavimrc | 1 + flake.nix | 3 ++ home-manager/zsh/default.nix | 2 ++ modules/misc/cli-tools.nix | 3 ++ modules/nix/index.nix | 29 +++++++--------- secrets/create_secrets.md | 4 +-- systems/vm/configuration.nix | 5 +-- users/kopatz/home.nix | 64 ++++++++++++++++++++++++++++++++++-- 8 files changed, 86 insertions(+), 25 deletions(-) diff --git a/.ideavimrc b/.ideavimrc index 0bff591..b248c4f 100644 --- a/.ideavimrc +++ b/.ideavimrc @@ -17,6 +17,7 @@ set notimeout set easymotion set surround + nnoremap , :action IdeaVim.ReloadVimRc.reload nnoremap diff --git a/flake.nix b/flake.nix index 8ffbc41..a3d79b0 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,9 @@ stylix.nixosModules.stylix ./modules/graphical/stylix.nix ./modules/graphical/cosmic.nix + ({ outputs, ... }: { + stylix.image = ./yuyukowallpaper.png; + }) ] else [ ]); specialArgs = specialArgs // { inherit inputs outputs; }; diff --git a/home-manager/zsh/default.nix b/home-manager/zsh/default.nix index e488103..53ffccd 100644 --- a/home-manager/zsh/default.nix +++ b/home-manager/zsh/default.nix @@ -20,6 +20,8 @@ goto = "cd $(find ~/projects -maxdepth 2 -type d | ${pkgs.fzf}/bin/fzf)"; dev = "nix-shell --run zsh"; rm = "trashy put"; + cat = "bat -P --style plain"; + cdf = "cd $(find . -type d | fzf)"; }; #plugins = with pkgs; [ # { diff --git a/modules/misc/cli-tools.nix b/modules/misc/cli-tools.nix index 09a8b6c..06ac9e8 100644 --- a/modules/misc/cli-tools.nix +++ b/modules/misc/cli-tools.nix @@ -12,6 +12,7 @@ in environment.systemPackages = with pkgs; [ wget pciutils + rippkgs # faster nixpkgs search, init with `rippkgs-index nixpkgs && mv rippkgs-index.sqlite ~/.local/share/`; nixos-option btop git @@ -45,6 +46,8 @@ in nvd # nix diff, example: nvd diff /nix/var/nix/profiles/system-389-link /nix/var/nix/profiles/system-390-link compsize trashy # move files to trash + fzf # fuzzy finder + bat # fancy cat ]; }; } diff --git a/modules/nix/index.nix b/modules/nix/index.nix index 4aa2941..e923bda 100644 --- a/modules/nix/index.nix +++ b/modules/nix/index.nix @@ -1,19 +1,14 @@ -{config, lib, ...}: +{ config, lib, ... }: with lib; -let - cfg = config.custom.nix.index; -in -{ - options.custom.nix.index = { - enable = mkEnableOption "Enables nix index"; - }; - - config = mkIf cfg.enable { - programs.command-not-found.enable = false; - programs.nix-index = { - enable = true; - enableZshIntegration=true; - }; - }; -} +let cfg = config.custom.nix.index; +in { + options.custom.nix.index = { enable = mkEnableOption "Enables nix index"; }; + config = mkIf cfg.enable { + programs.command-not-found.enable = false; + programs.nix-index = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/secrets/create_secrets.md b/secrets/create_secrets.md index aca1b76..9fc1177 100644 --- a/secrets/create_secrets.md +++ b/secrets/create_secrets.md @@ -3,7 +3,7 @@ example secrets.nix file -``` +```nix let user1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH"; users = [ user1 ]; @@ -17,7 +17,7 @@ in ``` use secret in config -``` +```nix age.secrets.nextcloud = { file = ./secrets/secret1.age; owner = "nextcloud"; diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix index e8fefa0..19a379e 100644 --- a/systems/vm/configuration.nix +++ b/systems/vm/configuration.nix @@ -16,13 +16,10 @@ ld.enable = true; settings.enable = true; }; - graphical = { - i3.enable = true; - }; + graphical = { i3.enable = true; }; }; networking.networkmanager.enable = true; - environment.systemPackages = with pkgs; [ firefox ]; } diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index db72b1b..7b536b7 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -1,5 +1,4 @@ -{ osConfig, config, pkgs, inputs, lib, ...}: -{ +{ osConfig, config, pkgs, inputs, lib, ... }: { home = { # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage @@ -33,5 +32,66 @@ inputs.nix-colors.homeManagerModule ]; + programs.newsboat = { + enable = true; + extraConfig = '' + bind-key j down + bind-key k up + bind-key J next-feed articlelist + bind-key K prev-feed articlelist + bind-key G end + bind-key g home + bind-key l open + bind-key h quit + + # general settings + auto-reload yes + download-full-page yes + max-items 100 + # limit width so articles are more readable + text-width 80 + # solarized + color background color223 default + color listnormal color4 default + color listnormal_unread color2 default + color listfocus color223 color237 bold + color listfocus_unread color223 color237 bold + color info color8 color0 + color article color223 default + + # highlights + highlight article "^(Feed|Link):.*$" color11 default bold + highlight article "^(Title|Date|Author):.*$" color11 default bold + highlight article "https?://[^ ]+" color2 default underline + highlight article "\\[[0-9]+\\]" color2 default bold + highlight article "\\[image\\ [0-9]+\\]" color2 default bold + highlight feedlist "^─.*$" color6 color6 bold + ''; + urls = [ + { + title = "r/NixOS"; + tags = [ "nixos" "nix" "reddit" ]; + url = "https://www.reddit.com/r/NixOS.rss"; + } + { + title = "Hacker News"; + url = "https://hnrss.org/newest"; + } + { + title = "Phoronix"; + url = "https://www.phoronix.com/rss.php"; + } + { + title = "LWN"; + url = "https://lwn.net/headlines/rss"; + } + { + title = "/g/"; + tags = [ "4chan" "technology" ]; + url = "https://boards.4channel.org/g/index.rss"; + } + ]; + }; + #colorScheme = import ../../home-manager/themes/yorha/colors.nix; }