some cleanups and stuffs
This commit is contained in:
parent
cb8832c79a
commit
f4d0e23fa3
5 changed files with 73 additions and 67 deletions
|
@ -6,12 +6,15 @@ args @ { pkgs, ... }:
|
|||
"freeimage-unstable-2021-11-01"
|
||||
];
|
||||
|
||||
home-manager.users.krizej.programs.home-manager.enable = true;
|
||||
home-manager.users.krizej.home.packages = [
|
||||
(pkgs.writeShellScriptBin "rebuild" ''
|
||||
set -e
|
||||
|
||||
# hack: update autorandr stuffs
|
||||
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 $@
|
||||
'')
|
||||
];
|
||||
|
||||
|
|
64
misc/xdg.nix
64
misc/xdg.nix
|
@ -1,19 +1,26 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
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 {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common.default = [ "*" ];
|
||||
};
|
||||
|
||||
home-manager.users.krizej = {
|
||||
home.packages = with pkgs; [
|
||||
xdg-user-dirs
|
||||
xdg-utils
|
||||
];
|
||||
|
||||
home.sessionVariables = rec {
|
||||
home.sessionVariables = {
|
||||
# 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_HOME = "${XDG_DATA_HOME}/android/sdk";
|
||||
GRADLE_USER_HOME = "${XDG_DATA_HOME}/gradle";
|
||||
|
@ -30,7 +37,13 @@ in {
|
|||
GTK2_RC_FILES = lib.mkForce "${XDG_CONFIG_HOME}/gtk-2.0/gtkrc";
|
||||
};
|
||||
|
||||
xdg.userDirs = {
|
||||
xdg = {
|
||||
dataHome = XDG_DATA_HOME;
|
||||
configHome = XDG_CONFIG_HOME;
|
||||
stateHome = XDG_STATE_HOME;
|
||||
cacheHome = XDG_CACHE_HOME;
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
desktop = "${HOME}/desktop";
|
||||
documents = "${HOME}/documents";
|
||||
|
@ -42,38 +55,27 @@ in {
|
|||
videos = "${HOME}/videos";
|
||||
};
|
||||
|
||||
# fix this scheisse
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-kde ];
|
||||
config.common.default = [ "*" ];
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/python/pythonrc".text = ''
|
||||
def is_vanilla() -> bool:
|
||||
import sys
|
||||
return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]
|
||||
|
||||
def setup_history():
|
||||
configFile = {
|
||||
"python/pythonrc".text = ''
|
||||
import os
|
||||
import atexit
|
||||
import readline
|
||||
from pathlib import Path
|
||||
|
||||
if state_home := os.environ.get('XDG_STATE_HOME'):
|
||||
state_home = Path(state_home)
|
||||
else:
|
||||
state_home = Path.home() / '.local' / 'state'
|
||||
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
|
||||
try:
|
||||
readline.read_history_file(history)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
history: Path = state_home / 'python_history'
|
||||
def write_history():
|
||||
try:
|
||||
readline.write_history_file(history)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
readline.read_history_file(str(history))
|
||||
atexit.register(readline.write_history_file, str(history))
|
||||
|
||||
if is_vanilla():
|
||||
setup_history()
|
||||
atexit.register(write_history)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -19,29 +19,27 @@
|
|||
|
||||
environment.systemPackages = with pkgs; [
|
||||
ed # is the standard text editor.
|
||||
|
||||
ripgrep
|
||||
file
|
||||
tree
|
||||
btop
|
||||
eza
|
||||
wget
|
||||
|
||||
zip
|
||||
unzip
|
||||
rar
|
||||
unrar
|
||||
p7zip
|
||||
p7zip-rar
|
||||
wget
|
||||
|
||||
gcc
|
||||
gnumake
|
||||
pkg-config
|
||||
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; [
|
||||
fortune
|
||||
|
@ -70,6 +68,8 @@
|
|||
sqlitebrowser
|
||||
feh
|
||||
vlc
|
||||
obs-studio
|
||||
yt-dlp
|
||||
|
||||
gdb
|
||||
ccls
|
||||
|
@ -78,10 +78,6 @@
|
|||
valgrind
|
||||
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.clion
|
||||
(pkgs.writeShellScriptBin "clion-nix" ''
|
||||
|
|
|
@ -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 ];
|
||||
programs.fish.enable = true;
|
||||
users.users.krizej.shell = pkgs.fish;
|
||||
|
@ -17,6 +19,8 @@
|
|||
"mv" = "mv -v";
|
||||
"ytmp3" = "yt-dlp -o '%(title)s.%(ext)s' -x --audio-format mp3";
|
||||
"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 = {
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
args @ { config, lib, pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
xkb.layout = "pl";
|
||||
|
||||
displayManager = {
|
||||
displayManager = let
|
||||
monitors = import ../utils/monitors.nix args;
|
||||
in {
|
||||
# THIS SHIT DOESN'T WORK!!!
|
||||
# TODO: REPLACE MONITOR NAMES HERE WHEN I START CARING
|
||||
setupCommands = ''
|
||||
xrandr --output DP-3 --mode 1920x1080 --rate 239.76 --primary
|
||||
xrandr --output HDMI-1 --off
|
||||
xrandr --output ${monitors.left} --mode 1920x1080 --rate 239.76 --primary
|
||||
xrandr --output ${monitors.right} --off
|
||||
xset r rate 180 50
|
||||
'';
|
||||
sessionCommands = ''
|
||||
xrandr --output DP-3 --mode 1920x1080 --rate 239.76 --primary
|
||||
xrandr --output HDMI-1 --mode 1920x1080 --rate 74.97 --right-of DP-3
|
||||
xrandr --output ${monitors.left} --mode 1920x1080 --rate 239.76 --primary
|
||||
xrandr --output ${monitors.right} --mode 1920x1080 --rate 74.97 --right-of ${monitors.left}
|
||||
xset r rate 180 50
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue