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
usbutils
coreutils
lshw
systemd
dmidecode
pciutils
nix-ld
patchelf
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
environment.variables.EDITOR = "nvim";

View File

@@ -1,30 +1,23 @@
{ lib, pkgs, userName, hostname, ... }:
{
lib,
pkgs,
userName,
hostname,
...
} @ args: {
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!
users.users."${userName}" = lib.mkMerge [
{
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 = [
security = lib.optionalAttrs pkgs.stdenv.isLinux {
sudo.extraRules = [
{
groups = [ "wheel" ];
commands = [
@@ -37,7 +30,9 @@
];
};
users.groups.wyatt = {};
nix.settings.trusted-users = [userName];
environment = lib.optionalAttrs pkgs.stdenv.isDarwin {
etc."sudoers.d/wheel-nopasswd".text = ''
%wheel ALL=(ALL:ALL) NOPASSWD: SETENV: ALL
'';
};
}