Update and clean up modules
All checks were successful
CI / build (push) Successful in 2m9s

This commit is contained in:
Fabian Hauser 2025-03-03 23:46:19 +02:00
parent cc3d5090ac
commit e02d86dffd
21 changed files with 270 additions and 241 deletions

View file

@ -4,6 +4,18 @@
}:
{
environment.etc = {
gitconfig.source = ./etc/gitconfig;
vimrc.source = ./etc/vimrc;
};
programs.autojump.enable = true;
programs.vim = {
enable = true;
defaultEditor = true;
};
environment.systemPackages =
with pkgs;
[
@ -33,6 +45,7 @@
nix-diff
nixpkgs-review
nixos-option
comma
]
++ [
autojump
@ -53,20 +66,6 @@
git
git-lfs
]
++ [
# Filesystem & Disk Utilities
exfat
samba
cifs-utils
keyutils # required for cifs kerberos auth
sshfs-fuse
hdparm
mtpfs
ntfs3g
smartmontools
parted
usbutils
]
++ [
# Networking Utilities
nmap

View file

@ -0,0 +1,34 @@
{
inputs,
pkgs,
lib,
...
}:
{
imports = [ inputs.lanzaboote.nixosModules.lanzaboote ];
environment.systemPackages = [
pkgs.sbctl
];
boot = {
loader.timeout = 2;
tmp.useTmpfs = true;
kernelPackages = pkgs.linuxPackages_latest;
bootspec.enable = true;
loader.efi.canTouchEfiVariables = true;
initrd.systemd.enable = true;
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
loader.systemd-boot.enable = lib.mkForce false;
lanzaboote = {
enable = true;
pkiBundle = "/var/lib/sbctl";
};
};
}

View file

@ -1,65 +1,19 @@
{
lib,
pkgs,
inputs,
...
}:
let
users = {
fhauser = {
uid = 1000;
isNormalUser = true;
description = "Fabian Hauser";
group = "fhauser";
extraGroups = [
"wheel"
"video"
"docker"
"networkmanager"
"libvirtd"
"adbusers"
];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108"
];
};
};
in
{
imports = [
inputs.private.nixosModules.users # Contains hashedPasswords for users.
./unfree.nix
./applications.nix
./boot.nix
./unfree.nix
./users.nix
];
boot.loader.timeout = 2;
boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.bootspec.enable = true;
catppuccin = {
flavor = "mocha";
tty.enable = true;
};
console.keyMap = "de_CH-latin1";
i18n.defaultLocale = "en_US.UTF-8";
users.mutableUsers = false;
users.groups = {
fhauser.gid = 1000;
};
users.users = users // {
root.openssh.authorizedKeys.keys =
with lib;
concatLists (
mapAttrsToList (
_name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else [ ]
) users
);
};
# Package management
nix = {
settings.trusted-users = [
@ -69,7 +23,7 @@ in
optimise.automatic = true;
gc = {
automatic = true;
dates = "weekly";
dates = "monthly";
options = "--delete-older-than 60d";
};
package = pkgs.nixVersions.stable;
@ -78,10 +32,6 @@ in
'';
};
# System Services
services.btrfs.autoScrub.enable = true;
services.fwupd.enable = true;
# Network services
networking.networkmanager.enable = true;
networking.firewall = {
@ -95,18 +45,5 @@ in
settings.PasswordAuthentication = false;
};
# Default Settings
environment.etc = {
gitconfig.source = ./etc/gitconfig;
vimrc.source = ./etc/vimrc;
};
programs.autojump.enable = true;
programs.vim = {
enable = true;
defaultEditor = true;
};
environment.systemPackages = [ pkgs.comma ];
services.dbus.implementation = "broker";
}

View file

@ -0,0 +1,48 @@
{
lib,
inputs,
...
}:
let
users = {
fhauser = {
uid = 1000;
isNormalUser = true;
description = "Fabian Hauser";
group = "fhauser";
extraGroups = [
"wheel"
"video"
"docker"
"networkmanager"
"libvirtd"
"adbusers"
];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108"
];
};
};
in
{
imports = [
inputs.private.nixosModules.users # Contains hashedPasswords for users.
];
users = {
mutableUsers = false;
groups = {
fhauser.gid = 1000;
};
users = users // {
root.openssh.authorizedKeys.keys =
with lib;
concatLists (
mapAttrsToList (
_name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else [ ]
) users
);
};
};
}