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

@@ -2,9 +2,9 @@
lib, lib,
pkgs, pkgs,
modulesPath, modulesPath,
inputs,
... ...
}: let }: let
install-script = pkgs.writeShellScriptBin "movcfg-install" (builtins.readFile ./movcfg-install.sh);
extraFigletFonts = pkgs.fetchFromGitHub { extraFigletFonts = pkgs.fetchFromGitHub {
owner = "xero"; owner = "xero";
repo = "figlet-fonts"; repo = "figlet-fonts";
@@ -23,6 +23,8 @@
in { in {
imports = [ imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
inputs.home-manager.nixosModules.home-manager
../../modules/sys/software/nixvim
]; ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
@@ -35,6 +37,7 @@ in {
networking = { networking = {
wireless.enable = false; wireless.enable = false;
networkmanager.enable = true; networkmanager.enable = true;
hostName = "mov-nixos-installer";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@@ -57,16 +60,27 @@ in {
pciutils pciutils
usbutils usbutils
toilet-extrafonts toilet-extrafonts
install-script
nvim
]; ];
home-manager = {
users.root = {
programs.home-manager.enable = true;
home= {
stateVersion = "24.05";
file = {
"disko.nix".source = ./disko-ext4-singledisk.nix;
};
};
};
};
services = { services = {
openssh.enable = true; openssh.enable = true;
dbus.enable = true; dbus.enable = true;
}; };
programs.zsh = { programs = {
zsh = {
enable = true; enable = true;
ohMyZsh = { ohMyZsh = {
@@ -167,56 +181,57 @@ in {
unalias ls unalias ls
clear clear
''; '';
}; };
programs.starship = { starship = {
enable = true; enable = true;
settings = { settings = {
add_newline = true; add_newline = true;
right_format = "($custom)"; right_format = "($custom)";
format = lib.concatStrings [ format = lib.concatStrings [
"($username)(bold white)($cmd_duration)($character)" "($username)(bold white)($cmd_duration)($character)"
"($git_branch)($git_status)($rust)($nix-shell)" "($git_branch)($git_status)($rust)($nix-shell)"
"($directory)" "($directory)"
"$line_break[ > ](bold #89b4fa)" "$line_break[ > ](bold #89b4fa)"
]; ];
username = { username = {
show_always = true; show_always = true;
style_user = "bold white"; style_user = "bold white";
format = "[$user]($style)"; format = "[$user]($style)";
}; };
directory = { directory = {
format = "\n[$path](bold cyan)[/](bold green) "; format = "\n[$path](bold cyan)[/](bold green) ";
style = "bold #b4befe"; style = "bold #b4befe";
}; };
character = { character = {
success_symbol = "[ -> ](bold green)"; success_symbol = "[ -> ](bold green)";
error_symbol = "[ -> ](bold red)"; error_symbol = "[ -> ](bold red)";
# error_symbol = "[ ](bold #89dceb)[ ✗](bold red)"; # error_symbol = "[ ](bold #89dceb)[ ✗](bold red)";
}; };
cmd_duration = { cmd_duration = {
format = "[ 󰔛 $duration]($style)"; format = "[ 󰔛 $duration]($style)";
disabled = false; disabled = false;
style = "bg:none fg:#f9e2af"; style = "bg:none fg:#f9e2af";
show_notifications = false; show_notifications = false;
min_time_to_notify = 60000; min_time_to_notify = 60000;
}; };
git_branch = { git_branch = {
format = "\non [$symbol$branch](bold purple)"; format = "\non [$symbol$branch](bold purple)";
symbol = " "; symbol = " ";
truncation_length = 15; truncation_length = 15;
style = "bold purple"; style = "bold purple";
}; };
custom.shellver = { custom.shellver = {
command = "zsh --version"; command = "zsh --version";
when = ''test $SHELL = "/run/current-system/sw/bin/zsh"''; when = ''test $SHELL = "/run/current-system/sw/bin/zsh"'';
symbol = ""; symbol = "";
style = "bold magenta"; style = "bold magenta";
};
}; };
}; };
}; };

View File

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

View File

@@ -3,11 +3,19 @@ pkgs.writeShellScriptBin "viconf" ''
#!/usr/bin/env bash #!/usr/bin/env bash
[ ! $# -eq 1 ] && echo "Usage: viconf <*.nix>" && exit 1 [ ! $# -eq 1 ] && echo "Usage: viconf <*.nix>" && exit 1
results=$(find "$FLAKEPATH" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$') results=$(find "$FLAKEPATH" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$')
numresults=$(echo "$results" | wc -l) numresults=$(echo "$results" | wc -l)
[ "$numresults" -eq 0 ] && echo "$1 not found in \$FLAKEPATH" && exit 1 [ "$numresults" -eq 0 ] && echo "$1 not found in \$FLAKEPATH" && exit 1
if [ "$numresults" -gt 1 ]; then 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 else
nvim "$results" nvim "$results"
fi fi