Improve configuration
This commit is contained in:
parent
71d2f7d5dd
commit
37f278819a
12 changed files with 121 additions and 39 deletions
|
|
@ -1,15 +1,34 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
rose-pine-cursor
|
|
||||||
lxappearance
|
lxappearance
|
||||||
];
|
];
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
iconTheme.name = "breeze-dark";
|
||||||
cursorTheme = {
|
cursorTheme = {
|
||||||
name = "BreezeX-RoséPine";
|
name = "BreezeX-RosePineDawn-Linux";
|
||||||
package = pkgs.rose-pine-cursor;
|
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;
|
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
bin = ''
|
bin = ''
|
||||||
#/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ORG="hausgold"
|
ORG="hausgold"
|
||||||
OUTPUT_FILE="/home/christopher/.gh/$ORG-repos"
|
OUTPUT_FILE="/home/christopher/.gh/$ORG-repos"
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
vcv-rack # Eurorack simulator
|
vcv-rack # Eurorack simulator
|
||||||
davinci-resolve # Video editor
|
davinci-resolve # Video editor
|
||||||
cider-2 # Apple music player
|
cider-2 # Apple music player
|
||||||
|
todoist-electron # To-Do List app
|
||||||
|
|
||||||
xarchiver # Archive viewer/extractor
|
xarchiver # Archive viewer/extractor
|
||||||
zathura # Document viewer
|
zathura # Document viewer
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,18 @@
|
||||||
{lib, ...} @ all: {
|
{lib, ...} @ all: rec {
|
||||||
rootPath = ./..;
|
rootPath = ./..;
|
||||||
secret = name: ./../secrets/${name};
|
secret = name: ./../secrets/${name};
|
||||||
|
|
||||||
commonHomeModule = module: ./../homes/common + "/${module}";
|
commonHomeModule = module: ./../homes/common + "/${module}";
|
||||||
writeNushellApplication = import ./writeNushellApplication.nix {inherit lib;};
|
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;};
|
enabled = {enable = true;};
|
||||||
disabled = {enable = false;};
|
disabled = {enable = false;};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{config, ...}: let
|
{config, ...}: let
|
||||||
data = config.xdg.dataHome;
|
|
||||||
conf = config.xdg.configHome;
|
conf = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
in {
|
in {
|
||||||
|
|
@ -7,7 +6,8 @@ in {
|
||||||
./programs
|
./programs
|
||||||
./shell/aliases.nix
|
./shell/aliases.nix
|
||||||
./shell/prompt.nix
|
./shell/prompt.nix
|
||||||
# ./shell/nu
|
./shell/fish.nix
|
||||||
|
./shell/nu.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# add environment variables
|
# add environment variables
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Shell software
|
# Shell software
|
||||||
fzf # Fuzzy finding
|
fzf # Fuzzy finding
|
||||||
|
|
@ -15,7 +19,25 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
atuin.enable = true; # Better shell history
|
atuin = {
|
||||||
atuin.enableNushellIntegration = true;
|
# 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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,15 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
tmuxConfigFile = ".tmux.inspect.conf";
|
||||||
|
in {
|
||||||
home.packages = [pkgs.tmux];
|
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 -g status-position top
|
||||||
set-option -g status-bg default
|
set-option -g status-bg default
|
||||||
set -g 'status-format[0]' '#[fill=colour202 bg=colour202 fg=colour231 bold]Danger! HAUSGOLD Inspector '
|
set -g 'status-format[0]' '#[fill=colour202 bg=colour202 fg=colour231 bold]Danger! HAUSGOLD Inspector '
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
{lib, ...}: {
|
{lib, ...}: {
|
||||||
home.shellAliases = {
|
home.shellAliases = {
|
||||||
elements = "just -f /nix/elements/Justfile -d /nix/elements";
|
elements = "just -f /nix/elements/Justfile -d /nix/elements";
|
||||||
elm = "elements";
|
|
||||||
g = "git";
|
|
||||||
copy = lib.mkDefault "wl-copy";
|
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\"";
|
ansi = "sed -r \"s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g\"";
|
||||||
calc = "numbat --pretty-print never -e";
|
calc = "numbat --pretty-print never -e";
|
||||||
pcalc = "numbat --pretty-print always -e";
|
pcalc = "numbat --pretty-print always -e";
|
||||||
|
|
|
||||||
37
modules/home/common/terminal/shell/fish.nix
Normal file
37
modules/home/common/terminal/shell/fish.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,27 +1,22 @@
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
programs.zoxide.enable = true;
|
|
||||||
programs.zoxide.enableNushellIntegration = true;
|
|
||||||
|
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
shellAliases = config.home.shellAliases;
|
shellAliases = config.home.shellAliases;
|
||||||
|
environmentVariables = config.home.sessionVariables;
|
||||||
|
|
||||||
plugins = with pkgs; [
|
plugins = with pkgs; [
|
||||||
nushellPlugins.query
|
nushellPlugins.query
|
||||||
nushellPlugins.gstat
|
nushellPlugins.gstat
|
||||||
nushellPlugins.skim
|
nushellPlugins.skim
|
||||||
# nushellPlugins.net
|
|
||||||
# nushellPlugins.units
|
|
||||||
];
|
];
|
||||||
|
|
||||||
environmentVariables = config.home.sessionVariables;
|
extraConfig = lib._elements.selfReferencedString {sep = "#";} ''
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
let carapace_completer = { |spans|
|
let carapace_completer = { |spans|
|
||||||
carapace $spans.0 nushell ...$spans
|
carapace $spans.0 nushell ...$spans
|
||||||
| from json
|
| from json
|
||||||
|
|
@ -77,7 +72,7 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
envFile.text = ''
|
envFile.text = lib._elements.selfReferencedString {sep = "#";} ''
|
||||||
$env.PATH = (
|
$env.PATH = (
|
||||||
$env.PATH
|
$env.PATH
|
||||||
| split row (char esep)
|
| split row (char esep)
|
||||||
|
|
@ -88,10 +83,4 @@
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Shell completions
|
|
||||||
programs.carapace = {
|
|
||||||
enable = true;
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
{...}: let
|
{config, ...}: let
|
||||||
unicode = code: builtins.fromJSON ''"${code}" '';
|
unicode = code: builtins.fromJSON ''"${code}" '';
|
||||||
in {
|
in {
|
||||||
programs.oh-my-posh = {
|
programs.oh-my-posh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
enableNushellIntegration = config.programs.nushell.enable;
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = config.programs.fish.enable;
|
||||||
|
|
||||||
# Original settings taken from `catppuccin_frappe`, and adjusted to my
|
# Original settings taken from `catppuccin_frappe`, and adjusted to my
|
||||||
# likings and usage.
|
# likings and usage.
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
{pkgs, ...}:
|
{
|
||||||
pkgs.writeTextFile rec {
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib._elements.writeNushellApplication pkgs {
|
||||||
name = "git-delete-stale";
|
name = "git-delete-stale";
|
||||||
destination = "/bin/${name}";
|
runtimeInputs = with pkgs; [git];
|
||||||
executable = true;
|
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
#!${pkgs.nushell}/bin/nu
|
|
||||||
|
|
||||||
let localBranches = (
|
let localBranches = (
|
||||||
git branch
|
git branch
|
||||||
| lines
|
| lines
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue