more stuff

This commit is contained in:
Noah Masur
2025-02-01 16:10:16 -05:00
parent ea3ab18cca
commit 1226eafef2
34 changed files with 291 additions and 308 deletions

View File

@ -0,0 +1,4 @@
{ lib, ... }:
{
imports = lib.filesystem.listFilesRecursive ./.;
}

View File

@ -6,13 +6,12 @@
}:
let
cfg = config.nmasur.presets.programs."1password";
cfg = config.nmasur.presets.programs._1password;
in
{
options.nmasur.presets.programs."1password".enable =
lib.mkEnableOption "1Password password manager";
options.nmasur.presets.programs._1password.enable = lib.mkEnableOption "1Password password manager";
config = lib.mkIf cfg.enable {
unfreePackages = [

View File

@ -1,16 +0,0 @@
{ ... }:
{
imports = [
./1password.nix
./alacritty.nix
./discord.nix
./firefox.nix
./kitty.nix
./media.nix
./nsxiv.nix
./wezterm.nix
./yt-dlp.nix
./zathura.nix
];
}

View File

@ -17,11 +17,6 @@ in
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config = {
whitelist = {
prefix = [ config.nmasur.dotfilesPath ];
};
};
};
};
}

View File

@ -0,0 +1,26 @@
{
config,
lib,
...
}:
let
cfg = config.nmasur.presets.programs.doas;
in
{
options.nmasur.presets.programs.doas.enable = lib.mkEnableOption "doas sudo alternative";
config = lib.mkIf cfg.enable {
# Alias sudo to doas for convenience
fish.shellAliases = {
sudo = "doas";
};
# Disable overriding our sudo alias with a TERMINFO alias
kitty.settings.shell_integration = "no-sudo";
};
}

View File

