fixed an edge case in viconf.nix, added a missing logic check to home-manager.nix, tuned up the installer config to better fit the current configuration

This commit is contained in:
pagedmov
2024-11-01 03:06:31 -04:00
parent 23cfe1068b
commit c426e1b77a
3 changed files with 75 additions and 51 deletions

View File

@@ -10,6 +10,7 @@
...
}: let
nur = config.nur;
desktop = (host == "oganesson");
in {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
@@ -18,12 +19,12 @@ in {
backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host wallpaper scheme username nur;};
users.${username} = {
dconf.settings = {
dconf.settings = if desktop then {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
} else {};
programs.home-manager.enable = true;
imports = [
./programs

View File

@@ -3,11 +3,19 @@ pkgs.writeShellScriptBin "viconf" ''
#!/usr/bin/env bash
[ ! $# -eq 1 ] && echo "Usage: viconf <*.nix>" && exit 1
results=$(find "$FLAKEPATH" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$')
numresults=$(echo "$results" | wc -l)
[ "$numresults" -eq 0 ] && echo "$1 not found in \$FLAKEPATH" && exit 1
if [ "$numresults" -gt 1 ]; then
echo "$results" | tr ' ' '\n' | fzf | xargs -I {} nvim {}
# cut up the paths to give shorter path names to fuzzy finder
results_prefix=$(echo "$results" | tail -n 1 | cut -d'/' -f-3)
results=$(echo "$results" | cut -d'/' -f4-)
results=$(echo "$results" | grep "$1")
echo "$results" | tr ' ' '\n' | fzf | xargs -I {} nvim "$results_prefix"/{}
else
nvim "$results"
fi