fix references

This commit is contained in:
Noah Masur
2025-02-17 14:05:23 -05:00
parent 7de88ba2b6
commit ebd7b88909
54 changed files with 272 additions and 216 deletions

View File

@ -15,12 +15,12 @@ in
config = lib.mkIf cfg.enable {
# Alias sudo to doas for convenience
fish.shellAliases = {
programs.fish.shellAliases = {
sudo = "doas";
};
# Disable overriding our sudo alias with a TERMINFO alias
kitty.settings.shell_integration = "no-sudo";
programs.kitty.settings.shell_integration = "no-sudo";
};
}

View File

@ -12,7 +12,7 @@ in
# Allows me to make sure I can work on my dotfiles locally
options.nmasur.preset.programs.dotfiles = {
options.nmasur.presets.programs.dotfiles = {
enable = lib.mkEnableOption "Clone dotfiles repository";
repo = lib.mkOption {
type = lib.types.str;

View File

@ -21,7 +21,7 @@ in
config = lib.mkIf cfg.enable {
cfg.fish_user_key_bindings = # fish
nmasur.presets.programs.fish.fish_user_key_bindings = # fish
''
# Shift-Enter (defined by terminal)
bind -M insert \x1F accept-autosuggestion

View File

@ -13,13 +13,15 @@ in
options.nmasur.presets.programs.jujutsu.enable = lib.mkEnableOption "Jujutsu version control";
config = lib.mkIf cfg.enable {
enable = true;
programs.jujutsu = {
enable = true;
# https://github.com/martinvonz/jj/blob/main/docs/config.md
settings = {
user = {
name = config.programs.git.userName;
email = config.programs.git.userEmail;
# https://github.com/martinvonz/jj/blob/main/docs/config.md
settings = {
user = {
name = config.programs.git.userName;
email = config.programs.git.userEmail;
};
};
};

View File

@ -6,12 +6,12 @@
}:
let
cfg = config.nmasur.presets.programs.alacritty;
cfg = config.nmasur.presets.programs.mpv;
in
{
options.nmasur.presets.programs.alacritty.enable = lib.mkEnableOption "Alacritty terminal";
options.nmasur.presets.programs.mpv.enable = lib.mkEnableOption "mpv video player";
config = lib.mkIf cfg.enable {
# Video player

View File

@ -28,7 +28,7 @@ in
home.packages = [ cfg.package ];
cfg.package = lib.mkDefault pkgs.nmasur-neovim.override {
nmasur.presets.programs.neovim.package = lib.mkDefault pkgs.nmasur-neovim.override {
colors = cfg.colors;
github = cfg.github.enable;
terraform = cfg.terraform.enable;

View File

@ -6,7 +6,6 @@
}:
let
inherit (config.nmasur.settings) username;
cfg = config.nmasur.presets.programs.nixpkgs;
in
@ -110,51 +109,47 @@ in
''
);
# Set automatic generation cleanup for home-manager
nix.gc = {
automatic = config.nix.gc.automatic;
options = config.nix.gc.options;
nix = {
# Set channel to flake packages, used for nix-shell commands
nixPath = [ "nixpkgs=${pkgs.path}" ];
# For security, only allow specific users
settings.allowed-users = [
"@wheel" # Anyone in the wheel group
config.home.username # The current user
];
# Enable features in Nix commands
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
# Set automatic generation cleanup for home-manager
gc = {
automatic = true;
options = "--delete-older-than 10d";
};
settings = {
# Add community Cachix to binary cache
# Don't use at work because blocked by corporate firewall
builders-use-substitutes = true;
substituters = lib.mkIf (!config.nmasur.profiles.work.enable) [
"https://nix-community.cachix.org"
];
trusted-public-keys = lib.mkIf (!config.nmasur.profiles.work.enable) [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# 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;
};
};
};
nix = {
# Set channel to flake packages, used for nix-shell commands
nixPath = [ "nixpkgs=${pkgs.path}" ];
# For security, only allow specific users
settings.allowed-users = [
"@wheel" # Anyone in the wheel group
config.home.username # The current user
];
# Enable features in Nix commands
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
gc = {
automatic = true;
options = "--delete-older-than 10d";
};
settings = {
# Add community Cachix to binary cache
# Don't use at work because blocked by corporate firewall
builders-use-substitutes = true;
substituters = lib.mkIf (!config.nmasur.profiles.work.enable) [
"https://nix-community.cachix.org"
];
trusted-public-keys = lib.mkIf (!config.nmasur.profiles.work.enable) [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# 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;
};
};
}

View File

@ -13,43 +13,48 @@ in
# Adapted from:
# A rofi powered menu to execute brightness choices.
config.brightnessCommand = lib.mkIf config.nmasur.presets.programs.rofi.enable builtins.toString (
pkgs.writeShellScript "brightness" ''
config.nmasur.presets.services.i3.commands.brightness =
lib.mkIf config.nmasur.presets.programs.rofi.enable
(
builtins.toString (
pkgs.writeShellScript "brightness" # bash
''
dimmer="󰃝"
medium="󰃟"
brighter="󰃠"
dimmer="󰃝"
medium="󰃟"
brighter="󰃠"
chosen=$(printf '%s;%s;%s\n' \
"$dimmer" \
"$medium" \
"$brighter" \
| ${lib.getExe rofi} \
-theme-str '@import "brightness.rasi"' \
-hover-select \
-me-select-entry ''' \
-me-accept-entry MousePrimary \
-dmenu \
-sep ';' \
-selected-row 1)
chosen=$(printf '%s;%s;%s\n' \
"$dimmer" \
"$medium" \
"$brighter" \
| ${lib.getExe rofi} \
-theme-str '@import "brightness.rasi"' \
-hover-select \
-me-select-entry ''' \
-me-accept-entry MousePrimary \
-dmenu \
-sep ';' \
-selected-row 1)
case "$chosen" in
"$dimmer")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 25; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 25
;;
case "$chosen" in
"$dimmer")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 25; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 25
;;
"$medium")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 75; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 75
;;
"$medium")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 75; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 75
;;
"$brighter")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 100; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 100
;;
"$brighter")
${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 100; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 100
;;
*) exit 1 ;;
esac
*) exit 1 ;;
esac
''
);
''
)
);
}

View File

@ -38,7 +38,7 @@ 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";
applicationSwitch = "${lib.getExe rofi} -show window -modi window";
calculator = "${lib.getExe rofi} -modes calc -show calc";
audioSwitch = lib.getExe (
pkgs.writeShellApplication {

View File

@ -13,23 +13,25 @@ in
options.nmasur.presets.services.dunst.enable = lib.mkEnableOption "Dunst notification system";
config = lib.mkIf cfg.enable {
enable = false;
settings = {
global = {
width = 300;
height = 200;
offset = "30x50";
origin = "top-right";
transparency = 0;
padding = 20;
horizontal_padding = 20;
frame_color = config.theme.colors.base03;
};
services.dunst = {
enable = false;
settings = {
global = {
width = 300;
height = 200;
offset = "30x50";
origin = "top-right";
transparency = 0;
padding = 20;
horizontal_padding = 20;
frame_color = config.theme.colors.base03;
};
urgency_normal = {
background = config.theme.colors.base00;
foreground = config.theme.colors.base05;
timeout = 10;
urgency_normal = {
background = config.theme.colors.base00;
foreground = config.theme.colors.base05;
timeout = 10;
};
};
};

View File

@ -190,7 +190,9 @@ in
lib.mkIf cfg.commands.systemdSearch != null "exec --no-startup-id ${cfg.commands.systemdSearch}";
"${modifier}+Shift+a" =
lib.mkIf cfg.commands.audioSwitch != null "exec --no-startup-id ${cfg.commands.audioSwitch}";
"Mod1+Tab" = lib.mkIf cfg.commands.altTab != null "exec --no-startup-id ${cfg.commands.altTab}";
"Mod1+Tab" =
lib.mkIf cfg.commands.applicationSwitch
!= null "exec --no-startup-id ${cfg.commands.applicationSwitch}";
"${modifier}+Shift+period" =
lib.mkIf cfg.commands.power != null "exec --no-startup-id ${cfg.commands.power}";
"${modifier}+Shift+m" =

View File

@ -12,7 +12,7 @@ in
{
options.nmasur.preset.services.mbsync = {
options.nmasur.presets.services.mbsync = {
enable = lib.mkEnableOption "Mail service.";
user = lib.mkOption {
type = lib.types.str;