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

View File

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

View File

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