flake: migrate users/profiles -> users/modules

This commit is contained in:
Infinidoge 2023-09-08 21:59:56 -04:00
parent 85fb3f8251
commit e50310eb80
36 changed files with 46 additions and 79 deletions

View file

@ -1,6 +0,0 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,114 +0,0 @@
{ config, main, pkgs, lib, ... }:
let
ifGraphical = lib.optionals main.info.graphical;
ifGraphical' = lib.optional main.info.graphical;
in
{
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [ vterm pdf-tools emacsql-sqlite ];
package = pkgs.emacsNativeComp;
};
services.emacs = {
enable = true;
client.enable = true;
};
home = {
sessionPath = [
"${config.xdg.configHome}/emacs/bin"
];
packages = with pkgs; lib.flatten [
# --- Doom Emacs ---
fd
ripgrep
fzf
gnumake
# --- :tools ---
# :tools editorconfig
editorconfig-core-c
editorconfig-checker
# --- :app ---
# :app everywhere
xdotool
xclip
# --- :editor ---
# :editor format
nodePackages.prettier
# --- :lang ---
# :lang org
python310Packages.pygments
## +gnuplot
gnuplot
## +roam2
graphviz
# :lang common-lisp
sbcl
# :lang cc
clang-tools
# :lang csharp
dotnetCorePackages.sdk_6_0
omnisharp-roslyn
# :lang latex
(ifGraphical [
(texlive.combine {
inherit (texlive)
scheme-medium
biblatex
biblatex-chicago
capt-of minted
catchfile
framed
fvextra
lipsum
upquote
wrapfig
xstring
;
})
biber
])
# :lang markdown
pandoc
python310Packages.grip
# :lang sh
shellcheck
# :lang json
jq
# --- :checkers ---
# :checkers spell
## +aspell
(aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]))
# :checkers grammar
languagetool
];
# activation = { # Works in theory, but times out on rebuild
# install_doom_emacs = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
# if [ ! -d ${config.xdg.configHome}/emacs/bin ]; then
# rm -rf ${config.xdg.configHome}/emacs
# git clone --depth 1 $VERBOSE_ARG https://github.com/hlissner/doom-emacs ${config.xdg.configHome}/emacs
# ${config.xdg.configHome}/emacs/bin/doom -y install --no-config
# fi
# '';
# };
};
}

View file

@ -1,31 +0,0 @@
{ config, main, pkgs, lib, ... }:
{
services.flameshot = {
enable = true;
settings = {
General = {
buttons = "@Variant(\\0\\0\\0\\x7f\\0\\0\\0\\vQList<int>\\0\\0\\0\\0\\x18\\0\\0\\0\\0\\0\\0\\0\\x1\\0\\0\\0\\x2\\0\\0\\0\\x3\\0\\0\\0\\x4\\0\\0\\0\\x5\\0\\0\\0\\x6\\0\\0\\0\\x12\\0\\0\\0\\x13\\0\\0\\0\\xf\\0\\0\\0\\x16\\0\\0\\0\\a\\0\\0\\0\\b\\0\\0\\0\\t\\0\\0\\0\\x10\\0\\0\\0\\n\\0\\0\\0\\v\\0\\0\\0\\f\\0\\0\\0\\r\\0\\0\\0\\xe\\0\\0\\0\\x11\\0\\0\\0\\x14\\0\\0\\0\\x15\\0\\0\\0\\x17)";
contrastOpacity = 188;
contrastUiColor = "#000070";
drawColor = "#00ffff";
uiColor = "#2e86cf";
disabledTrayIcon = true;
showDesktopNotification = false;
showHelp = true;
showStartupLaunchMessage = false;
startupLaunch = false;
undoLimit = 100;
uploadHistoryMax = 25;
savePath = "/home/infinidoge/Pictures";
saveAsFileExtension = ".png";
filenamePattern = "%F_%T";
saveAfterCopy = false;
savePathFixed = true;
};
};
};
}

View file

@ -1,50 +0,0 @@
{ pkgs, ... }: {
programs.git = {
enable = true;
package = pkgs.gitFull;
extraConfig = {
pull.rebase = true;
merge.ignore.driver = "true";
init.defaultBranch = "master";
status.showUntrackedFiles = "all";
push.autoSetupRemote = true;
};
aliases = {
a = "add -p";
co = "checkout";
cob = "checkout -b";
f = "fetch -p";
c = "commit";
p = "push";
ba = "branch -a";
bd = "branch -d";
bD = "branch -D";
d = "diff";
dc = "diff --cached";
ds = "diff --staged";
r = "restore";
rs = "restore --staged";
st = "status -sb";
# reset
soft = "reset --soft";
hard = "reset --hard";
s1ft = "soft HEAD~1";
h1rd = "hard HEAD~1";
# logging
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
rank = "shortlog -sn --no-merges";
# delete merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
crypt = "!git-crypt";
root = "rev-parse --show-toplevel";
};
};
}

View file

