From 3649c233b73d03370779a8f58c6613a412979e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 8 Aug 2022 10:13:19 +0200 Subject: Improve devices and few more machines --- nixos/modules/generic.nix | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'nixos/modules/generic.nix') diff --git a/nixos/modules/generic.nix b/nixos/modules/generic.nix index 2b3c3fd..57c5d82 100644 --- a/nixos/modules/generic.nix +++ b/nixos/modules/generic.nix @@ -2,7 +2,11 @@ with lib; -{ +let + + isNative = config.nixpkgs.crossSystem == null; + +in { config = { system.stateVersion = "22.05"; @@ -12,12 +16,10 @@ with lib; settings = { auto-optimise-store = true; substituters = [ - "https://cache.nixos.org" "https://thefloweringash-armv7.cachix.org" "https://arm.cachix.org" ]; trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "thefloweringash-armv7.cachix.org-1:v+5yzBD2odFKeXbmC+OPWVqx4WVoIVO6UXgnSAWFtso=" "arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8=" ]; @@ -41,7 +43,8 @@ with lib; environment.systemPackages = with pkgs; [ git # We need git for this repository to even work # Administration tools - coreutils moreutils binutils psmisc progress lshw file + #coreutils moreutils binutils psmisc progress lshw file + coreutils binutils psmisc progress lshw file ldns wget gnumake exfat exfatprogs @@ -49,16 +52,16 @@ with lib; usbutils # NCurses tools - htop iotop glances + htop iotop #glances mc screen tmux - ncdu + #ncdu # ls tools tree - mlocate lsof strace + #mlocate sourceHighlight # Colors for less unrar p7zip zip unzip @@ -71,7 +74,16 @@ with lib; lm_sensors - ] ++ optional (system == "x86_64-linux") ltrace; + ] ++ optionals (system == "x86_64-linux") [ + ltrace + ] ++ optionals (!isNative) [ + ncdu_1 + ] ++ optionals (isNative) [ + moreutils + glances + ncdu + mlocate + ]; users.mutableUsers = false; users.groups.cynerd.gid = 1000; @@ -87,14 +99,14 @@ with lib; subGidRanges = [{ count = 65534; startGid = 10000; }]; isNormalUser = true; createHome = true; - shell = pkgs.zsh.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") ]; }; }; - programs.zsh.enable = true; + programs.zsh.enable = isNative; programs.shellrc.enable = true; programs.vim.defaultEditor = mkDefault true; -- cgit v1.2.3