mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +01:00
feat: Make username customizable
Now it's possible to use whatever username you want for your system. The default value of "user" is good if you're concerned about information disclosure attacks through things like the username being visible in logs or other output.
This commit is contained in:
parent
558e0b1623
commit
7f05a66fa5
@ -1,5 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (config.modules.system) username;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../modules/fish.nix
|
||||
@ -52,13 +55,11 @@
|
||||
users = {
|
||||
allowNoPasswordLogin = true;
|
||||
|
||||
users = {
|
||||
user = {
|
||||
users.${username} = {
|
||||
password = lib.mkForce null;
|
||||
extraGroups = lib.mkForce [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.enable = true;
|
||||
hardware.opengl.enable = true;
|
||||
|
@ -4,6 +4,7 @@ let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (pkgs.xfce) thunar-volman exo;
|
||||
inherit (pkgs) glib;
|
||||
inherit (config.modules.system) username;
|
||||
|
||||
theme = "monokai";
|
||||
opacity = 0.95;
|
||||
@ -100,7 +101,7 @@ in
|
||||
|
||||
initial_session = {
|
||||
command = "${pkgs.hyprland}/bin/Hyprland";
|
||||
user = "user";
|
||||
user = username;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -4,11 +4,17 @@ let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib.types) str listOf;
|
||||
inherit (pkgs.nixVersions) nix_2_19;
|
||||
inherit (cfg) username;
|
||||
|
||||
cfg = config.modules.system;
|
||||
in
|
||||
{
|
||||
options.modules.system = {
|
||||
username = mkOption {
|
||||
type = str;
|
||||
default = "user";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = str;
|
||||
default = "America/New_York";
|
||||
@ -81,15 +87,13 @@ in
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
|
||||
users = {
|
||||
user = {
|
||||
users.${username} = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
password = "user";
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
@ -100,11 +104,10 @@ in
|
||||
programs.man.generateCaches = true;
|
||||
}];
|
||||
|
||||
users = {
|
||||
user = {
|
||||
home.username = "user";
|
||||
home.homeDirectory = "/home/user";
|
||||
};
|
||||
users.${username}.home = {
|
||||
inherit username;
|
||||
|
||||
homeDirectory = "/home/${username}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,8 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (config.modules.system) username;
|
||||
in
|
||||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
@ -13,7 +16,7 @@
|
||||
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "user";
|
||||
user = username;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (config.modules.system) username;
|
||||
in
|
||||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
@ -9,7 +12,7 @@
|
||||
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "user";
|
||||
user = username;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user