bulk of the refactor

This commit is contained in:
2025-08-27 11:31:06 -04:00
parent 6ff4e13b03
commit ddd3fb39e4
2 changed files with 32 additions and 32 deletions

View File

@@ -6,14 +6,19 @@
neovim neovim
usbutils usbutils
coreutils coreutils
lshw
systemd
dmidecode
pciutils pciutils
nix-ld
patchelf patchelf
htop htop
]; ] ++
lib.optionals pkgs.stdenv.isLinux (with pkgs; [
systemd
lshw
dmidecode
nix-ld
]) ++
lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
# nothing here, yet
]);
# Common environment variables that every system will use # Common environment variables that every system will use
environment.variables.EDITOR = "nvim"; environment.variables.EDITOR = "nvim";

View File

@@ -1,30 +1,23 @@
{ lib, pkgs, userName, hostname, ... }:
{ {
lib,
pkgs,
userName,
hostname,
...
} @ args: {
networking.hostName = hostname; networking.hostName = hostname;
users.users."${userName}" = {
home = if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
description = userName;
} // lib.optionalAttrs pkgs.stdenv.isLinux {
group = "${userName}";
isNormalUser = true;
};
users.groups.wyatt = {};
nix.settings.trusted-users = [userName];
# Don't forget to set a password with passwd! security = lib.optionalAttrs pkgs.stdenv.isLinux {
users.users."${userName}" = lib.mkMerge [ sudo.extraRules = [
{
home =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
description = userName;
}
(lib.mkIf (pkgs.stdenv.isLinux) {
group = "${userName}";
isNormalUser = true;
})
];
security.sudo = {
extraRules = [
{ {
groups = [ "wheel" ]; groups = [ "wheel" ];
commands = [ commands = [
@@ -37,7 +30,9 @@
]; ];
}; };
users.groups.wyatt = {}; environment = lib.optionalAttrs pkgs.stdenv.isDarwin {
etc."sudoers.d/wheel-nopasswd".text = ''
nix.settings.trusted-users = [userName]; %wheel ALL=(ALL:ALL) NOPASSWD: SETENV: ALL
'';
};
} }