some cleanups and stuffs

This commit is contained in:
krizej 2024-07-12 16:56:54 +02:00
parent cb8832c79a
commit f4d0e23fa3
5 changed files with 73 additions and 67 deletions

View file

@ -5,13 +5,16 @@ args @ { pkgs, ... }:
nixpkgs.config.permittedInsecurePackages = [ nixpkgs.config.permittedInsecurePackages = [
"freeimage-unstable-2021-11-01" "freeimage-unstable-2021-11-01"
]; ];
home-manager.users.krizej.programs.home-manager.enable = true;
home-manager.users.krizej.home.packages = [ home-manager.users.krizej.home.packages = [
(pkgs.writeShellScriptBin "rebuild" '' (pkgs.writeShellScriptBin "rebuild" ''
set -e
# hack: update autorandr stuffs # hack: update autorandr stuffs
autorandr --match-edid --dry-run &> ~/nix/files/autorandr.txt autorandr --match-edid --dry-run &> ~/nix/files/autorandr.txt
sudo nixos-rebuild switch --flake ~/nix --show-trace -v sudo nixos-rebuild switch --flake ~/nix --show-trace -v $@
'') '')
]; ];

View file

@ -1,19 +1,26 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
HOME = config.home-manager.users.krizej.home.homeDirectory; HOME = config.home-manager.users.krizej.home.homeDirectory;
XDG_DATA_HOME = "${HOME}/.local/share";
XDG_CONFIG_HOME = "${HOME}/.config";
XDG_STATE_HOME = "${HOME}/.local/state";
XDG_CACHE_HOME = "${HOME}/.cache";
in { in {
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
config.common.default = [ "*" ];
};
home-manager.users.krizej = { home-manager.users.krizej = {
home.packages = with pkgs; [ home.packages = with pkgs; [
xdg-user-dirs xdg-user-dirs
xdg-utils xdg-utils
]; ];
home.sessionVariables = rec { home.sessionVariables = {
# xdg crap thx poz # xdg crap thx poz
XDG_DATA_HOME = "${HOME}/.local/share";
XDG_CONFIG_HOME = "${HOME}/.config";
XDG_STATE_HOME = "${HOME}/.local/state";
XDG_CACHE_HOME = "${HOME}/.cache";
ANDROID_USER_HOME = "${XDG_DATA_HOME}/android"; ANDROID_USER_HOME = "${XDG_DATA_HOME}/android";
ANDROID_HOME = "${XDG_DATA_HOME}/android/sdk"; ANDROID_HOME = "${XDG_DATA_HOME}/android/sdk";
GRADLE_USER_HOME = "${XDG_DATA_HOME}/gradle"; GRADLE_USER_HOME = "${XDG_DATA_HOME}/gradle";
@ -30,50 +37,45 @@ in {
GTK2_RC_FILES = lib.mkForce "${XDG_CONFIG_HOME}/gtk-2.0/gtkrc"; GTK2_RC_FILES = lib.mkForce "${XDG_CONFIG_HOME}/gtk-2.0/gtkrc";
}; };
xdg.userDirs = { xdg = {
enable = true; dataHome = XDG_DATA_HOME;
desktop = "${HOME}/desktop"; configHome = XDG_CONFIG_HOME;
documents = "${HOME}/documents"; stateHome = XDG_STATE_HOME;
download = "${HOME}/downloads"; cacheHome = XDG_CACHE_HOME;
music = "${HOME}/music";
pictures = "${HOME}/pictures";
publicShare = "${HOME}/public";
templates = "${HOME}/templates";
videos = "${HOME}/videos";
};
# fix this scheisse userDirs = {
xdg.portal = { enable = true;
enable = true; desktop = "${HOME}/desktop";
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-kde ]; documents = "${HOME}/documents";
config.common.default = [ "*" ]; download = "${HOME}/downloads";
}; music = "${HOME}/music";
pictures = "${HOME}/pictures";
publicShare = "${HOME}/public";
templates = "${HOME}/templates";
videos = "${HOME}/videos";
};
home.file = { configFile = {
".config/python/pythonrc".text = '' "python/pythonrc".text = ''
def is_vanilla() -> bool: import os
import sys import atexit
return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0] import readline
def setup_history(): history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
import os try:
import atexit readline.read_history_file(history)
import readline except OSError:
from pathlib import Path pass
if state_home := os.environ.get('XDG_STATE_HOME'): def write_history():
state_home = Path(state_home) try:
else: readline.write_history_file(history)
state_home = Path.home() / '.local' / 'state' except OSError:
pass
history: Path = state_home / 'python_history' atexit.register(write_history)
'';
readline.read_history_file(str(history)) };
atexit.register(readline.write_history_file, str(history))
if is_vanilla():
setup_history()
'';
}; };
}; };
} }

