1
Fork 0

Make hyprland work nicely with the GTK portals, and move some modules around into being active by default in home manager

This commit is contained in:
prescientmoon 2025-06-01 20:43:24 +02:00
commit 569bc3153e
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
32 changed files with 302 additions and 262 deletions

View file

@ -1,10 +1,12 @@
# 'cat' alternative
{
# Enabling this produces an uglier theme for some reason.
# options.stylix.targets.bat.enable = true;
programs.bat = {
enable = true;
config.theme = "base16-256";
};
home.shellAliases.cat = "bat";
# Enabling this produces an uglier theme for some reason.
# options.stylix.targets.bat.enable = true;
}

View file

@ -1,47 +1,59 @@
{ pkgs, ... }:
{
imports = [
./scripts
./eza.nix
./bat.nix
./ssh.nix
./git.nix
./starship.nix
./catgirl.nix
./direnv.nix
./eza.nix
./git.nix
./lazygit.nix
./ssh.nix
./tealdeer.nix
./yazi.nix
./fish
];
# Enable basic CLI thingies
programs.bash.enable = true;
programs.broot.enable = true;
programs.starship.enable = true;
# Enable nix-index
programs.nix-index-database.comma.enable = true;
programs.nix-index.enable = true;
programs.command-not-found.enable = false;
home.packages = with pkgs; [
# {{{ System information
# System information
acpi # Battery stats
neofetch # Display system information
tokei # Useless but fun line of code counter (sloc alternative)
bottom # System monitor
# }}}
# {{{ Storage
ncdu # TUI disk usage
du-dust # Similar to du and ncdu in purpose.
# }}}
# {{{ Alternatives to usual commands
bandwhich # Network bandwhich info
# Storage
dua # du + ncdu replacement
dust # Similar to du, but with prettier output
dysk # Similar to df, but with prettier output
# Alternatives to usual commands
ripgrep # Better grep
fd # Better find
sd # Better sed
httpie # Better curl
# }}}
# {{{ Misc
bc # Calculator
# Misc
ouch # Unified compression / decompression tool
mkpasswd # Hash passwords
jq # Json maniuplation
# }}}
jq # JSON manipulation
ffsend # File sharing
# Normally, I'd recommend against installing this globally, although
# it seems the completions don't play nicely with direnv otherwise.
just
];
home.shellAliases = {
# {{{ Storage
# -h: humans readable units
df = "df -h";
du = "du -h";
@ -49,6 +61,5 @@
# duh: short for `du here`
# -d: depth
duh = "du -hd 1";
# }}}
};
}

View file

