mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-14 04:07:18 +00:00
Compare commits
No commits in common. "86383c69dd6b29dff8e78b45391e727c739ff8dc" and "2da382b4dcb1ce874a49bd93b105a20c4ca0f493" have entirely different histories.
86383c69dd
...
2da382b4dc
|
@ -101,7 +101,7 @@
|
|||
dim_inactive = false; # disabled for now
|
||||
dim_strength = 0.02;
|
||||
dim_special = 0.2;
|
||||
#inactive_opacity = 0.9;
|
||||
inactive_opacity = 0.9;
|
||||
};
|
||||
|
||||
#
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./python.nix
|
||||
./ipython.nix
|
||||
./poetry.nix
|
||||
./rye.nix
|
||||
|
|
14
home/programs/terminal/coding/python/python.nix
Normal file
14
home/programs/terminal/coding/python/python.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ python312 ];
|
||||
};
|
||||
}
|
|
@ -1,38 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
||||
|
||||
toTOML = name: (pkgs.formats.toml {}).generate "${name}";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = with pkgs; [ rye ];
|
||||
|
||||
sessionVariables = {
|
||||
RYE_HOME = "${config.xdg.configHome}/rye";
|
||||
};
|
||||
|
||||
# Add rye python shims to path.
|
||||
# Rye provides python executables that will automatically pick up on the python
|
||||
# from a virtual environment, if we're in a directory (project) with one. If not,
|
||||
# rye will fall back to system python. That is, if behavior.global-python=false,
|
||||
# otherwise, we can actually use a python version from rye as our global python.
|
||||
sessionPath = [
|
||||
"${config.xdg.configHome}/rye/shims"
|
||||
];
|
||||
};
|
||||
|
||||
# see: <https://rye.astral.sh/guide/config/#config-file>
|
||||
xdg.configFile."rye/config.toml".source = toTOML "config.toml" {
|
||||
default.license = "GPL-3.0-or-later";
|
||||
behavior.global-python=true;
|
||||
};
|
||||
home.packages = with pkgs; [ rye ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
"gitlab" = {
|
||||
user = "git";
|
||||
hostname = "gitlab.com";
|
||||
identityFile = "~/.ssh/git/gitlab-itsdrike";
|
||||
identityFile = "~/.ssh/git/gitlab";
|
||||
};
|
||||
"github" = {
|
||||
user = "git";
|
||||
hostname = "gitlab.com";
|
||||
identityFile = "~/.ssh/git/github-itsdrike";
|
||||
identityFile = "~/.ssh/git/github";
|
||||
};
|
||||
# TODO: Figure out how to add protected/encrypted blocks here
|
||||
# I don't like the idea of expising IPs/hostnames in the config
|
||||
|
|
|
@ -57,34 +57,34 @@ in {
|
|||
'';
|
||||
|
||||
"python/pythonrc.py".text = ''
|
||||
def is_vanilla() -> bool:
|
||||
import sys
|
||||
return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]
|
||||
import atexit
|
||||
import os
|
||||
import readline
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from types import ModuleType
|
||||
|
||||
cache_xdg_dir = Path(
|
||||
os.environ.get("XDG_CACHE_HOME", str(Path("~/.cache").expanduser()))
|
||||
)
|
||||
cache_xdg_dir.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
history_file = cache_xdg_dir.joinpath("python_history")
|
||||
history_file.touch()
|
||||
|
||||
readline.read_history_file(history_file)
|
||||
|
||||
|
||||
def setup_history():
|
||||
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: Path = state_home / 'python_history'
|
||||
|
||||
# https://github.com/python/cpython/issues/105694
|
||||
if not history.is_file():
|
||||
readline.write_history_file(str(history)) # breaks on macos + python3 without this.
|
||||
|
||||
readline.read_history_file(str(history))
|
||||
atexit.register(readline.write_history_file, str(history))
|
||||
def write_history(readline: ModuleType, history_file: Path) -> None:
|
||||
"""
|
||||
We need to get ``readline`` and ``history_file`` as arguments, as it
|
||||
seems they get garbage collected when the function is registered and
|
||||
the program ends, even though we refer to them here.
|
||||
"""
|
||||
readline.write_history_file(history_file)
|
||||
|
||||
|
||||
if is_vanilla():
|
||||
setup_history()
|
||||
atexit.register(partial(write_history, readline, history_file))
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
_: {
|
||||
imports = [
|
||||
./dunst.nix
|
||||
./hyprpaper.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf getExe;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.services.hyprpaper;
|
||||
cfgIsWayland = osConfig.myOptions.home-manager.wms.isWayland;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfgIsWayland) {
|
||||
systemd.user.services.hyprpaper = {
|
||||
Install.WantedBy = [ "hyprland-session.target" ];
|
||||
Unit = {
|
||||
Description = "Hyprpaper (Hyprland wallpaper daemon)";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${getExe pkgs.hyprpaper}";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
xdg.configFile."hypr/hyprpaper.conf".text = ''
|
||||
preload=${cfg.wallpaperPath}
|
||||
wallpaper=,${cfg.wallpaperPath} # same wallpaper on all monitors
|
||||
ipc=off
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -66,7 +66,6 @@
|
|||
".config/obs-studio"
|
||||
|
||||
# Tools
|
||||
".ssh"
|
||||
".local/share/gnupg"
|
||||
".local/share/zoxide"
|
||||
".local/share/wakatime"
|
||||
|
@ -80,7 +79,6 @@
|
|||
# Language package managers
|
||||
".local/share/cargo"
|
||||
".local/share/go"
|
||||
".config/rye"
|
||||
];
|
||||
extraFiles = [
|
||||
".config/gtk-3.0/bookmarks"
|
||||
|
@ -88,7 +86,6 @@
|
|||
".cache/walker/history.gob"
|
||||
".config/pcmanfm-qt/default/recent-files.conf"
|
||||
".config/qalculate/qalculate-gtk.cfg"
|
||||
".local/state/python_history"
|
||||
];
|
||||
|
||||
persistentDataMountPoint = "/data/Data";
|
||||
|
@ -217,12 +214,6 @@
|
|||
|
||||
services = {
|
||||
dunst.enable = true;
|
||||
hyprpaper = {
|
||||
enable = true;
|
||||
# This file intentionally lacks a file extension, it should be a symlink
|
||||
# to whatever file you wish to actually be your wallpaper
|
||||
wallpaperPath = "/data/Data/Media/Pictures/Wallpapers/active";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,14 +4,6 @@ in
|
|||
{
|
||||
options.myOptions.home-manager.services = {
|
||||
dunst.enable = mkEnableOption "Dunst (lightweight notification daemon)";
|
||||
hyprpaper = {
|
||||
enable = mkEnableOption "Hyprpaper (Hyprland wallpaper daemon)";
|
||||
wallpaperPath = mkOption {
|
||||
type = types.path;
|
||||
default = null;
|
||||
description = "Path to the wallpaper of your choosing";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue