mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 21:29:12 +02:00
style: fix formatting
This commit is contained in:
parent
b1b2fc68a3
commit
80c08a6d19
4 changed files with 1169 additions and 1177 deletions
|
|
@ -2487,12 +2487,15 @@ The rest of the functions are used to build full NixOS systems as well as halfCo
|
|||
// config.guestConfigurations;
|
||||
|
||||
guestResources = lib.mapAttrs
|
||||
(name: _: let
|
||||
(name: _:
|
||||
let
|
||||
f = arg: lib.foldr (base: acc: base + acc) 0 (map (node: nodes."${name}-${node}".config.microvm.${arg}) (builtins.attrNames nodes.${name}.config.guests));
|
||||
in {
|
||||
in
|
||||
{
|
||||
mem = f "mem";
|
||||
vcpu = f "vcpu";
|
||||
}) nodes;
|
||||
})
|
||||
nodes;
|
||||
|
||||
"@" = lib.mapAttrs (_: v: v.config.system.build.toplevel) config.nodes;
|
||||
};
|
||||
|
|
@ -2854,7 +2857,8 @@ Aside from the =default= devShell which is the one that should usually be called
|
|||
deploy =
|
||||
let
|
||||
nix-version = "2_28";
|
||||
in {
|
||||
in
|
||||
{
|
||||
packages = [
|
||||
(builtins.trace "alarm: pinned nix_${nix-version}" pkgs.stable25_05.nixVersions."nix_${nix-version}")
|
||||
pkgs.git
|
||||
|
|
@ -3199,7 +3203,8 @@ On the structure of overlays: as you notice, all of the attributes within overla
|
|||
{
|
||||
flake = _:
|
||||
{
|
||||
overlays = let
|
||||
overlays =
|
||||
let
|
||||
nixpkgs-stable-versions = final: _:
|
||||
let
|
||||
nixpkgsInputs =
|
||||
|
|
@ -3222,7 +3227,8 @@ On the structure of overlays: as you notice, all of the attributes within overla
|
|||
})
|
||||
(builtins.attrNames nixpkgsInputs));
|
||||
|
||||
in rec {
|
||||
in
|
||||
rec {
|
||||
default = additions;
|
||||
additions = final: prev:
|
||||
let
|
||||
|
|
@ -3259,9 +3265,11 @@ On the structure of overlays: as you notice, all of the attributes within overla
|
|||
})
|
||||
names);
|
||||
|
||||
from = let
|
||||
from =
|
||||
let
|
||||
stablePackages = nixpkgs-stable-versions final prev;
|
||||
in key:
|
||||
in
|
||||
key:
|
||||
stablePackages.${key} or (throw "Missing nixpkgs input nixpkgs-${key}");
|
||||
|
||||
in
|
||||
|
|
@ -6143,7 +6151,6 @@ A Mac notebook that I have received from work. I use this machine for getting ac
|
|||
My phone. I use only a minimal config for remote debugging here.
|
||||
|
||||
#+begin_src nix-ts :tangle hosts/android/aarch64-linux/magicant/default.nix
|
||||
|
||||
{ pkgs, ... }: {
|
||||
environment = {
|
||||
packages = with pkgs; [
|
||||
|
|
@ -6188,8 +6195,6 @@ My phone. I use only a minimal config for remote debugging here.
|
|||
experimental-features = nix-command flakes
|
||||
'';
|
||||
}
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
**** Treehouse (DGX Spark)
|
||||
|
|
@ -12012,7 +12017,7 @@ Restricts access to the system by the nix build user as per https://discourse.ni
|
|||
"nix-store --serve --write")
|
||||
exec env NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt ${config.nix.package}/bin/nix-store --serve --write
|
||||
;;
|
||||
,*)
|
||||
*)
|
||||
echo "Access only allowed for using the nix remote builder" 1>&2
|
||||
exit
|
||||
esac
|
||||
|
|
@ -12154,14 +12159,8 @@ systemd-initrd provides a lightweight SSH server in form of dropbear - in order
|
|||
I also take some precautions in how I get networking information during stage 1. For the most part, I just use [[#h:12370671-7892-4a74-a804-84f871acde06][systemd-networkd (server)]], however, for hosts in my local network, I take another step to define the network in the =kernelParams=, to make extra sure I can reach it.
|
||||
|
||||
#+begin_src nix-ts :tangle modules/nixos/server/disk-encrypt.nix
|
||||
{ self, pkgs, lib, config, globals, minimal, ... }:
|
||||
{ self, pkgs, lib, config, minimal, ... }:
|
||||
let
|
||||
localIp = globals.networks.${config.swarselsystems.server.netConfigName}.hosts.${config.node.name}.ipv4;
|
||||
subnetMask = globals.networks.${config.swarselsystems.server.netConfigName}.subnetMask4;
|
||||
gatewayIp = globals.hosts.${config.node.name}.defaultGateway4;
|
||||
|
||||
inherit (globals.general) routerServer;
|
||||
isRouter = config.node.name == routerServer;
|
||||
|
||||
hostKeyPathBase = "/etc/secrets/initrd/ssh_host_ed25519_key";
|
||||
hostKeyPath =
|
||||
|
|
@ -12275,9 +12274,11 @@ By default, attic only provides a cli client to authenticate to caches. I want a
|
|||
config.sops.templates.attic-env.path
|
||||
];
|
||||
};
|
||||
script = let
|
||||
script =
|
||||
let
|
||||
attic = lib.getExe pkgs.attic-client;
|
||||
in ''
|
||||
in
|
||||
''
|
||||
set -eu
|
||||
if ${attic} cache info ${config.swarselsystems.mainUser} >/dev/null 2>&1; then
|
||||
echo "cache already authenticated"
|
||||
|
|
@ -12337,9 +12338,11 @@ In order to define a new wireguard interface, I have to:
|
|||
lib.mkEnableOption "enable ${serviceName} settings";
|
||||
|
||||
swarselsystems.server.wireguard = {
|
||||
interfaces = let
|
||||
interfaces =
|
||||
let
|
||||
topConfig = config;
|
||||
in lib.mkOption {
|
||||
in
|
||||
lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
|
||||
options = {
|
||||
isServer = lib.mkEnableOption "set this interface as a wireguard server";
|
||||
|
|
@ -13470,7 +13473,7 @@ Needed for audio and stuff.
|
|||
Many services require a databasee, and I like to go with full postgres when giving the chance. Each host will usually run its own instance instead of maintaining a centralised one.
|
||||
|
||||
#+begin_src nix-ts :tangle modules/nixos/server/postgresql.nix
|
||||
{ self, config, lib, pkgs, confLib, ... }:
|
||||
{ config, lib, pkgs, confLib, ... }:
|
||||
let
|
||||
inherit (confLib.gen { name = "postgresql"; port = 3254; }) serviceName;
|
||||
postgresVersion = 14;
|
||||
|
|
@ -14547,7 +14550,6 @@ I use this configuration for sailing.
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
**** syncthing
|
||||
|
|
@ -16021,12 +16023,14 @@ kanidm person credential create-reset-token <user>
|
|||
};
|
||||
|
||||
|
||||
nodes = let
|
||||
nodes =
|
||||
let
|
||||
extraConfig = ''
|
||||
allow ${globals.networks.home-lan.vlans.services.cidrv4};
|
||||
allow ${globals.networks.home-lan.vlans.services.cidrv6};
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
${dnsServer}.swarselsystems.server.dns.${globals.services.${serviceName}.baseDomain}.subdomainRecords = {
|
||||
"${globals.services.${serviceName}.subDomain}" = dns.lib.combinators.host proxyAddress4 proxyAddress6;
|
||||
};
|
||||
|
|
@ -20268,7 +20272,7 @@ Some standard options that should be set for every microvm guest. We set the def
|
|||
Some standard options that should be set for every microvm guest. We set the default
|
||||
|
||||
#+begin_src nix-ts :tangle modules/nixos/optional/microvm-guest-shares.nix
|
||||
{ self, lib, config, inputs, microVMParent, nodes, ... }:
|
||||
{ lib, config, microVMParent, nodes, ... }:
|
||||
{
|
||||
config = {
|
||||
microvm = {
|
||||
|
|
@ -20283,7 +20287,6 @@ Some standard options that should be set for every microvm guest. We set the def
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
**** systemd-networkd (base)
|
||||
|
|
@ -20598,7 +20601,6 @@ The general structure here is the same as in the [[#h:6da812f5-358c-49cb-aff2-0a
|
|||
{
|
||||
imports = lib.swarselsystems.mkImports importNames "modules/home";
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
*** Steps to setup/upgrade home-manager only
|
||||
|
|
@ -28824,7 +28826,8 @@ In short, the options defined here are passed to the modules systems using =_mod
|
|||
lib.nameValuePair "/storage/${eternorPath}" {
|
||||
pool = "Vault";
|
||||
dataset = "Eternor/${eternorPath}";
|
||||
}) eternorPaths)));
|
||||
})
|
||||
eternorPaths)));
|
||||
modules = [
|
||||
(config.node.configDir + /guests/${guestName}/default.nix)
|
||||
{
|
||||
|
|
@ -29459,7 +29462,7 @@ This app checks for different apps that I keep around in the scratchpad for quic
|
|||
cmd=(sh -c 'kitty --add-id spotifytui -T spotifytui -o confirm_os_window_close=0 spotify_player' '&')
|
||||
searchapp="spotifytui"
|
||||
;;
|
||||
,*) break ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
|
@ -29475,7 +29478,6 @@ This app checks for different apps that I keep around in the scratchpad for quic
|
|||
|
||||
'';
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
***** swarselzellij
|
||||
|
|
@ -30826,7 +30828,7 @@ AppImage version of mgba in which the lua scripting works.
|
|||
;;
|
||||
|
||||
-*) OPTIONS+=("$1") ;;
|
||||
,*) POSITIONAL_ARGS+=("$1") ;;
|
||||
*) POSITIONAL_ARGS+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
|
@ -30892,7 +30894,6 @@ AppImage version of mgba in which the lua scripting works.
|
|||
done
|
||||
'';
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
***** swarsel-build
|
||||
|
|
@ -31035,7 +31036,7 @@ This script allows for quick git replace of a string.
|
|||
target_dirs=rue
|
||||
;;
|
||||
-h | --help) help_and_exit ;;
|
||||
,*)
|
||||
*)
|
||||
echo "Invalid option detected."
|
||||
help_and_exit
|
||||
;;
|
||||
|
|
@ -31059,8 +31060,6 @@ This script allows for quick git replace of a string.
|
|||
fi
|
||||
'';
|
||||
}
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
***** gen-sops-guest
|
||||
|
|
@ -31435,7 +31434,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
#+end_src
|
||||
**** MicroVM
|
||||
:PROPERTIES:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ self, lib, config, inputs, microVMParent, nodes, ... }:
|
||||
{ lib, config, microVMParent, nodes, ... }:
|
||||
{
|
||||
config = {
|
||||
microvm = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
{ self, pkgs, lib, config, globals, minimal, ... }:
|
||||
{ self, pkgs, lib, config, minimal, ... }:
|
||||
let
|
||||
localIp = globals.networks.${config.swarselsystems.server.netConfigName}.hosts.${config.node.name}.ipv4;
|
||||
subnetMask = globals.networks.${config.swarselsystems.server.netConfigName}.subnetMask4;
|
||||
gatewayIp = globals.hosts.${config.node.name}.defaultGateway4;
|
||||
|
||||
inherit (globals.general) routerServer;
|
||||
isRouter = config.node.name == routerServer;
|
||||
|
||||
hostKeyPathBase = "/etc/secrets/initrd/ssh_host_ed25519_key";
|
||||
hostKeyPath =
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ self, config, lib, pkgs, confLib, ... }:
|
||||
{ config, lib, pkgs, confLib, ... }:
|
||||
let
|
||||
inherit (confLib.gen { name = "postgresql"; port = 3254; }) serviceName;
|
||||
postgresVersion = 14;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue