Initial commit lol
This commit is contained in:
parent
a2318e586a
commit
ed3d2e8ef8
18 changed files with 375 additions and 0 deletions
48
flake.lock
generated
Normal file
48
flake.lock
generated
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1700013383,
|
||||||
|
"narHash": "sha256-ZBhrew3BrUEv48i+3Mp2pDjLU6dcue8BKMz6tCDSyfc=",
|
||||||
|
"owner": "langedev",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "6498661f3856a685c4fa7a19d0f8cbe17c08d8bd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "langedev",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1699825797,
|
||||||
|
"narHash": "sha256-W2m42mVt4/O6CJFbECPfLApmi8bO+qscbmSeEKrSHEg=",
|
||||||
|
"owner": "langedev",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a69768a1c385042d46ff57396c49d26df5ac035c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "langedev",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
23
flake.nix
Normal file
23
flake.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
description = "Home Manager configuration of pan";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
# Specify the source of Home Manager and Nixpkgs.
|
||||||
|
nixpkgs.url = "github:langedev/nixpkgs/nixos-unstable";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:langedev/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs, home-manager, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
homeConfigurations."pan" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [ ./home.nix ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
54
home.nix
Normal file
54
home.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
home.username = "pan";
|
||||||
|
home.homeDirectory = "/home/pan";
|
||||||
|
|
||||||
|
xdg.enable = true;
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./programs/alacritty
|
||||||
|
./programs/pywal
|
||||||
|
./programs/fish
|
||||||
|
./programs/nnn
|
||||||
|
./programs/rofi
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
eww-wayland # eww widgets
|
||||||
|
socat # For hyprland scripts
|
||||||
|
swww # Wallpaper engine
|
||||||
|
trash-cli # Trash application
|
||||||
|
dunst # Notification Manager
|
||||||
|
wlr-randr # Xrandr for wayland
|
||||||
|
|
||||||
|
# Applications
|
||||||
|
syncthing # For syncing files between computers
|
||||||
|
discord # Chat app
|
||||||
|
gimp # Photo editting
|
||||||
|
mpv # Video player
|
||||||
|
pamixer # Volume control
|
||||||
|
playerctl # Control media
|
||||||
|
wget # Download web stuff
|
||||||
|
zathura # PDF viewer
|
||||||
|
feh # Image viewer
|
||||||
|
sshfs # SSH File system
|
||||||
|
appimage-run # Lets you run app images
|
||||||
|
|
||||||
|
# Development stuff, can be removed
|
||||||
|
nodejs # For compiling JS stuff
|
||||||
|
jq # May be critical for scripts?
|
||||||
|
];
|
||||||
|
# home.file = {};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
VISUAL = "nvim";
|
||||||
|
BROWSER = "librewolf";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself.
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
home.stateVersion = "23.05"; # don't change lol, u know why
|
||||||
|
}
|
||||||
32
programs/alacritty/default.nix
Normal file
32
programs/alacritty/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.alacritty.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
programs.alacritty.settings = {
|
||||||
|
font = let fam = "Cascadia Code"; in {
|
||||||
|
normal = {
|
||||||
|
family = fam;
|
||||||
|
style = "Regular";
|
||||||
|
};
|
||||||
|
bold = {
|
||||||
|
family = fam;
|
||||||
|
style = "Bold";
|
||||||
|
};
|
||||||
|
italic = {
|
||||||
|
family = fam;
|
||||||
|
style = "Italic";
|
||||||
|
};
|
||||||
|
bold_italic = {
|
||||||
|
family = fam;
|
||||||
|
style = "Bold Italic";
|
||||||
|
};
|
||||||
|
offset = {
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
};
|
||||||
|
size = 24.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
43
programs/fish/default.nix
Normal file
43
programs/fish/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
programs.fish.interactiveShellInit = ''
|
||||||
|
cat ~/.cache/wal/sequences
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.fish.functions = {
|
||||||
|
fish_greeting = "";
|
||||||
|
fish_prompt = ''
|
||||||
|
${builtins.readFile ./functions/fish_prompt.fish}
|
||||||
|
'';
|
||||||
|
fish_right_prompt = ''
|
||||||
|
${builtins.readFile ./functions/fish_right_prompt.fish}
|
||||||
|
'';
|
||||||
|
git_branch_name = ''
|
||||||
|
${builtins.readFile ./functions/git_branch_name.fish}
|
||||||
|
'';
|
||||||
|
git_is_dirty = ''
|
||||||
|
${builtins.readFile ./functions/git_is_dirty.fish}
|
||||||
|
'';
|
||||||
|
git_is_repo = ''
|
||||||
|
${builtins.readFile ./functions/git_is_repo.fish}
|
||||||
|
'';
|
||||||
|
git_is_staged = ''
|
||||||
|
${builtins.readFile ./functions/git_is_staged.fish}
|
||||||
|
'';
|
||||||
|
git_is_touched = ''
|
||||||
|
${builtins.readFile ./functions/git_is_touched.fish}
|
||||||
|
'';
|
||||||
|
git_is_worktree = ''
|
||||||
|
${builtins.readFile ./functions/git_is_worktree.fish}
|
||||||
|
'';
|
||||||
|
n = ''
|
||||||
|
${builtins.readFile ./functions/n.fish}
|
||||||
|
'';
|
||||||
|
ssh = ''
|
||||||
|
${builtins.readFile ./functions/ssh.fish}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
13
programs/fish/functions/fish_prompt.fish
Normal file
13
programs/fish/functions/fish_prompt.fish
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
set -l last_command_status $status
|
||||||
|
|
||||||
|
set -l symbol 'τ'
|
||||||
|
|
||||||
|
set -l normal_color (set_color normal)
|
||||||
|
set -l symbol_color (set_color blue -o)
|
||||||
|
set -l error_color (set_color red -o)
|
||||||
|
|
||||||
|
if test $last_command_status -eq 0
|
||||||
|
echo -n -s $symbol_color $symbol " " $normal_color
|
||||||
|
else
|
||||||
|
echo -n -s $error_color $symbol " " $normal_color
|
||||||
|
end
|
||||||
61
programs/fish/functions/fish_right_prompt.fish
Normal file
61
programs/fish/functions/fish_right_prompt.fish
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
set -l cwd
|
||||||
|
set -l cwd_color (set_color blue)
|
||||||
|
set -l normal_color (set_color normal)
|
||||||
|
set -l branch_color (set_color yellow)
|
||||||
|
set -l meta_color (set_color red)
|
||||||
|
|
||||||
|
if git_is_repo
|
||||||
|
echo -n -s $branch_color (git_branch_name) $normal_color
|
||||||
|
set -l git_meta ""
|
||||||
|
if test (command git ls-files --others --exclude-standard | wc -w 2> /dev/null) -gt 0
|
||||||
|
set git_meta "$git_meta?"
|
||||||
|
end
|
||||||
|
if test (command git rev-list --walk-reflogs --count refs/stash 2> /dev/null)
|
||||||
|
set git_meta "$git_meta\$"
|
||||||
|
end
|
||||||
|
if git_is_touched
|
||||||
|
git_is_dirty && set git_meta "$git_meta⨯"
|
||||||
|
git_is_staged && set git_meta "$git_meta●"
|
||||||
|
end
|
||||||
|
set -l commit_count (command git rev-list --count --left-right (git remote)/(git_branch_name)"...HEAD" 2> /dev/null)
|
||||||
|
if test $commit_count
|
||||||
|
set -l behind (echo $commit_count | cut -f 1)
|
||||||
|
set -l ahead (echo $commit_count | cut -f 2)
|
||||||
|
if test $behind -gt 0
|
||||||
|
set git_meta "$git_meta🠋"
|
||||||
|
end
|
||||||
|
if test $ahead -gt 0
|
||||||
|
set git_meta "$git_meta🠉"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if test $git_meta
|
||||||
|
echo -n -s $meta_color " " $git_meta " " $normal_color
|
||||||
|
else
|
||||||
|
echo -n -s " "
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
set root_folder (command git rev-parse --show-toplevel 2> /dev/null)
|
||||||
|
set parent_root_folder (dirname $root_folder)
|
||||||
|
set cwd (echo $PWD | sed -e "s|$parent_root_folder/||")
|
||||||
|
else
|
||||||
|
set cwd (prompt_pwd)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
echo -n -s $cwd_color "$cwd"
|
||||||
|
set_color --dim
|
||||||
|
|
||||||
|
set -l S (math $CMD_DURATION/1000)
|
||||||
|
set -l M (math $S/60)
|
||||||
|
|
||||||
|
|
||||||
|
echo -n -s " "
|
||||||
|
if test $M -gt 1
|
||||||
|
echo -n -s $M m
|
||||||
|
else if test $S -gt 1
|
||||||
|
echo -n -s $S s
|
||||||
|
else
|
||||||
|
echo -n -s $CMD_DURATION ms
|
||||||
|
end
|
||||||
|
set_color normal
|
||||||
4
programs/fish/functions/git_branch_name.fish
Normal file
4
programs/fish/functions/git_branch_name.fish
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
git_is_repo; and begin
|
||||||
|
command git symbolic-ref --short HEAD 2> /dev/null;
|
||||||
|
or command git show-ref --head -s --abbrev | head -n1 2> /dev/null
|
||||||
|
end
|
||||||
1
programs/fish/functions/git_is_dirty.fish
Normal file
1
programs/fish/functions/git_is_dirty.fish
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
git_is_worktree; and not command git diff --no-ext-diff --quiet --exit-code
|
||||||
5
programs/fish/functions/git_is_repo.fish
Normal file
5
programs/fish/functions/git_is_repo.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
test -d .git
|
||||||
|
or begin
|
||||||
|
set -l info (command git rev-parse --git-dir --is-bare-repository 2>/dev/null)
|
||||||
|
and test $info[2] = false
|
||||||
|
end
|
||||||
3
programs/fish/functions/git_is_staged.fish
Normal file
3
programs/fish/functions/git_is_staged.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
git_is_repo; and begin
|
||||||
|
not command git diff --cached --no-ext-diff --quiet --exit-code
|
||||||
|
end
|
||||||
6
programs/fish/functions/git_is_touched.fish
Normal file
6
programs/fish/functions/git_is_touched.fish
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
git_is_worktree; and begin
|
||||||
|
# The first checks for staged changes, the second for unstaged ones.
|
||||||
|
# We put them in this order because checking staged changes is *fast*.
|
||||||
|
not command git diff-index --cached --quiet HEAD -- >/dev/null 2>&1
|
||||||
|
or not command git diff --no-ext-diff --quiet --exit-code >/dev/null 2>&1
|
||||||
|
end
|
||||||
2
programs/fish/functions/git_is_worktree.fish
Normal file
2
programs/fish/functions/git_is_worktree.fish
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
git_is_repo
|
||||||
|
and test (command git rev-parse --is-inside-git-dir) = false
|
||||||
30
programs/fish/functions/n.fish
Normal file
30
programs/fish/functions/n.fish
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Block nesting of nnn in subshells
|
||||||
|
if test -n "$NNNLVL"
|
||||||
|
if [ (expr $NNNLVL + 0) -ge 1 ]
|
||||||
|
exit
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
|
# To cd on quit only on ^G, remove the "-x" as in:
|
||||||
|
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||||
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
|
if test -n "$XDG_CONFIG_HOME"
|
||||||
|
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||||
|
else
|
||||||
|
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||||
|
# stty start undef
|
||||||
|
# stty stop undef
|
||||||
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
|
nnn -T v $argv
|
||||||
|
|
||||||
|
if test -e $NNN_TMPFILE
|
||||||
|
source $NNN_TMPFILE
|
||||||
|
rm $NNN_TMPFILE
|
||||||
|
end
|
||||||
1
programs/fish/functions/ssh.fish
Normal file
1
programs/fish/functions/ssh.fish
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
command ssh -o IPQoS=0 $argv;
|
||||||
11
programs/nnn/default.nix
Normal file
11
programs/nnn/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nnn.enable = true;
|
||||||
|
home.sessionVariables = {
|
||||||
|
NNN_FCOLORS = "0000E6310000000000000000";
|
||||||
|
NNN_OPTS = "eH";
|
||||||
|
NNN_FIFO = "/tmp/nnn.fifo";
|
||||||
|
NNN_TRASH = "1";
|
||||||
|
};
|
||||||
|
}
|
||||||
8
programs/pywal/default.nix
Normal file
8
programs/pywal/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.pywal.enable = true;
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
pywalfox # Update librewolf's colorscheme based on pywal
|
||||||
|
];
|
||||||
|
}
|
||||||
30
programs/rofi/default.nix
Normal file
30
programs/rofi/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.rofi.enable = true;
|
||||||
|
programs.rofi.package = pkgs.rofi-wayland;
|
||||||
|
programs.wofi.settings = {
|
||||||
|
show = "dmenu"; # Default to dmenu
|
||||||
|
prompt = "";
|
||||||
|
hide_scroll = true;
|
||||||
|
insensitive = true;
|
||||||
|
location = "bottom_right";
|
||||||
|
dynamic_lines = true;
|
||||||
|
yoffset = -100;
|
||||||
|
xoffset = -40;
|
||||||
|
height = "50%";
|
||||||
|
width = "50%";
|
||||||
|
};
|
||||||
|
programs.wofi.style = ''
|
||||||
|
window {
|
||||||
|
background: rgba(0, 0, 0, 255);
|
||||||
|
font-size: 4rem;
|
||||||
|
}
|
||||||
|
#entry, #input {
|
||||||
|
margin: 2px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-width: 2px;
|
||||||
|
border-color: #000000;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue