fix infinite recursion by namespacing new pkgs

This commit is contained in:
Noah Masur 2025-02-24 21:14:38 -05:00
parent 3206b48f28
commit e7366f9510
No known key found for this signature in database
13 changed files with 31 additions and 19 deletions

View File

@ -5,5 +5,5 @@
type = "app"; type = "app";
program = pkgs.lib.getExe pkgs.format-root; program = pkgs.lib.getExe pkgs.nmasur.format-root;
} }

View File

@ -5,5 +5,5 @@
type = "app"; type = "app";
program = "${pkgs.loadkey}/bin/loadkey"; program = "${pkgs.nmasur.loadkey}/bin/loadkey";
} }

View File

@ -14,20 +14,29 @@ let
list: list:
builtins.listToAttrs ( builtins.listToAttrs (
map (v: { map (v: {
name = v."pname" ? v."name"; name = v."pname" or v."name";
value = v; value = v;
}) list }) list
); );
lib = prev.lib; lib = prev.lib;
# packagesDirectory = lib.filesystem.listFilesRecursive ../pkgs; # packagesDirectory = lib.filesystem.listFilesRecursive ../pkgs;
# [ package1/package.nix package2/package.nix package2/hello.sh ]
packages = lib.pipe (lib.filesystem.listFilesRecursive ../pkgs) [ packages = lib.pipe (lib.filesystem.listFilesRecursive ../pkgs) [
# Get only files called package.nix # Get only files called package.nix
# [ package1/package.nix package2/package.nix ]
(builtins.filter (name: lib.hasSuffix "package.nix" name)) (builtins.filter (name: lib.hasSuffix "package.nix" name))
# Apply callPackage to create a derivation # Apply callPackage to create a derivation
# Must use final.callPackage to avoid infinite recursion
# [ package1.drv package2.drv ]
(builtins.map (name: prev.callPackage name { })) (builtins.map (name: prev.callPackage name { }))
# Convert the list to an attrset # Convert the list to an attrset
# { package1 = package1.drv, package2 = package2.drv }
listToAttrsByPnameOrName listToAttrsByPnameOrName
]; ];
in in
packages {
nmasur = packages;
}

View File

@ -2,7 +2,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
pname = "volnoti-unstable"; pname = "volnoti";
version = "2013-09-23"; version = "2013-09-23";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "davidbrazdil"; owner = "davidbrazdil";

View File

@ -1,5 +1,6 @@
{ {
config, config,
pkgs,
lib, lib,
... ...
}: }:
@ -43,7 +44,7 @@ in
body = builtins.readFile ./functions/fish_user_key_bindings.fish; body = builtins.readFile ./functions/fish_user_key_bindings.fish;
}; };
ip = { ip = {
body = builtins.readFile ./functions/ip.fish; body = lib.getExe pkgs.nmasur.ip-check;
}; };
json = { json = {
description = "Tidy up JSON using jq"; description = "Tidy up JSON using jq";

View File

@ -20,7 +20,7 @@ in
gitCredentialHelper.enable = true; gitCredentialHelper.enable = true;
settings.git_protocol = "https"; settings.git_protocol = "https";
extensions = [ extensions = [
pkgs.gh-collaborators pkgs.nmasur.gh-collaborators
pkgs.gh-dash pkgs.gh-dash
pkgs.gh-copilot pkgs.gh-copilot
]; ];

View File

@ -47,7 +47,7 @@ in
pkgs.ponymix pkgs.ponymix
rofi rofi
]; ];
text = builtins.readFile ./rofi/pulse-sink.sh; text = builtins.readFile ./pulse-sink.sh;
} }
); );
}; };

View File

