refactor: split up home configs

This commit is contained in:
matt1432 2023-06-26 23:29:17 +02:00
parent 716e0c6fb3
commit 450a82dc53
6 changed files with 262 additions and 135 deletions

View file

@ -2,6 +2,7 @@
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
consoleLogLevel = 0;
initrd.verbose = false;
initrd.systemd.enable = true;

View file

@ -27,7 +27,7 @@
gtklock = {};
# all the changes in /etc/pam.d/*
sddm.text = ''
sddm.text = /* TODO: lib.mkBefore ... */''
auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok
auth sufficient /nix/store/7hw6i2p2p7zzgjirw6xaj3c50gga488y-fprintd-1.94.2/lib/security/pam_fprintd.so
auth substack login

116
nixos/home/bashdots.nix Normal file
View file

@ -0,0 +1,116 @@
{ pkgs, ... }:
{
programs.bash = { # TODO: deal with root dotfiles
enable = true;
enableCompletion = true;
#enableVteIntegration = false; what is this?
historyFile = "\$HOME/.cache/.bash_history";
historyFileSize = 100000; # default
historySize = 10000; # default
historyControl = [
"erasedups"
"ignorespace"
];
historyIgnore = [
"ls"
"exit"
"logout"
];
shellOptions = [
"histappend"
"checkwinsize"
"extglob"
"globstar"
"checkjobs"
"autocd"
"cdspell"
"dirspell"
"dotglob"
]
;
shellAliases = {
sudo = "sudo ";
frick = "sudo $(fc -ln -1)";
tmux = "tmux -2";
ls = "ls -lah --color=auto";
cp = "cp -r";
tup = "tailscale up --login-server https://headscale.nelim.org";
pc = "mosh matt@10.0.0.248 -- tmux -2u new -At laptop";
oksys = "mosh matt@10.0.0.213 -- tmux -2u new -At laptop";
pve = "mosh matt@10.0.0.121 -- tmux -2u new -At laptop";
mc = "mosh mc@10.0.0.124 -- tmux -2u new -At laptop";
pod = "mosh matt@10.0.0.121 -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'";
jelly = "mosh matt@10.0.0.121 -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'";
qbit = "mosh matt@10.0.0.121 -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'";
};
sessionVariables = {
TERM = "xterm-color";
#MOZ_ENABLE_WAYLAND = 1;
#QT_QPA_PLATFORM = "wayland-egl";
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:\$XDG_DATA_DIRS";
};
profileExtra = ''
export POKE=true
[[ -f ~/.bashrc ]] && . ~/.bashrc
'';
bashrcExtra = ''
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
[[ -d ~/.local/bin ]] && PATH+=":$HOME/.local/bin"
USER_COLOR="01;32m"
HOST_COLOR="183m"
PS1="\[\033[$USER_COLOR\]\u\[\033[01;38;5;$HOST_COLOR\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ "
# source: https://stackoverflow.com/a/44232192
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
[ -x "$(command -v pokemon-colorscripts)" ] &&
[ "$POKE" == "true" ] &&
pokemon-colorscripts -r 1-5
function colorgrid() {
iter=16
while [ $iter -lt 52 ]
do
second=$[$iter+36]
third=$[$second+36]
four=$[$third+36]
five=$[$four+36]
six=$[$five+36]
seven=$[$six+36]
if [ $seven -gt 250 ];then seven=$[$seven-251]; fi
echo -en "\033[38;5;$(echo $iter)m "
printf "%03d" $iter
echo -en " \033[38;5;$(echo $second)m "
printf "%03d" $second
echo -en " \033[38;5;$(echo $third)m "
printf "%03d" $third
echo -en " \033[38;5;$(echo $four)m "
printf "%03d" $four
echo -en " \033[38;5;$(echo $five)m "
printf "%03d" $five
echo -en " \033[38;5;$(echo $six)m "
printf "%03d" $six
echo -en " \033[38;5;$(echo $seven)m "
printf "%03d" $seven
iter=$[$iter+1]
printf '\r\n'
done
}
'';
#initExtra = ''
#'';
#logoutExtra = ''
#'';
};
}

View file

