vm updates

This commit is contained in:
Motiejus Jakštys 2024-03-04 14:53:50 +02:00
parent c697fca9df
commit 3d8f1d3912
3 changed files with 19 additions and 32 deletions

View File

@ -28,7 +28,7 @@
mj = {
stateVersion = "23.11";
timeZone = "UTC";
desktop.username = "nixos";
username = "nixos";
};
isoImage = {
@ -49,14 +49,6 @@
xserver.enable = true;
};
programs = {
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
users.users = {
nixos = {
isNormalUser = true;
@ -66,6 +58,9 @@
root.initialHashedPassword = "";
};
# do not autostart lightdm, leave at tty
systemd.services.display-manager.wantedBy = lib.mkForce [];
security = {
pam.services.lightdm.text = ''
auth sufficient pam_succeed_if.so user ingroup wheel
@ -81,11 +76,4 @@
domain = "jakstys.lt";
firewall.allowedTCPPorts = [22];
};
nix = {
extraOptions = ''
experimental-features = nix-command flakes
trusted-users = nixos
'';
};
}

View File

@ -4,7 +4,9 @@
pkgs,
myData,
...
}: {
}: let
cfg = config.mj;
in {
imports = [
./boot
./fileSystems
@ -28,6 +30,11 @@
example = "Europe/Vilnius";
description = "Time zone for this system";
};
username = lib.mkOption {
type = str;
default = "motiejus";
};
};
config = {
@ -37,7 +44,7 @@
hardware.enableRedistributableFirmware = true;
time.timeZone = config.mj.timeZone;
time.timeZone = cfg.timeZone;
mj.services.friendlyport.ports = [
{
@ -60,11 +67,11 @@
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = ["motiejus"];
trusted-users = [cfg.username];
};
};
system.stateVersion = config.mj.stateVersion;
system.stateVersion = cfg.stateVersion;
security = {
sudo = {

View File

@ -1,18 +1,10 @@
{
lib,
pkgs,
config,
...
}: let
cfg = config.mj.desktop;
username = config.mj.username;
in {
options.mj.desktop = with lib.types; {
username = lib.mkOption {
type = str;
default = "motiejus";
};
};
config = {
hardware.bluetooth = {
enable = true;
@ -27,7 +19,7 @@ in {
wireshark.enable = true;
};
mj.base.users.passwd.${cfg.username}.extraGroups = ["adbusers" "networkmanager" "wireshark"];
mj.base.users.passwd.${username}.extraGroups = ["adbusers" "networkmanager" "wireshark"];
services = {
fwupd.enable = true;
@ -68,7 +60,7 @@ in {
defaultSession = "none+awesome";
autoLogin = {
enable = true;
user = cfg.username;
user = username;
};
};
};
@ -239,7 +231,7 @@ in {
# https://discourse.nixos.org/t/nixos-rebuild-switch-upgrade-networkmanager-wait-online-service-failure/30746
systemd.services.NetworkManager-wait-online.enable = false;
home-manager.users.${cfg.username} = {
home-manager.users.${username} = {
pkgs,
config,
...