From 70cc223444059ea2885275dac9ef55f970b92281 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 2 Jun 2021 15:28:48 +0200 Subject: treewide: NixOS 20.09 -> NixOS 21.05 --- common/commandline/htop.nix | 127 ++++++++++++++++++++++++++++++++------------ common/tinc.nix | 7 --- 2 files changed, 92 insertions(+), 42 deletions(-) (limited to 'common') diff --git a/common/commandline/htop.nix b/common/commandline/htop.nix index 95763a0..dd04405 100644 --- a/common/commandline/htop.nix +++ b/common/commandline/htop.nix @@ -3,44 +3,101 @@ inputs: { config, ... }: { - home-manager.users.minijackson = { ... }: - { - programs.htop = { - enable = true; - - fields = [ - "PID" "USER" - "PRIORITY" "NICE" - "STATE" - "IO_PRIORITY" "IO_READ_RATE" "IO_WRITE_RATE" - "PERCENT_CPU" "PERCENT_MEM" - "TIME" - "COMM" - ]; - - hideThreads = true; - hideUserlandThreads = true; - showThreadNames = true; - shadowOtherUsers = true; - - highlightBaseName = true; - - # On NixOS? NO. - showProgramPath = false; - - treeView = true; - - meters = { - left = [ "LeftCPUs2" "Memory" "Swap" "Blank" { kind = "Battery"; mode = 1; } ]; - right = [ "RightCPUs2" "Blank" "Tasks" "LoadAverage" "Uptime" ]; + home-manager.users.minijackson = { config, ... }: + { + programs.htop = { + enable = true; + + settings = { + fields = with config.lib.htop.fields; [ + PID + USER + PRIORITY + NICE + STATE + IO_PRIORITY + IO_READ_RATE + IO_WRITE_RATE + PERCENT_CPU + PERCENT_MEM + TIME + COMM + ]; + + hide_threads = true; + hide_kernel_threads = true; + hide_userland_threads = true; + show_thread_names = true; + shadow_other_users = true; + + highlight_base_name = true; + + # On NixOS? NO. + show_program_path = false; + + tree_view = true; + + left_meters = [ + "LeftCPUs" + "Memory" + "Swap" + "Zram" + "Blank" + "Battery" + ]; + left_meter_modes = with config.lib.htop.modes; [ + Bar + Bar + Bar + Bar + Text + Bar + ]; + + right_meters = [ + "RightCPUs" + "Blank" + "Tasks" + "LoadAverage" + "Uptime" + "Systemd" + ]; + right_meter_modes = with config.lib.htop.modes; [ + Bar + Text + Text + Text + Text + Text + ]; + # TODO: this doesn't keep the order: + # https://github.com/nix-community/home-manager/issues/2060 + /* + } // (with config.lib.htop; leftMeters { + LeftCPUs2 = modes.Bar; + Memory = modes.Bar; + Swap = modes.Bar; + Blank = modes.Text; + Battery = modes.Bar; + }) // (with config.lib.htop; rightMeters { + RightCPUs2 = modes.Bar; + Blank = modes.Text; + Tasks = modes.Text; + LoadAverage = modes.Text; + Uptime = modes.Text; + }); + */ + }; }; }; - }; home-manager.users.root = { ... }: - { - programs.htop = config.home-manager.users.minijackson.programs.htop // { - shadowOtherUsers = false; + { + programs.htop = { + enable = true; + settings = config.home-manager.users.minijackson.programs.htop.settings // { + shadowOtherUsers = false; + }; + }; }; - }; } diff --git a/common/tinc.nix b/common/tinc.nix index c77afb7..d176355 100644 --- a/common/tinc.nix +++ b/common/tinc.nix @@ -5,13 +5,6 @@ inputs: with lib; with builtins; { - # TODO: remove use of unstable for NixOS 21.05 - imports = [ - (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/networking/tinc.nix") - ]; - - disabledModules = [ "services/networking/tinc.nix" ]; - options.topology = { mainVpn = { interfaceName = mkOption { -- cgit v1.2.3