mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 12:40:13 +00:00
move all files to new nixfmt rfc
This commit is contained in:
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
_1password = {
|
||||
@ -10,9 +16,16 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config._1password.enable) {
|
||||
unfreePackages = [ "1password" "_1password-gui" "1password-cli" ];
|
||||
unfreePackages = [
|
||||
"1password"
|
||||
"_1password-gui"
|
||||
"1password-cli"
|
||||
];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ _1password-gui _1password ];
|
||||
home.packages = with pkgs; [
|
||||
_1password-gui
|
||||
_1password
|
||||
];
|
||||
};
|
||||
|
||||
# https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app
|
||||
@ -26,5 +39,4 @@
|
||||
firefox
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
alacritty = {
|
||||
@ -28,7 +34,9 @@
|
||||
opacity = 1.0;
|
||||
};
|
||||
scrolling.history = 10000;
|
||||
font = { size = 14.0; };
|
||||
font = {
|
||||
size = 14.0;
|
||||
};
|
||||
key_bindings = [
|
||||
# Used for word completion in fish_user_key_bindings
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./1password.nix
|
||||
@ -12,5 +13,4 @@
|
||||
./slack.nix
|
||||
./yt-dlp.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
discord = {
|
||||
|
@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
@ -22,8 +27,7 @@
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package =
|
||||
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||
package = if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "default";
|
||||
@ -49,32 +53,24 @@
|
||||
"app.update.auto" = false;
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.warnOnQuit" = false;
|
||||
"browser.quitShortcut.disabled" =
|
||||
if pkgs.stdenv.isLinux then true else false;
|
||||
"browser.quitShortcut.disabled" = if pkgs.stdenv.isLinux then true else false;
|
||||
"browser.theme.dark-private-windows" = true;
|
||||
"browser.toolbars.bookmarks.visibility" = false;
|
||||
"browser.startup.page" = 3; # Restore previous session
|
||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||
"trailhead.firstrun.didSeeAboutWelcome" =
|
||||
true; # Disable welcome splash
|
||||
"trailhead.firstrun.didSeeAboutWelcome" = true; # Disable welcome splash
|
||||
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
||||
"extensions.formautofill.creditCards.enabled" =
|
||||
false; # Disable credit cards
|
||||
"extensions.formautofill.creditCards.enabled" = false; # Disable credit cards
|
||||
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
||||
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
||||
"services.sync.prefs.sync.general.autoScroll" =
|
||||
false; # Prevent disabling autoscroll
|
||||
"services.sync.prefs.sync.general.autoScroll" = false; # Prevent disabling autoscroll
|
||||
"extensions.pocket.enabled" = false;
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" =
|
||||
true; # Allow userChrome.css
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Allow userChrome.css
|
||||
"layout.css.color-mix.enabled" = true;
|
||||
"ui.systemUsesDarkTheme" =
|
||||
if config.theme.dark == true then 1 else 0;
|
||||
"media.ffmpeg.vaapi.enabled" =
|
||||
true; # Enable hardware video acceleration
|
||||
"ui.systemUsesDarkTheme" = if config.theme.dark == true then 1 else 0;
|
||||
"media.ffmpeg.vaapi.enabled" = true; # Enable hardware video acceleration
|
||||
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
|
||||
"devtools.command-button-screenshot.enabled" =
|
||||
true; # Scrolling screenshot of entire page
|
||||
"devtools.command-button-screenshot.enabled" = true; # Scrolling screenshot of entire page
|
||||
"svg.context-properties.content.enabled" = true; # Sidebery styling
|
||||
};
|
||||
userChrome = ''
|
||||
@ -160,33 +156,34 @@
|
||||
|
||||
extraConfig = "";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
associations.added = { "text.html" = [ "firefox.desktop" ]; };
|
||||
defaultApplications = { "text.html" = [ "firefox.desktop" ]; };
|
||||
associations.added = {
|
||||
"text.html" = [ "firefox.desktop" ];
|
||||
};
|
||||
defaultApplications = {
|
||||
"text.html" = [ "firefox.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+b" = "exec ${
|
||||
# Don't name the script `firefox` or it will affect grep
|
||||
builtins.toString (pkgs.writeShellScript "focus-ff.sh" ''
|
||||
count=$(ps aux | grep -c firefox)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id firefox"
|
||||
sleep 0.5
|
||||
fi
|
||||
i3-msg "[class=firefox] focus"
|
||||
'')
|
||||
}";
|
||||
};
|
||||
|
||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+b" = "exec ${
|
||||
# Don't name the script `firefox` or it will affect grep
|
||||
builtins.toString (
|
||||
pkgs.writeShellScript "focus-ff.sh" ''
|
||||
count=$(ps aux | grep -c firefox)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id firefox"
|
||||
sleep 0.5
|
||||
fi
|
||||
i3-msg "[class=firefox] focus"
|
||||
''
|
||||
)
|
||||
}";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
kitty = {
|
||||
@ -13,20 +19,19 @@
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
# Using optionalAttrs because only available in NixOS
|
||||
environment = { } // lib.attrsets.optionalAttrs
|
||||
(builtins.hasAttr "sessionVariables" config.environment) {
|
||||
environment =
|
||||
{ }
|
||||
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
||||
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
|
||||
# Set the Rofi terminal for running programs
|
||||
programs.rofi.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
# Display images in the terminal
|
||||
programs.fish.shellAliases = {
|
||||
@ -48,16 +53,14 @@
|
||||
|
||||
# Kitty scrollback nvim
|
||||
"kitty_mod+h" = "kitty_scrollback_nvim";
|
||||
"kitty_mod+g" =
|
||||
"kitty_scrollback_nvim --config ksb_builtin_last_cmd_output";
|
||||
"kitty_mod+g" = "kitty_scrollback_nvim --config ksb_builtin_last_cmd_output";
|
||||
};
|
||||
settings = {
|
||||
|
||||
# Required for kitty-scrollback.nvim
|
||||
allow_remote_control = "socket-only";
|
||||
listen_on = "unix:/tmp/kitty";
|
||||
action_alias =
|
||||
"kitty_scrollback_nvim kitten ${pkgs.vimPlugins.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py";
|
||||
action_alias = "kitty_scrollback_nvim kitten ${pkgs.vimPlugins.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py";
|
||||
|
||||
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
||||
background = config.theme.colors.base00;
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
media = {
|
||||
@ -44,7 +50,10 @@
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
associations.removed = {
|
||||
"application/pdf" = [ "mupdf.desktop" "wine-extension-pdf.desktop" ];
|
||||
"application/pdf" = [
|
||||
"mupdf.desktop"
|
||||
"wine-extension-pdf.desktop"
|
||||
];
|
||||
};
|
||||
defaultApplications = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
@ -53,9 +62,6 @@
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
obsidian = {
|
||||
@ -18,7 +24,5 @@
|
||||
# Broken on 2023-12-11
|
||||
# https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8
|
||||
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
qbittorrent = {
|
||||
@ -14,8 +20,6 @@
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [ qbittorrent ];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
slack = {
|
||||
@ -15,5 +21,4 @@
|
||||
home.packages = with pkgs; [ slack ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
yt-dlp = {
|
||||
@ -27,9 +33,6 @@
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,19 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports =
|
||||
[ ./applications ./mail ./neovim ./programming ./repositories ./shell ];
|
||||
imports = [
|
||||
./applications
|
||||
./mail
|
||||
./neovim
|
||||
./programming
|
||||
./repositories
|
||||
./shell
|
||||
];
|
||||
|
||||
options = {
|
||||
user = lib.mkOption {
|
||||
@ -17,8 +29,7 @@
|
||||
download = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "XDG directory for downloads";
|
||||
default =
|
||||
if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
||||
default = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
||||
};
|
||||
};
|
||||
identityFile = lib.mkOption {
|
||||
@ -47,10 +58,9 @@
|
||||
homePath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path of user's home directory.";
|
||||
default = builtins.toPath (if pkgs.stdenv.isDarwin then
|
||||
"/Users/${config.user}"
|
||||
else
|
||||
"/home/${config.user}");
|
||||
default = builtins.toPath (
|
||||
if pkgs.stdenv.isDarwin then "/Users/${config.user}" else "/home/${config.user}"
|
||||
);
|
||||
};
|
||||
dotfilesPath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
@ -122,28 +132,33 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = let stateVersion = "23.05";
|
||||
in {
|
||||
config =
|
||||
let
|
||||
stateVersion = "23.05";
|
||||
in
|
||||
{
|
||||
|
||||
# Basic common system packages for all devices
|
||||
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
||||
# Basic common system packages for all devices
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
];
|
||||
|
||||
# Use the system-level nixpkgs instead of Home Manager's
|
||||
home-manager.useGlobalPkgs = true;
|
||||
# Use the system-level nixpkgs instead of Home Manager's
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||
# using multiple profiles for one user
|
||||
home-manager.useUserPackages = true;
|
||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||
# using multiple profiles for one user
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# Allow specified unfree packages (identified elsewhere)
|
||||
# Retrieves package object based on string name
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
home-manager.users.root.home.stateVersion = stateVersion;
|
||||
|
||||
};
|
||||
# Allow specified unfree packages (identified elsewhere)
|
||||
# Retrieves package object based on string name
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
home-manager.users.root.home.stateVersion = stateVersion;
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.mail.aerc.enable = lib.mkEnableOption "Aerc email.";
|
||||
|
||||
@ -75,7 +81,9 @@
|
||||
"<Esc>" = ":clear<Enter>";
|
||||
};
|
||||
|
||||
"messages:folder=Drafts" = { "<Enter>" = ":recall<Enter>"; };
|
||||
"messages:folder=Drafts" = {
|
||||
"<Enter>" = ":recall<Enter>";
|
||||
};
|
||||
|
||||
view = {
|
||||
"/" = ":toggle-key-passthrough <Enter> /";
|
||||
@ -148,21 +156,19 @@
|
||||
"<C-p>" = ":prev-tab<Enter>";
|
||||
"<C-n>" = ":next-tab<Enter>";
|
||||
};
|
||||
|
||||
};
|
||||
extraConfig = {
|
||||
general.unsafe-accounts-conf = true;
|
||||
viewer = { pager = "${pkgs.less}/bin/less -R"; };
|
||||
viewer = {
|
||||
pager = "${pkgs.less}/bin/less -R";
|
||||
};
|
||||
filters = {
|
||||
"text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"text/calendar" =
|
||||
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
|
||||
"text/html" =
|
||||
"${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
|
||||
"text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
|
||||
"text/html" = "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
|
||||
# "text/*" =
|
||||
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
|
||||
"message/delivery-status" =
|
||||
"${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
||||
"application/pdf" = "${pkgs.zathura}/bin/zathura -";
|
||||
@ -184,26 +190,27 @@
|
||||
name = "aerc";
|
||||
exec = "kitty aerc %u";
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+e" = "exec ${
|
||||
# Don't name the script `aerc` or it will affect grep
|
||||
builtins.toString (pkgs.writeShellScript "focus-mail.sh" ''
|
||||
count=$(ps aux | grep -c aerc)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id kitty --class aerc aerc"
|
||||
sleep 0.25
|
||||
fi
|
||||
i3-msg "[class=aerc] focus"
|
||||
'')
|
||||
}";
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = { ae = "aerc"; };
|
||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+e" = "exec ${
|
||||
# Don't name the script `aerc` or it will affect grep
|
||||
builtins.toString (
|
||||
pkgs.writeShellScript "focus-mail.sh" ''
|
||||
count=$(ps aux | grep -c aerc)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id kitty --class aerc aerc"
|
||||
sleep 0.25
|
||||
fi
|
||||
i3-msg "[class=aerc] focus"
|
||||
''
|
||||
)
|
||||
}";
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
ae = "aerc";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,16 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports = [ ./himalaya.nix ./aerc.nix ./system.nix ];
|
||||
imports = [
|
||||
./himalaya.nix
|
||||
./aerc.nix
|
||||
./system.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
mail.enable = lib.mkEnableOption "Mail service.";
|
||||
@ -26,7 +36,9 @@
|
||||
config = lib.mkIf config.mail.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
programs.mbsync = { enable = true; };
|
||||
programs.mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Automatically check for mail and keep files synced locally
|
||||
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
||||
@ -44,8 +56,11 @@
|
||||
# Better local mail search
|
||||
programs.notmuch = {
|
||||
enable = true;
|
||||
new.ignore =
|
||||
[ ".mbsyncstate.lock" ".mbsyncstate.journal" ".mbsyncstate.new" ];
|
||||
new.ignore = [
|
||||
".mbsyncstate.lock"
|
||||
".mbsyncstate.journal"
|
||||
".mbsyncstate.new"
|
||||
];
|
||||
};
|
||||
|
||||
accounts.email = {
|
||||
@ -54,72 +69,71 @@
|
||||
maildirBasePath = "${config.homePath}/mail";
|
||||
|
||||
accounts = {
|
||||
home = let address = "${config.mail.user}@${config.mail.server}";
|
||||
in {
|
||||
userName = address;
|
||||
realName = config.fullName;
|
||||
primary = true;
|
||||
inherit address;
|
||||
aliases = map (user: "${user}@${config.mail.server}") [
|
||||
"me"
|
||||
"hey"
|
||||
"admin"
|
||||
];
|
||||
home =
|
||||
let
|
||||
address = "${config.mail.user}@${config.mail.server}";
|
||||
in
|
||||
{
|
||||
userName = address;
|
||||
realName = config.fullName;
|
||||
primary = true;
|
||||
inherit address;
|
||||
aliases = map (user: "${user}@${config.mail.server}") [
|
||||
"me"
|
||||
"hey"
|
||||
"admin"
|
||||
];
|
||||
|
||||
# Options for contact completion
|
||||
alot = { };
|
||||
# Options for contact completion
|
||||
alot = { };
|
||||
|
||||
imap = {
|
||||
host = config.mail.imapHost;
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
imap = {
|
||||
host = config.mail.imapHost;
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
|
||||
# Watch for mail and run notifications or sync
|
||||
imapnotify = {
|
||||
enable = true;
|
||||
boxes = [ "Inbox" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
||||
onNotifyPost = lib.mkIf
|
||||
config.home-manager.users.${config.user}.services.dunst.enable
|
||||
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
||||
};
|
||||
# Watch for mail and run notifications or sync
|
||||
imapnotify = {
|
||||
enable = true;
|
||||
boxes = [ "Inbox" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
||||
onNotifyPost =
|
||||
lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable
|
||||
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
||||
};
|
||||
|
||||
# Name of the directory in maildir for this account
|
||||
maildir = { path = "main"; };
|
||||
# Name of the directory in maildir for this account
|
||||
maildir = {
|
||||
path = "main";
|
||||
};
|
||||
|
||||
# Bi-directional syncing options for local files
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
remove = "both";
|
||||
patterns = [ "*" ];
|
||||
extraConfig.channel = {
|
||||
CopyArrivalDate = "yes"; # Sync time of original message
|
||||
# Bi-directional syncing options for local files
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
remove = "both";
|
||||
patterns = [ "*" ];
|
||||
extraConfig.channel = {
|
||||
CopyArrivalDate = "yes"; # Sync time of original message
|
||||
};
|
||||
};
|
||||
|
||||
# Enable indexing
|
||||
notmuch.enable = true;
|
||||
|
||||
# Used to login and send and receive emails
|
||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${pkgs.writeText "mailpass.age" (builtins.readFile ../../../private/mailpass.age)}";
|
||||
|
||||
smtp = {
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Enable indexing
|
||||
notmuch.enable = true;
|
||||
|
||||
# Used to login and send and receive emails
|
||||
passwordCommand =
|
||||
"${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${
|
||||
pkgs.writeText "mailpass.age"
|
||||
(builtins.readFile ../../../private/mailpass.age)
|
||||
}";
|
||||
|
||||
smtp = {
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
|
||||
options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email.";
|
||||
|
||||
@ -6,7 +7,9 @@
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.himalaya = { enable = true; };
|
||||
programs.himalaya = {
|
||||
enable = true;
|
||||
};
|
||||
accounts.email.accounts.home.himalaya = {
|
||||
enable = true;
|
||||
settings = {
|
||||
@ -15,9 +18,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = { hi = "himalaya"; };
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
hi = "himalaya";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = lib.mkIf (config.mail.enable || config.server) {
|
||||
|
||||
@ -8,17 +14,15 @@
|
||||
|
||||
# The system user for sending automatic notifications
|
||||
accounts.email.accounts.system =
|
||||
let address = "system@${config.mail.server}";
|
||||
in {
|
||||
let
|
||||
address = "system@${config.mail.server}";
|
||||
in
|
||||
{
|
||||
userName = address;
|
||||
realName = "NixOS System";
|
||||
primary = !config.mail.enable; # Only primary if mail not enabled
|
||||
inherit address;
|
||||
passwordCommand =
|
||||
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
|
||||
pkgs.writeText "mailpass-system.age"
|
||||
(builtins.readFile ../../../private/mailpass-system.age)
|
||||
}";
|
||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${pkgs.writeText "mailpass-system.age" (builtins.readFile ../../../private/mailpass-system.age)}";
|
||||
msmtp.enable = true;
|
||||
smtp = {
|
||||
host = config.mail.smtpHost;
|
||||
@ -26,9 +30,6 @@
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# Plugin for aligning text programmatically
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# Shows buffers in a VSCode-style tab layout
|
||||
|
||||
@ -11,7 +12,7 @@
|
||||
diagnostics = "nvim_lsp";
|
||||
always_show_bufferline = false;
|
||||
separator_style = "slant";
|
||||
offsets = [{ filetype = "NvimTree"; }];
|
||||
offsets = [ { filetype = "NvimTree"; } ];
|
||||
};
|
||||
};
|
||||
lua = ''
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ pkgs, lib, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Sets Neovim colors based on Nix colorscheme
|
||||
|
||||
@ -18,5 +24,4 @@
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, dsl, ... }: {
|
||||
{ pkgs, dsl, ... }:
|
||||
{
|
||||
|
||||
plugins = [
|
||||
pkgs.vimPlugins.cmp-nvim-lsp
|
||||
@ -25,21 +26,15 @@
|
||||
|
||||
# Basic completion keybinds
|
||||
mapping = {
|
||||
"['<C-n>']" = dsl.rawLua
|
||||
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||
"['<C-p>']" = dsl.rawLua
|
||||
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||
"['<Down>']" = dsl.rawLua
|
||||
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||
"['<Up>']" = dsl.rawLua
|
||||
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||
"['<C-n>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||
"['<C-p>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||
"['<Down>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||
"['<Up>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
||||
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
||||
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
||||
"['<CR>']" = dsl.rawLua
|
||||
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||
"['<C-r>']" = dsl.rawLua
|
||||
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||
"['<CR>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||
"['<C-r>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||
"['<Esc>']" = dsl.rawLua ''
|
||||
function(_)
|
||||
cmp.mapping({
|
||||
@ -72,13 +67,19 @@
|
||||
name = "rg"; # Grep for text from the current directory
|
||||
keyword_length = 6;
|
||||
max_item_count = 10;
|
||||
option = { additional_arguments = "--ignore-case"; };
|
||||
option = {
|
||||
additional_arguments = "--ignore-case";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# Styling of the completion menu
|
||||
formatting = {
|
||||
fields = [ "kind" "abbr" "menu" ];
|
||||
fields = [
|
||||
"kind"
|
||||
"abbr"
|
||||
"menu"
|
||||
];
|
||||
format = dsl.rawLua ''
|
||||
function(entry, vim_item)
|
||||
local kind_icons = {
|
||||
@ -125,7 +126,6 @@
|
||||
native_menu = false; # Use cmp menu instead of Vim menu
|
||||
ghost_text = true; # Show preview auto-completion
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
lua = ''
|
||||
@ -145,5 +145,4 @@
|
||||
}),
|
||||
})
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
|
||||
setup.gitsigns = { };
|
||||
lua = builtins.readFile ./gitsigns.lua;
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ pkgs, dsl, lib, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
dsl,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
plugins = [
|
||||
pkgs.vimPlugins.vim-surround # Keybinds for surround characters
|
||||
pkgs.vimPlugins.vim-eunuch # File manipulation commands
|
||||
@ -13,7 +19,11 @@
|
||||
|
||||
# Initialize some plugins
|
||||
setup.Comment = { };
|
||||
setup.colorizer = { user_default_options = { names = false; }; };
|
||||
setup.colorizer = {
|
||||
user_default_options = {
|
||||
names = false;
|
||||
};
|
||||
};
|
||||
setup.glow = { };
|
||||
setup.which-key = { };
|
||||
setup.kitty-scrollback = { };
|
||||
@ -54,12 +64,15 @@
|
||||
vim.o.backup = true; # Easier to recover and more secure
|
||||
vim.bo.swapfile = false; # Instead of swaps, create backups
|
||||
vim.bo.undofile = true; # Keeps undos after quit
|
||||
vim.o.backupdir =
|
||||
dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
|
||||
vim.o.backupdir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
|
||||
vim.o.undodir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/undo//")'';
|
||||
|
||||
# Required for nvim-cmp completion
|
||||
vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
|
||||
vim.opt.completeopt = [
|
||||
"menu"
|
||||
"menuone"
|
||||
"noselect"
|
||||
];
|
||||
|
||||
lua = lib.mkBefore ''
|
||||
vim.loader.enable()
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
plugins = [ pkgs.vimPlugins.lualine-nvim ];
|
||||
setup.lualine = {
|
||||
options = {
|
||||
|
@ -1,8 +1,9 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
|
||||
plugins = [
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||
with pkgs.tree-sitter-grammars; [
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
|
||||
_plugins: with pkgs.tree-sitter-grammars; [
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-fish
|
||||
@ -19,7 +20,8 @@
|
||||
tree-sitter-toml
|
||||
tree-sitter-vimdoc
|
||||
tree-sitter-yaml
|
||||
]))
|
||||
]
|
||||
))
|
||||
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
||||
pkgs.vimPlugins.nginx-vim
|
||||
@ -34,9 +36,15 @@
|
||||
];
|
||||
|
||||
setup."nvim-treesitter.configs" = {
|
||||
highlight = { enable = true; };
|
||||
indent = { enable = true; };
|
||||
matchup = { enable = true; }; # Uses vim-matchup
|
||||
highlight = {
|
||||
enable = true;
|
||||
};
|
||||
indent = {
|
||||
enable = true;
|
||||
};
|
||||
matchup = {
|
||||
enable = true;
|
||||
}; # Uses vim-matchup
|
||||
|
||||
textobjects = {
|
||||
select = {
|
||||
@ -70,5 +78,4 @@
|
||||
-- Use HCL parser with .tf files
|
||||
vim.treesitter.language.register('hcl', 'terraform')
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ pkgs, dsl, ... }: {
|
||||
{ pkgs, dsl, ... }:
|
||||
{
|
||||
|
||||
# Telescope is a fuzzy finder that can work with different sub-plugins
|
||||
|
||||
@ -20,9 +21,15 @@
|
||||
};
|
||||
};
|
||||
pickers = {
|
||||
find_files = { theme = "ivy"; };
|
||||
oldfiles = { theme = "ivy"; };
|
||||
buffers = { theme = "dropdown"; };
|
||||
find_files = {
|
||||
theme = "ivy";
|
||||
};
|
||||
oldfiles = {
|
||||
theme = "ivy";
|
||||
};
|
||||
buffers = {
|
||||
theme = "dropdown";
|
||||
};
|
||||
};
|
||||
extensions = {
|
||||
fzy_native = { };
|
||||
@ -33,5 +40,4 @@
|
||||
setup.project_nvim = { };
|
||||
|
||||
lua = builtins.readFile ./telescope.lua;
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ pkgs, dsl, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
dsl,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Toggleterm provides a floating terminal inside the editor for quick access
|
||||
|
||||
@ -15,5 +21,4 @@
|
||||
${if config.github then (builtins.readFile ./github.lua) else ""}
|
||||
${if config.kubernetes then (builtins.readFile ./kubernetes.lua) else ""}
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,12 @@
|
||||
{ pkgs, dsl, ... }: {
|
||||
{ pkgs, dsl, ... }:
|
||||
{
|
||||
|
||||
# This plugin creates a side drawer for navigating the current project
|
||||
|
||||
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
|
||||
plugins = [
|
||||
pkgs.vimPlugins.nvim-tree-lua
|
||||
pkgs.vimPlugins.nvim-web-devicons
|
||||
];
|
||||
|
||||
# Disable netrw eagerly
|
||||
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
|
||||
@ -16,12 +20,14 @@
|
||||
hijack_netrw = true; # Works as the file manager
|
||||
sync_root_with_cwd = true; # Change project whenever currend dir changes
|
||||
respect_buf_cwd = true; # Change to exact location of focused buffer
|
||||
update_focused_file = { # Change project based on the focused buffer
|
||||
update_focused_file = {
|
||||
# Change project based on the focused buffer
|
||||
enable = true;
|
||||
update_root = true;
|
||||
ignore_list = { };
|
||||
};
|
||||
diagnostics = { # Enable LSP and linter integration
|
||||
diagnostics = {
|
||||
# Enable LSP and linter integration
|
||||
enable = true;
|
||||
icons = {
|
||||
hint = "";
|
||||
@ -30,7 +36,8 @@
|
||||
error = "";
|
||||
};
|
||||
};
|
||||
renderer = { # Show files with changes vs. current commit
|
||||
renderer = {
|
||||
# Show files with changes vs. current commit
|
||||
icons = {
|
||||
glyphs = {
|
||||
git = {
|
||||
@ -61,7 +68,8 @@
|
||||
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
|
||||
end
|
||||
'';
|
||||
view = { # Set look and feel
|
||||
view = {
|
||||
# Set look and feel
|
||||
width = 30;
|
||||
side = "left";
|
||||
number = false;
|
||||
@ -73,5 +81,4 @@
|
||||
lua = ''
|
||||
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
@ -9,8 +14,8 @@ let
|
||||
github = true;
|
||||
kubernetes = config.kubernetes.enable;
|
||||
};
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
||||
|
||||
@ -33,7 +38,9 @@ in {
|
||||
|
||||
# Create quick aliases for launching Neovim
|
||||
programs.fish = {
|
||||
shellAliases = { vim = "nvim"; };
|
||||
shellAliases = {
|
||||
vim = "nvim";
|
||||
};
|
||||
shellAbbrs = {
|
||||
v = lib.mkForce "nvim";
|
||||
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||
@ -45,23 +52,22 @@ in {
|
||||
# Requires removing some of the ANSI escape codes that are sent to the
|
||||
# scrollback using sed and baleia, as well as removing several
|
||||
# unnecessary features.
|
||||
programs.kitty.settings.scrollback_pager =
|
||||
"${neovim}/bin/nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'%print' +'quit!' 2>&1";
|
||||
programs.kitty.settings.scrollback_pager = "${neovim}/bin/nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'%print' +'quit!' 2>&1";
|
||||
|
||||
# Create a desktop option for launching Neovim from a file manager
|
||||
# (Requires launching the terminal and then executing Neovim)
|
||||
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
||||
name = "Neovim wrapper";
|
||||
exec = "kitty nvim %F";
|
||||
mimeType = [ "text/plain" "text/markdown" ];
|
||||
mimeType = [
|
||||
"text/plain"
|
||||
"text/markdown"
|
||||
];
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"text/markdown" = [ "nvim.desktop" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -26,13 +26,25 @@
|
||||
# ] ++ extraConfig;
|
||||
# }
|
||||
|
||||
{ pkgs, colors, terraform ? false, github ? false, kubernetes ? false, ... }:
|
||||
{
|
||||
pkgs,
|
||||
colors,
|
||||
terraform ? false,
|
||||
github ? false,
|
||||
kubernetes ? false,
|
||||
...
|
||||
}:
|
||||
|
||||
# Comes from nix2vim overlay:
|
||||
# https://github.com/gytis-ivaskevicius/nix2vim/blob/master/lib/neovim-builder.nix
|
||||
pkgs.neovimBuilder {
|
||||
package = pkgs.neovim-unwrapped;
|
||||
inherit colors terraform github kubernetes;
|
||||
inherit
|
||||
colors
|
||||
terraform
|
||||
github
|
||||
kubernetes
|
||||
;
|
||||
imports = [
|
||||
../config/align.nix
|
||||
../config/bufferline.nix
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./haskell.nix
|
||||
@ -9,5 +10,4 @@
|
||||
./rust.nix
|
||||
./terraform.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
|
||||
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
||||
|
||||
config = lib.mkIf config.haskell.enable {
|
||||
|
||||
# Binary Cache for Haskell.nix
|
||||
nix.settings.trusted-public-keys =
|
||||
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||
nix.settings.substituters = [ "https://cache.iog.io" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.kubernetes.enable = lib.mkEnableOption "Kubernetes tools.";
|
||||
|
||||
@ -99,12 +105,16 @@
|
||||
views = {
|
||||
charts = {
|
||||
bgColor = "default";
|
||||
defaultDialColors =
|
||||
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||
defaultDialColors = [
|
||||
config.theme.colors.base0D
|
||||
config.theme.colors.base08
|
||||
];
|
||||
# - *blue
|
||||
# - *red
|
||||
defaultChartColors =
|
||||
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||
defaultChartColors = [
|
||||
config.theme.colors.base0D
|
||||
config.theme.colors.base08
|
||||
];
|
||||
# - *blue
|
||||
# - *red
|
||||
};
|
||||
@ -149,9 +159,6 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
||||
|
||||
@ -8,5 +14,4 @@
|
||||
sumneko-lua-language-server # Lua LSP
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.nixlang.enable = lib.mkEnableOption "Nix programming language.";
|
||||
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.python.enable = lib.mkEnableOption "Python programming language.";
|
||||
|
||||
@ -13,10 +19,9 @@
|
||||
python310Packages.flake8 # Python linter
|
||||
];
|
||||
|
||||
programs.fish.shellAbbrs = { py = "python3"; };
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
py = "python3";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.rust.enable = lib.mkEnableOption "Rust programming language.";
|
||||
|
||||
@ -6,12 +12,16 @@
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.fish.shellAbbrs = { ca = "cargo"; };
|
||||
|
||||
home.packages = with pkgs; [ cargo rustc clippy gcc ];
|
||||
programs.fish.shellAbbrs = {
|
||||
ca = "cargo";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
clippy
|
||||
gcc
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
||||
|
||||
@ -15,9 +21,6 @@
|
||||
terraform-ls # Language server
|
||||
tflint # Linter
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
{ ... }: {
|
||||
|
||||
imports = [ ./dotfiles.nix ./notes.nix ];
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./dotfiles.nix
|
||||
./notes.nix
|
||||
];
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Allows me to make sure I can work on my dotfiles locally
|
||||
|
||||
@ -11,23 +17,17 @@
|
||||
home.activation = {
|
||||
|
||||
# Always clone dotfiles repository if it doesn't exist
|
||||
cloneDotfiles =
|
||||
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||
[ "writeBoundary" ] ''
|
||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||
$DRY_RUN_CMD ${pkgs.git}/bin/git \
|
||||
clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||
fi
|
||||
'';
|
||||
|
||||
cloneDotfiles = config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] ''
|
||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||
$DRY_RUN_CMD ${pkgs.git}/bin/git \
|
||||
clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# Set a variable for dotfiles repo, not necessary but convenient
|
||||
home.sessionVariables.DOTS = config.dotfilesPath;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
|
||||
# Shell history sync
|
||||
|
||||
@ -10,7 +11,10 @@
|
||||
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
flags = [ "--disable-up-arrow" "--disable-ctrl-r" ];
|
||||
flags = [
|
||||
"--disable-up-arrow"
|
||||
"--disable-ctrl-r"
|
||||
];
|
||||
settings = {
|
||||
auto_sync = true;
|
||||
update_check = false;
|
||||
@ -27,13 +31,9 @@
|
||||
keymap_mode = "vim-normal";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# Give root user the same setup
|
||||
home-manager.users.root.programs.atuin =
|
||||
config.home-manager.users.${config.user}.programs.atuin;
|
||||
|
||||
home-manager.users.root.programs.atuin = config.home-manager.users.${config.user}.programs.atuin;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases =
|
||||
config.home-manager.users.${config.user}.programs.fish.shellAliases;
|
||||
shellAliases = config.home-manager.users.${config.user}.programs.fish.shellAliases;
|
||||
initExtra = "";
|
||||
profileExtra = "";
|
||||
};
|
||||
@ -14,7 +19,6 @@
|
||||
programs.starship.enableBashIntegration = false;
|
||||
programs.zoxide.enableBashIntegration = true;
|
||||
programs.fzf.enableBashIntegration = true;
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Convenience utilities from charm.sh
|
||||
|
||||
@ -12,7 +18,5 @@
|
||||
charm # Manage account and filesystem
|
||||
pop # Send emails from a TUI
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./atuin.nix
|
||||
./bash
|
||||
|
@ -1,10 +1,15 @@
|
||||
{ config, ... }: {
|
||||
{ config, ... }:
|
||||
{
|
||||
|
||||
# Enables quickly entering Nix shells when changing directories
|
||||
home-manager.users.${config.user}.programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config = { whitelist = { prefix = [ config.dotfilesPath ]; }; };
|
||||
config = {
|
||||
whitelist = {
|
||||
prefix = [ config.dotfilesPath ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# programs.direnv.direnvrcExtra = ''
|
||||
@ -28,5 +33,4 @@
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
users.users.${config.user}.shell = pkgs.fish;
|
||||
programs.fish.enable = true; # Needed for LightDM to remember username
|
||||
@ -46,7 +52,9 @@
|
||||
fish_user_key_bindings = {
|
||||
body = builtins.readFile ./functions/fish_user_key_bindings.fish;
|
||||
};
|
||||
ip = { body = builtins.readFile ./functions/ip.fish; };
|
||||
ip = {
|
||||
body = builtins.readFile ./functions/ip.fish;
|
||||
};
|
||||
json = {
|
||||
description = "Tidy up JSON using jq";
|
||||
body = "pbpaste | jq '.' | pbcopy"; # Need to fix for non-macOS
|
||||
@ -112,8 +120,7 @@
|
||||
moon = "curl wttr.in/Moon";
|
||||
|
||||
# Cheat Sheets
|
||||
ssl =
|
||||
"openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr";
|
||||
ssl = "openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr";
|
||||
fingerprint = "ssh-keyscan myhost.com | ssh-keygen -lf -";
|
||||
publickey = "ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub";
|
||||
forloop = "for i in (seq 1 100)";
|
||||
@ -122,7 +129,6 @@
|
||||
dc = "$DOTS/bin/docker_cleanup";
|
||||
dr = "docker run --rm -it";
|
||||
db = "docker build . -t";
|
||||
|
||||
};
|
||||
shellInit = "";
|
||||
};
|
||||
@ -132,6 +138,5 @@
|
||||
programs.starship.enableFishIntegration = true;
|
||||
programs.zoxide.enableFishIntegration = true;
|
||||
programs.fzf.enableFishIntegration = true;
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ config, pkgs, ... }: {
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
# FZF is a fuzzy-finder for the terminal
|
||||
|
||||
@ -25,17 +26,20 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
shellAbbrs = { lsf = "ls -lh | fzf"; };
|
||||
shellAbbrs = {
|
||||
lsf = "ls -lh | fzf";
|
||||
};
|
||||
};
|
||||
|
||||
# Global fzf configuration
|
||||
home.sessionVariables = let fzfCommand = "fd --type file";
|
||||
in {
|
||||
FZF_DEFAULT_COMMAND = fzfCommand;
|
||||
FZF_CTRL_T_COMMAND = fzfCommand;
|
||||
FZF_DEFAULT_OPTS = "-m --height 50% --border";
|
||||
};
|
||||
|
||||
home.sessionVariables =
|
||||
let
|
||||
fzfCommand = "fd --type file";
|
||||
in
|
||||
{
|
||||
FZF_DEFAULT_COMMAND = fzfCommand;
|
||||
FZF_CTRL_T_COMMAND = fzfCommand;
|
||||
FZF_DEFAULT_OPTS = "-m --height 50% --border";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,14 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let home-packages = config.home-manager.users.${config.user}.home.packages;
|
||||
|
||||
in {
|
||||
let
|
||||
home-packages = config.home-manager.users.${config.user}.home.packages;
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
gitName = lib.mkOption {
|
||||
@ -28,16 +34,26 @@ in {
|
||||
userName = config.gitName;
|
||||
userEmail = config.gitEmail;
|
||||
extraConfig = {
|
||||
core.pager =
|
||||
"${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F";
|
||||
interactive.difffilter =
|
||||
"${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
|
||||
pager = { branch = "false"; };
|
||||
safe = { directory = config.dotfilesPath; };
|
||||
pull = { ff = "only"; };
|
||||
push = { autoSetupRemote = "true"; };
|
||||
init = { defaultBranch = "master"; };
|
||||
rebase = { autosquash = "true"; };
|
||||
core.pager = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F";
|
||||
interactive.difffilter = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
|
||||
pager = {
|
||||
branch = "false";
|
||||
};
|
||||
safe = {
|
||||
directory = config.dotfilesPath;
|
||||
};
|
||||
pull = {
|
||||
ff = "only";
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = "true";
|
||||
};
|
||||
init = {
|
||||
defaultBranch = "master";
|
||||
};
|
||||
rebase = {
|
||||
autosquash = "true";
|
||||
};
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
ssh.allowedSignersFile = "~/.config/git/allowed-signers";
|
||||
@ -45,11 +61,16 @@ in {
|
||||
# commit.gpgsign = true;
|
||||
# tag.gpgsign = true;
|
||||
};
|
||||
ignores = [ ".direnv/**" "result" ];
|
||||
includes = [{
|
||||
path = "~/.config/git/personal";
|
||||
condition = "gitdir:~/dev/personal/";
|
||||
}];
|
||||
ignores = [
|
||||
".direnv/**"
|
||||
"result"
|
||||
];
|
||||
includes = [
|
||||
{
|
||||
path = "~/.config/git/personal";
|
||||
condition = "gitdir:~/dev/personal/";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Personal git config
|
||||
@ -86,8 +107,7 @@ in {
|
||||
gl = "git log --graph --decorate --oneline -20";
|
||||
gll = "git log --graph --decorate --oneline";
|
||||
gco = "git checkout";
|
||||
gcom = ''
|
||||
git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)'';
|
||||
gcom = ''git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)'';
|
||||
gcob = "git switch -c";
|
||||
gb = "git branch";
|
||||
gpd = "git push origin -d";
|
||||
@ -101,58 +121,63 @@ in {
|
||||
};
|
||||
|
||||
# Required for fish commands
|
||||
home.packages = with pkgs; [ fish fzf bat ];
|
||||
home.packages = with pkgs; [
|
||||
fish
|
||||
fzf
|
||||
bat
|
||||
];
|
||||
|
||||
programs.fish.functions = lib.mkIf (builtins.elem pkgs.fzf home-packages
|
||||
&& builtins.elem pkgs.bat home-packages) {
|
||||
git = { body = builtins.readFile ./fish/functions/git.fish; };
|
||||
git-add-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-add-fuzzy.fish;
|
||||
programs.fish.functions =
|
||||
lib.mkIf (builtins.elem pkgs.fzf home-packages && builtins.elem pkgs.bat home-packages)
|
||||
{
|
||||
git = {
|
||||
body = builtins.readFile ./fish/functions/git.fish;
|
||||
};
|
||||
git-add-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-add-fuzzy.fish;
|
||||
};
|
||||
git-fuzzy-branch = {
|
||||
argumentNames = "header";
|
||||
body = builtins.readFile ./fish/functions/git-fuzzy-branch.fish;
|
||||
};
|
||||
git-checkout-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "checkout branch...")
|
||||
and git checkout $branch
|
||||
'';
|
||||
};
|
||||
git-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "delete branch...")
|
||||
and git branch -d $branch
|
||||
'';
|
||||
};
|
||||
git-force-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "force delete branch...")
|
||||
and git branch -D $branch
|
||||
'';
|
||||
};
|
||||
git-merge-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "merge from...")
|
||||
and git merge $branch
|
||||
'';
|
||||
};
|
||||
git-show-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-show-fuzzy.fish;
|
||||
};
|
||||
git-commits = {
|
||||
body = builtins.readFile ./fish/functions/git-commits.fish;
|
||||
};
|
||||
git-history = {
|
||||
body = builtins.readFile ./fish/functions/git-history.fish;
|
||||
};
|
||||
uncommitted = {
|
||||
description = "Find uncommitted git repos";
|
||||
body = builtins.readFile ./fish/functions/uncommitted.fish;
|
||||
};
|
||||
};
|
||||
git-fuzzy-branch = {
|
||||
argumentNames = "header";
|
||||
body = builtins.readFile ./fish/functions/git-fuzzy-branch.fish;
|
||||
};
|
||||
git-checkout-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "checkout branch...")
|
||||
and git checkout $branch
|
||||
'';
|
||||
};
|
||||
git-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "delete branch...")
|
||||
and git branch -d $branch
|
||||
'';
|
||||
};
|
||||
git-force-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "force delete branch...")
|
||||
and git branch -D $branch
|
||||
'';
|
||||
};
|
||||
git-merge-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "merge from...")
|
||||
and git merge $branch
|
||||
'';
|
||||
};
|
||||
git-show-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-show-fuzzy.fish;
|
||||
};
|
||||
git-commits = {
|
||||
body = builtins.readFile ./fish/functions/git-commits.fish;
|
||||
};
|
||||
git-history = {
|
||||
body = builtins.readFile ./fish/functions/git-history.fish;
|
||||
};
|
||||
uncommitted = {
|
||||
description = "Find uncommitted git repos";
|
||||
body = builtins.readFile ./fish/functions/uncommitted.fish;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,40 +1,43 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.gh =
|
||||
lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
|
||||
enable = true;
|
||||
gitCredentialHelper.enable = true;
|
||||
settings.git_protocol = "https";
|
||||
extensions = [ pkgs.gh-collaborators ];
|
||||
programs.gh = lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
|
||||
enable = true;
|
||||
gitCredentialHelper.enable = true;
|
||||
settings.git_protocol = "https";
|
||||
extensions = [ pkgs.gh-collaborators ];
|
||||
};
|
||||
|
||||
programs.fish = lib.mkIf config.home-manager.users.${config.user}.programs.gh.enable {
|
||||
shellAbbrs = {
|
||||
ghr = "gh repo view -w";
|
||||
gha = "gh run list | head -1 | awk '{ print \\$\\(NF-2\\) }' | xargs gh run view";
|
||||
grw = "gh run watch";
|
||||
grf = "gh run view --log-failed";
|
||||
grl = "gh run view --log";
|
||||
ghpr = "gh pr create && sleep 3 && gh run watch";
|
||||
|
||||
# https://github.com/cli/cli/discussions/4067
|
||||
prs = "gh search prs --state=open --review-requested=@me";
|
||||
};
|
||||
|
||||
programs.fish =
|
||||
lib.mkIf config.home-manager.users.${config.user}.programs.gh.enable {
|
||||
shellAbbrs = {
|
||||
ghr = "gh repo view -w";
|
||||
gha =
|
||||
"gh run list | head -1 | awk '{ print \\$\\(NF-2\\) }' | xargs gh run view";
|
||||
grw = "gh run watch";
|
||||
grf = "gh run view --log-failed";
|
||||
grl = "gh run view --log";
|
||||
ghpr = "gh pr create && sleep 3 && gh run watch";
|
||||
|
||||
# https://github.com/cli/cli/discussions/4067
|
||||
prs = "gh search prs --state=open --review-requested=@me";
|
||||
};
|
||||
functions = {
|
||||
repos = {
|
||||
description = "Clone GitHub repositories";
|
||||
argumentNames = "organization";
|
||||
body = ''
|
||||
set directory (gh-repos $organization)
|
||||
and cd $directory
|
||||
'';
|
||||
};
|
||||
functions = {
|
||||
repos = {
|
||||
description = "Clone GitHub repositories";
|
||||
argumentNames = "organization";
|
||||
body = ''
|
||||
set directory (gh-repos $organization)
|
||||
and cd $directory
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "gh-repos" ''
|
||||
@ -76,7 +79,5 @@
|
||||
}
|
||||
'')
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ config, ... }: {
|
||||
{ config, ... }:
|
||||
{
|
||||
|
||||
config = {
|
||||
|
||||
@ -9,12 +10,9 @@
|
||||
settings = {
|
||||
user = {
|
||||
name = config.home-manager.users.${config.user}.programs.git.userName;
|
||||
email =
|
||||
config.home-manager.users.${config.user}.programs.git.userEmail;
|
||||
email = config.home-manager.users.${config.user}.programs.git.userEmail;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.fish = {
|
||||
@ -62,22 +68,22 @@
|
||||
|
||||
# Create nix-index if doesn't exist
|
||||
home.activation.createNixIndex =
|
||||
let cacheDir = "${config.homePath}/.cache/nix-index";
|
||||
in lib.mkIf
|
||||
config.home-manager.users.${config.user}.programs.nix-index.enable
|
||||
(config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||
[ "writeBoundary" ] ''
|
||||
let
|
||||
cacheDir = "${config.homePath}/.cache/nix-index";
|
||||
in
|
||||
lib.mkIf config.home-manager.users.${config.user}.programs.nix-index.enable (
|
||||
config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] ''
|
||||
if [ ! -d ${cacheDir} ]; then
|
||||
$DRY_RUN_CMD ${pkgs.nix-index}/bin/nix-index -f ${pkgs.path}
|
||||
fi
|
||||
'');
|
||||
''
|
||||
);
|
||||
|
||||
# Set automatic generation cleanup for home-manager
|
||||
nix.gc = {
|
||||
automatic = config.nix.gc.automatic;
|
||||
options = config.nix.gc.options;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
nix = {
|
||||
@ -92,7 +98,10 @@
|
||||
};
|
||||
|
||||
# For security, only allow specific users
|
||||
settings.allowed-users = [ "@wheel" config.user ];
|
||||
settings.allowed-users = [
|
||||
"@wheel"
|
||||
config.user
|
||||
];
|
||||
|
||||
# Enable features in Nix commands
|
||||
extraOptions = ''
|
||||
@ -110,8 +119,7 @@
|
||||
# Add community Cachix to binary cache
|
||||
# Don't use with macOS because blocked by corporate firewall
|
||||
builders-use-substitutes = true;
|
||||
substituters =
|
||||
lib.mkIf (!pkgs.stdenv.isDarwin) [ "https://nix-community.cachix.org" ];
|
||||
substituters = lib.mkIf (!pkgs.stdenv.isDarwin) [ "https://nix-community.cachix.org" ];
|
||||
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
@ -119,9 +127,6 @@
|
||||
# Scans and hard links identical files in the store
|
||||
# Not working with macOS: https://github.com/NixOS/nix/issues/7273
|
||||
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home-manager.users.${config.user}.programs.starship = {
|
||||
enable = true;
|
||||
@ -29,7 +35,9 @@
|
||||
truncate_to_repo = true;
|
||||
truncation_length = 100;
|
||||
};
|
||||
git_branch = { format = "[$symbol$branch]($style)"; };
|
||||
git_branch = {
|
||||
format = "[$symbol$branch]($style)";
|
||||
};
|
||||
git_commit = {
|
||||
format = "( @ [$hash]($style) )";
|
||||
only_detached = false;
|
||||
@ -56,8 +64,9 @@
|
||||
format = "[$symbol $name]($style)";
|
||||
symbol = "❄️";
|
||||
};
|
||||
python = { format = "[\${version}\\(\${virtualenv}\\)]($style)"; };
|
||||
python = {
|
||||
format = "[\${version}\\(\${virtualenv}\\)]($style)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ let
|
||||
.terraform/
|
||||
.target/
|
||||
/Library/'';
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
config = {
|
||||
|
||||
@ -70,9 +70,6 @@ in {
|
||||
body = "${pkgs.prettyping}/bin/prettyping --nolegend $target";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,46 +1,52 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
home.packages = let
|
||||
ldap_scheme = "ldaps";
|
||||
magic_number = "2";
|
||||
magic_end_seq = "corp";
|
||||
magic_prefix = "take";
|
||||
ldap_host =
|
||||
"${magic_prefix}${magic_number}.t${magic_number}.${magic_end_seq}";
|
||||
ldap_port = 636;
|
||||
ldap_dc_1 = "${magic_prefix}${magic_number}";
|
||||
ldap_dc_2 = "t${magic_number}";
|
||||
ldap_dc_3 = magic_end_seq;
|
||||
ldap_script = pkgs.writeShellScriptBin "ldap" ''
|
||||
# if ! [ "$LDAP_HOST" ]; then
|
||||
# echo "No LDAP_HOST specified!"
|
||||
# exit 1
|
||||
# fi
|
||||
SEARCH_FILTER="$@"
|
||||
ldapsearch -LLL \
|
||||
-B -o ldif-wrap=no \
|
||||
-H "${ldap_scheme}://${ldap_host}:${builtins.toString ldap_port}" \
|
||||
-D "${pkgs.lib.toUpper magic_prefix}${magic_number}\\${
|
||||
pkgs.lib.toLower config.user
|
||||
}" \
|
||||
-w "$(${pkgs._1password}/bin/op item get T${magic_number} --fields label=password)" \
|
||||
-b "DC=${ldap_dc_1},DC=${ldap_dc_2},DC=${ldap_dc_3}" \
|
||||
-s "sub" -x "(cn=$SEARCH_FILTER)" \
|
||||
| jq --slurp \
|
||||
--raw-input 'split("\n\n")|map(split("\n")|map(select(.[0:1]!="#" and length>0)) |select(length > 0)|map(capture("^(?<key>[^:]*:?): *(?<value>.*)") |if .key[-1:.key|length] == ":" then .key=.key[0:-1]|.value=(.value|@base64d) else . end)| group_by(.key) | map({key:.[0].key,value:(if .|length > 1 then [.[].value] else .[].value end)}) | from_entries)' | jq -r 'del(.[].thumbnailPhoto)'
|
||||
'';
|
||||
ldapm_script = pkgs.writeShellScriptBin "ldapm" ''
|
||||
${ldap_script}/bin/ldap "$@" | jq '[ .[].memberOf] | add'
|
||||
'';
|
||||
ldapg_script = pkgs.writeShellScriptBin "ldapg" ''
|
||||
${ldap_script}/bin/ldap "$@" | jq '[ .[].member] | add'
|
||||
'';
|
||||
in [ ldap_script ldapm_script ldapg_script ];
|
||||
|
||||
home.packages =
|
||||
let
|
||||
ldap_scheme = "ldaps";
|
||||
magic_number = "2";
|
||||
magic_end_seq = "corp";
|
||||
magic_prefix = "take";
|
||||
ldap_host = "${magic_prefix}${magic_number}.t${magic_number}.${magic_end_seq}";
|
||||
ldap_port = 636;
|
||||
ldap_dc_1 = "${magic_prefix}${magic_number}";
|
||||
ldap_dc_2 = "t${magic_number}";
|
||||
ldap_dc_3 = magic_end_seq;
|
||||
ldap_script = pkgs.writeShellScriptBin "ldap" ''
|
||||
# if ! [ "$LDAP_HOST" ]; then
|
||||
# echo "No LDAP_HOST specified!"
|
||||
# exit 1
|
||||
# fi
|
||||
SEARCH_FILTER="$@"
|
||||
ldapsearch -LLL \
|
||||
-B -o ldif-wrap=no \
|
||||
-H "${ldap_scheme}://${ldap_host}:${builtins.toString ldap_port}" \
|
||||
-D "${pkgs.lib.toUpper magic_prefix}${magic_number}\\${pkgs.lib.toLower config.user}" \
|
||||
-w "$(${pkgs._1password}/bin/op item get T${magic_number} --fields label=password)" \
|
||||
-b "DC=${ldap_dc_1},DC=${ldap_dc_2},DC=${ldap_dc_3}" \
|
||||
-s "sub" -x "(cn=$SEARCH_FILTER)" \
|
||||
| jq --slurp \
|
||||
--raw-input 'split("\n\n")|map(split("\n")|map(select(.[0:1]!="#" and length>0)) |select(length > 0)|map(capture("^(?<key>[^:]*:?): *(?<value>.*)") |if .key[-1:.key|length] == ":" then .key=.key[0:-1]|.value=(.value|@base64d) else . end)| group_by(.key) | map({key:.[0].key,value:(if .|length > 1 then [.[].value] else .[].value end)}) | from_entries)' | jq -r 'del(.[].thumbnailPhoto)'
|
||||
'';
|
||||
ldapm_script = pkgs.writeShellScriptBin "ldapm" ''
|
||||
${ldap_script}/bin/ldap "$@" | jq '[ .[].memberOf] | add'
|
||||
'';
|
||||
ldapg_script = pkgs.writeShellScriptBin "ldapg" ''
|
||||
${ldap_script}/bin/ldap "$@" | jq '[ .[].member] | add'
|
||||
'';
|
||||
in
|
||||
[
|
||||
ldap_script
|
||||
ldapm_script
|
||||
ldapg_script
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user