add user conf and split some configs

This commit is contained in:
Satria 2026-02-01 18:01:09 +07:00
commit 6d4453b618
6 changed files with 52 additions and 16 deletions

View file

@ -3,7 +3,8 @@ rewrite of my nixos flake with hopefully better structuring and modularity
# todo # todo
- (progress) migrate files to this repository in the modules folder - (progress) migrate files to this repository in the modules folder
- split the files into little chunks for 1 specific purposes per file - (half-progress) split the files into little chunks for 1 specific purposes per file
- (quater-progress) reintegrate file paths and arguments to work together
# todo: migrate files below # todo: migrate files below
[X] flake stuff (flake.nix & flake.lock) [X] flake stuff (flake.nix & flake.lock)
@ -12,7 +13,7 @@ rewrite of my nixos flake with hopefully better structuring and modularity
[X] nixos system [X] nixos system
[X] base nix configs [X] base nix configs
[X] apps list [X] apps list
[ ] user config (not hm) [X] user config (not hm)
[ ] home manager config [ ] home manager config
[ ] rice config (everything in /rice) [ ] rice config (everything in /rice)

View file

@ -0,0 +1,3 @@
{ ... }: {
}

View file

@ -0,0 +1,10 @@
{ resume-dev, ... }: {
security.protectKernelImage = false; # https://discourse.nixos.org/t/hibernate-doesnt-work-anymore/24673/7
boot = {
kernelParams = if resume-dev == "" then [] else ["resume=${resume-dev}"];
resumeDevice = "${resume-dev}";
};
powerManagement = {
enable = true;
};
}

View file

@ -1,11 +1,10 @@
{ pkgs, lib, resume-dev, ... }: { { pkgs, ... }: {
time.timeZone = lib.mkForce null; import = [
powerManagement = { ./tzupdate.nix
enable = true; ./hibernation.nix
powertop.enable = true; ];
}; powerManagement.powertop.enable = true;
security = { security = {
protectKernelImage = false; # https://discourse.nixos.org/t/hibernate-doesnt-work-anymore/24673/7
tpm2 = { tpm2 = {
enable = true; enable = true;
pkcs11.enable = true; pkcs11.enable = true;
@ -30,9 +29,6 @@
}; };
}; };
boot = { boot = {
kernelParams = if resume-dev == "" then [] else ["resume=${resume-dev}"];
resumeDevice = "${resume-dev}";
kernelPackages = pkgs.linuxPackages; kernelPackages = pkgs.linuxPackages;
kernel.sysctl."vm.laptop_mode" = 5; kernel.sysctl."vm.laptop_mode" = 5;
initrd.availableKernelModules = [ "thinkpad_acpi" ]; initrd.availableKernelModules = [ "thinkpad_acpi" ];
@ -54,10 +50,6 @@
echo 85 > /sys/class/power_supply/BAT1/charge_control_end_threshold || true echo 85 > /sys/class/power_supply/BAT1/charge_control_end_threshold || true
''}" ''}"
''; '';
tzupdate = {
enable = true;
timer.enable = true;
};
upower = { upower = {
enable = true; enable = true;
percentageCritical = 15; percentageCritical = 15;

View file

@ -0,0 +1,7 @@
{ lib, ... }: {
time.timeZone = lib.mkForce null;
services.tzupdate = {
enable = true;
timer.enable = true;
};
}

23
modules/system/user.nix Normal file
View file

@ -0,0 +1,23 @@
{ pkgs, username, ... }: {
users = {
users."${username}" = {
linger = true;
isNormalUser = true;
description = "${username}";
initialPassword = "${username}";
shell = pkgs.zsh;
extraGroups = [
"networkmanager"
"wheel"
"dialout"
"libvirtd"
"docker"
"input"
"uinput"
"ydotool"
"adbusers"
"kvm"
];
};
};
}