Update formatter

This commit is contained in:
Fabian Hauser 2024-04-10 10:53:41 +07:00
parent 4eea2232fb
commit d8235cb2a9
55 changed files with 1031 additions and 664 deletions

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
environment.systemPackages = with pkgs;
environment.systemPackages =
with pkgs;
[
vim
tmux
@ -25,8 +31,20 @@
units
powertop
lm_sensors
] ++ [ nixfmt nix-index nix-diff nixpkgs-review nixos-option ]
++ [ autojump powerline-go ] ++ [ # File Utilities
]
++ [
nixfmt
nix-index
nix-diff
nixpkgs-review
nixos-option
]
++ [
autojump
powerline-go
]
++ [
# File Utilities
ripgrep
unzip
p7zip
@ -40,7 +58,9 @@
vimPlugins.airline
git
git-lfs
] ++ [ # Filesystem & Disk Utilities
]
++ [
# Filesystem & Disk Utilities
exfat
samba
cifs-utils
@ -52,7 +72,9 @@
smartmontools
parted
usbutils
] ++ [ # Networking Utilities
]
++ [
# Networking Utilities
nmap
bind
curl
@ -68,5 +90,4 @@
imapsync
bluez-tools
];
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
users = {
@ -7,10 +12,15 @@ let
isNormalUser = true;
description = "Fabian Hauser";
group = "fhauser";
extraGroups =
[ "wheel" "video" "docker" "networkmanager" "libvirtd" "adbusers" ];
hashedPassword =
"$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
extraGroups = [
"wheel"
"video"
"docker"
"networkmanager"
"libvirtd"
"adbusers"
];
hashedPassword = "$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108"
];
@ -22,18 +32,22 @@ let
description = "Testuser empty0";
group = "empty0";
extraGroups = [ "video" ];
hashedPassword =
"$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
hashedPassword = "$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
};
};
in {
imports = [ ../../modules ./unfree.nix ./applications.nix ./overlays.nix ];
in
{
imports = [
../../modules
./unfree.nix
./applications.nix
./overlays.nix
];
boot.loader.timeout = 2;
boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
catppuccin.flavour = "mocha";
console.keyMap = "de_CH-latin1";
@ -46,17 +60,21 @@ in {
empty0.gid = 1003;
};
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);
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 = [ "root" "@wheel" ];
settings.trusted-users = [
"root"
"@wheel"
];
optimise.automatic = true;
gc = {
automatic = true;

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, options, ... }:
{
config,
lib,
pkgs,
options,
...
}:
{
nixpkgs.overlays = [ (import ../../overlays) ];

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
nixpkgs.config.allowUnfreePredicate = pkg:
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"unrar"

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
@ -14,24 +19,26 @@
'';
# request-key expects a configuration file under /etc
environment.etc."request-key.conf" = {
text = let
upcall = "${pkgs.cifs-utils}/bin/cifs.upcall";
keyctl = "${pkgs.keyutils}/bin/keyctl";
in ''
#OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM
# -t is required for DFS share servers...
create cifs.spnego * * ${upcall} -t %k
create dns_resolver * * ${upcall} %k
# Everything below this point is essentially the default configuration,
# modified minimally to work under NixOS. Notably, it provides debug
# logging.
create user debug:* negate ${keyctl} negate %k 30 %S
create user debug:* rejected ${keyctl} reject %k 30 %c %S
create user debug:* expired ${keyctl} reject %k 30 %c %S
create user debug:* revoked ${keyctl} reject %k 30 %c %S
create user debug:loop:* * |${pkgs.coreutils}/bin/cat
create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S
negate * * * ${keyctl} negate %k 30 %S
'';
text =
let
upcall = "${pkgs.cifs-utils}/bin/cifs.upcall";
keyctl = "${pkgs.keyutils}/bin/keyctl";
in
''
#OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM
# -t is required for DFS share servers...
create cifs.spnego * * ${upcall} -t %k
create dns_resolver * * ${upcall} %k
# Everything below this point is essentially the default configuration,
# modified minimally to work under NixOS. Notably, it provides debug
# logging.
create user debug:* negate ${keyctl} negate %k 30 %S
create user debug:* rejected ${keyctl} reject %k 30 %c %S
create user debug:* expired ${keyctl} reject %k 30 %c %S
create user debug:* revoked ${keyctl} reject %k 30 %c %S
create user debug:loop:* * |${pkgs.coreutils}/bin/cat
create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S
negate * * * ${keyctl} negate %k 30 %S
'';
};
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
imports = [
./desktop-environment.nix
@ -8,5 +14,4 @@
./security.nix
./video.nix
];
}

View file

@ -1,16 +1,29 @@
{ config, pkgs, lib, ... }:
let mkDefault = lib.mkDefault;
in {
{
config,
pkgs,
lib,
...
}:
let
mkDefault = lib.mkDefault;
in
{
environment.systemPackages = with pkgs;
[ # Utilities
environment.systemPackages =
with pkgs;
[
# Utilities
freetype
feh
lxappearance
sound-theme-freedesktop
] ++ [ # Networking
]
++ [
# Networking
gnome.networkmanager-openconnect
] ++ [ # Various
]
++ [
# Various
xfce.thunar
xfce.thunar-archive-plugin
xfce.xfce4-appfinder # xfce.thunar-volman # needed?
@ -79,5 +92,4 @@ in {
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
services.xserver.windowManager.i3.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
@ -44,5 +49,4 @@
programs.light.enable = true;
programs.adb.enable = true;
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
services.pcscd.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
#boot.kernelModules = [ "v4l2loopback" ];

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
thunderboltDevices = ''
THUNDERBOLT_DEVICES="$(${pkgs.pciutils}/bin/lspci -D | ${pkgs.gnugrep}/bin/grep -i thunderbolt | cut --delimiter=' ' --fields=1)"
@ -33,7 +39,8 @@ let
echo 'Done.'
'';
in {
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
@ -47,7 +54,10 @@ in {
"igb"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "uhid" ];
boot.kernelModules = [
"kvm-amd"
"uhid"
];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "acpi_enforce_resources=lax" ];
@ -56,6 +66,5 @@ in {
hardware.cpu.amd.updateMicrocode = true;
nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.powerUpCommands =
"${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
powerManagement.powerUpCommands = "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
}

View file

@ -1,13 +1,18 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.loader.grub.extraConfig =
"\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.loader.grub.extraConfig = "\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
@ -18,7 +23,11 @@
"sdhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "virtio" "tun" ];
boot.kernelModules = [
"kvm-amd"
"virtio"
"tun"
];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "console=ttyS0,115200n8" ];

View file

@ -1,3 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }: {
hardware.rasdaemon = { enable = true; };
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
hardware.rasdaemon = {
enable = true;
};
}

View file

@ -1,4 +1,12 @@
{ config, lib, pkgs, modulesPath, hardwareModules, ... }: {
{
config,
lib,
pkgs,
modulesPath,
hardwareModules,
...
}:
{
imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix")
@ -22,8 +30,7 @@
# Ignore Alcor smartcard (gpg is not very smart)
# See https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html
systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES =
"Alcor";
systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES = "Alcor";
#hardware.video.hidpi.enable = true;

View file

@ -1,18 +1,36 @@
{ config, lib, pkgs, modulesPath, hardwareModules, pkgFccUnlock, ... }: {
{
config,
lib,
pkgs,
modulesPath,
hardwareModules,
pkgFccUnlock,
...
}:
{
imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix")
hardwareModules.lenovo-thinkpad-x1-9th-gen
];
boot.initrd.availableKernelModules =
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "ahci" "usbhid" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
"ahci"
"usbhid"
];
boot.kernelModules = [ "kvm-intel" ];
boot.initrd.kernelModules =
[ "dm-snapshot" ]; # TODO: This should be moved to defaults
boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults
environment.systemPackages = with pkgs; [ modemmanager libmbim ];
environment.systemPackages = with pkgs; [
modemmanager
libmbim
];
environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = {
source = "${pkgFccUnlock}/bin/fcc-unlock";

View file

@ -1,9 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
services.printing = {
enable = true;
drivers = with pkgs; [ gutenprint hplip splix cups-googlecloudprint ];
drivers = with pkgs; [
gutenprint
hplip
splix
cups-googlecloudprint
];
};
services.system-config-printer.enable = true;