Merge branch 'main' of vm-gitlab.shire-zebra.ts.net:greg/nixos-config

This commit is contained in:
Greg Hellings
2025-10-15 00:01:35 -05:00
48 changed files with 782 additions and 13225 deletions
+1 -33
View File
@@ -38,11 +38,7 @@ in
path add /run/current-system/sw/bin
path add ${config.home.homeDirectory}/.nix-profile/bin
def --env unlock [] {
if "BW_SESSION" not-in $env {
$env.BW_SESSION = ^bw unlock --raw
}
}
source ${./nushell/functions.nu}
def --env vpn [] {
unlock
@@ -51,34 +47,6 @@ in
let otp = ^bw get totp 10371487-7f40-4b08-9a45-b33e00de318b
osascript ${vpn} $username $"($password)($otp)"
}
def rebuild [] {
if (uname | get operating-system) == "Darwin" {
sudo darwin-rebuild switch
} else {
let hostname = uname | get nodename
let build = ^nom build $"/etc/nixos#nixosConfigurations.($hostname).config.system.build.toplevel" | complete
if build.exit_code == 0 {
nvd diff /run/current-system result
sudo nixos-rebuild switch
}
}
}
def deploy [ $host: string, $build: string = "" ] {
mut buildhost = $build
if $build == "" {
$buildhost = $host
}
if $buildhost == "linode" {
$buildhost = "isaiah"
}
nixos-rebuild switch --use-remote-sudo --use-substitutes --target-host $host --build-host $buildhost
}
def ff [ $file: string ] {
ls **/* | where name =~ $file
}
'';
settings = {
buffer_editor = lib.getExe config.programs.nixvim.package;
+57
View File
@@ -0,0 +1,57 @@
# vim: set filetype=nushell :
let servers = [isaiah jeremiah zeke genesis vm-gitlab vm-jellyfin]
def par-map [ items: list, c: closure ] {
let results = $items | par-each -k $c
$items | enumerate | reduce -f {} {|e, a| $a | upsert $e.item { $results | get $e.index }}
}
def --env unlock [] {
if "BW_SESSION" not-in $env {
$env.BW_SESSION = ^bw unlock --raw
}
}
def rebuild [] {
if (uname | get operating-system) == "Darwin" {
sudo darwin-rebuild switch
} else {
let hostname = uname | get nodename
let build = ^nom build --keep-going $"/etc/nixos#nixosConfigurations.($hostname).config.system.build.toplevel"
if $env.LAST_EXIT_CODE == 0 {
nvd diff /run/current-system result
run0 nixos-rebuild switch
} else {
print "Error during build"
}
}
}
def deploy [ $host: string, $build: string = "" ] {
mut buildhost = $build
if $build == "" {
$buildhost = $host
}
if $buildhost == "linode" or $buildhost == "genesis" {
$buildhost = "isaiah"
}
nixos-rebuild switch --sudo --use-substitutes --target-host $host --build-host $buildhost
}
def ff [ $file: string ] {
ls **/* | where name =~ $file
}
def update_all [] {
par-map $servers {|e| deploy $e | complete} | explore
}
def bake [template: string] {
let copier = "~/.copier-templates" | path expand
if not ($copier | path exists) {
git clone srcpub:greg/copier-templates.git $copier
}
let srcdir = [$copier $template] | path join
print $srcdir
copier copy $srcdir .
}
+1 -1
View File
@@ -25,13 +25,13 @@
nixup = "nix flake lock update";
nixcopy = "nix copy --to \"s3://binary-cache/?profile=default&endpoint=nas.home%3A9000&scheme=http\"";
r = "run0";
s = "nix run \".#runserver\"";
updateScript = "nix-shell maintainers/scripts/update.nix --argstr package";
# General
k = "kubectl";
kn = "kubectl get nodes -o wide";
kp = "kubectl get pods -o wide";
s = "lazyssh";
win = "sudo virsh start win10";
yaml2js = "python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'";
z = "zeditor .";
+6 -1
View File
@@ -9,9 +9,9 @@
};
programs.ssh = {
enable = true;
serverAliveInterval = 60;
includes = [ "config.local" ];
enableDefaultConfig = false;
matchBlocks =
let
@@ -27,6 +27,11 @@
"*" = {
dynamicForwards = [ { port = 10240; } ];
serverAliveInterval = 60;
extraOptions = {
LogLevel = "error";
SetEnv = "TERM=xterm-256color";
};
};
"10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas;
+3 -1
View File
@@ -4,11 +4,13 @@
with pkgs;
[
dig
dnsutils
jqp
kubernetes-helm
iamb
lazyssh
rainfrog
tenere
uv
wiki-tui
]
++ (lib.optionals pkgs.stdenv.hostPlatform.isLinux [
+1 -2
View File
@@ -115,11 +115,11 @@
lsp = {
enable = true;
servers = {
ansiblels.enable = true;
cmake.enable = true;
gopls.enable = true;
html.enable = true;
nixd.enable = true;
nushell.enable = true;
pylsp.enable = true;
pyright.enable = true;
rust_analyzer = {
@@ -149,7 +149,6 @@
extraConfigVim = builtins.readFile ./extra.vimrc;
extraPlugins = with pkgs.vimPlugins; [
bufexplorer
context-vim
vim-indent-guides
];
+14 -4
View File
@@ -1,7 +1,8 @@
{
config,
pkgs,
lib,
nixvim,
pkgs,
...
}:
@@ -10,7 +11,16 @@
fonts.fontconfig.enable = true;
home.packages = with pkgs.nerd-fonts; [ hack ];
programs.nixvim = (import ./config.nix { inherit config pkgs lib; }) // {
enable = true;
};
programs.nixvim =
(import ./config.nix {
inherit
config
nixvim
pkgs
lib
;
})
// {
enable = true;
};
}
+1 -1
View File
@@ -59,7 +59,7 @@ local lspconfig = require('lspconfig')
-- capabilities = capabilities
--}
--lspconfig.pyright.setup { capabilities = capabilities }
lspconfig.ansiblels.setup { capabilities = capabilities }
--lspconfig.ansiblels.setup { capabilities = capabilities }
--lspconfig.jedi_language_server.setup { capabilities }
-- ======================================================================
+1 -1
View File
@@ -88,7 +88,7 @@ lua <<EOF
-- capabilities = capabilities
--}
--lspconfig.pyright.setup { capabilities = capabilities }
lspconfig.ansiblels.setup { capabilities = capabilities }
--lspconfig.ansiblels.setup { capabilities = capabilities }
lspconfig.jedi_language_server.setup { capabilities = capabilities }
EOF
" Set filetype to the way I want it
+2 -1
View File
@@ -33,7 +33,7 @@ in
{
"MacBook-Pro.local" = user "aarch64-darwin" "ivr" "gregory.hellings";
"MacBook-Prolocal.local" = user "aarch64-darwin" "ivr" "gregory.hellings";
"jude.thehellings.lan" = user "aarch64-darwin" "ivr" "gregory.hellings"; # This is annoying, but DNS is a pain for the shared docking station
genesis = greg "genesis";
exodus = greg "exodus";
zeke = greg "zeke";
isaiah = greg "isaiah";
@@ -41,4 +41,5 @@ in
linode = greg "linode";
hosea = greg "hosea";
vm-gitlab = greg "vm-gitlab";
vm-jellyfin = greg "vm-jellyfin";
}
+2
View File
@@ -13,12 +13,14 @@
cargo
freeciv
gimp
gnucash
k9s
kdePackages.kdenlive
kubernetes-helm
kubectl
kubectl-cnpg
mumble
pre-commit
wineWowPackages.stable
];
}
+13
View File
@@ -36,6 +36,7 @@ in
just
k9s
kubectl
mariadb
minikube
mise
nil
@@ -81,6 +82,18 @@ in
};
};
};
ssh.matchBlocks = lib.listToAttrs (lib.map (key: { name = "${key}.ivrtechnology.com"; value = {}; }) [
"apidev1"
"asdev1"
"agidev1"
"kdev1"
"kdev2"
"kdev3"
"webdev4"
"webdev5"
"web4"
]);
tmux.shell = (lib.getExe x);
};
}