From 7390d759240785f660cbdb0ca55898732aa12c98 Mon Sep 17 00:00:00 2001 From: refaelsh Date: Tue, 8 Oct 2024 18:14:23 +0100 Subject: nix flake Author: refaelsh Date: Tue Oct 8 18:14:23 2024 +0100 --- nix/readme.org | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 nix/readme.org (limited to 'nix/readme.org') diff --git a/nix/readme.org b/nix/readme.org new file mode 100644 index 0000000..d83d232 --- /dev/null +++ b/nix/readme.org @@ -0,0 +1,80 @@ +* Nix flake for Xmobar +This flake exposes a module to use with home-manager. +Here is how to set it up: + +1. Add the nixmobar flake as an input to your NiOS flake: + #+BEGIN_SRC nix + inputs = { + nixmobar.url = "git+https://codeberg.org/xmobar/xmobar.git/?dir=nix"; + }; + #+END_SRC + +2. And then, where you import your `home.nix`, add `extraSpecialArgs` like this: + #+BEGIN_SRC nix + home-manager = { + extraSpecialArgs = { + inherit inputs nixmobar; + }; + users.refaelsh = import ./home.nix; + }; + #+END_SRC + +3. Final step, use the module in `home.nix`: + #+BEGIN_SRC nix + { + inputs, + ... + }: + { + home.stateversion = "24.05"; + + imports = [ + inputs.nixmobar.homemodules.mainmodule + # Other imports go here. + ]; + + } + #+END_SRC + +* Example usage +#+BEGIN_SRC haskell +{ + programs.nixmobar = { + enable = true; + font = "Fira Code 13"; + additionalFonts = [ "Fira Code 22" ]; + bgColor = "#282A36"; + fgColor = "#F8F8F2"; + textOffset = 2; + verbose = true; + allDesktops = true; + lowerOnStart = true; + overrideRedirect = true; + position = "BottomH 26"; + alpha = 200; + alignSep = "}{"; + template = "%XMonadLog% }{ %load%|%disku%|%diskio%|%wifi_signal%|%dynnetwork%|󰈐%cat0%|%multicoretemp%|%cpufreq%|%multicpu%|%kbd%|%memory% %swap%|%battery%|%alsa:default:Master%|%kernel_version%|%date%|%_XMONAD_TRAYPAD%"; + commands = # haskell + '' + Run XMonadLog, + Run DiskU [("/", "\xf0a0 ")] [] 50, + Run DiskIO [("/", " R W ")] ["-t", "", "-w", "4"] 10, + Run DynNetwork ["-t", "KB/s\x1F89B\x1F899KB/s", "-w", "5"] 10, + Run Memory ["-t", "\xE266%"] 10, + Run Swap ["-t", "S%"] 10, + Run Kbd [], + Run CpuFreq ["-t", "GHz"] 50, + Run MultiCoreTemp ["-t", "\xf2c9°", "-L", "60", "-H", "95", "-l", "white", "-n", "white", "-h", "red"] 50, + Run CatInt 0 "/sys/class/hwmon/hwmon4/fan1_input" [] 50, + Run MultiCpu ["-t", "\xf4bc ", "-w", "99", "-L", "3", "-H", "50", "--normal", "green", "--high", "red"] 10, + Run BatteryP ["BAT0"] ["-t", "󱊣%", "-L", "10", "-H", "80", "-p", "3", "--", "-O", "On - ", "-i", "", "-L", "-15", "-H", "-5", "-l", "red", "-m", "blue", "-h", "green", "-a", "notify-send -u critical 'Battery running out!!'", "-A", "3"] 600, + Run Alsa "default" "Master" ["-t", "\xf028 %"], + Run Date "%a %_d %b %H:%M:%S" "date" 10, + Run Load ["-t", "L", "-L", "1", "-H", "3", "-d", "2"] 300, + Run ComX "nmcli" ["-t", "-f", "SIGNAL", "dev", "wifi"] "N/A" "wifi_signal" 50, + Run Com "uname" ["-r"] "kernel_version" 3600, + Run XPropertyLog "_XMONAD_TRAYPAD" + ''; + }; +} +#+END_SRC -- cgit v1.2.3