@ -1,17 +1,12 @@
{ config, ... }:
let statePath = "${config.xdg.dataHome}/direnv/allow";
let
statePath = "${config.xdg.dataHome}/direnv/allow";
in
{
programs.direnv.enable = true;
programs.direnv.silent = true;
programs.direnv.nix-direnv.enable = true;
home.sessionVariables = {
# No more long command warnings
DIRENV_WARN_TIMEOUT = "24h";
# No more usesless logs
DIRENV_LOG_FORMAT = "";
};
# Only save allowed paths for 30d
systemd.user.tmpfiles.rules = [ "d ${statePath} - - - 30d" ];
satellite.persistence.at.state.apps.direnv.directories = [ statePath ];

View file

@ -1,32 +1,24 @@
# {{{ Start tmux if not already inside tmux
if status is-interactive
and not set -q TMUX
and not set -q NO_TMUX
and set -q ALWAYS_TMUX
exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux"
end
# }}}
# {{{ Sets cursor based on vim mode
set fish_cursor_default block # Set the normal and visual mode cursors to a block
# Set cursor based on vim mode
set fish_cursor_default block # Set the normal & visual mode cursors to a block
set fish_cursor_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore
# Force fish to skip some checks (I think?)
set fish_vi_force_cursor
# }}}
# {{{ Disable greeting
# Disable greeting
set fish_greeting
# }}}
# {{{ Keybinds
# Key-binds
function fish_user_key_bindings
fish_vi_key_bindings
fish_nix_key_bindings
bind -M insert -m default -k f10 'commandline -f repaint' # Exit insert mode with <f10>
# Exit insert mode with <f10>
bind -M insert -m default f10 'commandline -f repaint'
end
# }}}
# {{{ Helpers
# Helpers
function take -d "Create a directory and cd into it"
mkdir -p $argv; and cd $argv
end
# }}}

View file

@ -8,21 +8,21 @@ let
repaint = "commandline -f repaint";
fishKeybinds = {
# C-x to clear screen
"\\cx" = "clear && ${repaint}";
"ctrl-x" = "clear && ${repaint}";
# C-z to return to background process
"\\cz" = "fg && ${repaint}";
"ctrl-z" = "fg && ${repaint}";
# C-y to yank current command
"\\cy" = "wl-copy \$(commandline)";
"ctrl-y" = "wl-copy \$(commandline)";
# C-e to launch $EDITOR
"\\ce" = "$EDITOR";
"ctrl-e" = "$EDITOR";
# C-S-e to edit commandline using $EDITOR
"\\e\\[69\\;5u" = "edit_command_buffer";
"ctrl-E" = "edit_command_buffer";
# C-enter to run command through a pager
"\\e\\[13\\;2u" = "commandline -a ' | $PAGER' && commandline -f execute";
"ctrl-enter" = "commandline -a ' | $PAGER' && commandline -f execute";
# C-g to open lazygit
"\\cg" = "lazygit";
"ctrl-g" = "lazygit";
# C-S-f to open mini.files
"\\e\\[70\\;5u" = ''nvim +":lua require('mini.files').open()"'';
"ctrl-F" = ''nvim +":lua require('mini.files').open()"'';
};
mkKeybind =
@ -59,7 +59,7 @@ in
${builtins.readFile ./config.fish}
# Modify nix-shell to use `fish` as it's default shell
# Modify nix-shell to use `fish` as its default shell
${lib.getExe pkgs.nix-your-shell} fish | source
'';

View file

@ -1,5 +0,0 @@
{
programs.nix-index-database.comma.enable = true;
programs.nix-index.enable = true;
programs.command-not-found.enable = false;
}

View file

@ -1,5 +1,3 @@
smos_github_token: ...
smos_password: ...
moonythm_mail_pass: ...
vaultwarden_env: |
ADMIN_TOKEN=...

View file

@ -1,12 +1,7 @@
smos_github_token: ENC[AES256_GCM,data:kqy5mQf96DoPN1iEt2akJWFfD3IJWdSkvZa0MeAyF0WJ/+V5P5C4iQ==,iv:QwmIdV/vzGTLE89XJVi3prgfmXqRa/OYcp9CA7KJDYc=,tag:+S1EZBcxoOQO2ADjDx9STQ==,type:str]
smos_password: ENC[AES256_GCM,data:s+WuVJpe+bSZ7IPYKqA=,iv:fH4k1VTxkcgBwabX7TwZFu1bdWtinK8vug71xa0PiSo=,tag:epqGvDj5pfh9IVLFQLcifA==,type:str]
moonythm_mail_pass: ENC[AES256_GCM,data:FmBUICHDxmn72EGnYVSh,iv:L45AeAiXUfz4jH+4q+PDGwvKnEb4r/XDP+55Cf+Q+Nc=,tag:171ImWbCqdEUUK/nlrldCQ==,type:str]
vaultwarden_env: ENC[AES256_GCM,data:dKAkO1pckFVpuN3srD99aGln8fhT69ZNCO1QbdfyJMHlypyNX3YOReR7BoAeDK5DYGRs//8/PLPynRzKPAICng7+yfNDsHHzaF+QNpY=,iv:oNntDA4cXlg5gbTZwqnpyx5nGkYzmLvds5BsAdpdUdc=,tag:IXYS+CKnVb9ZfBm/zcG3JA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age14mga4r0xa82a2uus3wq5q7rqnvflms3jmhknz4f3hsda8wttk9gsv2k9fs
enc: |
@ -35,8 +30,7 @@ sops:
a3Vzak1qM2lGUWFUS2lPa1loY0tkM0UKF9IGvrJM8BdivLQBnetZz2OeH6FCNaCZ
JeqqJXM96LKzPBCXxFqclpoPgy8zUb1yNpKg3CRUroC7VO0tBG3KJg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-05-30T03:01:52Z"
mac: ENC[AES256_GCM,data:DNEOMhZIspChJh30AcULXA2hcSYgArCqY8ct4GIojkFutuHeJcHGZFQ+NNgUB5MUIVJHEJ6f5qeWrwDJCAeAarlwgUhcFUQMilZ0jwU+o6w1mUWwZeWV7W467YQ/zWUBZqwb3udeSsI6KTmsMkIpBdYON7UHQ/LFXrkzqrUkhSc=,iv:Ur94AGkiqcet9Vz97XyqfM5PQzJBMQ2NZ9yj4dDFVJ8=,tag:EiVThawyfm0LjJ7jg4pTEQ==,type:str]
pgp: []
lastmodified: "2025-05-30T19:26:28Z"
mac: ENC[AES256_GCM,data:2yBG1RRTA8z5u9XqMXzI7TPMBYPf9LW4DRpqJbVkiMqJyFcAKIoQ5NXI8kqi6dKar2sYQMu/3kq4ISGaTHoMsikP3UWDOHDn6aWIZNGx/Psm9AyQv8LyxIizLybF7XIn/Z99NdlaIsUCB0yUD742xkU3pHPLNL1K9BwuWpRbtbQ=,iv:JfMIB2+HQ941yTT/rhUbh1PnH9vmj+2GVWRHe7KOcPU=,tag:deMUz5Oji7Hh1XBGyl95Vw==,type:str]
unencrypted_suffix: _unencrypted
version: 3.9.4
version: 3.10.2

View file

@ -1,6 +0,0 @@
{ pkgs, ... }:
let uptimes = pkgs.writeShellScriptBin "uptimes" (builtins.readFile ./uptimes.sh);
in
{
home.packages = [ uptimes ];
}

View file

@ -1,27 +0,0 @@
print_uptime() {
local HOST=$1
local EMOJI=$2
# -n: do not echo a newline
echo -n "$EMOJI $HOST: ~"
# The output of `uptime` looks like this:
# `18:40:54 up 1 day 0:51, 0 users, load average: 0.79, 0.68, 0.69`,
# so we use awk to trim it down to the parts we care about.
#
# For awk:
# -F: splits the input by a string
ssh $USER@$HOST uptime \
| awk -F '(up |,)' '{print $2}'
}
echo "Uptimes:"
{
print_uptime "tethys" "🔥"
print_uptime "lapetus" "⛵"
} |
column --table -R 2 -s "~"
# ^ We use the column command to align things nicely:
# -R 2 aligns the second column to the right
# -s ~ will split on occurrences of ~

View file

@ -1,8 +1,4 @@
{
programs.ssh.enable = true;
satellite.persistence.at.state.apps.ssh.directories = [ ".ssh" ];
# This allows me to push/pull to my forgejo server via SSH.
# See the docs for more details: https://developers.cloudflare.com/cloudflare-one/tutorials/gitlab/#configuring-ssh
# programs.ssh.matchBlocks."ssh.git.moonythm.dev".proxyCommand = "${lib.getExe pkgs.cloudflared} access ssh --hostname %h";
}

View file

@ -1,3 +0,0 @@
{
programs.starship.enable = true;
}

View file

@ -1,6 +1,7 @@
# Example based cli docs
# Example-based CLI documentation
# https://dbrgn.github.io/tealdeer/
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
home.packages = [ pkgs.tealdeer ];
xdg.configFile."tealdeer/config.toml".text = ''

View file

@ -4,8 +4,8 @@
}:
{
stylix.targets.yazi.enable = true;
programs.yazi.enable = true;
home.packages = [
pkgs.yazi # Terminal file explorer
pkgs.exiftool # Read file metadata
];
}

View file

@ -1,4 +0,0 @@
{
programs.zellij.enable = true;
stylix.targets.zellij.enable = true;
}