@ -28,6 +28,9 @@ in
config = lib.mkIf cfg.enable {
programs.git.extraConfig.safe.directory = cfg.path;
programs.direnv.config.whitelist.prefix = [ cfg.path ];
home.activation = {
# Always clone dotfiles repository if it doesn't exist

View File

@ -0,0 +1,69 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.presets.programs.git-work;
in
{
options.nmasur.presets.programs.git-work = {
enable = lib.mkEnableOption "Git settings for work";
work = {
name = lib.mkOption {
type = lib.types.str;
description = "Name to use for work git commits";
};
email = lib.mkOption {
type = lib.types.str;
description = "Email to use for work git commits";
};
};
personal = {
name = lib.mkOption {
type = lib.types.str;
description = "Name to use for personal git commits";
};
email = lib.mkOption {
type = lib.types.str;
description = "Email to use for personal git commits";
};
};
};
config = lib.mkIf cfg.enable {
programs.git = {
userName = lib.mkForce cfg.work.name;
userEmail = lib.mkForce cfg.work.email;
includes = [
{
path = "${config.xdg.configHome}/${config.xdg.configFile."git/personal".target}";
condition = "gitdir:~/dev/personal/";
}
];
};
# Personal git config
xdg.configFile."git/personal".text = pkgs.formats.gitIni {
user = {
name = cfg.personal.name;
email = cfg.personal.email;
signingkey = "~/.ssh/id_ed25519";
};
commit = {
gpgsign = true;
};
tag = {
gpgsign = true;
};
};
};
}

View File

@ -12,12 +12,12 @@ in
{
options.nmasur.presets.programs.git = {
enable = lib.mkEnableOption "";
gitName = lib.mkOption {
enable = lib.mkEnableOption "Git version control";
name = lib.mkOption {
type = lib.types.str;
description = "Name to use for git commits";
};
gitEmail = lib.mkOption {
email = lib.mkOption {
type = lib.types.str;
description = "Email to use for git commits";
};
@ -27,17 +27,14 @@ in
programs.git = {
enable = true;
userName = config.gitName;
userEmail = config.gitEmail;
userName = cfg.name;
userEmail = cfg.email;
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";
};
@ -61,27 +58,8 @@ in
".direnv/**"
"result"
];
includes = [
{
path = "~/.config/git/personal";
condition = "gitdir:~/dev/personal/";
}
];
};
# Personal git config
# TODO: fix with variables
xdg.configFile."git/personal".text = ''
[user]
name = "${config.fullName}"
email = "7386960+nmasur@users.noreply.github.com"
signingkey = ~/.ssh/id_ed25519
[commit]
gpgsign = true
[tag]
gpgsign = true
'';
xdg.configFile."git/allowed-signers".text = ''
7386960+nmasur@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s
'';

View File

@ -16,7 +16,14 @@ in
./brightness.nix
];
options.nmasur.presets.programs.rofi.enable = lib.mkEnableOption "Rofi quick launcher";
options.nmasur.presets.programs.rofi = {
enable = lib.mkEnableOption "Rofi quick launcher";
terminal = lib.mkOption {
type = lib.types.package;
description = "Terminal application for rofi";
default = config.nmasur.presets.services.i3.terminal;
};
};
config = lib.mkIf cfg.enable {
@ -24,12 +31,33 @@ in
jq # Required for rofi-systemd
];
nmasur.presets.services.i3.commands =
let
rofi = config.programs.rofi.finalPackage;
in
{
launcher = ''${lib.getExe rofi} -modes drun -show drun -theme-str '@import "launcher.rasi"' '';
systemdSearch = lib.getExe pkgs.rofi-systemd;
altTab = "${lib.getExe rofi} -show window -modi window";
calculator = "${lib.getExe rofi} -modes calc -show calc";
audioSwitch = lib.getExe (
pkgs.writeShellApplication {
name = "switch-audio";
runtimeInputs = [
pkgs.ponymix
rofi
];
text = builtins.readFile ./rofi/pulse-sink.sh;
}
);
};
programs.rofi = {
enable = true;
cycle = true;
location = "center";
pass = { };
terminal = lib.mkIf pkgs.stdenv.isLinux config.terminal;
terminal = lib.getExe cfg.terminal;
plugins = [
pkgs.rofi-calc
pkgs.rofi-emoji

View File

@ -17,6 +17,10 @@ in
type = lib.types.package;
description = "Terminal application to launch";
};
wallpaper = {
type = lib.types.path;
description = "Wallpaper background image file";
};
commands = {
launcher = lib.mkOption {
type = lib.types.nullOr lib.types.str;
@ -31,7 +35,7 @@ in
updateLockScreen = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Update lock screen cache";
default = "${lib.getExe pkgs.betterlockscreen} --update ${config.wallpaper} --display 1 --span";
default = "${lib.getExe pkgs.betterlockscreen} --update ${cfg.wallpaper} --display 1 --span";
};
toggleBar = lib.mkOption {
type = lib.types.nullOr lib.types.str;
@ -271,7 +275,7 @@ in
modes = { };
startup = [
{
command = "feh --bg-fill ${config.wallpaper}";
command = "feh --bg-fill ${cfg.wallpaper}";
always = true;
notification = false;
}

View File

@ -12,18 +12,30 @@ in
options.nmasur.profiles.common.enable = lib.mkEnableOption "Common home-manager config";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
dig # DNS lookup
fd # find
htop # Show system processes
killall # Force quit
inetutils # Includes telnet, whois
jq # JSON manipulation
rsync # Copy folders
ripgrep # grep
sd # sed
unzip # Extract zips
home.packages = [
pkgs.dig # DNS lookup
pkgs.fd # find
pkgs.htop # Show system processes
pkgs.killall # Force quit
pkgs.inetutils # Includes telnet, whois
pkgs.jq # JSON manipulation
pkgs.rsync # Copy folders
pkgs.ripgrep # grep
pkgs.sd # sed
pkgs.unzip # Extract zips
];
nmasur.presets = {
programs = {
bat.enable = true;
ripgrep.enable = true;
fd.enable = true;
};
services = {
loadkey.enable = lib.mkDefault true;
};
};
};
}

View File

@ -20,7 +20,7 @@ in
};
# Used for aerc
xdg.enable = true;
xdg.enable = lib.mkDefault pkgs.stdenv.isDarwin;
home.packages = [
pkgs.noti # Create notifications programmatically

View File

@ -6,12 +6,12 @@
}:
let
cfg = config.nmasur.profiles.fun;
cfg = config.nmasur.profiles.experimental;
in
{
options.nmasur.profiles.fun.enable = lib.mkEnableOption "Fun tools";
options.nmasur.profiles.experimental.enable = lib.mkEnableOption "experimental tools";
config = lib.mkIf cfg.enable {

View File

@ -35,23 +35,25 @@ in
programs.zoxide.enable = lib.mkDefault true; # Shortcut jump command
programs.fish.shellAliases = {
"cd" = lib.mkDefault "${pkgs.zoxide}/bin/zoxide";
"du" = lib.mkDefault "${pkgs.dua}/bin/dua";
"ncdu" = lib.mkDefault "${pkgs.du-dust}/bin/du-dust";
"df" = lib.mkDefault "${pkgs.duf}/bin/duf";
"cd" = lib.mkDefault lib.getExe pkgs.zoxide;
"du" = lib.mkDefault lib.getExe pkgs.dua;
"ncdu" = lib.mkDefault lib.getExe pkgs.du-dust;
"df" = lib.mkDefault lib.getExe pkgs.duf;
# Use eza (exa) instead of ls for fancier output
ls = "${pkgs.eza}/bin/eza --group";
ls = lib.mkDefault "${lib.getExe pkgs.eza} --group";
# Version of bash which works much better on the terminal
bash = "${pkgs.bashInteractive}/bin/bash";
bash = lib.mkDefault lib.getExe pkgs.bashInteractive;
};
config.nmasur.presets.bat.enable = lib.mkDefault true;
config.nmasur.presets.fd.enable = lib.mkDefault true;
config.nmasur.presets.ripgrep.enable = lib.mkDefault true;
config.nmasur.presets.prettyping.enable = lib.mkDefault true;
config.nmasur.presets.weather.enable = lib.mkDefault true;
nmasur.presets = {
bat.enable = lib.mkDefault true;
fd.enable = lib.mkDefault true;
ripgrep.enable = lib.mkDefault true;
prettyping.enable = lib.mkDefault true;
weather.enable = lib.mkDefault true;
};
};
}

View File

@ -15,7 +15,7 @@ in
config = lib.mkIf cfg.enable {
config.nmasur.programs.wine.enable = lib.mkDefault true;
nmasur.programs.wine.enable = lib.mkDefault true;
home.packages = lib.mkDefault [
pkgs.heroic

View File

@ -34,35 +34,40 @@ in
pkgs.ipcalc # Make IP network calculations
pkgs.cloudflared # Allow connecting to Cloudflare tunnels
pkgs.monitorcontrol # Allows adjusting external displays
(pkgs.writeShellApplication {
name = "ocr";
runtimeInputs = [ pkgs.tesseract ];
text = builtins.readFile ../../modules/common/shell/bash/scripts/ocr.sh;
})
(pkgs.writeShellApplication {
name = "ec2";
runtimeInputs = [
pkgs.awscli2
pkgs.jq
pkgs.fzf
];
text = builtins.readFile ../../modules/common/shell/bash/scripts/aws-ec2.sh;
})
(pkgs.writeShellApplication {
name = "tfinit";
runtimeInputs = [
pkgs.terraform
pkgs.gawk
pkgs.git
];
text = builtins.readFile ../../modules/common/shell/bash/scripts/terraform-init.sh;
})
pkgs.ocr # Converts images to text
pkgs.aws-ec2 # Browse EC2 instances
pkgs.terraform-init # Quick shortcut for initializing Terraform backend
];
programs.helix.enable = lib.mkDefault true;
programs.zed-editor.enable = lib.mkDefault true;
config.nmasur.presets.programs.terraform.enable = lib.mkDefault true;
nmasur.presets = {
programs = {
_1password.enable = lib.mkDefault true;
atuin.enable = lib.mkDefault true;
bash.enable = lib.mkDefault true;
bat.enable = lib.mkDefault true;
direnv.enable = lib.mkDefault true;
dotfiles.enable = lib.mkDefault true;
fd.enable = lib.mkDefault true;
firefox.enable = lib.mkDefault true;
fish.enable = lib.mkDefault true;
fzf.enable = lib.mkDefault true;
git-work.enable = lib.mkDefault true;
git.enable = lib.mkDefault true;
github.enable = lib.mkDefault true;
jujutsu.enable = lib.mkDefault true;
k9s.enable = lib.mkDefault true;
kubectl.enable = lib.mkDefault true;
ldapsearch.enable = lib.mkDefault true;
ripgrep.enable = lib.mkDefault true;
starship.enable = lib.mkDefault true;
terraform.enable = lib.mkDefault true;
weather.enable = lib.mkDefault true;
wezterm.enable = lib.mkDefault true;
};
};
};