This commit is contained in:
Nikos Papadakis 2023-09-24 15:07:57 +03:00
parent 9622e5b39e
commit 23060964d4
Signed by untrusted user who does not match committer: nikos
GPG key ID: 78871F9905ADFF02
32 changed files with 267 additions and 285 deletions

10
.editorconfig Normal file
View file

@ -0,0 +1,10 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.nix]
indent_style = space
indent_size = 2

View file

@ -1,46 +1,26 @@
## Configurations
## Dotfiles
- [Neovim Nightly](https://github.com/neovim/neovim)
- [Fish Shell](https://github.com/fish-shell/fish-shell)
- And more
Pick and choose - you might want to change some stuff (git config for example).
## Fonts
You will have to install the fonts I use in these dotfiles separately
- [ttf-jetbrains-mono-nerd](https://github.com/ryanoasis/nerd-fonts)
## Tools
- [ripgrep](https://github.com/BurntSushi/ripgrep) `grep` alternative (used by nvim)
- [fd](https://github.com/sharkdp/fd) - `find` alternative (used by nvim)
- [lsd](https://github.com/lsd-rs/lsd) - `ls` alternative
See [packages.nix]() for a list of programs that I use, which `home-manager`
installs automatically.
## Usage
Either copy and paste anything you like, or use *Nix*
[home-manager](https://github.com/nix-community/home-manager) (recommended)
- Clone the repository (e.g into `~/.dotfiles`)
```
git clone https://git.nikos.gg/nikos/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
```
- For automated dotfile linking use [just](https://github.com/casey/just)
- Use `just add target` where target is the config directory
```
cd ~/.dotfiles
just add fish
just add nvim
just add wezterm
```
- Or, manually link the directory you need
```
ln -s ~/.dotfiles/fish/dot-config/fish ~/.config/fish
ln -s ~/.dotfiles/nvim/dot-config/nvim ~/.config/nvim
ln -s ~/.dotfiles/wezterm/dot-config/wezterm ~/.config/wezterm
```
- `cd ~/.dotfiles`
- Install [Nix](https://nixos.org/download)
- Enable `flakes`:
- Using your editor, open the nix configuration (`/etc/nix/nix.conf`)
- Add the following line: `experimental-features = nix-command flakes`
- Edit `flakes.nix`, `home.nix` and `packages.nix` to your liking (add/remove
packages, configs, etc.)
- **Double check your nix config**, you'll probably want to edit them for yourself,
especially things like the git config
- On your first run: `nix run home-manager/master -- switch --flake ~/.dotfiles`
- On subsequent runs: `home-manager switch --flake ~/.dotfiles`

File diff suppressed because one or more lines are too long

View file

@ -1,26 +0,0 @@
set -U fish_greeting
alias lsd="lsd --group-directories-first"
alias newkey="gpg-connect-agent \"scd serialno\" \"learn --force\" /bye"
alias usepodman="set -x -g DOCKER_HOST unix://(podman info --format '{{.Host.RemoteSocket.Path}}')"
abbr gs git status
abbr gc git commit
abbr gap git add -p
abbr gps git push
abbr gpl git pull
type -q nvim && abbr vim nvim
type -q doas && abbr sudo doas
if type -q lsd
abbr ls lsd
abbr ll lsd -l
abbr la lsd -la
abbr llg lsd -lg
end
# Environment variables
set -x -g RUSTUP_HOME $XDG_DATA_HOME/rustup
set -x -g CARGO_HOME $HOME/.cargo
set -x -g PATH $CARGO_HOME/bin $RUSTUP_HOME/bin $HOME/.local/bin $PATH
type -q zoxide && zoxide init fish | source
test -e ~/.asdf && source ~/.asdf/asdf.fish

105
flake.lock Normal file
View file

@ -0,0 +1,105 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1695550077,
"narHash": "sha256-xoxR/iY69/3lTnnZDP6gf3J46DUKPcf+Y1jH03tfZXE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a88df2fb101778bfd98a17556b3a2618c6c66091",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"neovim": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1695564269,
"narHash": "sha256-hawh5Z4NCiFV7KRLBZBAPNLUPqk/SGOJF/0d3jz8BW8=",
"owner": "neovim",
"repo": "neovim",
"rev": "61ecb3e16c22eec9cb8eb77f76d9e8ddfc3601bc",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1695360818,
"narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e35dcc04a3853da485a396bdd332217d0ac9054f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"neovim": "neovim",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

41
flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
description = "Home Manager configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim = {
url = "github:neovim/neovim?dir=contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, neovim, ... }:
let
system = "x86_64-linux"; # change your system type here
user = "nikos"; # change your user here
pkgs = nixpkgs.legacyPackages.${system};
in
{
homeConfigurations.${user} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [
./home.nix
{
nixpkgs.overlays = [
(final: prev: {
neovim = neovim.packages.${system}.neovim;
})
];
}
];
};
};
}

View file

@ -1,14 +0,0 @@
[user]
email = nikos@papadakis.xyz
name = Nikos Papadakis
signingkey = 78871F9905ADFF02
[pull]
rebase = true
[branch]
autosetuprebase = always
[gpg]
program = gpg2
[commit]
gpgsign = true
[init]
defaultBranch = main

60
home.nix Normal file
View file

@ -0,0 +1,60 @@
{ config, pkgs, lib, ... }:
{
home.username = "nikos";
home.homeDirectory = "/home/nikos";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
".config/nvim".source = ./nvim;
".config/foot".source = ./foot;
};
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = import ./packages.nix pkgs;
fonts.fontconfig.enable = true;
programs.git = {
enable = true;
userName = "Nikos Papadakis";
userEmail = "nikos@papadakis.xyz";
signing.key = "78871F9905ADFF02";
signing.signByDefault = true;
includes = [
{
contents = {
init.defaultBranch = "main";
pull.rebase = true;
};
}
];
};
programs.fish = {
enable = true;
shellInit = builtins.readFile ./fish/config.fish;
functions = lib.attrsets.mapAttrs'
(
name: value: {
name = builtins.replaceStrings [ ".fish" ] [ "" ] name;
value = builtins.readFile (./fish/functions + ("/" + name));
}
)
(builtins.readDir ./fish/functions);
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View file

@ -1,25 +0,0 @@
add target:
#!/bin/env sh
set -e
target={{trim_end_matches(target, '/')}}
find $target -mindepth 1 | while read p; do
t=~/`echo -n $p | sed "s/^$target\///" | sed s/dot-/./g`
s="{{justfile_directory()}}/$p"
if ( ! test -e $t ); then
echo "Linking $t -> $s"
ln -s $s $t
fi
done
remove target:
#!/bin/env sh
set -e
target={{trim_end_matches(target, '/')}}
find $target -mindepth 1 | while read p; do
t=~/`echo -n $p | sed "s/^$target\///" | sed s/dot-/./g`
if ( test -L $t ); then
rm $t && echo "Removing $t"
fi
done
# vim: set syntax=sh :

7
packages.nix Normal file
View file

@ -0,0 +1,7 @@
pkgs: with pkgs; [
neovim # neovim nightly
ripgrep # "rg" cli, alternative to grep, used by nvim
fd # find alternative, used by nvim
lsd # "ls" alternative
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # nerdfonts jetbrains mono
]

View file

@ -1,123 +0,0 @@
palette = "catppuccin_frappe"
[character]
success_symbol = "[[♥](green) ](maroon)"
error_symbol = "[](red)"
vicmd_symbol = "[](green)"
[directory]
truncation_length = 4
# Catppuccin 'lavender'
style = "bold lavender"
[palettes.catppuccin_macchiato]
rosewater = "#f4dbd6"
flamingo = "#f0c6c6"
pink = "#f5bde6"
mauve = "#c6a0f6"
red = "#ed8796"
maroon = "#ee99a0"
peach = "#f5a97f"
yellow = "#eed49f"
green = "#a6da95"
teal = "#8bd5ca"
sky = "#91d7e3"
sapphire = "#7dc4e4"
blue = "#8aadf4"
lavender = "#b7bdf8"
text = "#cad3f5"
subtext1 = "#b8c0e0"
subtext0 = "#a5adcb"
overlay2 = "#939ab7"
overlay1 = "#8087a2"
overlay0 = "#6e738d"
surface2 = "#5b6078"
surface1 = "#494d64"
surface0 = "#363a4f"
base = "#24273a"
mantle = "#1e2030"
crust = "#181926"
[palettes.catppuccin_frappe]
rosewater = "#f2d5cf"
flamingo = "#eebebe"
pink = "#f4b8e4"
mauve = "#ca9ee6"
red = "#e78284"
maroon = "#ea999c"
peach = "#ef9f76"
yellow = "#e5c890"
green = "#a6d189"
teal = "#81c8be"
sky = "#99d1db"
sapphire = "#85c1dc"
blue = "#8caaee"
lavender = "#babbf1"
text = "#c6d0f5"
subtext1 = "#b5bfe2"
subtext0 = "#a5adce"
overlay2 = "#949cbb"
overlay1 = "#838ba7"
overlay0 = "#737994"
surface2 = "#626880"
surface1 = "#51576d"
surface0 = "#414559"
base = "#303446"
mantle = "#292c3c"
crust = "#232634"
[palettes.catppuccin_latte]
rosewater = "#dc8a78"
flamingo = "#dd7878"
pink = "#ea76cb"
mauve = "#8839ef"
red = "#d20f39"
maroon = "#e64553"
peach = "#fe640b"
yellow = "#df8e1d"
green = "#40a02b"
teal = "#179299"
sky = "#04a5e5"
sapphire = "#209fb5"
blue = "#1e66f5"
lavender = "#7287fd"
text = "#4c4f69"
subtext1 = "#5c5f77"
subtext0 = "#6c6f85"
overlay2 = "#7c7f93"
overlay1 = "#8c8fa1"
overlay0 = "#9ca0b0"
surface2 = "#acb0be"
surface1 = "#bcc0cc"
surface0 = "#ccd0da"
base = "#eff1f5"
mantle = "#e6e9ef"
crust = "#dce0e8"
[palettes.catppuccin_mocha]
rosewater = "#f5e0dc"
flamingo = "#f2cdcd"
pink = "#f5c2e7"
mauve = "#cba6f7"
red = "#f38ba8"
maroon = "#eba0ac"
peach = "#fab387"
yellow = "#f9e2af"
green = "#a6e3a1"
teal = "#94e2d5"
sky = "#89dceb"
sapphire = "#74c7ec"
blue = "#89b4fa"
lavender = "#b4befe"
text = "#cdd6f4"
subtext1 = "#bac2de"
subtext0 = "#a6adc8"
overlay2 = "#9399b2"
overlay1 = "#7f849c"
overlay0 = "#6c7086"
surface2 = "#585b70"
surface1 = "#45475a"
surface0 = "#313244"
base = "#1e1e2e"
mantle = "#181825"
crust = "#11111b"

View file

@ -1,3 +0,0 @@
indent_type = "Spaces"
indent_width = 4
no_call_parentheses = true

View file

@ -1,57 +0,0 @@
local wezterm = require 'wezterm'
return {
font = wezterm.font 'JetBrainsMono Nerd Font Mono',
color_scheme = 'Catppuccin Mocha',
harfbuzz_features = { "zero" },
front_end = "Software",
use_fancy_tab_bar = true,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
},
keys = {
{
key = '|',
mods = 'CTRL|SHIFT',
action = wezterm.action.SplitHorizontal,
},
{
key = '"',
mods = 'CTRL|SHIFT',
action = wezterm.action.SplitVertical,
},
{
key = 'h',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivatePaneDirection 'Left',
},
{
key = 'j',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivatePaneDirection 'Down',
},
{
key = 'k',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivatePaneDirection 'Up',
},
{
key = 'l',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivatePaneDirection 'Right',
},
{
key = '{',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivateTabRelative(-1),
},
{
key = '}',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivateTabRelative(1),
},
},
}