@ -1,15 +0,0 @@
{ config, main, ... }: {
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
};
services.gpg-agent = {
enable = true;
pinentryFlavor = (if main.services.xserver.enable then "qt" else "curses");
extraConfig = ''
allow-emacs-pinentry
allow-loopback-pinentry
'';
};
}

View file

@ -1,48 +0,0 @@
{ config, ... }: {
programs.htop = {
enable = true;
settings = {
fields = with config.lib.htop.fields; [
PID
USER
PRIORITY
NICE
M_SIZE
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
TIME
COMM
];
color_scheme = 0;
cpu_count_from_one = 0;
delay = 15;
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
find_comm_in_cmdline = 1;
tree_view = 1;
header_margin = 1;
show_cpu_usage = 1;
show_cpu_frequency = 1;
show_cpu_temperature = 1;
update_process_names = 1;
} // (with config.lib.htop; leftMeters [
(bar "AllCPUs")
(bar "CPU")
]) // (with config.lib.htop; rightMeters [
(bar "Memory")
(bar "Swap")
(text "Blank")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
(text "DiskIO")
(text "NetworkIO")
]);
};
}

View file

@ -1,9 +0,0 @@
{ config, pkgs, ... }:
{
programs.keychain = {
enable = true;
extraFlags = [ "--quiet" "--dir ${config.xdg.configHome}/keychain" ];
keys = [ "id_ed25519" ];
};
}

View file

@ -1,19 +0,0 @@
{ pkgs, ... }: {
programs.kitty = {
enable = true;
font = {
package = (pkgs.nerdfonts.override { fonts = [ "DejaVuSansMono" ]; });
name = "DejaVuSansMono";
size = 12;
};
settings = {
confirm_os_window_close = 0;
scrollback_lines = 100000;
};
};
home.shellAliases = {
ssh = "kitty +kitten ssh";
icat = "kitty +kitten icat";
};
}

View file

@ -1,22 +0,0 @@
{ config, lib, pkgs, ... }:
{
services = {
mpd = {
enable = true;
extraConfig = ''
audio_output {
type "pipewire"
name "PipeWire Sound Server"
}
'';
};
mpd-mpris.enable = true;
mpris-proxy.enable = true;
playerctld.enable = true;
};
home.packages = with pkgs; [
playerctl
];
}

View file

@ -1,16 +0,0 @@
{ pkgs, lib, ... }: {
home.packages = with pkgs; lib.lists.flatten [
haskell-language-server
ghc
cabal-install
ormolu
(with haskellPackages; [
hoogle
])
stack
# stack2nix
cabal2nix
];
}

View file

@ -1,7 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
openjdk19
clang-tools
gradle
];
}

View file

@ -1,6 +0,0 @@
{ pkgs, lib, ... }: {
home.packages = with pkgs; lib.lists.flatten [
kotlin
kotlin-language-server
];
}

View file

@ -1,5 +0,0 @@
{ pkgs, lib, ... }: {
home.packages = with pkgs; lib.lists.flatten [
lua-language-server
];
}

View file

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

View file

@ -1,18 +0,0 @@
{ pkgs, lib, ... }: {
home.packages = with pkgs; lib.lists.flatten [
python310
(with python310Packages; [
black
isort
jupyter
mypy
nose
pip
pyflakes
pyls-isort
pytest
])
pyright
pipenv
];
}

View file

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

View file

@ -1,11 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
}))
gcc
];
}

View file

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

View file

@ -1,19 +0,0 @@
{ pkgs, ... }: {
programs.rofi = {
enable = true;
extraConfig = {
modi = builtins.concatStringsSep "," [
"window"
"run"
"ssh"
"windowcd"
"drun"
"combi"
"keys"
];
};
plugins = with pkgs; [ ];
pass.enable = true;
theme = "Adapta-Nokto";
};
}

View file

@ -1,9 +0,0 @@
{ ... }: {
imports = [
./bash.nix
./fish.nix
./ion.nix
./nushell.nix
./zsh.nix
];
}

View file

@ -1,15 +0,0 @@
{ config, pkgs, ... }: {
imports = [ ./common.nix ];
programs = {
bash = {
enable = true;
enableVteIntegration = true;
initExtra = ''
source <(kitty + complete setup bash)
'';
};
starship.enableBashIntegration = true;
};
}

View file

@ -1,3 +0,0 @@
{ ... }: {
programs.command-not-found.enable = true;
}

View file

@ -1,16 +0,0 @@
{ config, lib, pkgs, ... }: {
imports = [ ./common.nix ];
programs = {
fish = {
enable = true;
functions = { };
shellAbbrs = { };
interactiveShellInit = ''
kitty + complete setup fish | source
'';
};
starship.enableFishIntegration = lib.mkIf config.programs.starship.enable true;
};
}

View file

@ -1,11 +0,0 @@
{ config, pkgs, ... }: {
imports = [ ./common.nix ];
programs = {
ion = {
enable = true;
};
starship.enableIonIntegration = true;
};
}

View file

@ -1,12 +0,0 @@
{ ... }: {
programs.nushell = {
enable = true;
configFile.text = ''
source ~/.cache/starship/init.nu
'';
envFile.text = ''
mkdir ~/.cache/starship
starship init nu | save ~/.cache/starship/init.nu
'';
};
}