@ -20,7 +20,7 @@ in
wallpaper = lib.mkOption { wallpaper = lib.mkOption {
type = lib.types.path; type = lib.types.path;
description = "Wallpaper background image file"; description = "Wallpaper background image file";
default = "${pkgs.wallpapers}/gruvbox/road.jpg"; default = "${pkgs.nmasur.wallpapers}/gruvbox/road.jpg";
}; };
commands = { commands = {
launcher = lib.mkOption { launcher = lib.mkOption {

View File

@ -162,7 +162,7 @@ in
ramp-volume-0 = ""; ramp-volume-0 = "";
ramp-volume-1 = "󰕾"; ramp-volume-1 = "󰕾";
ramp-volume-2 = ""; ramp-volume-2 = "";
click-right = config.audioSwitchCommand; click-right = config.nmasur.presets.services.i3.commands.audioSwitch;
}; };
# "module/xkeyboard" = { # "module/xkeyboard" = {
# type = "internal/xkeyboard"; # type = "internal/xkeyboard";
@ -217,7 +217,7 @@ in
"module/power" = { "module/power" = {
type = "custom/text"; type = "custom/text";
content = " "; content = " ";
click-left = config.powerCommand; click-left = config.nmasur.presets.services.i3.commands.toggleBar;
click-right = "polybar-msg cmd restart"; click-right = "polybar-msg cmd restart";
content-foreground = config.theme.colors.base04; content-foreground = config.theme.colors.base04;
}; };

View File

@ -14,23 +14,23 @@ let
increaseVolume = pkgs.writeShellScriptBin "increaseVolume" '' increaseVolume = pkgs.writeShellScriptBin "increaseVolume" ''
${pkgs.pamixer}/bin/pamixer -i 2 ${pkgs.pamixer}/bin/pamixer -i 2
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume) volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
${pkgs.volnoti}/bin/volnoti-show $volume ${pkgs.nmasur.volnoti}/bin/volnoti-show $volume
''; '';
decreaseVolume = pkgs.writeShellScriptBin "decreaseVolume" '' decreaseVolume = pkgs.writeShellScriptBin "decreaseVolume" ''
${pkgs.pamixer}/bin/pamixer -d 2 ${pkgs.pamixer}/bin/pamixer -d 2
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume) volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
${pkgs.volnoti}/bin/volnoti-show $volume ${pkgs.nmasur.volnoti}/bin/volnoti-show $volume
''; '';
toggleMute = pkgs.writeShellScriptBin "toggleMute" '' toggleMute = pkgs.writeShellScriptBin "toggleMute" ''
${pkgs.pamixer}/bin/pamixer --toggle-mute ${pkgs.pamixer}/bin/pamixer --toggle-mute
mute=$(${pkgs.pamixer}/bin/pamixer --get-mute) mute=$(${pkgs.pamixer}/bin/pamixer --get-mute)
if [ "$mute" == "true" ]; then if [ "$mute" == "true" ]; then
${pkgs.volnoti}/bin/volnoti-show --mute ${pkgs.nmasur.volnoti}/bin/volnoti-show --mute
else else
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume) volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
${pkgs.volnoti}/bin/volnoti-show $volume ${pkgs.nmasur.volnoti}/bin/volnoti-show $volume
fi fi
''; '';
in in

View File

@ -26,6 +26,7 @@ in
nautilus.enable = lib.mkDefault true; nautilus.enable = lib.mkDefault true;
nsxiv.enable = lib.mkDefault true; nsxiv.enable = lib.mkDefault true;
obsidian.enable = lib.mkDefault true; obsidian.enable = lib.mkDefault true;
rofi.enable = lib.mkDefault true;
xclip.enable = lib.mkDefault true; xclip.enable = lib.mkDefault true;
wezterm.enable = lib.mkDefault true; wezterm.enable = lib.mkDefault true;
zathura.enable = lib.mkDefault true; zathura.enable = lib.mkDefault true;

View File

@ -19,7 +19,7 @@ in
pkgs.difftastic # Other fancy diffs pkgs.difftastic # Other fancy diffs
pkgs.jless # JSON viewer pkgs.jless # JSON viewer
pkgs.jo # JSON output pkgs.jo # JSON output
pkgs.osc # Clipboard over SSH pkgs.nmasur.osc # Clipboard over SSH
pkgs.qrencode # Generate qr codes pkgs.qrencode # Generate qr codes
pkgs.ren # Rename files pkgs.ren # Rename files
pkgs.rep # Replace text in files pkgs.rep # Replace text in files
@ -33,6 +33,7 @@ in
pkgs.mpd # TUI slideshows pkgs.mpd # TUI slideshows
pkgs.doggo # DNS client (dig) pkgs.doggo # DNS client (dig)
pkgs.bottom # System monitor (top) pkgs.bottom # System monitor (top)
pkgs.nmasur.jqr # FZF fq JSON tool
]; ];
programs.fish.shellAliases = { programs.fish.shellAliases = {

View File

@ -34,9 +34,9 @@ in
pkgs.ipcalc # Make IP network calculations pkgs.ipcalc # Make IP network calculations
pkgs.cloudflared # Allow connecting to Cloudflare tunnels pkgs.cloudflared # Allow connecting to Cloudflare tunnels
pkgs.monitorcontrol # Allows adjusting external displays pkgs.monitorcontrol # Allows adjusting external displays
pkgs.ocr # Converts images to text pkgs.nmasur.ocr # Converts images to text
pkgs.aws-ec2 # Browse EC2 instances pkgs.nmasur.aws-ec2 # Browse EC2 instances
pkgs.terraform-init # Quick shortcut for initializing Terraform backend pkgs.nmasur.terraform-init # Quick shortcut for initializing Terraform backend
]; ];
nmasur.presets = { nmasur.presets = {