From d5dc7479c489d17e6dcacf081c0f1b5242d99bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 8 Jan 2023 11:25:01 +0100 Subject: Format using Alejandra --- nixos/modules/generic.nix | 153 ++++++++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 61 deletions(-) (limited to 'nixos/modules/generic.nix') diff --git a/nixos/modules/generic.nix b/nixos/modules/generic.nix index 121133f..25fcbde 100644 --- a/nixos/modules/generic.nix +++ b/nixos/modules/generic.nix @@ -1,13 +1,12 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - +{ + config, + lib, + pkgs, + ... +}: +with lib; let isNative = config.nixpkgs.crossSystem == null; - in { - config = { system.stateVersion = "22.05"; @@ -23,7 +22,7 @@ in { "thefloweringash-armv7.cachix.org-1:v+5yzBD2odFKeXbmC+OPWVqx4WVoIVO6UXgnSAWFtso=" "arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8=" ]; - trusted-users = [ "@wheel" ]; + trusted-users = ["@wheel"]; }; registry = { personal.to = { @@ -40,52 +39,70 @@ in { hardware.enableAllFirmware = true; services.fwupd.enable = mkIf (pkgs.system == "x86_64-linux") true; - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ - git # We need git for this repository to even work - # Administration tools - #coreutils moreutils binutils psmisc progress lshw file - coreutils binutils psmisc progress lshw file vde2 - ldns wget - gnumake - exfat exfatprogs ntfs3g - nix-index - usbutils pciutils smartmontools - - # NCurses tools - htop iotop #glances - mc - screen tmux - - # ls tools - tree - lsof - strace - #mlocate - - sourceHighlight # Colors for less - unrar p7zip zip unzip - - # Network - nmap netcat traceroute - iftop nethogs - # TODO add mdns - sshfs - wakeonlan - - lm_sensors - - ] ++ optionals (system == "x86_64-linux") [ - ltrace - ] ++ optionals (!isNative) [ - ncdu_1 - ] ++ optionals (isNative) [ - moreutils - glances - ncdu - mlocate - ]; + environment.systemPackages = with pkgs; + [ + git # We need git for this repository to even work + # Administration tools + coreutils + binutils + psmisc + progress + lshw + file + vde2 + ldns + wget + gnumake + exfat + exfatprogs + ntfs3g + nix-index + usbutils + pciutils + smartmontools + + # NCurses tools + htop + iotop + mc + screen + tmux + + # ls tools + tree + lsof + strace + + sourceHighlight # Colors for less + unrar + p7zip + zip + unzip + + # Network + nmap + netcat + traceroute + iftop + nethogs + sshfs + wakeonlan + + lm_sensors + ] + ++ optionals (system == "x86_64-linux") [ + ltrace + ] + ++ optionals (!isNative) [ + ncdu_1 + ] + ++ optionals isNative [ + moreutils + glances + ncdu + mlocate + ]; users.mutableUsers = false; users.groups.cynerd.gid = 1000; @@ -97,11 +114,24 @@ in { group = "cynerd"; extraGroups = ["users" "wheel" "dialout" "kvm" "uucp"]; uid = 1000; - subUidRanges = [{ count = 65534; startUid = 10000; }]; - subGidRanges = [{ count = 65534; startGid = 10000; }]; + subUidRanges = [ + { + count = 65534; + startUid = 10000; + } + ]; + subGidRanges = [ + { + count = 65534; + startGid = 10000; + } + ]; isNormalUser = true; createHome = true; - shell = if isNative then pkgs.zsh.out else pkgs.bash.out; + shell = + if isNative + then pkgs.zsh.out + else pkgs.bash.out; passwordFile = "/run/secrets/cynerd.pass"; openssh.authorizedKeys.keyFiles = [ (config.personal-secrets + "/unencrypted/git-private.pub") @@ -113,7 +143,10 @@ in { programs.vim.defaultEditor = mkDefault true; security.sudo.extraRules = [ - { groups = [ "wheel" ]; commands = [ "ALL" ]; } + { + groups = ["wheel"]; + commands = ["ALL"]; + } ]; networking.dhcpcd.extraConfig = "controlgroup wheel"; environment.etc."dhcpcd.conf".text = "controlgroup wheel"; @@ -123,7 +156,7 @@ in { time.timeZone = "Europe/Prague"; i18n.defaultLocale = "en_US.UTF-8"; - services.udev.packages = [ + services.udev.packages = [ (pkgs.writeTextFile rec { name = "bfq-drives.rules"; destination = "/etc/udev/rules.d/60-${name}"; @@ -140,7 +173,5 @@ in { ''; programs.fuse.userAllowOther = true; - }; - } -- cgit v1.2.3