mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
tree-wide: format with nixfmt
Another saturday another useless formatter change. It's my dotfiles, after all alejandra doesn't handle c-style inline comments well.
This commit is contained in:
parent
ec704b5272
commit
ebf8468807
116 changed files with 1895 additions and 1689 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
programs.atuin = {
|
||||
flags = ["--disable-up-arrow"];
|
||||
flags = [ "--disable-up-arrow" ];
|
||||
settings = {
|
||||
history_filter = [
|
||||
# privacy
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{config, ...}: {
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.btop = {
|
||||
settings.color_theme = "${config.programs.btop.package}/share/btop/themes/onedark.theme";
|
||||
extraConfig = builtins.readFile ./btop.conf;
|
||||
|
|
|
|||
|
|
@ -2,49 +2,51 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.cmus.extraConfig = let
|
||||
# dispatch to multiple callbacks
|
||||
callback-script = pkgs.writeShellApplication {
|
||||
name = "cmus-callback-script";
|
||||
runtimeInputs = [
|
||||
pkgs.cmusfm
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
# All keys contain only chars a-z. Values are UTF-8 strings.
|
||||
#
|
||||
# Keys: status file url artist album discnumber tracknumber title date
|
||||
# - status (stopped, playing, paused) is always given
|
||||
# - file or url is given only if track is 'loaded' in cmus
|
||||
# - other keys/values are given only if they are available
|
||||
}:
|
||||
{
|
||||
programs.cmus.extraConfig =
|
||||
let
|
||||
# dispatch to multiple callbacks
|
||||
callback-script = pkgs.writeShellApplication {
|
||||
name = "cmus-callback-script";
|
||||
runtimeInputs = [
|
||||
pkgs.cmusfm
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
# All keys contain only chars a-z. Values are UTF-8 strings.
|
||||
#
|
||||
# Keys: status file url artist album discnumber tracknumber title date
|
||||
# - status (stopped, playing, paused) is always given
|
||||
# - file or url is given only if track is 'loaded' in cmus
|
||||
# - other keys/values are given only if they are available
|
||||
|
||||
# Use a map so that we can redirect all the args to cmusfm
|
||||
argv=("$@")
|
||||
declare -A map
|
||||
while [ $# -gt 0 ]; do
|
||||
map["$1"]="$2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
# Use a map so that we can redirect all the args to cmusfm
|
||||
argv=("$@")
|
||||
declare -A map
|
||||
while [ $# -gt 0 ]; do
|
||||
map["$1"]="$2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
# Setup pretty symbols
|
||||
case ''${map[status]} in
|
||||
paused)
|
||||
SYMB="⏸"
|
||||
;;
|
||||
playing)
|
||||
SYMB="⏵"
|
||||
;;
|
||||
esac
|
||||
# Setup pretty symbols
|
||||
case ''${map[status]} in
|
||||
paused)
|
||||
SYMB="⏸"
|
||||
;;
|
||||
playing)
|
||||
SYMB="⏵"
|
||||
;;
|
||||
esac
|
||||
|
||||
notify-send \
|
||||
"$SYMB ''${map[title]}" \
|
||||
"''${map[artist]} / ''${map[album]}"
|
||||
cmusfm "''${argv[@]}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
notify-send \
|
||||
"$SYMB ''${map[title]}" \
|
||||
"''${map[artist]} / ''${map[album]}"
|
||||
cmusfm "''${argv[@]}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
builtins.readFile ./rc
|
||||
+ lib.optionalString pkgs.stdenv.isLinux ''
|
||||
set status_display_program=${lib.getExe callback-script}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{config, ...}: {
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.direnv = {
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.i18n.inputMethod;
|
||||
in {
|
||||
in
|
||||
{
|
||||
i18n.inputMethod = {
|
||||
fcitx5.addons = [
|
||||
pkgs.fcitx5-chinese-addons
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) nur;
|
||||
|
||||
cfg = config.programs.firefox;
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.firefox = {
|
||||
# https://mozilla.github.io/policy-templates
|
||||
# The following have more complex logic, keep them as policies and not profiles
|
||||
|
|
@ -19,7 +21,14 @@ in {
|
|||
];
|
||||
|
||||
SearchEngines = {
|
||||
Remove = ["Google" "Bing" "DuckDuckGo" "Qwant" "eBay" "Perplexity"];
|
||||
Remove = [
|
||||
"Google"
|
||||
"Bing"
|
||||
"DuckDuckGo"
|
||||
"Qwant"
|
||||
"eBay"
|
||||
"Perplexity"
|
||||
];
|
||||
Default = "leta";
|
||||
Add = [
|
||||
{
|
||||
|
|
@ -102,23 +111,25 @@ in {
|
|||
"media.peerconnection.enabled" = false;
|
||||
};
|
||||
|
||||
extensions.packages = let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in [
|
||||
addons.ublock-origin
|
||||
addons.privacy-badger
|
||||
addons.user-agent-string-switcher
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[
|
||||
addons.ublock-origin
|
||||
addons.privacy-badger
|
||||
addons.user-agent-string-switcher
|
||||
|
||||
/*
|
||||
Here's to you who want to remove news feed eradicator because you find it annoying:
|
||||
It is here to annoy you so it is less likely for you to be on the agency inversion path.
|
||||
DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT.
|
||||
/*
|
||||
Here's to you who want to remove news feed eradicator because you find it annoying:
|
||||
It is here to annoy you so it is less likely for you to be on the agency inversion path.
|
||||
DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT.
|
||||
|
||||
If you think it's annoying, go do some jump rope, sing, live.
|
||||
*/
|
||||
addons.news-feed-eradicator # did you read the comment above?
|
||||
addons.multi-account-containers
|
||||
];
|
||||
If you think it's annoying, go do some jump rope, sing, live.
|
||||
*/
|
||||
addons.news-feed-eradicator # did you read the comment above?
|
||||
addons.multi-account-containers
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.fish = {
|
||||
shellAbbrs = lib.mkMerge [
|
||||
(lib.mkIf pkgs.stdenv.isLinux {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./aliasesAbbrs.nix
|
||||
];
|
||||
|
|
@ -10,7 +11,7 @@
|
|||
#
|
||||
# Script dependencies
|
||||
#
|
||||
home.packages = [pkgs.vivid];
|
||||
home.packages = [ pkgs.vivid ];
|
||||
programs = {
|
||||
fd.enable = true;
|
||||
fzf.enable = true;
|
||||
|
|
@ -24,11 +25,9 @@
|
|||
#
|
||||
# Scripts and functions
|
||||
#
|
||||
xdg.configFile =
|
||||
lib.mapAttrs'
|
||||
(path: _:
|
||||
lib.nameValuePair "fish/functions/${path}" {source = "${./functions}/${path}";})
|
||||
(builtins.readDir ./functions);
|
||||
xdg.configFile = lib.mapAttrs' (
|
||||
path: _: lib.nameValuePair "fish/functions/${path}" { source = "${./functions}/${path}"; }
|
||||
) (builtins.readDir ./functions);
|
||||
|
||||
programs.fish = {
|
||||
interactiveShellInit = builtins.readFile ./shellInit.fish;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# git plugins
|
||||
programs.git = {
|
||||
lfs.enable = true;
|
||||
|
|
@ -11,18 +12,18 @@
|
|||
# known to fail on aarch64-linux
|
||||
(lib.mkIf (pkgs.system == "aarch64-linux") (
|
||||
# TODO: investigate this
|
||||
lib.warn "patdiff has been forcibly disabled because it has previously failed to build"
|
||||
lib.mkForce
|
||||
false
|
||||
lib.warn "patdiff has been forcibly disabled because it has previously failed to build" lib.mkForce
|
||||
false
|
||||
))
|
||||
(lib.mkDefault true)
|
||||
];
|
||||
};
|
||||
|
||||
# 懶惰鬼賴皮
|
||||
programs.lazygit = let
|
||||
patdiffCfg = config.programs.git.patdiff;
|
||||
in
|
||||
programs.lazygit =
|
||||
let
|
||||
patdiffCfg = config.programs.git.patdiff;
|
||||
in
|
||||
lib.mkIf patdiffCfg.enable {
|
||||
settings = {
|
||||
git.paging.externalDiffCommand = "${lib.getExe' patdiffCfg.package "patdiff-git-wrapper"}";
|
||||
|
|
|
|||
|
|
@ -1,25 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
gpg-agent.defaultCacheTtl = 1209600;
|
||||
gpg-agent.pinentry.package = pkgs.pinentry-tty;
|
||||
};
|
||||
|
||||
programs.gpg.publicKeys = let
|
||||
fromUrl = {
|
||||
url,
|
||||
hash,
|
||||
trust ? 5,
|
||||
}: {
|
||||
source = pkgs.fetchurl {inherit url hash;};
|
||||
inherit trust;
|
||||
};
|
||||
programs.gpg.publicKeys =
|
||||
let
|
||||
fromUrl =
|
||||
{
|
||||
url,
|
||||
hash,
|
||||
trust ? 5,
|
||||
}:
|
||||
{
|
||||
source = pkgs.fetchurl { inherit url hash; };
|
||||
inherit trust;
|
||||
};
|
||||
|
||||
github = {user, ...} @ args:
|
||||
fromUrl (
|
||||
builtins.removeAttrs args ["user"]
|
||||
// {url = "https://github.com/${user}.gpg";}
|
||||
);
|
||||
in
|
||||
github =
|
||||
{ user, ... }@args:
|
||||
fromUrl (builtins.removeAttrs args [ "user" ] // { url = "https://github.com/${user}.gpg"; });
|
||||
in
|
||||
map github [
|
||||
# Do not depend on my own forgejo instance / self-host server to avoid a single point of failure
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.kitty;
|
||||
in {
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [
|
||||
pkgs.nerd-fonts.iosevka
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.lazygit;
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.tmux.extraConfig = lib.mkIf cfg.enable ''
|
||||
bind g run-shell "tmux new-window ${lib.getExe cfg.package}"
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home = {
|
||||
username = lib.mkDefault "leana";
|
||||
homeDirectory = let
|
||||
inherit (config.home) username;
|
||||
in
|
||||
homeDirectory =
|
||||
let
|
||||
inherit (config.home) username;
|
||||
in
|
||||
lib.mkMerge [
|
||||
(lib.mkIf pkgs.stdenv.isLinux ("/home/" + username))
|
||||
(lib.mkIf pkgs.stdenv.isDarwin ("/Users/" + username))
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
nixosConfig ? null,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.language = {
|
||||
base = lib.mkDefault nixosConfig.i18n.defaultLocale or "en_US.UTF-8";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs = {
|
||||
vim.enable = true;
|
||||
};
|
||||
|
||||
home.packages =
|
||||
[
|
||||
pkgs.file
|
||||
pkgs.gnused
|
||||
pkgs.tree
|
||||
pkgs.findutils # xargs and more
|
||||
pkgs.rsync
|
||||
pkgs.parallel
|
||||
pkgs.jq
|
||||
]
|
||||
# coreutils for darwin
|
||||
++ lib.optional pkgs.stdenv.isDarwin pkgs.uutils-coreutils-noprefix;
|
||||
home.packages = [
|
||||
pkgs.file
|
||||
pkgs.gnused
|
||||
pkgs.tree
|
||||
pkgs.findutils # xargs and more
|
||||
pkgs.rsync
|
||||
pkgs.parallel
|
||||
pkgs.jq
|
||||
]
|
||||
# coreutils for darwin
|
||||
++ lib.optional pkgs.stdenv.isDarwin pkgs.uutils-coreutils-noprefix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.password-store;
|
||||
in {
|
||||
in
|
||||
{
|
||||
home.packages = lib.mkIf cfg.enable [
|
||||
pkgs.pwgen
|
||||
pkgs.diceware
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.sioyek = {
|
||||
bindings = {
|
||||
"move_up" = "k";
|
||||
|
|
@ -17,8 +18,11 @@
|
|||
"u"
|
||||
"<C-u>"
|
||||
];
|
||||
"toggle_two_page_mode" = ["T"];
|
||||
"goto_mark" = ["`" "'"];
|
||||
"toggle_two_page_mode" = [ "T" ];
|
||||
"goto_mark" = [
|
||||
"`"
|
||||
"'"
|
||||
];
|
||||
};
|
||||
|
||||
config.should_launch_new_window = "1";
|
||||
|
|
@ -27,7 +31,7 @@
|
|||
xdg.mimeApps = lib.mkIf config.programs.sioyek.enable {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"application/pdf" = ["sioyek.desktop"];
|
||||
"application/pdf" = [ "sioyek.desktop" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.starship;
|
||||
in {
|
||||
in
|
||||
{
|
||||
xdg.configFile = lib.mkIf cfg.enable {
|
||||
"starship.toml".source = "${./starship.toml}";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.tmux.extraConfig =
|
||||
builtins.readFile ./tmux.conf
|
||||
+ lib.optionalString pkgs.stdenv.isDarwin ''
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
nix = {
|
||||
package = lib.mkDefault (nixosConfig.nix.package or pkgs.nix);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,30 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vim = {
|
||||
extraConfig = builtins.readFile ./vimrc;
|
||||
plugins = let
|
||||
vpkgs = pkgs.vimPlugins;
|
||||
plugins =
|
||||
let
|
||||
vpkgs = pkgs.vimPlugins;
|
||||
|
||||
paramount = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "paramount";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "owickstrom";
|
||||
repo = "vim-colors-paramount";
|
||||
rev = "a5601d36fb6932e8d1a6f8b37b179a99b1456798";
|
||||
hash = "sha256-j9nMjKYK7bqrGHprYp0ddLEWs1CNMudxXD13sOROVmY=";
|
||||
paramount = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "paramount";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "owickstrom";
|
||||
repo = "vim-colors-paramount";
|
||||
rev = "a5601d36fb6932e8d1a6f8b37b179a99b1456798";
|
||||
hash = "sha256-j9nMjKYK7bqrGHprYp0ddLEWs1CNMudxXD13sOROVmY=";
|
||||
};
|
||||
};
|
||||
};
|
||||
in [
|
||||
vpkgs.vim-sleuth
|
||||
vpkgs.vim-surround
|
||||
vpkgs.vim-fugitive
|
||||
vpkgs.vim-commentary
|
||||
vpkgs.undotree
|
||||
vpkgs.tabular
|
||||
vpkgs.vim-caddyfile
|
||||
paramount
|
||||
];
|
||||
in
|
||||
[
|
||||
vpkgs.vim-sleuth
|
||||
vpkgs.vim-surround
|
||||
vpkgs.vim-fugitive
|
||||
vpkgs.vim-commentary
|
||||
vpkgs.undotree
|
||||
vpkgs.tabular
|
||||
vpkgs.vim-caddyfile
|
||||
paramount
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = [pkgs.iosevka];
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.iosevka ];
|
||||
services.wired = {
|
||||
config = "${./wired.ron}";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue