Improve configuration

This commit is contained in:
Christopher Mühl 2025-11-20 14:55:53 +01:00
parent 71d2f7d5dd
commit 37f278819a
No known key found for this signature in database
GPG key ID: E919B0F59E14FD47
12 changed files with 121 additions and 39 deletions

View file

@ -1,15 +1,34 @@
{pkgs, ...}: {
{
lib,
pkgs,
...
}: {
home.packages = with pkgs; [
rose-pine-cursor
lxappearance
];
gtk = {
enable = true;
iconTheme.name = "breeze-dark";
cursorTheme = {
name = "BreezeX-RoséPine";
name = "BreezeX-RosePineDawn-Linux";
package = pkgs.rose-pine-cursor;
size = 32;
};
gtk2.extraConfig = lib._elements.selfReferencedString {sep = "#";} ''
gtk-enable-animations = 1
gtk-primary-button-warps-slider = 1
gtk-toolbar-style = 3
gtk-menu-images = 1
gtk-button-images = 1
gtk-sound-theme-name = "freedesktop"
'';
font = {
name = "Noto Sans";
size = 10;
};
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;

View file

@ -4,7 +4,7 @@
...
}: let
bin = ''
#/usr/bin/env bash
#!/usr/bin/env bash
ORG="hausgold"
OUTPUT_FILE="/home/christopher/.gh/$ORG-repos"

View file

@ -34,6 +34,7 @@
vcv-rack # Eurorack simulator
davinci-resolve # Video editor
cider-2 # Apple music player
todoist-electron # To-Do List app
xarchiver # Archive viewer/extractor
zathura # Document viewer

View file

@ -1,10 +1,18 @@
{lib, ...} @ all: {
{lib, ...} @ all: rec {
rootPath = ./..;
secret = name: ./../secrets/${name};
commonHomeModule = module: ./../homes/common + "/${module}";
writeNushellApplication = import ./writeNushellApplication.nix {inherit lib;};
# Determines the file location of the passed in attr set (e.g. `{ sep = "#"; })
# and prepends the string with it. This allows to add references to the source
# file that wrote any setting to generated application configurations for debugging.
selfReferencedString = {sep} @ attrs: str: let
ref = builtins.unsafeGetAttrPos "sep" attrs;
in
"${sep} ${ref.file}:${builtins.toString ref.line}\n" + str;
enabled = {enable = true;};
disabled = {enable = false;};

View file

@ -1,5 +1,4 @@
{config, ...}: let
data = config.xdg.dataHome;
conf = config.xdg.configHome;
cache = config.xdg.cacheHome;
in {
@ -7,7 +6,8 @@ in {
./programs
./shell/aliases.nix
./shell/prompt.nix
# ./shell/nu
./shell/fish.nix
./shell/nu.nix
];
# add environment variables

View file

@ -1,4 +1,8 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: {
home.packages = with pkgs; [
# Shell software
fzf # Fuzzy finding
@ -15,7 +19,25 @@
];
programs = {
atuin.enable = true; # Better shell history
atuin.enableNushellIntegration = true;
atuin = {
# Better (and synchronized) shell history
enable = true;
enableNushellIntegration = config.programs.nushell.enable;
enableFishIntegration = config.programs.fish.enable;
};
zoxide = {
# Quick-jump to folders
enable = true;
enableNushellIntegration = config.programs.nushell.enable;
enableFishIntegration = config.programs.fish.enable;
};
carapace = {
# Shell completions
enable = true;
enableNushellIntegration = config.programs.nushell.enable;
enableFishIntegration = config.programs.fish.enable;
};
};
}

View file

@ -1,7 +1,15 @@
{pkgs, ...}: {
{
lib,
pkgs,
...
}: let
tmuxConfigFile = ".tmux.inspect.conf";
in {
home.packages = [pkgs.tmux];
home.file.".tmux.inspect.conf".text = ''
home.shellAliases.inspect = "tmux -f ~/${tmuxConfigFile} new-session ssh inspect";
home.file.${tmuxConfigFile}.text = lib._elements.selfReferencedString {sep = "#";} ''
set -g status-position top
set-option -g status-bg default
set -g 'status-format[0]' '#[fill=colour202 bg=colour202 fg=colour231 bold]Danger! HAUSGOLD Inspector '

View file

@ -1,10 +1,7 @@
{lib, ...}: {
home.shellAliases = {
elements = "just -f /nix/elements/Justfile -d /nix/elements";
elm = "elements";
g = "git";
copy = lib.mkDefault "wl-copy";
inspect = "tmux -f ~/.tmux.inspect.conf new-session ssh inspect";
ansi = "sed -r \"s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g\"";
calc = "numbat --pretty-print never -e";
pcalc = "numbat --pretty-print always -e";

View file

@ -0,0 +1,37 @@
{
lib,
pkgs,
config,
...
}: let
env =
lib.concatMapAttrsStringSep
"\n"
(name: value: "set -gx ${name} ${lib.escapeShellArg value}")
config.home.sessionVariables;
in {
programs.fish = {
enable = true;
shellAliases = config.home.shellAliases;
shellInit = lib._elements.selfReferencedString {sep = "#";} ''
# Set global environment variables.
${env}
'';
functions = {
agx = {
wraps = "ag";
description = "Runs ag on the given string and returns a list of selectable references of the result. The selection is then opened in the editor.";
body = ''
hx (ag $search $argv[2..] | fzf | cut -d : -f 1,2)
'';
};
};
preferAbbrs = true;
shellAbbrs = {
elm = "elements";
};
};
}

View file

@ -1,27 +1,22 @@
{
lib,
pkgs,
config,
...
}: {
programs.zoxide.enable = true;
programs.zoxide.enableNushellIntegration = true;
programs.nushell = {
enable = true;
shellAliases = config.home.shellAliases;
environmentVariables = config.home.sessionVariables;
plugins = with pkgs; [
nushellPlugins.query
nushellPlugins.gstat
nushellPlugins.skim
# nushellPlugins.net
# nushellPlugins.units
];
environmentVariables = config.home.sessionVariables;
extraConfig = ''
extraConfig = lib._elements.selfReferencedString {sep = "#";} ''
let carapace_completer = { |spans|
carapace $spans.0 nushell ...$spans
| from json
@ -77,7 +72,7 @@
}
'';
envFile.text = ''
envFile.text = lib._elements.selfReferencedString {sep = "#";} ''
$env.PATH = (
$env.PATH
| split row (char esep)
@ -88,10 +83,4 @@
)
'';
};
# Shell completions
programs.carapace = {
enable = true;
enableNushellIntegration = true;
};
}

View file

@ -1,10 +1,10 @@
{...}: let
{config, ...}: let
unicode = code: builtins.fromJSON ''"${code}" '';
in {
programs.oh-my-posh = {
enable = true;
enableNushellIntegration = true;
enableFishIntegration = true;
enableNushellIntegration = config.programs.nushell.enable;
enableFishIntegration = config.programs.fish.enable;
# Original settings taken from `catppuccin_frappe`, and adjusted to my
# likings and usage.

View file

@ -1,12 +1,13 @@
{pkgs, ...}:
pkgs.writeTextFile rec {
{
lib,
pkgs,
...
}:
lib._elements.writeNushellApplication pkgs {
name = "git-delete-stale";
destination = "/bin/${name}";
executable = true;
runtimeInputs = with pkgs; [git];
text = ''
#!${pkgs.nushell}/bin/nu
let localBranches = (
git branch
| lines