aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/generic.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-01-08 11:25:01 +0100
committerKarel Kočí <cynerd@email.cz>2023-01-08 11:25:01 +0100
commitd5dc7479c489d17e6dcacf081c0f1b5242d99bd9 (patch)
treec12d18231cacb81ff5b69a2073894d228e3c81e7 /nixos/modules/generic.nix
parentc7a226a92d65cedd384fa29083efdbb07a6084b0 (diff)
downloadnixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.gz
nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.bz2
nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.zip
Format using Alejandra
Diffstat (limited to 'nixos/modules/generic.nix')
-rw-r--r--nixos/modules/generic.nix153
1 files changed, 92 insertions, 61 deletions
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;
-
};
-
}