58 lines
1.2 KiB
Nix
Raw Normal View History

2025-01-20 22:35:40 -05:00
{
config,
2025-02-03 17:30:32 -05:00
pkgs,
2025-01-20 22:35:40 -05:00
lib,
...
}:
let
cfg = config.nmasur.profiles.base;
in
{
options.nmasur.profiles.base.enable = lib.mkEnableOption "base Linux config";
config = lib.mkIf cfg.enable {
# Allows us to declaritively set password
2025-02-01 16:10:16 -05:00
users.mutableUsers = lib.mkDefault false;
2025-01-20 22:35:40 -05:00
# Define a user account. Don't forget to set a password with passwd.
users.users.${config.user} = {
# Create a home directory for human user
2025-02-01 16:10:16 -05:00
isNormalUser = lib.mkDefault true;
2025-01-20 22:35:40 -05:00
# Automatically create a password to start
2025-02-01 16:10:16 -05:00
hashedPassword = lib.mkDefault config.passwordHash;
2025-01-20 22:35:40 -05:00
2025-02-01 16:10:16 -05:00
extraGroups = lib.mkDefault [
2025-01-20 22:35:40 -05:00
"wheel" # Sudo privileges
];
};
2025-02-03 17:30:32 -05:00
# Basic common system packages for all devices
environment.systemPackages = [
pkgs.git
pkgs.vim
pkgs.wget
pkgs.curl
];
2025-02-01 16:10:16 -05:00
# Include home-manager config in NixOS
home-manager = {
sharedModules = [ ../../../../home-manager ];
# Use the system-level nixpkgs instead of Home Manager's
useGlobalPkgs = lib.mkDefault true;
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
# using multiple profiles for one user
useUserPackages = lib.mkDefault true;
};
2025-01-20 22:35:40 -05:00
};
}