flake: Initialise new repository
This commit is contained in:
commit
1eb25ada72
41 changed files with 1657 additions and 0 deletions
39
modules/home-manager/colors.nix
Normal file
39
modules/home-manager/colors.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
# Rosé Pine Moon (https://rosepinetheme.com)
|
||||
programs = {
|
||||
bat = {
|
||||
config.theme = "rose-pine";
|
||||
themes.rose-pine = {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "rose-pine";
|
||||
repo = "tm-theme";
|
||||
rev = "c4235f9a65fd180ac0f5e4396e3a86e21a0884ec";
|
||||
hash = "sha256-jji8WOKDkzAq8K+uSZAziMULI8Kh7e96cBRimGvIYKY=";
|
||||
};
|
||||
file = "dist/themes/rose-pine.tmTheme";
|
||||
};
|
||||
};
|
||||
|
||||
fzf.colors = {
|
||||
"fg" = "#908caa";
|
||||
"bg" = "#191724";
|
||||
"hl" = "#ebbcba";
|
||||
"fg+" = "#e0def4";
|
||||
"bg+" = "#26233a";
|
||||
"hl+" = "#ebbcba";
|
||||
"border" = "#403d52";
|
||||
"header" = "#31748f";
|
||||
"gutter" = "#191724";
|
||||
"spinner" = "#f6c177";
|
||||
"info" = "#9ccfd8";
|
||||
"pointer" = "#c4a7e7";
|
||||
"marker" = "#eb6f92";
|
||||
"prompt" = "#908caa";
|
||||
};
|
||||
|
||||
ghostty.settings.theme = "rose-pine";
|
||||
|
||||
helix.settings.theme = "rose_pine";
|
||||
};
|
||||
}
|
||||
89
modules/home-manager/default.nix
Normal file
89
modules/home-manager/default.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.agenix.homeManagerModules.default
|
||||
./colors.nix
|
||||
./ghostty.nix
|
||||
./git
|
||||
./helix.nix
|
||||
./packages.nix
|
||||
./shell
|
||||
];
|
||||
|
||||
home = {
|
||||
username = "jan";
|
||||
homeDirectory = "/Users/jan";
|
||||
stateVersion = "24.05";
|
||||
|
||||
## Mute login message in terminal
|
||||
file.".hushlogin".text = "";
|
||||
|
||||
sessionVariables = {
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
LEDGER_FILE = "${config.xdg.dataHome}/ledger/2024.journal";
|
||||
OPENAI_API_KEY = "$(cat ${config.age.secrets.openai.path})";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
"yt" = "yt-dlp";
|
||||
"yta" = "yt-dlp -x";
|
||||
};
|
||||
|
||||
packages = [ inputs.agenix.packages.${pkgs.system}.default ];
|
||||
};
|
||||
|
||||
age = {
|
||||
# identityPaths = [ "~/.ssh/id_ed25519" ];
|
||||
secrets."openai".file = ../secrets/openai.age;
|
||||
};
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
userDirs = {
|
||||
videos = "${config.home.homeDirectory}/Movies/Videos";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
|
||||
gpg = {
|
||||
enable = true;
|
||||
homedir = "${config.xdg.dataHome}/gnupg";
|
||||
settings = {
|
||||
default-key = "20AF0A659F2B93AD918415D1A7DA689CB3B078EC";
|
||||
keyserver = "hkps://keys.openpgp.org";
|
||||
};
|
||||
};
|
||||
|
||||
pandoc.enable = true;
|
||||
|
||||
ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
extraConfig = ''
|
||||
UseKeychain yes
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
SetEnv TERM=xterm-256color
|
||||
'';
|
||||
};
|
||||
|
||||
yt-dlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
output = "${config.xdg.userDirs.videos}/%(title)s.%(ext)s";
|
||||
format-sort = "res:1080";
|
||||
audio-quality = 0;
|
||||
sponsorblock-mark = "default";
|
||||
embed-metadata = true;
|
||||
embed-thumbnail = true;
|
||||
xattrs = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home-manager/ghostty.nix
Normal file
14
modules/home-manager/ghostty.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
package = null;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
font-size = 16;
|
||||
window-padding-x = 5;
|
||||
window-padding-balance = true;
|
||||
mouse-hide-while-typing = true;
|
||||
macos-option-as-alt = "left";
|
||||
};
|
||||
};
|
||||
}
|
||||
68
modules/home-manager/git/default.nix
Normal file
68
modules/home-manager/git/default.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
imports = [
|
||||
./ignores.nix
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
GITHUB_TOKEN = "$(gh auth token)";
|
||||
};
|
||||
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Jan Kremer";
|
||||
userEmail = "mail@jankremer.eu";
|
||||
lfs.enable = true;
|
||||
difftastic.enable = true;
|
||||
|
||||
extraConfig = {
|
||||
user.signingkey = "A7DA689CB3B078EC";
|
||||
credential.helper = "osxkeychain";
|
||||
merge.conflictstyle = "zdiff3";
|
||||
commit = {
|
||||
verbose = true;
|
||||
gpgsign = true;
|
||||
};
|
||||
branch.sort = "-committerdate";
|
||||
help.autocorrect = 10;
|
||||
diff = {
|
||||
algorithm = "histogram";
|
||||
colorMoved = "default";
|
||||
};
|
||||
log.date = "iso";
|
||||
rebase.autostash = true;
|
||||
rerere.enabled = true;
|
||||
push = {
|
||||
followtags = true;
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gh = {
|
||||
enable = true;
|
||||
settings.git_protocol = "ssh";
|
||||
};
|
||||
|
||||
sapling = {
|
||||
enable = true;
|
||||
userName = "Jan Kremer";
|
||||
userEmail = "mail@jankremer.eu";
|
||||
};
|
||||
|
||||
jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
name = "Jan Kremer";
|
||||
email = "mail@jankremer.eu";
|
||||
};
|
||||
signing = {
|
||||
behavior = "own";
|
||||
backend = "gpg";
|
||||
};
|
||||
ui.default-command = "log";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/home-manager/git/ignores.nix
Normal file
30
modules/home-manager/git/ignores.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
programs.git.ignores = [
|
||||
"*.7z"
|
||||
"*.class"
|
||||
"*.com"
|
||||
"*.dll"
|
||||
"*.dmg"
|
||||
"*.exe"
|
||||
"*.gz"
|
||||
"*.iso"
|
||||
"*.jar"
|
||||
"*.log"
|
||||
"*.o"
|
||||
"*.pdf"
|
||||
"*.rar"
|
||||
"*.so"
|
||||
"*.sql"
|
||||
"*.sqlite"
|
||||
"*.tar"
|
||||
"*.zip"
|
||||
".DS_Store"
|
||||
".DS_Store?"
|
||||
".Spotlight-V100"
|
||||
".Trashes"
|
||||
"._*"
|
||||
".direnv"
|
||||
"Thumbs.db"
|
||||
"ehthumbs.db"
|
||||
];
|
||||
}
|
||||
103
modules/home-manager/helix.nix
Normal file
103
modules/home-manager/helix.nix
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
markdown-oxide
|
||||
nixd
|
||||
nixfmt-rfc-style
|
||||
];
|
||||
|
||||
settings = {
|
||||
editor = {
|
||||
line-number = "relative";
|
||||
cursorline = true;
|
||||
color-modes = true;
|
||||
mouse = true;
|
||||
|
||||
end-of-line-diagnostics = "hint";
|
||||
inline-diagnostics.cursor-line = "warning";
|
||||
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
|
||||
soft-wrap.enable = true;
|
||||
|
||||
statusline = {
|
||||
left = [
|
||||
"mode"
|
||||
"spinner"
|
||||
"version-control"
|
||||
"read-only-indicator"
|
||||
"file-modification-indicator"
|
||||
];
|
||||
|
||||
center = [ "file-name" ];
|
||||
|
||||
right = [
|
||||
"diagnostics"
|
||||
"selections"
|
||||
"register"
|
||||
"position"
|
||||
"position-percentage"
|
||||
"file-encoding"
|
||||
"file-type"
|
||||
];
|
||||
|
||||
mode = {
|
||||
normal = "NORMAL";
|
||||
insert = "INSERT";
|
||||
select = "SELECT";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keys = {
|
||||
normal = {
|
||||
X = [
|
||||
"extend_line_up"
|
||||
"extend_to_line_bounds"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
language-server = {
|
||||
tinymist.command = "tinymist";
|
||||
nixd = {
|
||||
command = "nixd";
|
||||
config = {
|
||||
formatting.command = [ "nixfmt" ];
|
||||
nixpkgs.expr = "import (builtins.getFlake \"~/.config/nix\").inputs.nixpkgs { }";
|
||||
options = {
|
||||
nixos.expr = "(builtins.getFlake \"~/.config/nix\").nixosConfigurations.galanthus.options";
|
||||
darwin.expr = "(builtins.getFlake \"~/.config/nix\").darwinConfigurations.Mac-von-Jan.options";
|
||||
home-manager.expr = "(builtins.getFlake \"~/.config/nix\").homeConfigurations.jan.options";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
language = [
|
||||
{
|
||||
name = "nix";
|
||||
language-servers = [ "nixd" ];
|
||||
formatter.command = "nixfmt";
|
||||
auto-format = true;
|
||||
}
|
||||
{
|
||||
name = "typst";
|
||||
language-servers = [ "tinymist" ];
|
||||
formatter.command = "typstyle";
|
||||
auto-format = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/home-manager/packages.nix
Normal file
24
modules/home-manager/packages.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
darwin.trash
|
||||
curl
|
||||
nh
|
||||
cachix
|
||||
hledger
|
||||
hledger-web
|
||||
ffmpeg
|
||||
imagemagick
|
||||
|
||||
# Work
|
||||
codex
|
||||
typst
|
||||
hayagriva
|
||||
# quarto
|
||||
# R
|
||||
# rPackages.reticulate
|
||||
# texliveFull
|
||||
plantuml
|
||||
ditaa
|
||||
];
|
||||
}
|
||||
12
modules/home-manager/shell/bat.nix
Normal file
12
modules/home-manager/shell/bat.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs.bat-extras; [ batman ];
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
"cat" = "bat";
|
||||
"man" = "batman";
|
||||
};
|
||||
}
|
||||
49
modules/home-manager/shell/default.nix
Normal file
49
modules/home-manager/shell/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
imports = [
|
||||
./bat.nix
|
||||
# ./fish.nix
|
||||
./starship.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
home.shellAliases = {
|
||||
"deploy" =
|
||||
"ssh -t galanthus 'cd ~/.config/nix; git pull --rebase; sudo nixos-rebuild switch --flake ~/.config/nix'";
|
||||
"mv" = "mv -i";
|
||||
"rm" = "trash";
|
||||
"tree" = "lt";
|
||||
"zz" = "z -";
|
||||
};
|
||||
|
||||
programs = {
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
warn_timeout = "1m";
|
||||
hide_env_diff = true;
|
||||
};
|
||||
};
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
defaultCommand = "fd --type f --strip-cwd-prefix --hidden --follow --exclude .git";
|
||||
fileWidgetCommand = "fd --type f --strip-cwd-prefix --hidden --follow --exclude .git";
|
||||
fileWidgetOptions = [ "--preview 'bat --color=always {}'" ];
|
||||
};
|
||||
|
||||
fd.enable = true;
|
||||
|
||||
ripgrep = {
|
||||
enable = true;
|
||||
arguments = [ "--ignore-case" ];
|
||||
};
|
||||
|
||||
zoxide.enable = true;
|
||||
};
|
||||
}
|
||||
22
modules/home-manager/shell/fish.nix
Normal file
22
modules/home-manager/shell/fish.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
interactiveShellInit = # fish
|
||||
''
|
||||
set fish_greeting
|
||||
set fish_vi_key_bindings
|
||||
set fish_vi_cursor
|
||||
|
||||
eval $(/opt/homebrew/bin/brew shellenv fish)
|
||||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
gs = "git status";
|
||||
gc = "git commit";
|
||||
gca = "git commit -a";
|
||||
gcaa = "git commit -a --amend";
|
||||
gco = "git checkout";
|
||||
};
|
||||
};
|
||||
}
|
||||
94
modules/home-manager/shell/starship.nix
Normal file
94
modules/home-manager/shell/starship.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableTransience = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
format = lib.concatStrings [
|
||||
"$username"
|
||||
"$hostname"
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_status"
|
||||
"$git_metrics"
|
||||
"$git_state"
|
||||
"$nodejs"
|
||||
"$rust"
|
||||
"$golang"
|
||||
"$python"
|
||||
"$typst"
|
||||
"$gleam"
|
||||
"$fill"
|
||||
"$nix_shell"
|
||||
"$shell"
|
||||
"$line_break"
|
||||
"$character"
|
||||
];
|
||||
|
||||
fill = {
|
||||
symbol = " ";
|
||||
};
|
||||
|
||||
character = {
|
||||
success_symbol = "[❯](green)";
|
||||
error_symbol = "[❯](red)";
|
||||
vimcmd_symbol = "[❮](blue)";
|
||||
};
|
||||
|
||||
directory = {
|
||||
style = "blue";
|
||||
};
|
||||
|
||||
git_branch = {
|
||||
format = "[$branch(:$remote_branch)](white) ";
|
||||
};
|
||||
|
||||
git_status = {
|
||||
style = "cyan";
|
||||
};
|
||||
|
||||
nodejs = {
|
||||
symbol = "nodejs";
|
||||
format = "[$symbol ($version )](green)";
|
||||
};
|
||||
|
||||
rust = {
|
||||
symbol = "rust";
|
||||
format = "[$symbol ($version )](red)";
|
||||
};
|
||||
|
||||
python = {
|
||||
symbol = "python";
|
||||
format = "[$symbol ($version )](yellow)";
|
||||
};
|
||||
|
||||
golang = {
|
||||
symbol = "go";
|
||||
format = "[$symbol ($version )](green)";
|
||||
};
|
||||
|
||||
typst = {
|
||||
symbol = "typst";
|
||||
format = "[$symbol ($version )](green)";
|
||||
};
|
||||
|
||||
gleam = {
|
||||
symbol = "gleam";
|
||||
format = "[$symbol ($version )](purple)";
|
||||
};
|
||||
|
||||
nix_shell = {
|
||||
symbol = "nix";
|
||||
heuristic = true;
|
||||
format = "[$symbol ($state $name )](red)";
|
||||
};
|
||||
|
||||
shell = {
|
||||
disabled = false;
|
||||
fish_indicator = "fish ";
|
||||
format = "[$indicator](purple)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
40
modules/home-manager/shell/zsh.nix
Normal file
40
modules/home-manager/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
# enableVteIntegration = true;
|
||||
dotDir = ".config/zsh";
|
||||
history = {
|
||||
path = "${config.xdg.stateHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
};
|
||||
autosuggestion.enable = true;
|
||||
autocd = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
highlighters = [
|
||||
"main"
|
||||
"cursor"
|
||||
"brackets"
|
||||
"root"
|
||||
];
|
||||
};
|
||||
initContent = # sh
|
||||
''
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
|
||||
setopt COMPLETE_IN_WORD
|
||||
setopt ALWAYS_TO_END
|
||||
setopt PATH_DIRS
|
||||
setopt AUTO_MENU
|
||||
setopt AUTO_LIST
|
||||
setopt MENU_COMPLETE
|
||||
'';
|
||||
|
||||
completionInit = # sh
|
||||
''
|
||||
autoload -U compinit && compinit
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue