From 1bfb2a25abfb12b1e2dea2a1a7c8fba87dfe3ded Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 19 Jan 2024 11:49:33 +0100 Subject: [PATCH] lib/default: format --- nix/os/lib/default.nix | 63 ++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/nix/os/lib/default.nix b/nix/os/lib/default.nix index 9871d3b..c74ccd0 100644 --- a/nix/os/lib/default.nix +++ b/nix/os/lib/default.nix @@ -1,35 +1,38 @@ -{ - lib, - config, -}: let +{ lib +, config +, +}: +let keys = import ../../variables/keys.nix; -in { +in +{ mkUser = args: ( - lib.attrsets.recursiveUpdate { - isNormalUser = true; - extraGroups = [ - "docker" - "wheel" - "libvirtd" - "networkmanager" - "vboxusers" - "users" - "input" - "audio" - "video" - "cdrom" - "adbusers" - "dialout" - "cdrom" - ]; - openssh.authorizedKeys.keys = keys.users.steveej.openssh; + lib.attrsets.recursiveUpdate + { + isNormalUser = true; + extraGroups = [ + "docker" + "wheel" + "libvirtd" + "networkmanager" + "vboxusers" + "users" + "input" + "audio" + "video" + "cdrom" + "adbusers" + "dialout" + "cdrom" + ]; + openssh.authorizedKeys.keys = keys.users.steveej.openssh; - # TODO: investigate why this secret cannot be found - # openssh.authorizedKeys.keyFiles = [ - # config.sops.secrets.sharedSshKeys-steveej.path - # ]; - } - args + # TODO: investigate why this secret cannot be found + # openssh.authorizedKeys.keyFiles = [ + # config.sops.secrets.sharedSshKeys-steveej.path + # ]; + } + args ); disk = rec { @@ -38,7 +41,7 @@ in { # LVM doesn't allow most characters in VG names # TODO: replace this with a whitelist for: [a-zA-Z0-9.-_+] - volumeGroup = diskId: builtins.replaceStrings [":"] [""] diskId; + volumeGroup = diskId: builtins.replaceStrings [ ":" ] [ "" ] diskId; # This is important at install-time bootGrubDevice = diskId: "/dev/disk/by-id/" + diskId;