View file

@ -1,74 +0,0 @@
{ config, lib, pkgs, main, ... }: {
imports = [ ./common.nix ];
programs = {
zsh = rec {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
enableAutosuggestions = true;
syntaxHighlighting.enable = true;
# defaultKeymap = "emacs";
initExtraFirst = ''
[[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return
'';
initExtra = ''
${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
functions -c precmd precmd_any_nix_shell
precmd() {
precmd_any_nix_shell
if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then
export __TODO_PRINTED=1
echo TODO:
\cat ~/TODO.txt
fi
}
if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then
PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9-]\+\/bin:\?//g' | sed 's/:$//')
fi
'';
dotDir = ".config/zsh";
history.path = "$HOME/${dotDir}/.zsh_history";
shellAliases = main.environment.shellAliases // config.home.shellAliases;
oh-my-zsh = {
enable = true;
plugins = [
# Display
"colorize"
"colored-man-pages"
# zsh modifications
"zsh-interactive-cd"
"command-not-found"
"sudo"
# Aliases
"alias-finder"
# Applications
## Python
"pip"
## Git
"gitignore"
## Vim
"fancy-ctrl-z"
];
};
};
starship.enableZshIntegration = lib.mkIf config.programs.starship.enable true;
};
}

View file

@ -1,13 +0,0 @@
{ ... }: {
programs.ssh = {
enable = true;
controlMaster = "auto";
controlPersist = "1m";
forwardAgent = true;
matchBlocks = {
"server.doge-inc.net" = {
port = 245;
};
};
};
}

View file

@ -1,109 +0,0 @@
{ ... }: {
programs.starship = {
enable = true;
enableBashIntegration = true;
settings =
let
line_style = "bold green";
section = {
user_host = "underline";
};
in
{
add_newline = true;
format = ''
($status$cmd_duration)
[[$username@$hostname](${section.user_host})($shlvl)($nix_shell)](${line_style})
[$directory($git_branch$git_status(@$git_commit)( $git_metrics)( $git_state))](${line_style})
[($shell)](${line_style})$character'';
character = rec {
success_symbol = "[](bold purple)";
error_symbol = success_symbol;
vicmd_symbol = "[](bold purple)";
};
aws.symbol = " ";
conda.symbol = " ";
dart.symbol = " ";
docker_context.symbol = " ";
elixir.symbol = " ";
elm.symbol = " ";
golang.symbol = " ";
hg_branch.symbol = " ";
java.symbol = " ";
julia.symbol = " ";
memory_usage.symbol = " ";
nim.symbol = " ";
package.symbol = " ";
perl.symbol = " ";
php.symbol = " ";
python.symbol = " ";
ruby.symbol = " ";
rust.symbol = " ";
scala.symbol = " ";
swift.symbol = " ";
directory = {
style = "cyan";
read_only = " ";
format = "[$read_only]($read_only_style)[$path]($style)";
};
git_branch = {
format = "[$symbol$branch]($style)";
style = "bold dimmed white";
symbol = " ";
};
git_status = {
format = " $ahead_behind$all_status";
conflicted = "";
ahead = "[\${count}](green bold) ";
behind = "[\${count}](red bold)";
diverged = "[](red bold) ";
untracked = "[](grey bold) ";
stashed = "[](grey bold) ";
modified = "[](yellow bold) ";
staged = "[](green bold) ";
renamed = "[](blue bold) ";
deleted = "[](red bold) ";
style = "bold";
};
nix_shell = {
format = "[$symbol$state $name]($style bold)";
pure_msg = "";
impure_msg = "𝚫";
symbol = " ";
};
username = {
format = "[$user]($style ${section.user_host})";
show_always = true;
};
hostname = {
ssh_only = false;
format = "[$hostname]($style ${section.user_host})";
trim_at = "";
};
shlvl = {
disabled = false;
format = " [$symbol$shlvl]($style bold)";
symbol = " ";
threshold = 0;
};
shell = {
disabled = false;
format = "$indicator";
};
status.disabled = false;
};
};
}

View file

@ -1,31 +0,0 @@
{ config, pkgs, ... }: {
gtk = {
enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
font = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
size = 10;
};
iconTheme = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita-dark";
};
theme = {
package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita-dark";
};
};
qt = {
enable = true;
style = {
package = pkgs.adwaita-qt;
name = "adwaita-dark";
};
platformTheme = "gnome";
};
}

View file

@ -1,12 +0,0 @@
{ ... }: {
programs.tmux = {
enable = true;
clock24 = true;
terminal = "screen-256color";
prefix = "C-Space";
extraConfig = ''
set -g mouse on
'';
};
}

View file

@ -1,20 +0,0 @@
{ ... }: {
programs.vim = {
enable = true;
settings = {
background = "dark";
directory = [
"."
"~/.local/share/vim/swap//"
];
expandtab = true;
history = 50;
ignorecase = true;
smartcase = true;
mouse = "a";
number = true;
tabstop = 4;
shiftwidth = 4;
};
};
}