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

@ -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