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";
program = pkgs.lib.getExe pkgs.format-root;
program = pkgs.lib.getExe pkgs.nmasur.format-root;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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