From f2ee1682c1813e68e91357e90100ade70bec2c89 Mon Sep 17 00:00:00 2001 From: larstvei Date: Sun, 6 Oct 2024 18:27:11 +0200 Subject: [PATCH] Divide into tools and languages --- flake.nix | 2 +- modules/home.nix | 69 ++++------------------------------ modules/languages.nix | 69 ++++++++++++++++++++++++++++++++++ modules/{mac.nix => macos.nix} | 0 modules/tools.nix | 36 ++++++++++++++++++ 5 files changed, 114 insertions(+), 62 deletions(-) create mode 100644 modules/languages.nix rename modules/{mac.nix => macos.nix} (100%) create mode 100644 modules/tools.nix diff --git a/flake.nix b/flake.nix index 263f83d..ba833fc 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ modules = [ ./modules/core.nix - ./modules/mac.nix + ./modules/macos.nix home-manager.darwinModule { diff --git a/modules/home.nix b/modules/home.nix index 43fa56e..0c985c1 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,64 +1,11 @@ -{ pkgs, emacs-larstvei, ... }: { - - home.packages = with pkgs; [ - emacs-larstvei.defaultPackage.${pkgs.system} - (hunspellWithDicts [ hunspellDicts.nb_NO ]) - (python3.withPackages - (python-packages: with python-packages; [ - graphviz - html2text - hypothesis - matplotlib - numpy - openpyxl - pandas - pygments - python-lsp-server - scikit-learn - scipy - xlsxwriter - yattag - z3 - ])) - (haskell.packages.ghc96.ghcWithPackages - (ps: with ps; [ - QuickCheck - ])) - bat - babashka - # cargo - cbqn - clj-kondo - cloc - clojure - fd - ffmpeg - fzf - go - gopls - graphviz - imagemagick - inkscape - jdk - jdt-language-server - jet - jq - leiningen - minizinc - nil - neil - nixfmt - pandoc - parallel - pdf2svg - poppler_utils - ripgrep - # rust-analyzer - rustup - stack - texlive.combined.scheme-full - wget - ]; +{ lib, pkgs, emacs-larstvei, ... }: +let + concatAttrVals = attrSet: lib.concatMap (x: x) (lib.attrValues attrSet); + tools = import ./tools.nix { inherit pkgs; inherit emacs-larstvei; }; + langauges = import ./languages.nix { inherit pkgs; }; +in +{ + home.packages = concatAttrVals langauges ++ concatAttrVals tools; home.file.".config/enchant/hunspell/".source = "${pkgs.hunspellDicts.nb_NO}/share/hunspell/"; diff --git a/modules/languages.nix b/modules/languages.nix new file mode 100644 index 0000000..59c5089 --- /dev/null +++ b/modules/languages.nix @@ -0,0 +1,69 @@ +{ pkgs, ... }: +with pkgs; { + bqn = [ + cbqn + ]; + + clojure = [ + babashka + clj-kondo + clojure + leiningen + neil + ]; + + go = [ + go + gopls + ]; + + haskell = [ + (haskell.packages.ghc96.ghcWithPackages + (ps: with ps; [ + QuickCheck + ])) + stack + ]; + + java = [ + jdk + jdt-language-server + ]; + + maude = [ + maude + ]; + + minizinc = [ + minizinc + ]; + + nix = [ + nil + nixfmt + ]; + + python = [ + (python3.withPackages + (python-packages: with python-packages; [ + graphviz + html2text + hypothesis + matplotlib + numpy + openpyxl + pandas + pygments + python-lsp-server + scikit-learn + scipy + xlsxwriter + yattag + z3 + ])) + ]; + + tex = [ + texlive.combined.scheme-full + ]; +} diff --git a/modules/mac.nix b/modules/macos.nix similarity index 100% rename from modules/mac.nix rename to modules/macos.nix diff --git a/modules/tools.nix b/modules/tools.nix new file mode 100644 index 0000000..f5cbc99 --- /dev/null +++ b/modules/tools.nix @@ -0,0 +1,36 @@ +{ pkgs, emacs-larstvei, ... }: +with pkgs; { + + editor = [ + emacs-larstvei.defaultPackage.${pkgs.system} + ]; + + spelling = [ + (hunspellWithDicts [ hunspellDicts.nb_NO ]) + ]; + + modernReplacements = [ + bat + fd + ripgrep + ]; + + utils = [ + cloc + jet + jq + pandoc + parallel + wget + ]; + + multimedia = [ + ffmpeg + graphviz + imagemagick + inkscape + pdf2svg + poppler_utils + ]; + +}