From 05bbe7463b8b6af6e0695992d2391e752902cbe2 Mon Sep 17 00:00:00 2001 From: ant Date: Sat, 27 Sep 2025 11:32:20 +0200 Subject: [PATCH] move programs in modules such that base.nix il a basic configuration --- flake.nix | 13 +++---- home/base.nix | 64 +++++++++++++++++++++---------- home/fish.nix | 39 +------------------ home/gui-software.nix | 13 +++++++ home/lf.nix | 17 +++++++++ home/more-software.nix | 46 +++++++++++++++++++++++ home/terminal-software.nix | 77 -------------------------------------- home/ui.nix | 67 ++++++++++++++++++--------------- 8 files changed, 162 insertions(+), 174 deletions(-) create mode 100644 home/more-software.nix delete mode 100644 home/terminal-software.nix diff --git a/flake.nix b/flake.nix index 0d679e5..6a7e305 100644 --- a/flake.nix +++ b/flake.nix @@ -46,9 +46,8 @@ { homeConfigurations."anvaure@Allegro23-12" = homeConfig [ { home.username = "anvaure"; } - ./home/base.nix + ./home/more-software.nix ./home/ui.nix - ./home/gui-software.nix ./home/syncthing.nix ./home/allegro.nix { home.packages = [ nixgl.nixGLIntel ]; } @@ -57,19 +56,18 @@ homeConfigurations."ant@hs" = homeConfig [ { home.username = "ant"; } - ./home/base.nix + ./home/more-software.nix ]; homeConfigurations."ant@ks" = homeConfig [ { home.username = "ant"; } - ./home/base.nix + ./home/more-software.nix ]; homeConfigurations."ant@basado" = homeConfig [ { home.username = "ant"; } - ./home/base.nix ./home/ui.nix - ./home/gui-software.nix + ./home/more-software.nix ./home/gaming.nix ./home/syncthing.nix { services.kdeconnect.enable = true; } @@ -78,9 +76,8 @@ homeConfigurations."ant@moon" = homeConfig [ { home.username = "ant"; } - ./home/base.nix + ./home/more-software.nix ./home/ui.nix - ./home/gui-software.nix ./home/syncthing.nix { services.kdeconnect.enable = true; } ./home/moon.nix diff --git a/home/base.nix b/home/base.nix index 292c3fe..79bbc8e 100644 --- a/home/base.nix +++ b/home/base.nix @@ -1,10 +1,8 @@ -{ inputs, config, lib, pkgs, ... }: +{ inputs, config, lib, pkgs, pkgs-unstable, ... }: { imports = [ - ./lf.nix ./fish.nix - ./terminal-software.nix ]; # Home Manager needs a bit of information about you and the paths it should @@ -15,25 +13,10 @@ home.stateVersion = "23.05"; # Please read the comment before changing. home.packages = with pkgs; [ - signal-desktop - open-in-mpv - (python313.withPackages (pp: with pp; [ - numpy - matplotlib - ])) - # bluez - go-mtpfs - xdg-utils - davfs2 + file + python3 sshfs - ghc - yt-dlp - aria2 - yazi - ncdu ripgrep - android-tools - scrcpy ]; @@ -93,5 +76,46 @@ extraConfig = { pull.rebase = true; }; + userName = config.home.username; + userEmail = "${config.home.username}@domain.xyz"; }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.neovim = { + enable = true; + viAlias = true; + defaultEditor = true; + package = pkgs-unstable.neovim-unwrapped; + extraPackages = with pkgs; [ + gcc + ]; + }; + + programs.tmux = { + enable = true; + historyLimit = 60000; + escapeTime = 10; + keyMode = "vi"; + mouse = true; + terminal = "tmux-256color"; + extraConfig = '' + unbind-key 'Space' + bind-key 'Space' copy-mode + set -g status-right "#{net_speed} #{cpu_percentage}" + set -g default-terminal "tmux-256color" + set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support + set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 + run-shell ${pkgs.tmuxPlugins.net-speed}/share/tmux-plugins/net-speed/net_speed.tmux + run-shell ${pkgs.tmuxPlugins.cpu}/share/tmux-plugins/cpu/cpu.tmux + + set-option -a terminal-features 'st-256color:RGB' + set-option -g focus-events on + ''; + plugins = with pkgs.tmuxPlugins; [ net-speed ]; + }; + } diff --git a/home/fish.nix b/home/fish.nix index 137ce46..1be76e3 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -15,25 +15,6 @@ functions = { # use "e" to open the text editor. if e job is paused, return to it - e.body = '' - jobs -c | grep $EDITOR \ - || $EDITOR $argv \ - && fg 2>/dev/null; commandline -f repaint - ''; - lfcd.body = '' - set tmp (mktemp) - # `command` is needed in case `lfcd` is aliased to `lf` - command lf -last-dir-path=$tmp $argv - if test -f "$tmp" - set dir (cat $tmp) - rm -f $tmp - if test -d "$dir" - if test "$dir" != (pwd) - cd $dir - end - end - end - ''; fish_prompt.body = '' set -l last_pipestatus $pipestatus set -lx __fish_last_status $status # Export for __fish_print_pipestatus. @@ -88,17 +69,11 @@ }; shellAliases = { + e = "$EDITOR"; ls = "ls -hN --color=auto --group-directories-first"; grep = "grep --color=auto"; diff = "diff --color=auto"; - bt = "bluetuith"; - hms = "nh home switch"; dev = "nix develop -c fish"; - gparted = "nix-shell -p pkgs.gparted --run 'sudo -E gparted'"; - ns = "nix-shell"; - nsp = "nix shell nixpkgs#"; - f = "lfcd"; - sxiv = "nsxiv"; del = "trash -rf"; rsyncp = "rsync --info=progress2 --no-inc-recursive"; ffmpeg = "ffmpeg -hide_banner"; @@ -113,17 +88,5 @@ gdb_ubsan = "gdb -tui -ex='break __ubsan::ScopedReport::~ScopedReport'"; gdb_msan = "gdb -tui -ex='break __sanitizer::Die'"; }; - - plugins = [ - { - name = "fish-lf-icons"; - src = pkgs.fetchFromGitHub { - owner = "joshmedeski"; - repo = "fish-lf-icons"; - rev = "d1c47b2088e0ffd95766b61d2455514274865b4f"; - sha256 = "sha256-6po/PYvq4t0K8Jq5/t5hXPLn80iyl3Ymx2Whme/20kc="; - }; - } - ]; }; } diff --git a/home/gui-software.nix b/home/gui-software.nix index d8d07bb..f89916e 100644 --- a/home/gui-software.nix +++ b/home/gui-software.nix @@ -1,5 +1,9 @@ { lib, config, pkgs, pkgs-unstable, ... }: { + imports = [ + ./base.nix + ]; + home.packages = with pkgs; [ nsxiv libreoffice @@ -7,6 +11,8 @@ thunderbird vieb gimp + signal-desktop + open-in-mpv ]; programs.mpv = { @@ -23,6 +29,13 @@ ]; }; + programs.fish = { + shellAliases = { + bt = "bluetuith"; + sxiv = "nsxiv"; + }; + }; + # programs.chromium = { # enable = true; # package = pkgs.ungoogled-chromium; diff --git a/home/lf.nix b/home/lf.nix index 6ceaed0..adef56c 100644 --- a/home/lf.nix +++ b/home/lf.nix @@ -189,4 +189,21 @@ setlocal ${config.xdg.userDirs.download} set info size:time ''; }; + + programs.fish = { + shellAliases = { + f = "lfcd"; + }; + plugins = [ + { + name = "fish-lf-icons"; + src = pkgs.fetchFromGitHub { + owner = "joshmedeski"; + repo = "fish-lf-icons"; + rev = "d1c47b2088e0ffd95766b61d2455514274865b4f"; + sha256 = "sha256-6po/PYvq4t0K8Jq5/t5hXPLn80iyl3Ymx2Whme/20kc="; + }; + } + ]; + }; } diff --git a/home/more-software.nix b/home/more-software.nix new file mode 100644 index 0000000..e42f19d --- /dev/null +++ b/home/more-software.nix @@ -0,0 +1,46 @@ +{ lib, config, pkgs, ... }: { + imports = [ + ./lf.nix + ./base.nix + ]; + + home.packages = with pkgs; [ + entr + trash-cli + nix-output-monitor + unzip + gnumake + pandoc + htop + ffmpeg-full + wget + dtrx + unzip + zip + glances + davfs2 + yt-dlp + aria2 + yazi + ncdu + android-tools + ]; + + programs.neovim.extraPackages = with pkgs; [ + nodejs_24 + ocamlPackages.lsp + ocamlPackages.ocamlformat + cargo + nixd + nixfmt-rfc-style + lua-language-server + ocaml + ocamlPackages.ocaml-lsp + pyright + ripgrep + ]; + + xdg.mimeApps.defaultApplications = { "text/plain" = "nvim.desktop"; }; + + programs.pistol.enable = true; +} diff --git a/home/terminal-software.nix b/home/terminal-software.nix deleted file mode 100644 index 2b91256..0000000 --- a/home/terminal-software.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ lib, config, pkgs, pkgs-unstable, ... }: { - home.packages = with pkgs; [ - entr - trash-cli - nix-output-monitor - unzip - gnumake - pandoc - htop - ffmpeg-full - wget - dtrx - unzip - zip - glances - file - ]; - - programs.neovim = { - enable = true; - viAlias = true; - defaultEditor = true; - package = pkgs-unstable.neovim-unwrapped; - extraPackages = with pkgs; [ - nodejs_24 - ocamlPackages.lsp - ocamlPackages.ocamlformat - cargo - nixd - nixfmt-rfc-style - lua-language-server - ocaml - ocamlPackages.ocaml-lsp - pyright - ripgrep - gcc - ]; - }; - - xdg.mimeApps.defaultApplications = { "text/plain" = "nvim.desktop"; }; - - programs.tmux = { - enable = true; - historyLimit = 60000; - escapeTime = 10; - keyMode = "vi"; - mouse = true; - terminal = "tmux-256color"; - extraConfig = '' - unbind-key 'Space' - bind-key 'Space' copy-mode - set -g status-right "#{net_speed} #{cpu_percentage}" - set -g default-terminal "tmux-256color" - set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support - set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 - run-shell ${pkgs.tmuxPlugins.net-speed}/share/tmux-plugins/net-speed/net_speed.tmux - run-shell ${pkgs.tmuxPlugins.cpu}/share/tmux-plugins/cpu/cpu.tmux - - set-option -a terminal-features 'st-256color:RGB' - set-option -g focus-events on - ''; - plugins = with pkgs.tmuxPlugins; [ net-speed ]; - }; - - programs.git = { - enable = true; - userName = config.home.username; - userEmail = "${config.home.username}@domain.xyz"; - }; - - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - - programs.pistol.enable = true; -} diff --git a/home/ui.nix b/home/ui.nix index 662b3e3..ebc0fbd 100644 --- a/home/ui.nix +++ b/home/ui.nix @@ -9,6 +9,7 @@ in ./bar.nix ./hyprland.nix ./gui-software.nix + ./base.nix ]; options = { @@ -18,6 +19,41 @@ in }; config = { + + home.packages = with pkgs; [ + inputs.st-flexipatch.packages.${system}.st + + gentium + nerd-fonts.noto + nerd-fonts.hack + nerd-fonts.jetbrains-mono + nerd-fonts.caskaydia-cove + cascadia-code + inter + emojione + + bluetuith + keepmenu + rofimoji + ydotool + libnotify + wtype + wl-clipboard + + pamixer + pulsemixer + + go-mtpfs + xdg-utils + + (catppuccin-gtk.override { + accents = [ "pink" ]; + size = "compact"; + tweaks = [ "black" ]; + variant = "mocha"; + }) + ]; + home.file = { ".config/kitty/light.conf".source = dotfiles/kitty/light.conf; ".config/kitty/dark.conf".source = dotfiles/kitty/dark.conf; @@ -113,37 +149,6 @@ in TERMINAL = defaultTerminal; }; - home.packages = with pkgs; [ - inputs.st-flexipatch.packages.${system}.st - - gentium - nerd-fonts.noto - nerd-fonts.hack - nerd-fonts.jetbrains-mono - nerd-fonts.caskaydia-cove - cascadia-code - inter - emojione - - bluetuith - keepmenu - rofimoji - ydotool - libnotify - wtype - wl-clipboard - - pamixer - pulsemixer - - (catppuccin-gtk.override { - accents = [ "pink" ]; - size = "compact"; - tweaks = [ "black" ]; - variant = "mocha"; - }) - ]; - xsession.enable = true; fonts.fontconfig.enable = true;