@ -22,143 +22,12 @@
home-manager.users.matt = {
imports = [
./bashdots.nix
./hyprland.nix
./packages.nix
./misc.nix
];
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
};
home.packages = with pkgs;
(with xorg; [
xcursorthemes
]) ++
(with python311Packages; [
python
pyclip
]) ++
(with plasma5Packages; [
polkit-kde-agent
qtstyleplugin-kvantum
breeze-icons
dolphin
dolphin-plugins
ffmpegthumbs
kio-admin # needs to be both here and in system pkgs
ark
kcharselect
#kdenlive
kmime
okular
]) ++
(with gnome; [
gnome-calculator
seahorse
adwaita-icon-theme
]) ++
[
swayosd
qt5.qtwayland
qt6.qtwayland
httrack
lisgd
zeal
acpi
libreoffice-fresh # TODO: add spelling stuff
neofetch
photoqt
progress
wl-color-picker # add bind for this in hyprland
xclip
xdg-utils
pavucontrol # TODO: open on left click
gimp-with-plugins
jdk19_headless
bluez-tools
spotify
#spotifywm # fails to build
spicetify-cli # TODO
vlc
discord
alacritty
brightnessctl
pulseaudio
alsa-utils
wget
firefox
tree
mosh
rsync
killall
jq # enable using home-manager?
ripgrep-all
hyprpaper
rofi-wayland
networkmanagerapplet
nextcloud-client
tutanota-desktop
galaxy-buds-client
swaynotificationcenter
swayidle
wl-clipboard
cliphist
gtklock
gtklock-playerctl-module
gtklock-powerbar-module
grim
slurp
swappy
neovim
fontfor
qt5ct
lxappearance
imagemagick
usbutils
evtest
squeekboard
(builtins.getFlake "github:matt1432/eww-exclusiver").packages.x86_64-linux.default
glib
appimage-run
gparted # doesn't open without sudo
(writeShellScriptBin "Gparted" ''
(
sleep 0.5
while killall -r -0 ksshaskpass > /dev/null 2>&1
do
sleep 0.1
if [[ $(hyprctl activewindow | grep Ksshaskpass) == "" ]]; then
killall -r ksshaskpass
fi
done
) &
exec env SUDO_ASKPASS=${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname} sudo -k -EA "${gparted}/bin/${gparted.pname}" "$@"
'')
];
xdg.desktopEntries.gparted = {
name = "GParted";
genericName = "Partition Editor";
comment = "Create, reorganize, and delete partitions";
exec = "Gparted";
icon = "gparted";
terminal = false;
type = "Application";
categories = [ "GNOME" "System" "Filesystem" ];
startupNotify = true;
settings = {
Keywords = "Partition";
X-GNOME-FullName = "GParted Partition Editor";
};
};
home.stateVersion = "23.05";
};
}

19
nixos/home/misc.nix Normal file
View file

@ -0,0 +1,19 @@
{ ... }:
{
xdg.desktopEntries.gparted = {
name = "GParted";
genericName = "Partition Editor";
comment = "Create, reorganize, and delete partitions";
exec = "Gparted";
icon = "gparted";
terminal = false;
type = "Application";
categories = [ "GNOME" "System" "Filesystem" ];
startupNotify = true;
settings = {
Keywords = "Partition";
X-GNOME-FullName = "GParted Partition Editor";
};
};
}

122
nixos/home/packages.nix Normal file
View file

@ -0,0 +1,122 @@
{ pkgs, ... }:
{
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
};
home.packages = with pkgs;
(with xorg; [
xcursorthemes
]) ++
(with python311Packages; [
python
pyclip
]) ++
(with plasma5Packages; [
polkit-kde-agent
qtstyleplugin-kvantum
breeze-icons
dolphin
dolphin-plugins
ffmpegthumbs
kio-admin # needs to be both here and in system pkgs
ark
kcharselect
kdenlive
kmime
okular
]) ++
(with gnome; [
gnome-calculator
seahorse
adwaita-icon-theme
]) ++
[
(writeShellScriptBin "Gparted" ''
(
sleep 0.5
while killall -r -0 ksshaskpass > /dev/null 2>&1
do
sleep 0.1
if [[ $(hyprctl activewindow | grep Ksshaskpass) == "" ]]; then
killall -r ksshaskpass
fi
done
) &
exec env SUDO_ASKPASS=${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname} sudo -k -EA "${gparted}/bin/${gparted.pname}" "$@"
'')
(builtins.getFlake "github:matt1432/eww-exclusiver").packages.x86_64-linux.default
swayosd
qt5.qtwayland
qt6.qtwayland
httrack
lisgd
zeal
acpi
libreoffice-fresh # TODO: add spelling stuff
neofetch
photoqt
progress
wl-color-picker # add bind for this in hyprland
xclip
xdg-utils
pavucontrol # TODO: open on left click
gimp-with-plugins
jdk19_headless
bluez-tools
spotify
#spotifywm # fails to build
spicetify-cli # TODO
vlc
discord
alacritty
brightnessctl
pulseaudio
alsa-utils
wget
firefox
tree
mosh
rsync
killall
jq # enable using home-manager?
ripgrep-all
hyprpaper
rofi-wayland
networkmanagerapplet
nextcloud-client
tutanota-desktop
galaxy-buds-client
swaynotificationcenter
swayidle
wl-clipboard
cliphist
gtklock
gtklock-playerctl-module
gtklock-powerbar-module
grim
slurp
swappy
neovim
fontfor
qt5ct
lxappearance
imagemagick
usbutils
evtest
squeekboard
glib
appimage-run
gparted # doesn't open without sudo
];
}