View file

@ -19,29 +19,27 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
ed # is the standard text editor. ed # is the standard text editor.
ripgrep ripgrep
file file
tree tree
btop btop
eza
wget
zip zip
unzip unzip
rar rar
unrar unrar
p7zip p7zip
p7zip-rar p7zip-rar
wget
gcc gcc
gnumake gnumake
pkg-config pkg-config
python39 python39
]; ];
# maybe i can just put it into the packages but idk whatever
home-manager.users.krizej.programs = {
home-manager.enable = true;
eza.enable = true;
yt-dlp.enable = true;
};
home-manager.users.krizej.home.packages = with pkgs; [ home-manager.users.krizej.home.packages = with pkgs; [
fortune fortune
@ -70,6 +68,8 @@
sqlitebrowser sqlitebrowser
feh feh
vlc vlc
obs-studio
yt-dlp
gdb gdb
ccls ccls
@ -78,10 +78,6 @@
valgrind valgrind
linuxKernel.packages.linux_6_6.perf linuxKernel.packages.linux_6_6.perf
gpu-screen-recorder # todo: config this shit so it works
gpu-screen-recorder-gtk
obs-studio
jetbrains.pycharm-community jetbrains.pycharm-community
jetbrains.clion jetbrains.clion
(pkgs.writeShellScriptBin "clion-nix" '' (pkgs.writeShellScriptBin "clion-nix" ''

View file

@ -1,5 +1,7 @@
{ pkgs, ... }: { pkgs, config, ... }: let
{ hmCfg = config.home-manager.users.krizej;
XDG_DATA_HOME = hmCfg.xdg.dataHome;
in {
environment.systemPackages = [ pkgs.fish ]; environment.systemPackages = [ pkgs.fish ];
programs.fish.enable = true; programs.fish.enable = true;
users.users.krizej.shell = pkgs.fish; users.users.krizej.shell = pkgs.fish;
@ -17,6 +19,8 @@
"mv" = "mv -v"; "mv" = "mv -v";
"ytmp3" = "yt-dlp -o '%(title)s.%(ext)s' -x --audio-format mp3"; "ytmp3" = "yt-dlp -o '%(title)s.%(ext)s' -x --audio-format mp3";
"myip" = "curl ifconfig.me"; "myip" = "curl ifconfig.me";
"0x0" = ''curl -F"file=@$argv" https://0x0.st'';
"wget" = "${pkgs.wget}/bin/wget --hsts-file='${XDG_DATA_HOME}/wget-hsts'";
}; };
shellAbbrs = { shellAbbrs = {

View file

@ -1,21 +1,22 @@
{ config, lib, pkgs, ... }: args @ { config, lib, pkgs, ... }:
{ {
services = { services = {
xserver = { xserver = {
enable = true; enable = true;
xkb.layout = "pl"; xkb.layout = "pl";
displayManager = { displayManager = let
monitors = import ../utils/monitors.nix args;
in {
# THIS SHIT DOESN'T WORK!!! # THIS SHIT DOESN'T WORK!!!
# TODO: REPLACE MONITOR NAMES HERE WHEN I START CARING
setupCommands = '' setupCommands = ''
xrandr --output DP-3 --mode 1920x1080 --rate 239.76 --primary xrandr --output ${monitors.left} --mode 1920x1080 --rate 239.76 --primary
xrandr --output HDMI-1 --off xrandr --output ${monitors.right} --off
xset r rate 180 50 xset r rate 180 50
''; '';
sessionCommands = '' sessionCommands = ''
xrandr --output DP-3 --mode 1920x1080 --rate 239.76 --primary xrandr --output ${monitors.left} --mode 1920x1080 --rate 239.76 --primary
xrandr --output HDMI-1 --mode 1920x1080 --rate 74.97 --right-of DP-3 xrandr --output ${monitors.right} --mode 1920x1080 --rate 74.97 --right-of ${monitors.left}
xset r rate 180 50 xset r rate 180 50
''; '';
}; };