nix-config

My personal nixos and home-manager configuration
Log | Files | Refs | README

commit c46aab59193accebd0675da6a0cc771cc8e68b08
parent 97d4286a69b7680fdae953b0445ba84fa87ac400
Author: Benjamin Paul <bpaul848@gmail.com>
Date:   Fri,  7 May 2021 21:36:44 +1000

stuff also why doesnt gtk work???

Diffstat:
Mflake.lock | 24++++++++++++------------
Mhome/home.nix | 28++++++++++++++++++++--------
Ahome/modules/default.nix | 10++++++++++
Mhome/modules/neovim/default.nix | 72+++++++++++++++++++++++++++++++++++++++++-------------------------------
Dhome/modules/polybar.nix | 7-------
Dhome/modules/polybar.sh | 12------------
Ahome/modules/polybar/default.nix | 29+++++++++++++++++++++++++++++
Rhome/modules/polybar.conf -> home/modules/polybar/polybar.conf | 0
Ahome/modules/polybar/settings.nix | 149+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ahome/modules/xinit.nix | 24++++++++++++++++++++++++
Dhome/neovim/c.lua | 17-----------------
Dhome/neovim/cpp.lua | 14--------------
Dhome/neovim/default.nix | 35-----------------------------------
Dhome/neovim/init.lua | 70----------------------------------------------------------------------
Dhome/neovim/lua.lua | 17-----------------
Dhome/neovim/settings.vim | 25-------------------------
Dhome/neovim/tex.lua | 16----------------
Dhome/polybar.conf | 428-------------------------------------------------------------------------------
Dhome/polybar.nix | 7-------
Dhome/polybar.sh | 12------------
Mnixos/laptop/configuration.nix | 2++
21 files changed, 287 insertions(+), 711 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1617631617, - "narHash": "sha256-PARRCz55qN3gy07VJZIlFeOX420d0nGF0RzGI/9hVlw=", + "lastModified": 1619345332, + "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=", "owner": "numtide", "repo": "flake-utils", - "rev": "b2c27d1a81b0dc266270fa8aeecebbd1807fc610", + "rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1617625716, - "narHash": "sha256-B36WKNVwtmRk3oqJ9XbOca0iy1Ga1dW6E26iavRFPKQ=", + "lastModified": 1620337456, + "narHash": "sha256-w4Z6NYNYI3v++Pmqs4j1pPGdWJEyjGQat5rYxkhncMI=", "owner": "nix-community", "repo": "home-manager", - "rev": "cc60c22c69e6967b732d02f072a9f1e30454e4f6", + "rev": "86944b0fb15f89bc1173efabbce556260a410154", "type": "github" }, "original": { @@ -46,11 +46,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1617733324, - "narHash": "sha256-lp9VAwyGKUuHyIYNUS7zEqYn6BVCnzcfbxKo+evzgAM=", + "lastModified": 1620378427, + "narHash": "sha256-xjXUlGsbqI2fp5ZfYNCwUBD4DZtw2zI/Bi82A4AV+hs=", "owner": "neovim", "repo": "neovim", - "rev": "b518b9076f59f3e24e4afb5fb9468b1d5212b1b5", + "rev": "17434b88b4892218386b49b400e7eb6d265000ff", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1618306168, - "narHash": "sha256-/IOtgzdEaiEqRVn6OhpekuYhRHfCm299Bqts5QqQVko=", + "lastModified": 1620278081, + "narHash": "sha256-KcCxMcUFIqpZArUqHcLTdBXKJ1bsHnFdPALyB9auV7M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c87cb87a2db6b9eb43541c1cf83f2a2f725fa25", + "rev": "123db833485edf8df83f95ef2888113390768686", "type": "github" }, "original": { diff --git a/home/home.nix b/home/home.nix @@ -4,13 +4,23 @@ home.stateVersion = "20.09"; imports = [ - modules/alacritty.nix - modules/starship.nix - modules/zsh.nix + ./modules ]; alacritty.enable = true; + neovim.enable = true; + polybar.enable = true; starship.enable = true; + xinit = { + enable = true; + config = '' + [[ -f ~/.Xresources ]] && xrdb -merge -I$HOME .Xresources + + . ~/.xprofile + + exec bspwm + ''; + }; zsh = { enable = true; editor = "nvim"; @@ -24,9 +34,11 @@ pkgs.tree-sitter ]; - programs = { - neovim = import ./neovim { inherit pkgs; }; - }; - services.polybar = import ./polybar.nix; - +# gtk = { +# enable = true; +# theme = { +# package = pkgs.gruvbox-dark-gtk; +# name = "Gruvbox Dark"; +# }; +# }; } diff --git a/home/modules/default.nix b/home/modules/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./alacritty.nix + ./starship.nix + ./xinit.nix + ./zsh.nix + ./neovim + ./polybar + ]; +} diff --git a/home/modules/neovim/default.nix b/home/modules/neovim/default.nix @@ -1,35 +1,45 @@ -{ pkgs, ... }: +{ config, pkgs, lib, ... }: + +with lib; { - enable = true; - package = pkgs.neovim; - extraConfig = '' - lua << EOF - ${builtins.readFile ./init.lua} + options.neovim = { + enable = mkEnableOption "Neovim"; + }; + + config = mkIf config.neovim.enable { + programs.neovim = { + enable = true; + package = pkgs.neovim; + extraConfig = '' + lua << EOF + ${builtins.readFile ./init.lua} - function c() - ${builtins.readFile ./c.lua} - end - function cpp() - ${builtins.readFile ./cpp.lua} - end - function lua() - ${builtins.readFile ./lua.lua} - end - function tex() - ${builtins.readFile ./tex.lua} - end - EOF - au BufEnter *.c lua c() - au BufEnter *.cpp lua cpp() - au BufEnter *.lua lua lua() - au BufEnter *.tex lua tex() - ''; - plugins = with pkgs.vimPlugins; [ - { plugin = vim-nix; } - { plugin = idris2-vim; } - { plugin = gruvbox; config = "colorscheme gruvbox"; } - { plugin = nvim-lspconfig; } - { plugin = nvim-treesitter; config = "lua require'nvim-treesitter.configs'.setup{highlight={enable=true}}"; } - ]; + function c() + ${builtins.readFile ./c.lua} + end + function cpp() + ${builtins.readFile ./cpp.lua} + end + function lua() + ${builtins.readFile ./lua.lua} + end + function tex() + ${builtins.readFile ./tex.lua} + end + EOF + au BufEnter *.c lua c() + au BufEnter *.cpp lua cpp() + au BufEnter *.lua lua lua() + au BufEnter *.tex lua tex() + ''; + plugins = with pkgs.vimPlugins; [ + { plugin = vim-nix; } + { plugin = idris2-vim; } + { plugin = gruvbox; config = "colorscheme gruvbox"; } + { plugin = nvim-lspconfig; } + { plugin = nvim-treesitter; config = "lua require'nvim-treesitter.configs'.setup{highlight={enable=true}}"; } + ]; + }; + }; } diff --git a/home/modules/polybar.nix b/home/modules/polybar.nix @@ -1,7 +0,0 @@ -{ - enable = true; - - script = builtins.readFile ./polybar.sh; - - config = ./polybar.conf; -} diff --git a/home/modules/polybar.sh b/home/modules/polybar.sh @@ -1,12 +0,0 @@ -#!/bin/bash - -# Terminate already running bar instences -killall -q polybar - -# Wait until the processes have been shut down -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - -# Launch Polybar -polybar -rq wm_left & -polybar -rq wm_right & -polybar -rq time & diff --git a/home/modules/polybar/default.nix b/home/modules/polybar/default.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ...}: + +with lib; + +{ + options.polybar = { + enable = mkEnableOption "Polybar"; + }; + + config = mkIf config.polybar.enable { + services.polybar = { + enable = true; + + script = '' + # Terminate already running bar instances + #killall -q polybar + + # Wait until the processes have been shut down + #while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + # Launch Polybar + export DISPLAY=:0 + polybar -rq bar & + ''; + + settings = import ./settings.nix; + }; + }; +} diff --git a/home/modules/polybar.conf b/home/modules/polybar/polybar.conf diff --git a/home/modules/polybar/settings.nix b/home/modules/polybar/settings.nix @@ -0,0 +1,149 @@ +let + #background = "\${xrdb:background}"; + background = "#222"; + background-alt = "#444"; + #foreground = "\${xrdb:background}"; + foreground = "#dfdfdf"; + foreground-alt = "#555"; + primary = "#ffb52a"; + secondary = "#e60053"; + alert = "#bd2c40"; +in { + # Bars + "bar/bar" = { + font-0 = "HackNerdFont:size=10:antialias=true#3"; + + height = 25; + + background = background; + + wm-restack = "bspwm"; + + padding = 2; + + line-size = 2; + + modules-left = "bspwm"; + modules-center = "date"; + modules-right = "battery powermenu"; + }; + # Modules + + "module/bspwm" = { + type = "internal/bspwm"; + + label-focused = "%index%"; + #label-focused = ""; + label-focused-background = background-alt; + label-focused-underline= primary; + label-focused-padding = 2; + + label-occupied = "%index%"; + #label-occupied = ""; + label-occupied-padding = 2; + + label-urgent = "%index%!"; + #label-urgent = ""; + label-urgent-background = alert; + label-urgent-padding = 2; + + label-empty = "%index%"; + #label-empty = ""; + label-empty-foreground = foreground-alt; + label-empty-padding = 2; + + # Separator in between workspaces + #label-separator = "|"; + }; + + "module/date" = { + type = "internal/date"; + interval = 1; + + date = ""; + time = "%H:%M"; + + date-alt = "%d/%m/%y"; + time-alt = "%H:%M:%S"; + + label = "%date% %time%"; + + format = " <label>"; + #format-background = background-alt; + format-underline = primary; + format-padding = 2; + }; + + "module/battery" = { + type = "internal/battery"; + battery = "BAT0"; + adapter = "ADP1"; + poll_interval = 5; + + format-charging = "<ramp-capacity> <label-charging>"; + #format-charging-background = background-alt; + format-charging-underline = primary; + format-charging-padding = 2; + + format-discharging = "<ramp-capacity> <label-discharging>"; + #format-discharging-background = background-alt; + format-discharging-underline = primary; + format-discharging-padding = 2; + + format-full = "<ramp-capacity> <label-full>"; + #format-full-background = background-alt; + format-full-underline = primary; + format-full-padding = 2; + + ramp-capacity-0 = " "; + ramp-capacity-1 = " "; + ramp-capacity-2 = " "; + ramp-capacity-3 = " "; + ramp-capacity-4 = " "; + }; + + "module/powermenu" = { + type = "custom/menu"; + + expand-right = "true"; + + format-spacing = 1; + + label-open = ""; + label-open-foreground = secondary; + label-close = " cancel"; + label-close-foreground = secondary; + label-separator = "|"; + label-separator-foreground = foreground-alt; + + menu-0-0 = "reboot"; + menu-0-0-exec = "menu-open-1"; + menu-0-1 = "power off"; + menu-0-1-exec = "menu-open-2"; + + menu-1-0 = "cancel"; + menu-1-0-exec = "menu-open-0"; + menu-1-1 = "reboot"; + menu-1-1-exec = "sudo reboot"; + + menu-2-0 = "power off"; + menu-2-0-exec = "sudo poweroff"; + menu-2-1 = "cancel"; + menu-2-1-exec = "menu-open-0"; + }; + + "settings" = { + screenchange-reload = true; + #compositing-background = xor + #compositing-background = screen + #compositing-foreground = source + #compositing-border = over + #pseudo-transparency = false + }; + + "global/wm" = { + margin-top = 5; + margin-bottom = 5; + }; +# vim:ft=dosini +} diff --git a/home/modules/xinit.nix b/home/modules/xinit.nix @@ -0,0 +1,24 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + options.xinit = { + enable = mkEnableOption ".xinitrc file"; + + config = mkOption { + type = types.str; + default = ""; + example = '' + . ~/.xprofile + + exec bspwm + ''; + description = "Contents of the ~/.xinitrc file"; + }; + }; + + config = mkIf config.xinit.enable { + home.file.".xinitrc".text = config.xinit.config; + }; +} diff --git a/home/neovim/c.lua b/home/neovim/c.lua @@ -1,17 +0,0 @@ --- c ftplugin - --- Use tabs instead of spaces for c files -vim.bo.tabstop = 4 -vim.bo.softtabstop = 0 -vim.bo.shiftwidth = 4 -vim.bo.expandtab = false -vim.bo.autoindent = true -vim.o.tabstop = 4 -vim.o.softtabstop = 0 -vim.o.shiftwidth = 4 -vim.o.expandtab = false -vim.o.autoindent = true -vim.o.smarttab = true - --- Make the width of a line 79 characters (if you have more it is ugly!) -vim.bo.textwidth = 79 diff --git a/home/neovim/cpp.lua b/home/neovim/cpp.lua @@ -1,14 +0,0 @@ --- cpp ftplugin - --- Use spaces for cpp files -vim.bo.tabstop = 4 -vim.bo.softtabstop = 4 -vim.bo.shiftwidth = 4 -vim.bo.expandtab = true -vim.bo.autoindent = true -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 -vim.o.expandtab = true -vim.o.autoindent = true -vim.o.smarttab = true diff --git a/home/neovim/default.nix b/home/neovim/default.nix @@ -1,35 +0,0 @@ -{ pkgs, ... }: - -{ - enable = true; - package = pkgs.neovim; - extraConfig = '' - lua << EOF - ${builtins.readFile ./init.lua} - - function c() - ${builtins.readFile ./c.lua} - end - function cpp() - ${builtins.readFile ./cpp.lua} - end - function lua() - ${builtins.readFile ./lua.lua} - end - function tex() - ${builtins.readFile ./tex.lua} - end - EOF - au BufEnter *.c lua c() - au BufEnter *.cpp lua cpp() - au BufEnter *.lua lua lua() - au BufEnter *.tex lua tex() - ''; - plugins = with pkgs.vimPlugins; [ - { plugin = vim-nix; } - { plugin = idris2-vim; } - { plugin = gruvbox; config = "colorscheme gruvbox"; } - { plugin = nvim-lspconfig; } - { plugin = nvim-treesitter; config = "lua require'nvim-treesitter.configs'.setup{highlight={enable=true}}"; } - ]; -} diff --git a/home/neovim/init.lua b/home/neovim/init.lua @@ -1,70 +0,0 @@ --- vimrc but lua - --- Set leader to space -vim.g.mapleader = ' ' - --- Line numbers --- See :h number_relativenumber -vim.wo.number = true -vim.wo.relativenumber = true - --- Tab configuration --- See :h tabstop for tab configuration stuff -vim.bo.tabstop = 4 -vim.bo.softtabstop = 4 -vim.bo.shiftwidth = 4 -vim.bo.expandtab = true -vim.bo.autoindent = true -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 -vim.o.expandtab = true -vim.o.autoindent = true -vim.o.smarttab = true - --- Use Australian spelling -vim.bo.spelllang = 'en_au' - --- Ruler shows the line and column number at the bottom right -vim.o.ruler = true - --- Always show the tab bar for consistency -vim.o.showtabline = 2 - --- Make underscore separated words separate words ---vim.bo.iskeyword = vim.bo.iskeyword:gsub(",_","") ---vim.o.iskeyword = vim.o.iskeyword:gsub(",_","") - --- Dont wrap long lines -vim.wo.wrap = false - --- Dont highlight searches -vim.o.hlsearch = false - --- Make CTRL-L clear echo and search -vim.api.nvim_set_keymap('n', '<C-L>', ':noh<CR>:mode<CR>', - { noremap = true, silent = true }) - --- Make leader+a insert one from the end of the line because semicolon -vim.api.nvim_set_keymap('n', '<leader>a', '$i', - { noremap = true, silent = true }) --- Make leader+x delete char at the end of the line -vim.api.nvim_set_keymap('n', '<leader>x', '$x', - { noremap = true, silent = true }) --- Make leader+f fix the spelling of the current word -vim.api.nvim_set_keymap('n', '<leader>f', '1z=', - { noremap = true, silent = true }) - --- Make Shift-Delete do nothing (my keyboard is weird so I press it a lot) -vim.api.nvim_set_keymap('i', '<S-Del>', '', { noremap = true, silent = true }) - --- Colour column shows the text width of a file -vim.wo.colorcolumn = vim.wo.colorcolumn .. '+' .. 1 -for i = 2,255 do vim.wo.colorcolumn = vim.wo.colorcolumn .. ',+' .. i end - --- LSP - -require('lspconfig').ccls.setup{} - --- Always have the sign column so that code doesnt move around on error -vim.wo.signcolumn = "yes" diff --git a/home/neovim/lua.lua b/home/neovim/lua.lua @@ -1,17 +0,0 @@ --- lua ftplugin - --- Use spaces for lua files -vim.bo.tabstop = 4 -vim.bo.softtabstop = 4 -vim.bo.shiftwidth = 4 -vim.bo.expandtab = true -vim.bo.autoindent = true -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 -vim.o.expandtab = true -vim.o.autoindent = true -vim.o.smarttab = true - --- Make the width of a line 79 characters (if you have more it is ugly!) -vim.bo.textwidth = 79 diff --git a/home/neovim/settings.vim b/home/neovim/settings.vim @@ -1,25 +0,0 @@ -" I might comment this later - -let mapleader = ' ' -let maplocalleader = '\' - -set number relativenumber - -set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smarttab - -set ruler - -set showtabline=2 - -set nowrap - -set nohlsearch - -set signcolumn="yes" - -let &colorcolumn="+".join(range(0,254),",+") - -nnoremap <C-L> :noh<CR>:mode<CR> -nnoremap <leader>a $i -nnoremap <leader>x $x -inoremap <S-Del> <Nop> diff --git a/home/neovim/tex.lua b/home/neovim/tex.lua @@ -1,16 +0,0 @@ --- latex ftplugin - --- Set the text width to 79 characters -vim.bo.textwidth = 79 - --- Enable spell checking -vim.wo.spell = true - --- Bind <leader>+c to ci{ the last {} on the current line --- e.g. <leader>+c would make \command{ahesifuhisg} \command{} with insert -vim.api.nvim_set_keymap('n', '<leader>c', '$bci{', - { noremap = true, silent = true }) - --- Bind <leader>+d to duplicate the current line down -vim.api.nvim_set_keymap('n', '<leader>d', 'yyp', - { noremap = true, silent = true }) diff --git a/home/polybar.conf b/home/polybar.conf @@ -1,428 +0,0 @@ -;========================================================== -; -; -; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ -; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ -; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ -; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ -; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ -; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ -; -; -; To learn more about how to configure Polybar -; go to https://github.com/polybar/polybar -; -; The README contains a lot of information -; -;========================================================== - -[colors] -background = ${xrdb:background} -;background = #222 -background-alt = #444 -foreground = ${xrdb:foreground} -;foreground = #dfdfdf -foreground-alt = #555 -primary = #ffb52a -secondary = #e60053 -alert = #bd2c40 - -; Bars -[bar/base] -font-0 = HackNerdFont:size=10:antialias=true;3 - -height = 25 -radius = 15 - -background = ${colors.background} - -offset-y = 5 - -wm-restack = bspwm - -[bar/wm_left] -inherit = bar/base - -monitor = ${env:MONITOR:HDMI-A-0} - -offset-x = 5 - -width = 22% - -modules-center = bspwm - -[bar/wm_right] -inherit = bar/base - -monitor = ${env:MONITOR:DisplayPort-2} - -offset-x = 5 - -width = 22% - -modules-center = bspwm - -[bar/time] -inherit = bar/base - -monitor = ${env:MONITOR:DisplayPort-2} - -offset-x = 91.5% - -width = 8% - -modules-center = date powermenu - -tray-position = right -tray-padding = 2 - -; Modules - -[module/xwindow] -type = internal/xwindow -label = %title:0:30:...% - -[module/xkeyboard] -type = internal/xkeyboard -blacklist-0 = num lock - -format-prefix = " " -format-prefix-foreground = ${colors.foreground-alt} -format-prefix-underline = ${colors.secondary} - -label-layout = %layout% -label-layout-underline = ${colors.secondary} - -label-indicator-padding = 2 -label-indicator-margin = 1 -label-indicator-background = ${colors.secondary} -label-indicator-underline = ${colors.secondary} - -[module/filesystem] -type = internal/fs -interval = 25 - -mount-0 = / - -label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% -label-unmounted = %mountpoint% not mounted -label-unmounted-foreground = ${colors.foreground-alt} - -[module/bspwm] -type = internal/bspwm - -;label-focused = %index% -label-focused =  -label-focused-background = ${colors.background-alt} -label-focused-underline= ${colors.primary} -label-focused-padding = 2 - -;label-occupied = %index% -label-occupied =  -label-occupied-padding = 2 - -;label-urgent = %index%! -label-urgent =  -label-urgent-background = ${colors.alert} -label-urgent-padding = 2 - -;label-empty = %index% -label-empty =  -label-empty-foreground = ${colors.foreground-alt} -label-empty-padding = 2 - -; Separator in between workspaces -; label-separator = | - -[module/i3] -type = internal/i3 -format = <label-state> <label-mode> -index-sort = true -wrapping-scroll = false - -; Only show workspaces on the same output as the bar -;pin-workspaces = true - -label-mode-padding = 2 -label-mode-foreground = #000 -label-mode-background = ${colors.primary} - -; focused = Active workspace on focused monitor -label-focused = %index% -label-focused-background = ${colors.background-alt} -label-focused-underline= ${colors.primary} -label-focused-padding = 2 - -; unfocused = Inactive workspace on any monitor -label-unfocused = %index% -label-unfocused-padding = 2 - -; visible = Active workspace on unfocused monitor -label-visible = %index% -label-visible-background = ${self.label-focused-background} -label-visible-underline = ${self.label-focused-underline} -label-visible-padding = ${self.label-focused-padding} - -; urgent = Workspace with urgency hint set -label-urgent = %index% -label-urgent-background = ${colors.alert} -label-urgent-padding = 2 - -; Separator in between workspaces -; label-separator = | - - -[module/mpd] -type = internal/mpd -format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next> - -icon-prev =  -icon-stop =  -icon-play =  -icon-pause =  -icon-next =  - -label-song-maxlen = 25 -label-song-ellipsis = true - -[module/xbacklight] -type = internal/xbacklight - -format = <label> <bar> -label = BL - -bar-width = 10 -bar-indicator = | -bar-indicator-foreground = #fff -bar-indicator-font = 2 -bar-fill = ─ -bar-fill-font = 2 -bar-fill-foreground = #9f78e1 -bar-empty = ─ -bar-empty-font = 2 -bar-empty-foreground = ${colors.foreground-alt} - -[module/backlight-acpi] -inherit = module/xbacklight -type = internal/backlight -card = intel_backlight - -[module/cpu] -type = internal/cpu -interval = 2 -format-prefix = " " -format-prefix-foreground = ${colors.foreground-alt} -format-underline = #f90000 -label = %percentage:2%% - -[module/memory] -type = internal/memory -interval = 2 -format-prefix = " " -format-prefix-foreground = ${colors.foreground-alt} -format-underline = #4bffdc -label = %percentage_used%% - -[module/wlan] -type = internal/network -interface = net1 -interval = 3.0 - -format-connected = <ramp-signal> <label-connected> -format-connected-underline = #9f78e1 -label-connected = %essid% - -format-disconnected = -;format-disconnected = <label-disconnected> -;format-disconnected-underline = ${self.format-connected-underline} -;label-disconnected = %ifname% disconnected -;label-disconnected-foreground = ${colors.foreground-alt} - -ramp-signal-0 =  -ramp-signal-1 =  -ramp-signal-2 =  -ramp-signal-3 =  -ramp-signal-4 =  -ramp-signal-foreground = ${colors.foreground-alt} - -[module/eth] -type = internal/network -interface = enp4s0 -interval = 3.0 - -format-connected-underline = #55aa55 -format-connected-prefix = " " -format-connected-prefix-foreground = ${colors.foreground-alt} -label-connected = %local_ip% - -format-disconnected = -;format-disconnected = <label-disconnected> -;format-disconnected-underline = ${self.format-connected-underline} -;label-disconnected = %ifname% disconnected -;label-disconnected-foreground = ${colors.foreground-alt} - -[module/date] -type = internal/date -interval = 5 - -date = -date-alt = " %Y-%m-%d" - -time = %H:%M -time-alt = %H:%M:%S - -format-prefix =  -format-prefix-foreground = ${colors.foreground-alt} -format-underline = #0a6cf5 - -label = %date% %time% - -[module/pulseaudio] -type = internal/pulseaudio - -format-volume = <label-volume> <bar-volume> -label-volume = VOL %percentage%% -label-volume-foreground = ${root.foreground} - -label-muted = 🔇 muted -label-muted-foreground = #666 - -bar-volume-width = 10 -bar-volume-foreground-0 = #55aa55 -bar-volume-foreground-1 = #55aa55 -bar-volume-foreground-2 = #55aa55 -bar-volume-foreground-3 = #55aa55 -bar-volume-foreground-4 = #55aa55 -bar-volume-foreground-5 = #f5a70a -bar-volume-foreground-6 = #ff5555 -bar-volume-gradient = false -bar-volume-indicator = | -bar-volume-indicator-font = 2 -bar-volume-fill = ─ -bar-volume-fill-font = 2 -bar-volume-empty = ─ -bar-volume-empty-font = 2 -bar-volume-empty-foreground = ${colors.foreground-alt} - -[module/alsa] -type = internal/alsa - -format-volume = <label-volume> <bar-volume> -label-volume = VOL -label-volume-foreground = ${root.foreground} - -format-muted-prefix = " " -format-muted-foreground = ${colors.foreground-alt} -label-muted = sound muted - -bar-volume-width = 10 -bar-volume-foreground-0 = #55aa55 -bar-volume-foreground-1 = #55aa55 -bar-volume-foreground-2 = #55aa55 -bar-volume-foreground-3 = #55aa55 -bar-volume-foreground-4 = #55aa55 -bar-volume-foreground-5 = #f5a70a -bar-volume-foreground-6 = #ff5555 -bar-volume-gradient = false -bar-volume-indicator = | -bar-volume-indicator-font = 2 -bar-volume-fill = ─ -bar-volume-fill-font = 2 -bar-volume-empty = ─ -bar-volume-empty-font = 2 -bar-volume-empty-foreground = ${colors.foreground-alt} - -[module/battery] -type = internal/battery -battery = BAT0 -adapter = ADP1 -full-at = 98 - -format-charging = <animation-charging> <label-charging> -format-charging-underline = #ffb52a - -format-discharging = <animation-discharging> <label-discharging> -format-discharging-underline = ${self.format-charging-underline} - -format-full-prefix = " " -format-full-prefix-foreground = ${colors.foreground-alt} -format-full-underline = ${self.format-charging-underline} - -ramp-capacity-0 =  -ramp-capacity-1 =  -ramp-capacity-2 =  -ramp-capacity-foreground = ${colors.foreground-alt} - -animation-charging-0 =  -animation-charging-1 =  -animation-charging-2 =  -animation-charging-foreground = ${colors.foreground-alt} -animation-charging-framerate = 750 - -animation-discharging-0 =  -animation-discharging-1 =  -animation-discharging-2 =  -animation-discharging-foreground = ${colors.foreground-alt} -animation-discharging-framerate = 750 - -[module/temperature] -type = internal/temperature -thermal-zone = 0 -warn-temperature = 60 - -format = <ramp> <label> -format-underline = #f50a4d -format-warn = <ramp> <label-warn> -format-warn-underline = ${self.format-underline} - -label = %temperature-c% -label-warn = %temperature-c% -label-warn-foreground = ${colors.secondary} - -ramp-0 =  -ramp-1 =  -ramp-2 =  -ramp-foreground = ${colors.foreground-alt} - -[module/powermenu] -type = custom/menu - -expand-right = true - -format-spacing = 1 - -label-open =  -label-open-foreground = ${colors.secondary} -label-close =  cancel -label-close-foreground = ${colors.secondary} -label-separator = | -label-separator-foreground = ${colors.foreground-alt} - -menu-0-0 = reboot -menu-0-0-exec = menu-open-1 -menu-0-1 = power off -menu-0-1-exec = menu-open-2 - -menu-1-0 = cancel -menu-1-0-exec = menu-open-0 -menu-1-1 = reboot -menu-1-1-exec = sudo reboot - -menu-2-0 = power off -menu-2-0-exec = sudo poweroff -menu-2-1 = cancel -menu-2-1-exec = menu-open-0 - -[settings] -screenchange-reload = true -;compositing-background = xor -;compositing-background = screen -;compositing-foreground = source -;compositing-border = over -;pseudo-transparency = false - -[global/wm] -margin-top = 5 -margin-bottom = 5 - -; vim:ft=dosini diff --git a/home/polybar.nix b/home/polybar.nix @@ -1,7 +0,0 @@ -{ - enable = true; - - script = builtins.readFile ./polybar.sh; - - config = ./polybar.conf; -} diff --git a/home/polybar.sh b/home/polybar.sh @@ -1,12 +0,0 @@ -#!/bin/bash - -# Terminate already running bar instences -killall -q polybar - -# Wait until the processes have been shut down -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - -# Launch Polybar -polybar -rq wm_left & -polybar -rq wm_right & -polybar -rq time & diff --git a/nixos/laptop/configuration.nix b/nixos/laptop/configuration.nix @@ -89,6 +89,8 @@ sxhkd ]; + services.dbus.packages = with pkgs; [ dconf ]; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true;