iosevka-nerd + new zsh prompt
This commit is contained in:
parent
8d2806d5bc
commit
3f9ef8fed3
9 changed files with 185 additions and 35 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
result
|
result
|
||||||
|
.DS_Store
|
||||||
|
/test.nix
|
1
assets/.gitignore
vendored
Normal file
1
assets/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
built
|
12
assets/build
Executable file
12
assets/build
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eau
|
||||||
|
|
||||||
|
_name=$(basename $1)
|
||||||
|
name=${_name%.*}
|
||||||
|
|
||||||
|
echo "Building $name"
|
||||||
|
nix build --file $1 -vL --show-trace
|
||||||
|
|
||||||
|
echo "Copying $name to ./built/$name.tgz"
|
||||||
|
tar -czf "built/$name.tgz" result/*
|
45
assets/iosevka-nerd.nix
Normal file
45
assets/iosevka-nerd.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
let
|
||||||
|
pkgs = import <nixpkgs> {};
|
||||||
|
nerdify = { font, args ? "--complete" }:
|
||||||
|
pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "${font.name}-nerd";
|
||||||
|
src = pkgs.fetchzip {
|
||||||
|
url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/FontPatcher.zip";
|
||||||
|
hash = "sha256-H2dPUs6HVKJcjxy5xtz9nL3SSPXKQF3w30/0l7A0PeY=";
|
||||||
|
stripRoot = false;
|
||||||
|
};
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
argparse
|
||||||
|
fontforge
|
||||||
|
(python3.withPackages (ps: with ps; [ setuptools fontforge ]))
|
||||||
|
];
|
||||||
|
buildPhase = ''
|
||||||
|
font_regexp='.*\.\(ttf\|ttc\|otf\|dfont\)'
|
||||||
|
find -L ${font} -regex "$font_regexp" -type f -print0 | while IFS= read -rd "" f_; do
|
||||||
|
f=$(basename "$f_")
|
||||||
|
echo "nerdifying $f"
|
||||||
|
mkdir -p $out/$f
|
||||||
|
fontforge -script $src/font-patcher "$f_" ${args} -out $out/$f -q
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
set -eaux
|
||||||
|
# fontforge tends to spit out a lot of files with the same name
|
||||||
|
# so we need to move them to a unique location
|
||||||
|
for f in $out/*; do
|
||||||
|
if [ -d "$f" ]; then
|
||||||
|
for g in $f/*; do
|
||||||
|
mv "$g" "$out/$(basename "$f")-$(basename "$g")"
|
||||||
|
done
|
||||||
|
rm -r "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in nerdify {
|
||||||
|
font = pkgs.fetchzip {
|
||||||
|
url = "https://github.com/be5invis/Iosevka/releases/download/v28.1.0/PkgTTC-IosevkaSS05-28.1.0.zip";
|
||||||
|
hash = "sha256-IOk0+Ha/FG29jIBr2+7Rx89TbnvK9ngx7gAFr5VfBpU=";
|
||||||
|
stripRoot = false;
|
||||||
|
};
|
||||||
|
}
|
|
@ -25,17 +25,15 @@
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
users.users.teidesu = {
|
|
||||||
home = "/Users/teidesu";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.teidesu = { pkgs, ... }: {
|
|
||||||
imports = [
|
imports = [
|
||||||
(abs "users/teidesu/darwin.nix")
|
(import (abs "users/teidesu/darwin.nix") {
|
||||||
|
home = {
|
||||||
|
imports = [
|
||||||
./arc-setup.nix
|
./arc-setup.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = 4;
|
system.stateVersion = 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,19 @@ the config is pretty much a mess and the code sucks.
|
||||||
## impure dependencies
|
## impure dependencies
|
||||||
note to self on what needs to be installed on the host manually:
|
note to self on what needs to be installed on the host manually:
|
||||||
|
|
||||||
|
### common
|
||||||
|
- `/etc/ssh/agenix_key` (darwin: `~/.ssh/agenix_key`) - private key for secret decryption
|
||||||
|
|
||||||
|
### koi:
|
||||||
- ~~`/etc/iso/win11.iso` - iso containing windows 11 installer (e.g. this: [magnet](magnet:?xt=urn:btih:56197d53136ffcecbae5225f0ac761121eacdac6&dn=Win11_22H2_English_x64v1.iso&tr=udp%3a%2f%2ftracker.torrent.eu.org%3a451%2fannounce&tr=udp%3a%2f%2ftracker.tiny-vps.com%3a6969%2fannounce&tr=udp%3a%2f%2fopen.stealth.si%3a80%2fannounce))~~ currently unused
|
- ~~`/etc/iso/win11.iso` - iso containing windows 11 installer (e.g. this: [magnet](magnet:?xt=urn:btih:56197d53136ffcecbae5225f0ac761121eacdac6&dn=Win11_22H2_English_x64v1.iso&tr=udp%3a%2f%2ftracker.torrent.eu.org%3a451%2fannounce&tr=udp%3a%2f%2ftracker.tiny-vps.com%3a6969%2fannounce&tr=udp%3a%2f%2fopen.stealth.si%3a80%2fannounce))~~ currently unused
|
||||||
- `/etc/vms/haos.img` - qcow2 image for haos vm (can be downloaded from the official website, the KVM/Proxmox image).
|
- `/etc/vms/haos.img` - qcow2 image for haos vm (can be downloaded from the official website, the KVM/Proxmox image).
|
||||||
- `/etc/ssh/agenix_key` - private key for secret decryption
|
- `/etc/ssh/agenix_key` - private key for secret decryption
|
||||||
- `/etc/secureboot/keys` - secure boot keys, generated with `sudo nix-shell -p sbctl --run "sbctl create-keys"`
|
- `/etc/secureboot/keys` - secure boot keys, generated with `sudo nix-shell -p sbctl --run "sbctl create-keys"`
|
||||||
- to enroll fde onto tpm: `sudo systemd-cryptenroll /dev/nvme0n1p2 --tpm2-device=auto --tpm2-pcrs=0+2+7`
|
- to enroll fde onto tpm: `sudo systemd-cryptenroll /dev/nvme0n1p2 --tpm2-device=auto --tpm2-pcrs=0+2+7`
|
||||||
|
|
||||||
|
### teidesu-osx
|
||||||
|
`cp /var/run/current-system/Library/Fonts/* /Library/Fonts` - copy nix-managed fonts to system fonts (waiting for [this PR](https://github.com/LnL7/nix-darwin/pull/754))
|
||||||
|
|
||||||
nginx may not start the first time, its fine, just run `sudo systemctl restart nginx` and it should work.
|
nginx may not start the first time, its fine, just run `sudo systemctl restart nginx` and it should work.
|
||||||
its likely due to docker containers not resolving yet.
|
its likely due to docker containers not resolving yet.
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
{ abs, pkgs, lib, inputs, ... }:
|
{ home ? {}, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./fonts.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.teidesu = {
|
||||||
|
home = "/Users/teidesu";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.teidesu = { pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
|
|
||||||
|
home
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -15,5 +26,7 @@
|
||||||
wget
|
wget
|
||||||
watch
|
watch
|
||||||
curl
|
curl
|
||||||
|
android-tools
|
||||||
];
|
];
|
||||||
|
};
|
||||||
}
|
}
|
11
users/teidesu/fonts.nix
Normal file
11
users/teidesu/fonts.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
fonts.fonts = [
|
||||||
|
(pkgs.fetchzip {
|
||||||
|
name = "iosevka-nerd";
|
||||||
|
url = "https://s3.tei.su/iosevka-nerd.tgz";
|
||||||
|
hash = "sha256-WrtCS1nwsGtYG7W7EiaaC4LVq1bGod4ygFC7VpSuDx0=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,16 +1,73 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
|
starshipConfig = {
|
||||||
|
# based on https://starship.rs/presets/pastel-powerline.html
|
||||||
|
format =
|
||||||
|
"$character" +
|
||||||
|
"$hostname" +
|
||||||
|
"[](fg:#be15dc bg:#FCA17D)" +
|
||||||
|
"$git_branch" +
|
||||||
|
"$git_status" +
|
||||||
|
"[](fg:#FCA17D bg:#86BBD8)" +
|
||||||
|
"$nodejs" +
|
||||||
|
"[](fg:#86BBD8 bg:#33658A)" +
|
||||||
|
"$directory" +
|
||||||
|
"[ ](fg:#33658A)" +
|
||||||
|
"";
|
||||||
|
add_newline = false;
|
||||||
|
|
||||||
|
character = {
|
||||||
|
success_symbol = "[](#be15dc)[ алина 🌸 ](bg:#be15dc)";
|
||||||
|
error_symbol = "[](#dc156b)[ алина 🌸 ](bg:#be15dc)";
|
||||||
|
format = "$symbol";
|
||||||
|
};
|
||||||
|
|
||||||
|
hostname = {
|
||||||
|
style = ''bg:#be15dc'';
|
||||||
|
format = "[$hostname ]($style)";
|
||||||
|
ssh_only = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
directory = {
|
||||||
|
style = "bg:#33658A";
|
||||||
|
format = "[ $path ]($style)";
|
||||||
|
truncation_length = 3;
|
||||||
|
truncation_symbol = "…/";
|
||||||
|
};
|
||||||
|
|
||||||
|
git_branch = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:#FCA17D fg:black";
|
||||||
|
format = "[ $symbol $branch ]($style)";
|
||||||
|
};
|
||||||
|
git_status = {
|
||||||
|
style = "bg:#FCA17D fg:black";
|
||||||
|
format = "[$all_status$ahead_behind ]($style)";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodejs = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:#86BBD8 fg:black";
|
||||||
|
version_format = "$major.$minor";
|
||||||
|
format = "[ $symbol ($version) ]($style)";
|
||||||
|
};
|
||||||
|
|
||||||
|
env_var._HOST_COLOR = {
|
||||||
|
format = "$env_value";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
oh-my-zsh = {
|
# oh-my-zsh = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
theme = "agnoster";
|
# theme = "agnoster";
|
||||||
extraConfig = ''
|
# extraConfig = ''
|
||||||
zstyle ':bracketed-paste-magic' active-widgets '.self-*'
|
# zstyle ':bracketed-paste-magic' active-widgets '.self-*'
|
||||||
'';
|
# '';
|
||||||
};
|
# };
|
||||||
|
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
enableAutosuggestions = true;
|
enableAutosuggestions = true;
|
||||||
|
@ -24,8 +81,12 @@
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
unsetopt correct_all
|
unsetopt correct_all
|
||||||
|
zstyle ':bracketed-paste-magic' active-widgets '.self-*'
|
||||||
|
|
||||||
|
export _HOST_COLOR="#$(([##16]`hostname | cksum | cut -f 1 -d ' '` % 16777215))"
|
||||||
|
export STARSHIP_CONFIG=${(pkgs.formats.toml {}).generate "starship.toml" starshipConfig}
|
||||||
|
eval "$(${pkgs.starship}/bin/starship init zsh)"
|
||||||
|
|
||||||
CURRENT_BG="$(( `hostname | cksum | cut -f 1 -d ' '` % 255 ))"
|
|
||||||
CASE_SENSITIVE="false"
|
CASE_SENSITIVE="false"
|
||||||
HYPHEN_INSENSITIVE="true"
|
HYPHEN_INSENSITIVE="true"
|
||||||
ENABLE_CORRECTION="true"
|
ENABLE_CORRECTION="true"
|
||||||
|
|
Loading…
Reference in a new issue