Restructured nixos home-manager config
This commit is contained in:
parent
deb4233b93
commit
fceb1282f0
@ -67,6 +67,9 @@
|
||||
extraSpecialArgs.user = "random";
|
||||
modules = [
|
||||
./home/headful-nixos.nix
|
||||
./home/modules/development.nix
|
||||
./home/modules/gui-apps.nix
|
||||
./home/modules/hacking.nix
|
||||
];
|
||||
};
|
||||
|
||||
@ -83,6 +86,7 @@
|
||||
extraSpecialArgs.user = "sampledb";
|
||||
modules = [
|
||||
./home/headless-nixos.nix
|
||||
./home/modules/development.nix
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
imports = [
|
||||
./shared.nix
|
||||
./modules/utils.nix
|
||||
./modules/development.nix
|
||||
./modules/sketchybar.nix
|
||||
./modules/aerospace.nix
|
||||
./modules/neovim.nix
|
||||
|
@ -5,58 +5,23 @@
|
||||
homeDirectory = "/home/${user}";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./shared.nix
|
||||
./modules/hacking.nix
|
||||
imports = [
|
||||
./shared.nix
|
||||
./modules/utils.nix
|
||||
./modules/linux-only-utils.nix
|
||||
./modules/networking.nix
|
||||
./modules/neovim.nix
|
||||
./modules/emacs.nix
|
||||
./modules/apps.nix
|
||||
./modules/tmux.nix
|
||||
./modules/zsh.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
feh
|
||||
ncdu
|
||||
dconf
|
||||
docker
|
||||
barrier
|
||||
firefox
|
||||
flameshot
|
||||
traceroute
|
||||
pavucontrol
|
||||
virt-viewer
|
||||
bitwarden-cli
|
||||
wireguard-tools
|
||||
nextcloud-client
|
||||
protonmail-desktop
|
||||
nvtopPackages.full
|
||||
];
|
||||
|
||||
services.emacs.enable = true;
|
||||
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Materia-dark";
|
||||
package = pkgs.materia-theme;
|
||||
};
|
||||
};
|
||||
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
obs-backgroundremoval
|
||||
];
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
bitwarden-cli
|
||||
wireguard-tools
|
||||
];
|
||||
|
||||
home.file = {
|
||||
".Xresources".source = ../dotfiles/.Xresources;
|
||||
|
@ -7,13 +7,11 @@
|
||||
|
||||
imports = [
|
||||
./shared.nix
|
||||
./modules/utils.nix
|
||||
./modules/linux-only-utils.nix
|
||||
./modules/networking.nix
|
||||
./modules/neovim.nix
|
||||
./modules/tmux.conf
|
||||
./modules/zsh.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ncdu
|
||||
traceroute
|
||||
nvtopPackages.full
|
||||
];
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
{pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
vlc
|
||||
typora
|
||||
zoom-us
|
||||
discord
|
||||
libreoffice
|
||||
bitwarden-desktop
|
||||
];
|
||||
}
|
11
home/modules/development.nix
Normal file
11
home/modules/development.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs [
|
||||
# Dev tools
|
||||
clang
|
||||
clang-tools
|
||||
cargo
|
||||
python3
|
||||
gnumake
|
||||
ansible
|
||||
];
|
||||
}
|
41
home/modules/gui-apps.nix
Normal file
41
home/modules/gui-apps.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
feh
|
||||
vlc
|
||||
firefox
|
||||
zoom-us
|
||||
discord
|
||||
flameshot
|
||||
libreoffice
|
||||
pavucontrol
|
||||
virt-viewer
|
||||
nextcloud-client
|
||||
protonmail-desktop
|
||||
bitwarden-desktop
|
||||
];
|
||||
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
obs-backgroundremoval
|
||||
];
|
||||
};
|
||||
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Materia-dark";
|
||||
package = pkgs.materia-theme;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
6
home/modules/linux-only-utils.nix
Normal file
6
home/modules/linux-only-utils.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs [
|
||||
ncdu
|
||||
nvtopPackages.full
|
||||
];
|
||||
}
|
13
home/modules/networking.nix
Normal file
13
home/modules/networking.nix
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
# Network tools
|
||||
dig
|
||||
iftop
|
||||
iperf
|
||||
tcpdump
|
||||
ethtool
|
||||
traceroute
|
||||
];
|
||||
}
|
||||
|
9
home/modules/tmux.nix
Normal file
9
home/modules/tmux.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ pkgs, lib, config, ... }: let
|
||||
mypkgs = import ../../packages/all-packages.nix { inherit pkgs lib config };
|
||||
in {
|
||||
home.packages = with pkgs [ tmux ];
|
||||
home.file = {
|
||||
"tmux/plugins/tpm".source = "${mypkgs.tpm}";
|
||||
".tmux.conf".source = ../../dotfiles/.tmux.conf;
|
||||
};
|
||||
}
|
21
home/modules/utils.nix
Normal file
21
home/modules/utils.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
# Nix specific utilities
|
||||
manix
|
||||
nix-tree
|
||||
|
||||
# Utilities
|
||||
jq
|
||||
bc
|
||||
file
|
||||
wget
|
||||
curl
|
||||
btop
|
||||
p7zip
|
||||
sshpass
|
||||
ripgrep
|
||||
openvpn
|
||||
pciutils
|
||||
fastfetch
|
||||
];
|
||||
}
|
@ -4,80 +4,88 @@
|
||||
meslo-lgs-nf
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
history.size = 100000000;
|
||||
|
||||
shellAliases = {
|
||||
cd = "z";
|
||||
ls = "eza";
|
||||
awkuniq = "sort | uniq";
|
||||
histogram = "awkuniq -c | sort -nr";
|
||||
json-less = "jq -C . | less -R";
|
||||
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
|
||||
|
||||
# Server user/address aliases
|
||||
r330-idrac = "bw-ssh iDRAC root@192.168.100.11 racadm";
|
||||
r730xd-idrac = "bw-ssh iDRAC root@192.168.100.12 racadm";
|
||||
ideapad = "ssh root@192.168.100.20";
|
||||
r330-proxmox = "ssh root@192.168.100.21";
|
||||
r730xd-proxmox = "ssh root@192.168.100.22";
|
||||
r330-media = "ssh media@192.168.100.40";
|
||||
r330-logging = "ssh logging@192.168.100.41";
|
||||
sampledb-dev = "ssh sampledb@192.168.100.42";
|
||||
mindforge = "ssh mindforge@mindforge.randomctf.local";
|
||||
|
||||
# Nix Specific aliases
|
||||
update-darwin = "darwin-rebuild switch --flake ~/dotfiles";
|
||||
update-config = "sudo nixos-rebuild switch --flake ~/dotfiles";
|
||||
update-home = "home-manager switch --flake ~/dotfiles";
|
||||
update-all = "update-config && update-home";
|
||||
};
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
|
||||
'';
|
||||
|
||||
initExtra = ''
|
||||
export PATH=$PATH:~/.cargo/bin
|
||||
function .. { cd .. }
|
||||
function ... { cd ../.. }
|
||||
function .... { cd ../../.. }
|
||||
function ..... { cd ../../../../.. }
|
||||
function ...... { cd ../../../../../.. }
|
||||
function ....... { cd ../../../../../../.. }
|
||||
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
source <(/opt/homebrew/bin/brew shellenv)
|
||||
fi
|
||||
|
||||
if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then
|
||||
export TERM="xterm-256color"
|
||||
fi
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "custom-functions";
|
||||
src = ../../dotfiles;
|
||||
file = ".functions.zsh";
|
||||
}
|
||||
{
|
||||
name = "powerlevel10k-config";
|
||||
src = ../../dotfiles;
|
||||
file = ".p10k.zsh";
|
||||
}
|
||||
];
|
||||
|
||||
zplug = {
|
||||
programs = {
|
||||
zoxide.enable = true;
|
||||
eza.enable = true;
|
||||
fzf.enable = true;
|
||||
zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
|
||||
];
|
||||
};
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
history.size = 100000000;
|
||||
|
||||
shellAliases = {
|
||||
cd = "z";
|
||||
ls = "eza";
|
||||
awkuniq = "sort | uniq";
|
||||
histogram = "awkuniq -c | sort -nr";
|
||||
json-less = "jq -C . | less -R";
|
||||
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
|
||||
|
||||
# Server user/address aliases
|
||||
r330-idrac = "bw-ssh iDRAC root@192.168.100.11 racadm";
|
||||
r730xd-idrac = "bw-ssh iDRAC root@192.168.100.12 racadm";
|
||||
ideapad = "ssh root@192.168.100.20";
|
||||
r330-proxmox = "ssh root@192.168.100.21";
|
||||
r730xd-proxmox = "ssh root@192.168.100.22";
|
||||
r330-media = "ssh media@192.168.100.40";
|
||||
r330-logging = "ssh logging@192.168.100.41";
|
||||
sampledb-dev = "ssh sampledb@192.168.100.42";
|
||||
mindforge = "ssh mindforge@mindforge.randomctf.local";
|
||||
|
||||
# Nix Specific aliases
|
||||
update-darwin = "darwin-rebuild switch --flake ~/dotfiles";
|
||||
update-config = "sudo nixos-rebuild switch --flake ~/dotfiles";
|
||||
update-home = "home-manager switch --flake ~/dotfiles";
|
||||
update-all = "update-config && update-home";
|
||||
};
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
|
||||
'';
|
||||
|
||||
initExtra = ''
|
||||
export PATH=$PATH:~/.cargo/bin
|
||||
function .. { cd .. }
|
||||
function ... { cd ../.. }
|
||||
function .... { cd ../../.. }
|
||||
function ..... { cd ../../../../.. }
|
||||
function ...... { cd ../../../../../.. }
|
||||
function ....... { cd ../../../../../../.. }
|
||||
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
source <(/opt/homebrew/bin/brew shellenv)
|
||||
fi
|
||||
|
||||
if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then
|
||||
export TERM="xterm-256color"
|
||||
fi
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "custom-functions";
|
||||
src = ../../dotfiles;
|
||||
file = ".functions.zsh";
|
||||
}
|
||||
{
|
||||
name = "powerlevel10k-config";
|
||||
src = ../../dotfiles;
|
||||
file = ".p10k.zsh";
|
||||
}
|
||||
];
|
||||
|
||||
zplug = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".functions.zsh".source ../../dotfiles/.functions.zsh;
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,10 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
mypkgs = import ../packages/all-packages.nix {
|
||||
inherit pkgs lib config;
|
||||
};
|
||||
in {
|
||||
{ lib, config, pkgs, ... }: {
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# Nix specific utilities
|
||||
manix
|
||||
nix-tree
|
||||
|
||||
# Utilities
|
||||
jq
|
||||
bc
|
||||
file
|
||||
wget
|
||||
curl
|
||||
tmux
|
||||
btop
|
||||
iftop
|
||||
p7zip
|
||||
sshpass
|
||||
ripgrep
|
||||
openvpn
|
||||
pciutils
|
||||
fastfetch
|
||||
|
||||
# Network tools
|
||||
dig
|
||||
iperf
|
||||
tcpdump
|
||||
ethtool
|
||||
|
||||
# Dev tools
|
||||
clang
|
||||
clang-tools
|
||||
cargo
|
||||
python3
|
||||
gnumake
|
||||
ansible
|
||||
];
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
zoxide.enable = true;
|
||||
eza.enable = true;
|
||||
fzf.enable = true;
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Random936";
|
||||
@ -57,11 +12,5 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".functions.zsh".source = ../dotfiles/.functions.zsh;
|
||||
".tmux/plugins/tpm".source = "${mypkgs.tpm}";
|
||||
".tmux.conf".source = ../dotfiles/.tmux.conf;
|
||||
};
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user