A bit of refactoring of home

This commit is contained in:
larstvei 2025-09-07 16:10:46 +02:00
parent 7e0fd0bac0
commit 9e3793918e
25 changed files with 277 additions and 229 deletions

View File

@ -1,85 +1,10 @@
{ {
lib, imports = [
pkgs, ./languages
emacs-larstvei, ./tools
... ];
}:
let
concatAttrVals = attrSet: lib.concatMap (x: x) (lib.attrValues attrSet);
tools = import ./tools {
inherit pkgs;
inherit emacs-larstvei;
};
languages = import ./languages { inherit pkgs; };
in
{
home.packages = concatAttrVals languages ++ concatAttrVals tools;
home.file.".config/enchant/hunspell/".source = "${pkgs.hunspellDicts.nb_NO}/share/hunspell/"; programs.home-manager.enable = true;
programs = {
fzf = {
enable = true;
enableFishIntegration = true;
};
fish = {
enable = true;
functions = {
track_directories = {
description = "For directory tracking in emacs vterm";
onEvent = "fish_postexec";
body = "printf \'\\e]51;A\'(pwd)\'\\e\\\\\'";
};
};
shellInit = ''
if test "$TERM" != "dumb"
track_directories
end
set -gx DIRENV_LOG_FORMAT ""
'';
};
starship = {
enable = true;
settings = {
custom = {
direnv = {
format = "[\\[direnv\\]]($style) ";
when = "env | grep -E '^DIRENV_FILE='";
};
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
git = {
enable = true;
userName = "larstvei";
userEmail = "larstvei@ifi.uio.no";
ignores = [
".envrc"
".DS_Store"
".direnv"
];
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
# Sets JAVA_HOME environment variable
java.enable = true;
# Let Home Manager install and manage itself.
home-manager.enable = true;
};
# This value determines the Home Manager release that your # This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage # configuration is compatible with. This helps avoid breakage

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
cbqn
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
gcc
];
}

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
babashka
clj-kondo
clojure
leiningen
neil
];
}

View File

@ -1,91 +1,18 @@
{ pkgs, ... }:
with pkgs;
{ {
bqn = [ imports = [
cbqn ./bqn
]; ./c
./clojure
c = [ gcc ]; ./go
./haskell
clojure = [ ./java
babashka ./maude
clj-kondo ./minizinc
clojure ./nix
leiningen ./python
neil ./rust
]; ./scheme
./tex
go = [ ./zig
go
gopls
];
haskell = [
(haskell.packages.ghc96.ghcWithPackages (
ps: with ps; [
QuickCheck
]
))
cabal-install
stack
];
java = [
jdk
jdt-language-server
];
maude = [
maude
];
minizinc = [
minizinc
];
nix = [
nil
nixfmt-rfc-style
];
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
]
))
];
rust = [
cargo
rustc
rustfmt
rust-analyzer
];
scheme = [
gambit
];
tex = [
texliveFull
];
zig = [
zig
zls
]; ];
} }

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
go
gopls
];
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(haskell.packages.ghc96.ghcWithPackages (
ps: with ps; [
QuickCheck
]
))
cabal-install
stack
];
}

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
# Sets JAVA_HOME environment variable
programs.java.enable = true;
home.packages = with pkgs; [
jdk
jdt-language-server
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
maude
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
minizinc
];
}

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nil
nixfmt-rfc-style
];
}

View File

@ -0,0 +1,23 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(python3.withPackages (
python-packages: with python-packages; [
graphviz
html2text
hypothesis
matplotlib
numpy
openpyxl
pandas
pygments
python-lsp-server
scikit-learn
scipy
xlsxwriter
yattag
z3
]
))
];
}

View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
cargo
rustc
rustfmt
rust-analyzer
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
gambit
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
texliveFull
];
}

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
zig
zls
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
zotero
];
}

View File

@ -1,64 +1,12 @@
{ pkgs, emacs-larstvei, ... }:
let
# Ghostscript has a name collision with gambit (scheme). Let's nuke the
# offending binary, as gsc most likely unused on my system.
ghostscriptNoGsc = pkgs.symlinkJoin {
name = "ghostscript-no-gsc";
paths = [ pkgs.ghostscript ];
postBuild = ''
rm -f $out/bin/gsc
'';
};
in
with pkgs;
{ {
imports = [
editor = [ ./academic
emacs-larstvei.defaultPackage.${pkgs.system} ./editor
]; ./git
./learning
spelling = [ ./multimedia
hunspell ./shell
hunspellDicts.en_US ./spelling
hunspellDicts.nb_NO ./utils
];
# terminal = [
# ghostty
# ];
modernReplacements = [
bat
fd
ripgrep
];
utils = [
gnumake
jet
jq
pandoc
parallel
tokei
wget
];
multimedia = [
dot2tex
ffmpeg
ghostscriptNoGsc
graphviz
imagemagick
inkscape
pdf2svg
poppler_utils
];
academic = [
zotero
];
learning = [
exercism
]; ];
} }

View File

@ -0,0 +1,6 @@
{ pkgs, emacs-larstvei, ... }:
{
home.packages = [
emacs-larstvei.defaultPackage.${pkgs.system}
];
}

View File

@ -0,0 +1,12 @@
{
programs.git = {
enable = true;
userName = "larstvei";
userEmail = "larstvei@ifi.uio.no";
ignores = [
".envrc"
".DS_Store"
".direnv"
];
};
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
exercism
];
}

View File

@ -0,0 +1,24 @@
{ pkgs, ... }:
let
# Ghostscript has a name collision with gambit (scheme). Let's nuke the
# offending binary, as gsc most likely unused on my system.
ghostscriptNoGsc = pkgs.symlinkJoin {
name = "ghostscript-no-gsc";
paths = [ pkgs.ghostscript ];
postBuild = ''
rm -f $out/bin/gsc
'';
};
in
{
home.packages = with pkgs; [
dot2tex
ffmpeg
ghostscriptNoGsc
graphviz
imagemagick
inkscape
pdf2svg
poppler_utils
];
}

View File

@ -0,0 +1,48 @@
{
programs = {
fish = {
enable = true;
functions = {
track_directories = {
description = "For directory tracking in emacs vterm";
onEvent = "fish_postexec";
body = "printf \'\\e]51;A\'(pwd)\'\\e\\\\\'";
};
};
shellInit = ''
if test "$TERM" != "dumb"
track_directories
end
set -gx DIRENV_LOG_FORMAT ""
'';
};
fzf = {
enable = true;
enableFishIntegration = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
starship = {
enable = true;
settings = {
custom = {
direnv = {
format = "[\\[direnv\\]]($style) ";
when = "env | grep -E '^DIRENV_FILE='";
};
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
};
}

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
hunspell
hunspellDicts.en_US
hunspellDicts.nb_NO
];
home.file.".config/enchant/hunspell/".source = "${pkgs.hunspellDicts.nb_NO}/share/hunspell/";
}

View File

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
bat
fd
gnumake
jet
jq
pandoc
parallel
ripgrep
tokei
wget
];
}