From 5c7f13ad490ea2666554e1d0126dbc266199d949 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 7 Sep 2022 19:36:55 -0400 Subject: [PATCH 01/22] Switch to xmonad --- home/jacob.nix | 24 ++++++++++++++-- home/xmobarrc | 45 ++++++++++++++++++++++++++++++ home/xmonad.hs | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 home/xmobarrc create mode 100644 home/xmonad.hs diff --git a/home/jacob.nix b/home/jacob.nix index f3c3b18..a1080e2 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -154,6 +154,10 @@ }; }; tmux = import ./tmux.nix; + xmobar = { + enable = true; + extraConfig = builtins.readFile ./xmobarrc; + }; zsh = { enable = true; enableSyntaxHighlighting = true; @@ -207,9 +211,23 @@ xsession = { enable = true; - windowManager.i3 = { - enable = true; - config = import ./i3.nix pkgs; + windowManager = { + i3 = { + enable = false; + config = import ./i3.nix pkgs; + }; + xmonad = { + enable = true; + enableContribAndExtras = true; + extraPackages = haskellPackages: with haskellPackages; [ + #dbus + #List + #monad-logger + xmonad + xmonad-contrib + ]; + config = ./xmonad.hs; + }; }; }; } diff --git a/home/xmobarrc b/home/xmobarrc new file mode 100644 index 0000000..7b2c036 --- /dev/null +++ b/home/xmobarrc @@ -0,0 +1,45 @@ +Config { overrideRedirect = False + , font = "xft:iosevka-9" + , bgColor = "#1f1f1f" + , fgColor = "#f8f8f2" + , position = TopW L 90 + , commands = [ + --Run Weather "EGPF" + --[ "--template", " °F" + --, "-L", "35" + --, "-H", "85" + --, "--low" , "lightblue" + --, "--normal", "#f8f8f2" + --, "--high" , "red" + --] 36000 + -- , + Run Cpu + [ "-L", "3" + , "-H", "50" + , "--high" , "red" + , "--normal", "green" + ] 10 + , Run BatteryP ["BAT1"] + ["-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" + [ "--template", "" + , "--suffix" , "True" + , "--" + , "--on", "" + ] + , Run Memory ["--template", "Mem: %"] 10 + , Run Swap [] 10 + , Run Date "%a %Y-%m-%d %H:%M" "date" 10 + , Run XMonadLog + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%XMonadLog% }{ Sound: %alsa:default:Master% | %cpu% | %memory% * %swap% | BAT1: %battery% | %date% " + } diff --git a/home/xmonad.hs b/home/xmonad.hs new file mode 100644 index 0000000..3676447 --- /dev/null +++ b/home/xmonad.hs @@ -0,0 +1,76 @@ +-- See https://xmonad.org/TUTORIAL.html +import XMonad + +import XMonad.Actions.RotSlaves + +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +import XMonad.Util.EZConfig (additionalKeysP) +import XMonad.Util.Loggers + +import XMonad.Layout.Magnifier +import XMonad.Layout.ThreeColumns + +main :: IO () +main = xmonad + . ewmhFullscreen + . ewmh +-- . xmobarProp + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + +myConfig = def + { terminal = "kitty" + , modMask = mod1Mask + , borderWidth = 1 +-- , workspaces = myWorkspaces + , layoutHook = myLayout + } + `additionalKeysP` + [ ("M-'", spawn "qutebrowser") + , ("M-s", spawn "scrot -s") + , ("M-a", rotAllUp) + , ("M-f", rotAllDown) + ] + +myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol + where + --threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio + threeCol = ThreeColMid nmaster delta ratio + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane + ratio = 1/2 -- Default proportion of screen occupied by master pane + delta = 3/100 -- Percent of screen to increment by when resizing panes + +myXmobarPP :: PP +myXmobarPP = def + { ppSep = magenta " • " + , ppTitleSanitize = xmobarStrip + , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 + , ppHidden = white . wrap " " "" + , ppHiddenNoWindows = lowWhite . wrap " " "" + , ppUrgent = red . wrap (yellow "!") (yellow "!") + , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] + , ppExtras = [logTitles formatFocused formatUnfocused] + } + where + formatFocused = wrap (white "[") (white "]") . magenta . ppWindow + formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow + + -- | Windows should have *some* title, which should not not exceed a + -- sane length. + ppWindow :: String -> String + ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 + + blue, lowWhite, magenta, red, white, yellow :: String -> String + magenta = xmobarColor "#ff79c6" "" + blue = xmobarColor "#bd93f9" "" + white = xmobarColor "#f8f8f2" "" + yellow = xmobarColor "#f1fa8c" "" + red = xmobarColor "#ff5555" "" + lowWhite = xmobarColor "#bbbbbb" "" + +--myWorkspaces = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "=" ] From 64cef09e533f0662e2e77fcfab707369197c46e6 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 7 Sep 2022 20:06:16 -0400 Subject: [PATCH 02/22] Default to tmux in terms, warn about M-S-q --- home/xmonad.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/xmonad.hs b/home/xmonad.hs index 3676447..68034b3 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -23,7 +23,7 @@ main = xmonad $ myConfig myConfig = def - { terminal = "kitty" + { terminal = "kitty tmux new" , modMask = mod1Mask , borderWidth = 1 -- , workspaces = myWorkspaces @@ -34,6 +34,7 @@ myConfig = def , ("M-s", spawn "scrot -s") , ("M-a", rotAllUp) , ("M-f", rotAllDown) + , ("M-S-q", spawn "kitty --hold echo M-S-q quits XMonad\\! You probably meant to use M-S-c to close the current window.") ] myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol From 2ebf4f1cebec674bf6241a14808cc2c547c80757 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 7 Sep 2022 20:41:20 -0400 Subject: [PATCH 03/22] Add lazygit and git aliases ci and s --- home/jacob.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/home/jacob.nix b/home/jacob.nix index a1080e2..ca39b24 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -88,9 +88,7 @@ }; programs = { - bat = { - enable = true; - }; + bat.enable = true; direnv = { enable = true; enableZshIntegration = true; @@ -109,10 +107,12 @@ userEmail = "jacob.hinkle@jhink.org"; lfs.enable = true; delta.enable = true; + aliases = { + s = "status"; + ci = "commit"; + }; }; - htop = { - enable = true; - }; + htop.enable = true; kitty = { enable = true; font = { @@ -120,9 +120,8 @@ size = 16; }; }; - mbsync = { - enable = true; - }; + lazygit.enable = true; + mbsync.enable = true; neovim = { enable = true; plugins = with pkgs.vimPlugins; [ @@ -162,6 +161,7 @@ enable = true; enableSyntaxHighlighting = true; shellAliases = { + lg = "lazygit"; vim = "nvim"; }; sessionVariables = { From 416d89c76a7a7cae5a29bd68ccce132cb09e8c6f Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Thu, 8 Sep 2022 09:37:18 -0400 Subject: [PATCH 04/22] Add toggleWS and additional workspaces to xmonad --- home/xmonad.hs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/home/xmonad.hs b/home/xmonad.hs index 68034b3..fdb7057 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -1,6 +1,7 @@ -- See https://xmonad.org/TUTORIAL.html import XMonad +import XMonad.Actions.CycleWS (toggleWS) import XMonad.Actions.RotSlaves import XMonad.Hooks.DynamicLog @@ -8,6 +9,8 @@ import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar.PP +import qualified XMonad.StackSet as W + import XMonad.Util.EZConfig (additionalKeysP) import XMonad.Util.Loggers @@ -26,16 +29,28 @@ myConfig = def { terminal = "kitty tmux new" , modMask = mod1Mask , borderWidth = 1 --- , workspaces = myWorkspaces + , workspaces = myWorkspaces , layoutHook = myLayout } `additionalKeysP` - [ ("M-'", spawn "qutebrowser") + ([ + -- launch programs + ("M-'", spawn "qutebrowser") , ("M-s", spawn "scrot -s") + -- cycle windows within a workspace , ("M-a", rotAllUp) , ("M-f", rotAllDown) + -- switch to previous workspace + , ("M-;", toggleWS) + -- Warn (disable shutting down xmonad since we can do that in other ways from a terminal... , ("M-S-q", spawn "kitty --hold echo M-S-q quits XMonad\\! You probably meant to use M-S-c to close the current window.") ] + ++ + -- access additional workspaces + [("M-" ++ w, windows $ W.greedyView w) | w <- addlWorkspaces] + ++ + [("M-S-" ++ w, windows $ W.shift w) | w <- addlWorkspaces] + ) myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol where @@ -74,4 +89,8 @@ myXmobarPP = def red = xmobarColor "#ff5555" "" lowWhite = xmobarColor "#bbbbbb" "" ---myWorkspaces = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "=" ] +addlWorkspaces :: [String] +addlWorkspaces = ["0", "-", "=", "i"] + +myWorkspaces :: [String] +myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"] ++ addlWorkspaces From bb6c5f39cccf37368c6f2af6270739d37c51840c Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Thu, 8 Sep 2022 12:05:07 -0400 Subject: [PATCH 05/22] Clean up flake to only have one nixpkgs dependency --- flake.lock | 58 ++++++++++++++---------------------------------------- flake.nix | 18 ++++++++++++++--- 2 files changed, 30 insertions(+), 46 deletions(-) diff --git a/flake.lock b/flake.lock index c349a22..4bfb60f 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1660407119, - "narHash": "sha256-04lWO0pDbhAXFdL4v2VzzwgxrZ5IefKn+TmZPiPeKxg=", + "lastModified": 1662458987, + "narHash": "sha256-hcDwRlsXZMp2Er3vQk1JEUZWhBPLVC9vTT4xHvhpcE0=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "12620020f76b1b5d2b0e6fbbda831ed4f5fe56e1", + "rev": "504b32caf83986b7e6b9c79c1c13008f83290f19", "type": "github" }, "original": { @@ -34,11 +34,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1661864979, - "narHash": "sha256-ajXYYTE1uoY3ei/P1v+Knklf2QNCBxMtw1gByaPTGU4=", + "lastModified": 1662099760, + "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a28adc36c20fd2fbaeb06ec9bbd79b6bf7443979", + "rev": "67e45078141102f45eff1589a831aeaa3182b41e", "type": "github" }, "original": { @@ -48,38 +48,6 @@ "type": "github" } }, - "nixpkgs-22_05": { - "locked": { - "lastModified": 1661656705, - "narHash": "sha256-1ujNuL1Tx1dt8dC/kuYS329ZZgiXXmD96axwrqsUY7w=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "290dbaacc1f0b783fd8e271b585ec2c8c3b03954", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-22.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1661353537, - "narHash": "sha256-1E2IGPajOsrkR49mM5h55OtYnU0dGyre6gl60NXKITE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0e304ff0d9db453a4b230e9386418fd974d5804a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "home-manager": "home-manager", @@ -90,15 +58,19 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_2", - "nixpkgs-22_05": "nixpkgs-22_05" + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-22_05": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1661660105, - "narHash": "sha256-3ITdkYwsNDh2DRqi7FZOJ92ui92NmcO6Nhj49u+JjWY=", + "lastModified": 1662390490, + "narHash": "sha256-HnFHRFu0eoB0tLOZRjLgVfHzK+4bQzAmAmHSzOquuyI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d92fba1bfc9f64e4ccb533701ddd8590c0d8c74a", + "rev": "044ccfe24b349859cd9efc943e4465cc993ac84e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 27c0ff7..61be3ba 100644 --- a/flake.nix +++ b/flake.nix @@ -3,13 +3,25 @@ inputs = { nixpkgs.url = github:nixos/nixpkgs/nixos-22.05; - nixos-hardware.url = github:nixos/nixos-hardware/master; + nixos-hardware = { + url = github:nixos/nixos-hardware/master; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { - #url = "github:nix-community/home-manager"; url = "https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; - sops-nix.url = github:Mic92/sops-nix; + sops-nix = { + url = github:Mic92/sops-nix; + # sops-nix uses both -22.05 and -unstable in their flake. + # As far as I can tell, 22.05 is only used for testing, whereas unstable + # is used for the tooling. So here, I let both of these follow our + # nixpkgs input. Note that after NixOS releases, this might break since + # they may do away with 22.05 at that point. + # https://github.com/Mic92/sops-nix/blob/master/flake.nix + inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs-22_05.follows = "nixpkgs"; + }; }; outputs = inputs @ { self, nixpkgs, nixos-hardware, home-manager, sops-nix, ... }: From 1a593cb3b907c788be29989814530a88b5b60789 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Thu, 8 Sep 2022 12:18:35 -0400 Subject: [PATCH 06/22] Use difftastic for git and add git lg alias --- home/jacob.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/jacob.nix b/home/jacob.nix index ca39b24..2af3e82 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -106,10 +106,14 @@ userName = "Jacob Hinkle"; userEmail = "jacob.hinkle@jhink.org"; lfs.enable = true; - delta.enable = true; + difftastic = { + enable = true; + background = "dark"; + }; aliases = { - s = "status"; ci = "commit"; + lg = "log --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\" --abbrev-commit -30"; + s = "status"; }; }; htop.enable = true; From 3f7ad45ebed45556488230789634d15152b6a13e Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Thu, 8 Sep 2022 12:20:35 -0400 Subject: [PATCH 07/22] Set threeCol to default xmonad layout --- home/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/xmonad.hs b/home/xmonad.hs index fdb7057..0799da8 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -52,7 +52,7 @@ myConfig = def [("M-S-" ++ w, windows $ W.shift w) | w <- addlWorkspaces] ) -myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol +myLayout = threeCol ||| tiled ||| Mirror tiled ||| Full where --threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio threeCol = ThreeColMid nmaster delta ratio From a897038529d9737096fda7ad569784474148e850 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Thu, 8 Sep 2022 12:27:21 -0400 Subject: [PATCH 08/22] Reformat nix code with alejandra --- flake.nix | 27 +-- home/i3.nix | 39 ++--- home/jacob.nix | 48 +++--- home/tmux.nix | 4 +- machines/buck/configuration.nix | 33 ++-- machines/buck/hardware-configuration.nix | 40 +++-- machines/pedro/configuration.nix | 103 ++++++----- machines/pedro/hardware-configuration-zfs.nix | 160 +++++++++--------- machines/pedro/nginx.nix | 2 +- machines/pedro/pihole.nix | 5 +- 10 files changed, 244 insertions(+), 217 deletions(-) diff --git a/flake.nix b/flake.nix index 61be3ba..7c413c0 100644 --- a/flake.nix +++ b/flake.nix @@ -24,15 +24,20 @@ }; }; - outputs = inputs @ { self, nixpkgs, nixos-hardware, home-manager, sops-nix, ... }: - let + outputs = inputs @ { + self, + nixpkgs, + nixos-hardware, + home-manager, + sops-nix, + ... + }: let system = "x86_64-linux"; - homeManagerConfFor = config: { ... }: { - #nixpkgs.overlays = [ nur.overlay ]; - imports = [ config ]; - }; + homeManagerConfFor = config: {...}: { + #nixpkgs.overlays = [ nur.overlay ]; + imports = [config]; + }; in { - nixosConfigurations = { # Thinkpad T470 laptop buck = nixpkgs.lib.nixosSystem { @@ -40,7 +45,8 @@ modules = [ nixos-hardware.nixosModules.lenovo-thinkpad-t470s ./machines/buck/configuration.nix - home-manager.nixosModules.home-manager { + home-manager.nixosModules.home-manager + { home-manager.useUserPackages = true; home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix; } @@ -53,8 +59,9 @@ modules = [ nixos-hardware.nixosModules.common-pc-hdd nixos-hardware.nixosModules.common-cpu-intel-cpu-only - ./machines/pedro/configuration.nix - home-manager.nixosModules.home-manager { + ./machines/pedro/configuration.nix + home-manager.nixosModules.home-manager + { home-manager.useUserPackages = true; home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix; } diff --git a/home/i3.nix b/home/i3.nix index 639159e..05c8108 100644 --- a/home/i3.nix +++ b/home/i3.nix @@ -1,11 +1,11 @@ -pkgs : -rec { +pkgs: rec { menu = "${pkgs.dmenu}/bin/dmenu_run"; modifier = "Mod1"; terminal = "kitty"; keybindings = let browser = "qutebrowser"; - scrot2clip = pkgs.writeShellScript "scrot2clip" + scrot2clip = + pkgs.writeShellScript "scrot2clip" "${pkgs.scrot}/bin/scrot -s - | ${pkgs.xclip}/bin/xclip -selection primary -i -t image/png"; in { "${modifier}+Return" = "exec ${terminal} tmux new"; @@ -54,31 +54,20 @@ rec { "${modifier}+9" = "workspace number 9"; "${modifier}+0" = "workspace number 10"; - "${modifier}+Shift+1" = - "move container to workspace number 1"; - "${modifier}+Shift+2" = - "move container to workspace number 2"; - "${modifier}+Shift+3" = - "move container to workspace number 3"; - "${modifier}+Shift+4" = - "move container to workspace number 4"; - "${modifier}+Shift+5" = - "move container to workspace number 5"; - "${modifier}+Shift+6" = - "move container to workspace number 6"; - "${modifier}+Shift+7" = - "move container to workspace number 7"; - "${modifier}+Shift+8" = - "move container to workspace number 8"; - "${modifier}+Shift+9" = - "move container to workspace number 9"; - "${modifier}+Shift+0" = - "move container to workspace number 10"; + "${modifier}+Shift+1" = "move container to workspace number 1"; + "${modifier}+Shift+2" = "move container to workspace number 2"; + "${modifier}+Shift+3" = "move container to workspace number 3"; + "${modifier}+Shift+4" = "move container to workspace number 4"; + "${modifier}+Shift+5" = "move container to workspace number 5"; + "${modifier}+Shift+6" = "move container to workspace number 6"; + "${modifier}+Shift+7" = "move container to workspace number 7"; + "${modifier}+Shift+8" = "move container to workspace number 8"; + "${modifier}+Shift+9" = "move container to workspace number 9"; + "${modifier}+Shift+0" = "move container to workspace number 10"; "${modifier}+Shift+c" = "reload"; "${modifier}+Shift+r" = "restart"; - "${modifier}+Shift+e" = - "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'"; + "${modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'"; "${modifier}+r" = "mode resize"; }; diff --git a/home/jacob.nix b/home/jacob.nix index 2af3e82..462702b 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -1,10 +1,14 @@ -{ config, pkgs, ... }: { + config, + pkgs, + ... +}: { imports = [ - ({ lib, ...}: { - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "zoom" - ]; + ({lib, ...}: { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "zoom" + ]; }) ]; @@ -16,7 +20,7 @@ keyboard = { layout = "us"; - options = [ "caps:swapescape" "ctrl:ralt_rctrl" ]; + options = ["caps:swapescape" "ctrl:ralt_rctrl"]; }; packages = with pkgs; [ @@ -58,8 +62,8 @@ stateVersion = "22.05"; }; - accounts.email = { - accounts.gmail = { + accounts.email.accounts = { + gmail = { address = "jacob.hinkle@gmail.com"; passwordCommand = "${pkgs.coreutils}/bin/cat /run/secrets/email/gmail/password"; flavor = "gmail.com"; @@ -71,7 +75,7 @@ primary = true; realName = "Jacob Hinkle"; }; - accounts.jhink = { + jhink = { address = "jacob.hinkle@jhink.org"; imap.host = "mail.privateemail.com"; smtp.host = "mail.privateemail.com"; @@ -132,6 +136,7 @@ vim-nix ]; }; + #notmuch.enable = true; qutebrowser = import ./qutebrowser.nix; rbw = { enable = true; @@ -174,12 +179,12 @@ oh-my-zsh = { enable = true; plugins = [ - "direnv" - "git" - "sudo" - "vi-mode" + "direnv" + "git" + "sudo" + "vi-mode" ]; - theme = "michelebologna"; # nice clean theme that shows jobs + theme = "michelebologna"; # nice clean theme that shows jobs }; # michelebologna theme doesn't have an RPROMPT, but I like the one from the clean theme initExtra = '' @@ -223,13 +228,14 @@ xmonad = { enable = true; enableContribAndExtras = true; - extraPackages = haskellPackages: with haskellPackages; [ - #dbus - #List - #monad-logger - xmonad - xmonad-contrib - ]; + extraPackages = haskellPackages: + with haskellPackages; [ + #dbus + #List + #monad-logger + xmonad + xmonad-contrib + ]; config = ./xmonad.hs; }; }; diff --git a/home/tmux.nix b/home/tmux.nix index 4822eec..f5ceb21 100644 --- a/home/tmux.nix +++ b/home/tmux.nix @@ -1,7 +1,7 @@ { enable = true; aggressiveResize = true; - clock24 = true; + clock24 = true; escapeTime = 0; historyLimit = 10000; keyMode = "vi"; @@ -26,6 +26,6 @@ set-window-option -g window-status-current-style fg=red # align center the window list set -g status-justify centre - + ''; } diff --git a/machines/buck/configuration.nix b/machines/buck/configuration.nix index a3f7b16..b96f4a2 100644 --- a/machines/buck/configuration.nix +++ b/machines/buck/configuration.nix @@ -1,14 +1,16 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, sops, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + config, + pkgs, + sops, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; sops = { # This will add secrets.yml to the nix store @@ -16,7 +18,7 @@ # sops.defaultSopsFile = "/root/.sops/secrets/example.yaml"; defaultSopsFile = ../../secrets.yaml; # This will automatically import SSH keys as age keys - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; # This is using an age key that is expected to already be in the filesystem #age.keyFile = "/var/lib/sops-nix/key.txt"; # This will generate a new key if the key specified above does not exist @@ -43,7 +45,7 @@ environmentFile = "/run/secrets/wifi/env"; networks = { "@SSID_HOME@" = { - pskRaw = "@PSKRAW_HOME@"; + pskRaw = "@PSKRAW_HOME@"; }; }; }; @@ -61,7 +63,6 @@ # Select internationalisation properties. i18n.defaultLocale = "en_US.utf8"; - # Allow unfree packages nixpkgs.config.allowUnfree = true; @@ -85,7 +86,7 @@ # List services that you want to enable: # Enable sound. sound.enable = true; - + #hardware.raspberry-pi."4".fkms-3d.enable = true; # Enable touchpad support (enabled default in most desktopManager). services.xserver.libinput.enable = true; @@ -93,11 +94,11 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.jacob = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. shell = pkgs.zsh; }; - security.rtkit.enable = true; # recommended for pipewire + security.rtkit.enable = true; # recommended for pipewire # List services that you want to enable: services = { @@ -133,7 +134,7 @@ enable = true; greeter.enable = false; }; - }; + }; libinput = { enable = true; touchpad = { @@ -148,7 +149,7 @@ i3status # gives you the default i3 status bar i3lock #default i3 screen locker i3blocks #if you are planning on using i3blocks over i3status - ]; + ]; }; }; }; @@ -179,6 +180,6 @@ gc = { automatic = true; }; - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = ["nix-command" "flakes"]; }; } diff --git a/machines/buck/hardware-configuration.nix b/machines/buck/hardware-configuration.nix index a37362e..fcb8ddb 100644 --- a/machines/buck/hardware-configuration.nix +++ b/machines/buck/hardware-configuration.nix @@ -1,29 +1,33 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.kernelModules = ["dm-snapshot"]; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/cc13728f-a446-49db-98fc-51db875bba20"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/cc13728f-a446-49db-98fc-51db875bba20"; + fsType = "ext4"; + }; - fileSystems."/boot/efi" = - { device = "/dev/disk/by-uuid/164F-882B"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/164F-882B"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/pedro/configuration.nix b/machines/pedro/configuration.nix index bf27a46..5e02dea 100644 --- a/machines/pedro/configuration.nix +++ b/machines/pedro/configuration.nix @@ -1,11 +1,15 @@ # Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, options, sops, ... }: - -{ imports = - [ # Include the results of the hardware scan. - ./hardware-configuration-zfs.nix - ]; +{ + config, + pkgs, + options, + sops, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration-zfs.nix + ]; sops = { # This will add secrets.yml to the nix store @@ -13,7 +17,7 @@ # sops.defaultSopsFile = "/root/.sops/secrets/example.yaml"; defaultSopsFile = ../../secrets.yaml; # This will automatically import SSH keys as age keys - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; # This is using an age key that is expected to already be in the filesystem #age.keyFile = "/var/lib/sops-nix/key.txt"; # This will generate a new key if the key specified above does not exist @@ -30,13 +34,14 @@ boot = { # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) loader = { - # Enables the generation of /extlinux/extlinux.conf grub.enable = true; - #grub.version = 2; grub.device = "/dev/sda"; grub.efiSupport = true; - systemd-boot.enable = true; + # Enables the generation of /extlinux/extlinux.conf grub.enable = true; + #grub.version = 2; grub.device = "/dev/sda"; grub.efiSupport = true; + systemd-boot.enable = true; }; - + # ZFS settings - initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; initrd.supportedFilesystems = [ "zfs" ]; # boot from zfs supportedFilesystems = [ "zfs" ]; zfs.devNodes = "/dev/"; + initrd.availableKernelModules = ["usbhid" "usb_storage"]; + initrd.supportedFilesystems = ["zfs"]; # boot from zfs supportedFilesystems = [ "zfs" ]; zfs.devNodes = "/dev/"; }; # Set your time zone. @@ -63,36 +68,51 @@ }; firewall = { allowedTCPPorts = [ - 8384 22000 # syncthing - 8080 8443 6789 8880 8843 27117 # unifi controller: https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference - 53 8088 # pihole + 8384 + 22000 # syncthing + 8080 + 8443 + 6789 + 8880 + 8843 + 27117 # unifi controller: https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference + 53 + 8088 # pihole #3000 # gitea #8081 # vaultwarden #8000 # paperless - 80 443 # reverse proxy + 80 + 443 # reverse proxy ]; allowedUDPPorts = [ - 22000 21027 # syncthing - 3478 5514 10001 1900 123 # unifi - 53 # pihole + 22000 + 21027 # syncthing + 3478 + 5514 + 10001 + 1900 + 123 # unifi + 53 # pihole ]; allowedUDPPortRanges = [ - { from = 5656; to = 5699; } # unifi + { + from = 5656; + to = 5699; + } # unifi ]; }; - timeServers = [ "192.168.88.1" ] ++ options.networking.timeServers.default; + timeServers = ["192.168.88.1"] ++ options.networking.timeServers.default; }; hardware.video.hidpi.enable = false; hardware.enableRedistributableFirmware = true; #hardware.pulseaudio = { - #enable = true; - #extraModules = [ pkgs.pulseaudio-modules-bt ]; - #package = pkgs.pulseaudioFull; + #enable = true; + #extraModules = [ pkgs.pulseaudio-modules-bt ]; + #package = pkgs.pulseaudioFull; #}; hardware.bluetooth.enable = false; services.blueman.enable = false; - # Enable CUPS to print documents. services.printing.enable = false; @@ -103,28 +123,28 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.jacob = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. shell = pkgs.zsh; }; # List packages installed in system profile. To search, run: $ nix search wget - environment.systemPackages = with pkgs; [ vim git wget ]; + environment.systemPackages = with pkgs; [vim git wget]; #environment.variables = { - #GDK_SCALE = "2"; - #GDK_DPI_SCALE = "0.5"; - #_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2"; + #GDK_SCALE = "2"; + #GDK_DPI_SCALE = "0.5"; + #_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2"; #}; # Some programs need SUID wrappers, can be configured further or are started in user sessions. programs.mtr.enable = true; programs.gnupg.agent = { # enable = true; enableSSHSupport = true; # }; - security.rtkit.enable = true; # recommended for pipewire + security.rtkit.enable = true; # recommended for pipewire # enable acme for certbot security.acme = { - acceptTerms = true; + acceptTerms = true; defaults = { email = "jacob.hinkle@gmail.com"; }; @@ -192,7 +212,7 @@ enable = true; greeter.enable = false; }; - }; + }; layout = "us"; libinput.enable = true; windowManager.i3 = { @@ -202,7 +222,7 @@ i3status # gives you the default i3 status bar i3lock #default i3 screen locker i3blocks #if you are planning on using i3blocks over i3status - ]; + ]; }; }; @@ -211,7 +231,7 @@ trim.enable = true; autoScrub = { enable = true; - pools = [ "rpool" ]; + pools = ["rpool"]; }; autoSnapshot = { enable = true; @@ -220,18 +240,17 @@ }; }; }; - + # Due to bug in home assistant, this workaround is suggested temporarily as of May 6, 2022 # https://github.com/nix-community/home-manager/issues/2942#issuecomment-1119760100 #nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowUnfreePredicate = ( pkg: true ); - + nixpkgs.config.allowUnfreePredicate = (pkg: true); + powerManagement.cpuFreqGovernor = "ondemand"; - # This value determines the NixOS release from which the default settings for stateful data, like file locations and database versions on your system were taken. It‘s perfectly fine and recommended to leave this value at the + # This value determines the NixOS release from which the default settings for stateful data, like file locations and database versions on your system were taken. It‘s perfectly fine and recommended to leave this value at the # release version of the first install of this system. Before changing this value read the documentation for this option (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "22.05"; # Did you read the comment? - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; } - diff --git a/machines/pedro/hardware-configuration-zfs.nix b/machines/pedro/hardware-configuration-zfs.nix index a9e4cee..112ed1b 100644 --- a/machines/pedro/hardware-configuration-zfs.nix +++ b/machines/pedro/hardware-configuration-zfs.nix @@ -1,103 +1,106 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # high-resolution display hardware.video.hidpi.enable = lib.mkDefault true; - fileSystems."/" = - { device = "none"; - fsType = "tmpfs"; - }; + fileSystems."/" = { + device = "none"; + fsType = "tmpfs"; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-partuuid/e7ebac1e-eb4c-4a7d-8893-49a95f6014d4"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-partuuid/e7ebac1e-eb4c-4a7d-8893-49a95f6014d4"; + fsType = "vfat"; + }; - fileSystems."/nix" = - { device = "rpool/nixos/nix"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/nix" = { + device = "rpool/nixos/nix"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/etc" = - { device = "rpool/nixos/etc"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/etc" = { + device = "rpool/nixos/etc"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/var" = - { device = "rpool/nixos/var"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/var" = { + device = "rpool/nixos/var"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/var/lib" = - { device = "rpool/nixos/var/lib"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/var/lib" = { + device = "rpool/nixos/var/lib"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/var/log" = - { device = "rpool/nixos/var/log"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/var/log" = { + device = "rpool/nixos/var/log"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/var/spool" = - { device = "rpool/nixos/var/spool"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/var/spool" = { + device = "rpool/nixos/var/spool"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/serverdata/pihole" = - { device = "rpool/serverdata/pihole"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; - fileSystems."/serverdata/gitea" = - { device = "rpool/serverdata/gitea"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; - fileSystems."/serverdata/home-assistant" = - { device = "rpool/serverdata/home-assistant"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/serverdata/pihole" = { + device = "rpool/serverdata/pihole"; + fsType = "zfs"; + options = ["zfsutil"]; + }; + fileSystems."/serverdata/gitea" = { + device = "rpool/serverdata/gitea"; + fsType = "zfs"; + options = ["zfsutil"]; + }; + fileSystems."/serverdata/home-assistant" = { + device = "rpool/serverdata/home-assistant"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/home" = - { device = "rpool/userdata/home"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/home" = { + device = "rpool/userdata/home"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/root" = - { device = "rpool/userdata/home/root"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/root" = { + device = "rpool/userdata/home/root"; + fsType = "zfs"; + options = ["zfsutil"]; + }; - fileSystems."/home/jacob" = - { device = "rpool/userdata/home/jacob"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + fileSystems."/home/jacob" = { + device = "rpool/userdata/home/jacob"; + fsType = "zfs"; + options = ["zfsutil"]; + }; swapDevices = [ { @@ -105,5 +108,4 @@ randomEncryption = true; } ]; - } diff --git a/machines/pedro/nginx.nix b/machines/pedro/nginx.nix index 720c616..e73ac1c 100644 --- a/machines/pedro/nginx.nix +++ b/machines/pedro/nginx.nix @@ -2,7 +2,7 @@ enable = true; recommendedProxySettings = true; virtualHosts = let - simpleProxy = ip : { + simpleProxy = ip: { forceSSL = true; enableACME = true; extraConfig = '' diff --git a/machines/pedro/pihole.nix b/machines/pedro/pihole.nix index b16f24b..f049ec7 100644 --- a/machines/pedro/pihole.nix +++ b/machines/pedro/pihole.nix @@ -1,5 +1,4 @@ -serverIP : -{ +serverIP: { image = "pihole/pihole:2022.07.1"; ports = [ "${serverIP}:53:53/tcp" @@ -21,6 +20,6 @@ serverIP : "/run/secrets/pihole:/run/secrets/pihole" ]; extraOptions = [ - "--no-hosts" # do not populate internal /etc/hosts with container host's + "--no-hosts" # do not populate internal /etc/hosts with container host's ]; } From 1a3bb082eca41a51aaf1b680bba46d3838cd3c50 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Fri, 9 Sep 2022 07:42:01 -0400 Subject: [PATCH 09/22] Add fd and jq to home-manager --- home/jacob.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/jacob.nix b/home/jacob.nix index 462702b..aafe74c 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -27,11 +27,13 @@ age bitwarden chromium + fd feh file #freecad #gnumake hack-font + jq inconsolata libreoffice logseq From 1e48eabbc5f85b9e1cac2b7a839079413188aceb Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 12 Sep 2022 11:27:00 -0400 Subject: [PATCH 10/22] Add boot.loader.configurationLimit = 10 for buck --- machines/buck/configuration.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/machines/buck/configuration.nix b/machines/buck/configuration.nix index b96f4a2..d389a04 100644 --- a/machines/buck/configuration.nix +++ b/machines/buck/configuration.nix @@ -33,9 +33,17 @@ }; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; + boot.loader = { + systemd-boot = { + enable = true; + # limit number of configurations to save in the boot menu + configurationLimit = 10; + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; networking.hostName = "buck"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. From ed21a8221480967456f14acc4c0edbf5a4a5ad71 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Sun, 18 Sep 2022 20:38:06 -0400 Subject: [PATCH 11/22] Fix up nvim config --- home/jacob.nix | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/home/jacob.nix b/home/jacob.nix index aafe74c..5c61b72 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -50,9 +50,14 @@ sxiv #texlive.combined.scheme-full xclip + zathura zoom-us ]; + sessionVariables = { + QT_ENABLE_HIGHDPI_SCALING = 1; + }; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards @@ -64,6 +69,19 @@ stateVersion = "22.05"; }; + xdg = { + enable = true; + mimeApps = { + enable = true; + associations.added = { + "application/pdf" = ["zathura.desktop"]; + }; + defaultApplications = { + "application/pdf" = ["zathura.desktop"]; + }; + }; + }; + accounts.email.accounts = { gmail = { address = "jacob.hinkle@gmail.com"; @@ -127,16 +145,30 @@ enable = true; font = { name = "Hack"; - size = 16; + size = 24; }; }; lazygit.enable = true; mbsync.enable = true; neovim = { enable = true; + extraConfig = '' + set tabstop=4 + set softtabstop=4 " enables backspacing, etc + set shiftwidth=4 + set expandtab + set tw=80 + + set bs=2 " allow backspacing over everything in insert mode + set ai " always set autoindenting on + ''; plugins = with pkgs.vimPlugins; [ + ctrlp + gundo + python-mode vim-nix ]; + vimAlias = true; }; #notmuch.enable = true; qutebrowser = import ./qutebrowser.nix; From a517896a4a708cb3686e7fbd4b4a783c3ffa094c Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 26 Sep 2022 09:43:22 -0400 Subject: [PATCH 12/22] Add some utilities: fzf, rg, speedcrunch --- home/jacob.nix | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/home/jacob.nix b/home/jacob.nix index 5c61b72..71bf3e5 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -31,6 +31,7 @@ feh file #freecad + fzf #gnumake hack-font jq @@ -42,10 +43,12 @@ #openscad #pandoc pavucontrol + ripgrep scli scrot signal-desktop sops + speedcrunch spotify-tui sxiv #texlive.combined.scheme-full @@ -161,11 +164,19 @@ set bs=2 " allow backspacing over everything in insert mode set ai " always set autoindenting on + + set number relativenumber + set colorcolumn=100 ''; plugins = with pkgs.vimPlugins; [ - ctrlp - gundo + #context-vim + #ctrlp + #fzf + #gundo python-mode + #telescope-nvim + #telescope-fzf-native-nvim + #nvim-treesitter vim-nix ]; vimAlias = true; @@ -209,6 +220,7 @@ }; sessionVariables = { EDITOR = "nvim"; + FZF_DEFAULT_OPTS = "--layout=reverse --inline-info --height=40% --border"; }; oh-my-zsh = { enable = true; @@ -217,12 +229,27 @@ "git" "sudo" "vi-mode" + "fzf" ]; theme = "michelebologna"; # nice clean theme that shows jobs }; - # michelebologna theme doesn't have an RPROMPT, but I like the one from the clean theme initExtra = '' + # michelebologna theme doesn't have an RPROMPT, but I like the one from + # the clean theme RPROMPT='[%*]' + + # wrap the fzf command with some killable helpers + function vif() { + local fname + fname=$(fzf) || return + vim "$fname" + } + + function fcd() { + local dirname + dirname=$(find -type d | fzf) || return + cd "$dirname" + } ''; }; }; From 75f1accf4360c48be823be63f29003c02e05f47e Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 26 Sep 2022 09:43:33 -0400 Subject: [PATCH 13/22] Add xmonad keys for hdmi --- home/xmonad.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/xmonad.hs b/home/xmonad.hs index 0799da8..9a1b55a 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -37,6 +37,10 @@ myConfig = def -- launch programs ("M-'", spawn "qutebrowser") , ("M-s", spawn "scrot -s") + -- xrandr commands for when (dis)connecting from external monitor + -- I have temporarily given up on using autorandr fo rthis + , ("M-x", spawn "xrandr --output DP-1 --auto --output eDP-1 --off") -- external + , ("M-c", spawn "xrandr --output eDP-1 --auto --output DP-1 --off") -- laptop only -- cycle windows within a workspace , ("M-a", rotAllUp) , ("M-f", rotAllDown) From b8490f2b074388a4c372dbc641a5a1b83f11d22f Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 26 Sep 2022 10:09:49 -0400 Subject: [PATCH 14/22] Factor user home out and place in homeManagerConfigurations --- flake.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 7c413c0..b5ee6d1 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,15 @@ #nixpkgs.overlays = [ nur.overlay ]; imports = [config]; }; - in { + jacobHome = homeManagerConfFor ./home/jacob.nix; + jacobHomeMod = { + home-manager.useUserPackages = true; + home-manager.users.jacob = jacobHome; + }; + in rec { + homeManagerConfigurations = { + jacob = jacobHome; + }; nixosConfigurations = { # Thinkpad T470 laptop buck = nixpkgs.lib.nixosSystem { @@ -46,10 +54,7 @@ nixos-hardware.nixosModules.lenovo-thinkpad-t470s ./machines/buck/configuration.nix home-manager.nixosModules.home-manager - { - home-manager.useUserPackages = true; - home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix; - } + jacobHomeMod sops-nix.nixosModules.sops ]; }; @@ -61,10 +66,7 @@ nixos-hardware.nixosModules.common-cpu-intel-cpu-only ./machines/pedro/configuration.nix home-manager.nixosModules.home-manager - { - home-manager.useUserPackages = true; - home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix; - } + jacobHomeMod sops-nix.nixosModules.sops ]; }; From c55e4ee1b9aa2854afea37379df2490432ed2649 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 27 Sep 2022 09:07:52 -0400 Subject: [PATCH 15/22] Switch from privateemail to fastmail --- home/jacob.nix | 30 +++++++++++++++++++++++++----- secrets.yaml | 7 ++++--- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/home/jacob.nix b/home/jacob.nix index 71bf3e5..d9675e5 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -95,13 +95,25 @@ create = "maildir"; }; notmuch.enable = false; - primary = true; realName = "Jacob Hinkle"; }; jhink = { address = "jacob.hinkle@jhink.org"; - imap.host = "mail.privateemail.com"; - smtp.host = "mail.privateemail.com"; + primary = true; + imap = { + host = "imap.fastmail.com"; + tls = { + enable = true; + useStartTls = false; + }; + }; + smtp = { + host = "smtp.fastmail.com"; + tls = { + enable = true; + useStartTls = false; + }; + }; flavor = "plain"; userName = "jacob.hinkle@jhink.org"; passwordCommand = "${pkgs.coreutils}/bin/cat /run/secrets/email/jhink/password"; @@ -152,7 +164,9 @@ }; }; lazygit.enable = true; - mbsync.enable = true; + mbsync = { + enable = true; + }; neovim = { enable = true; extraConfig = '' @@ -181,7 +195,9 @@ ]; vimAlias = true; }; - #notmuch.enable = true; + notmuch = { + enable = true; + }; qutebrowser = import ./qutebrowser.nix; rbw = { enable = true; @@ -255,6 +271,10 @@ }; services = { + mbsync = { + enable = true; + verbose = true; + }; spotifyd = { enable = true; settings = { diff --git a/secrets.yaml b/secrets.yaml index 3767dd3..71beec7 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -2,9 +2,10 @@ email: gmail: address: ENC[AES256_GCM,data:uWVgCX2nTVJn8HlEMKfU86DsVG9c0A==,iv:uLJk521DET65fizoUUKnLB325fNmSZNc3M9tNqjq2qg=,tag:zSlTWP3VYu0JR0FH0gdCHw==,type:str] password: ENC[AES256_GCM,data:DKB+h3jaX+BP,iv:kdc1NcYVLie3TRCf2qq5x8V3WaSKXKKHDqBDzjpQMDw=,tag:P1mmaKhPcX1yMUxI5I/uXA==,type:str] + #ENC[AES256_GCM,data:Otd/3wBbI7DCFsZwyg==,iv:rUajD3QRS4u1kdwpnfS8RQaNbB/WwtHnjDnsYkDe7Po=,tag:SS0lGIqLxmpdiJN1qvZoYg==,type:comment] jhink: address: ENC[AES256_GCM,data:nIuL4Ay343z3lzjiXKnSqPLsqZR96w==,iv:iKQCw/cj70q2Afuf97g3njkEcD5ux4HquXFTZ5K7xHo=,tag:BsnLC1MspQOsMN6qxtY4uQ==,type:str] - password: ENC[AES256_GCM,data:/F+gn/TaRqX+,iv:y6aNJb1zG+plXwcKilQLVFEnlemDJUV0PyIicbAD6BU=,tag:A2KPxqB4xZ2erFA/nstovg==,type:str] + password: ENC[AES256_GCM,data:YAa4rVh7I7AUAY8vcqM=,iv:lmx3zQzG0WSJcl1N6U3iAC3Akumcd/RHqL7XnmtYefM=,tag:+cJoktWtboMmzYUq1ROMqg==,type:str] pihole: webpassword: ENC[AES256_GCM,data:bqBbGE5M4LUukMh7vQA=,iv:YhKaO2WQq5Ar9aKitgRTbDU2Ld2Cdc0wmrcQZ92lztY=,tag:UGnerGhtQBjO+n4LobdSyg==,type:str] spotify: @@ -59,8 +60,8 @@ sops: WVUwaEIwWTFFTExyT3hLSC9wODhJdGcKWsNIUsT06qYA9vUVeFHQrCdcn2MkHt+w Rr7W+4uaNb8Qxo/NUp9kodE9m/fg9XVd8wM7HUP4wJC0rE4GSnFvGg== -----END AGE ENCRYPTED FILE----- - lastmodified: "2022-08-30T17:05:20Z" - mac: ENC[AES256_GCM,data:6f2RYsTBhMgLlwDgJ6vj2Jv82kFMNmjwYGV072YrfOE7qwjwcRRFE26L6mVkQ3yOt94wuOMAV/8gbqxY5hqVf1QxdnIiPDisks8yriquGBWM3RJZPA6i4Q8sBDqxA5Q9h/2geaHOpdu5If0XJolwhJOYso5buxWH2nrCIXQQ0B4=,iv:KaOccL/d/NSDI+jVMhbtBdNc/6ysK9nFUEbAHoyZ+lM=,tag:FnHUlPu5xmgJle4UVz0rcg==,type:str] + lastmodified: "2022-09-27T12:51:50Z" + mac: ENC[AES256_GCM,data:XC6YYy5ECsSmfIwoCDSCCTmRBbzhIAFszyrafqe4reBgOPktBjqukFT15l55nV0dYK263Zp6WA9H1Ruh33s73K8Nvi7yiPWi9EI+W8DHx5taQIzBgd+PeT622gdhuuXCjgwjOzwW8WZEQpaVaudDefvLK4i8cm/S2qu0UfLRbZY=,iv:GmwhIfJqq5iMq0tjG7i+alyMDslOvtJTDfxsa4SUAd4=,tag:enh1UrEE9Vbx4kDfL2WKnQ==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 From a141d3b971519b8b5cf7aede3db8737f96a9f01c Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 27 Sep 2022 09:08:11 -0400 Subject: [PATCH 16/22] Set dpi=180 by default on buck (external HiDPI monitor) --- machines/buck/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machines/buck/configuration.nix b/machines/buck/configuration.nix index d389a04..b83649f 100644 --- a/machines/buck/configuration.nix +++ b/machines/buck/configuration.nix @@ -131,7 +131,7 @@ # Enable the X11 windowing system. services.xserver.enable = true; xserver = { enable = true; - #dpi = 180; + dpi = 180; displayManager = { defaultSession = "none+i3"; autoLogin = { From 00bdafa17c3dfa9e144fa2d9133c000e17e0bdde Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 27 Sep 2022 09:08:24 -0400 Subject: [PATCH 17/22] Enable swap file at /var/swap on buck --- machines/buck/hardware-configuration.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/machines/buck/hardware-configuration.nix b/machines/buck/hardware-configuration.nix index fcb8ddb..1899fe0 100644 --- a/machines/buck/hardware-configuration.nix +++ b/machines/buck/hardware-configuration.nix @@ -27,7 +27,12 @@ fsType = "vfat"; }; - swapDevices = []; + swapDevices = [ + { + device = "/var/swap"; + size = 1024 * 8 * 2; + } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's From b2bf09a9728dc27ce8b3f26f2ab815d182f05adc Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 27 Sep 2022 09:18:31 -0400 Subject: [PATCH 18/22] Update fastmail password to app passwd --- secrets.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/secrets.yaml b/secrets.yaml index 71beec7..97fee5d 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -5,7 +5,7 @@ email: #ENC[AES256_GCM,data:Otd/3wBbI7DCFsZwyg==,iv:rUajD3QRS4u1kdwpnfS8RQaNbB/WwtHnjDnsYkDe7Po=,tag:SS0lGIqLxmpdiJN1qvZoYg==,type:comment] jhink: address: ENC[AES256_GCM,data:nIuL4Ay343z3lzjiXKnSqPLsqZR96w==,iv:iKQCw/cj70q2Afuf97g3njkEcD5ux4HquXFTZ5K7xHo=,tag:BsnLC1MspQOsMN6qxtY4uQ==,type:str] - password: ENC[AES256_GCM,data:YAa4rVh7I7AUAY8vcqM=,iv:lmx3zQzG0WSJcl1N6U3iAC3Akumcd/RHqL7XnmtYefM=,tag:+cJoktWtboMmzYUq1ROMqg==,type:str] + password: ENC[AES256_GCM,data:db0Wll4B8eXYc70dsIuYbw==,iv:2g4fE2GQyKxiVMkOQqOCPjAISdlXElvWYt0XKPEOWv0=,tag:73ymkTNGUlVccJFXjT40EA==,type:str] pihole: webpassword: ENC[AES256_GCM,data:bqBbGE5M4LUukMh7vQA=,iv:YhKaO2WQq5Ar9aKitgRTbDU2Ld2Cdc0wmrcQZ92lztY=,tag:UGnerGhtQBjO+n4LobdSyg==,type:str] spotify: @@ -60,8 +60,8 @@ sops: WVUwaEIwWTFFTExyT3hLSC9wODhJdGcKWsNIUsT06qYA9vUVeFHQrCdcn2MkHt+w Rr7W+4uaNb8Qxo/NUp9kodE9m/fg9XVd8wM7HUP4wJC0rE4GSnFvGg== -----END AGE ENCRYPTED FILE----- - lastmodified: "2022-09-27T12:51:50Z" - mac: ENC[AES256_GCM,data:XC6YYy5ECsSmfIwoCDSCCTmRBbzhIAFszyrafqe4reBgOPktBjqukFT15l55nV0dYK263Zp6WA9H1Ruh33s73K8Nvi7yiPWi9EI+W8DHx5taQIzBgd+PeT622gdhuuXCjgwjOzwW8WZEQpaVaudDefvLK4i8cm/S2qu0UfLRbZY=,iv:GmwhIfJqq5iMq0tjG7i+alyMDslOvtJTDfxsa4SUAd4=,tag:enh1UrEE9Vbx4kDfL2WKnQ==,type:str] + lastmodified: "2022-09-27T13:16:21Z" + mac: ENC[AES256_GCM,data:UkvaiVtsbMKNeMKlf6N6N0dxQWAUxT2VMQrhMJFqwdyRoFvTQ+4a27sXHIQgr+G+BAnsFBeWFjA3SS+YhHcDYCx1boXMhdoFeNjVZ2TUURX/KazcIwJNGmrt4qMK7BkfUu1mLa58pxie+XSY1MBRwByg7rnLaSJzNiWgqgLRGy0=,iv:7kBE0EKhvesWToa6+At0yWt1IzTWipv0fSvopA2PUXg=,tag:0e+5Gu5Ajw7r3AgeJLg+EQ==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 From 4ccd091af1455aac9427099dbaf89d8fc2eddec0 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 28 Sep 2022 12:38:25 -0400 Subject: [PATCH 19/22] Update git config --- home/jacob.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/jacob.nix b/home/jacob.nix index d9675e5..c5fbff0 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -143,7 +143,7 @@ git = { enable = true; userName = "Jacob Hinkle"; - userEmail = "jacob.hinkle@jhink.org"; + userEmail = "jacob@jhink.org"; lfs.enable = true; difftastic = { enable = true; @@ -154,6 +154,12 @@ lg = "log --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\" --abbrev-commit -30"; s = "status"; }; + extraConfig = { + color.ui = "auto"; + push.default = "simple"; + pull.rebase = false; + branch.autosetupmerge = true; + }; }; htop.enable = true; kitty = { From 90c1c1436efe5607e205835585e3354879f7a9c3 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Wed, 28 Sep 2022 12:39:29 -0400 Subject: [PATCH 20/22] Update xmonad borderwidth to 3 --- home/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/xmonad.hs b/home/xmonad.hs index 9a1b55a..d1c0c5c 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -28,7 +28,7 @@ main = xmonad myConfig = def { terminal = "kitty tmux new" , modMask = mod1Mask - , borderWidth = 1 + , borderWidth = 3 , workspaces = myWorkspaces , layoutHook = myLayout } From 30a08ac634f133342697a923c91069c1786aa5f0 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 3 Oct 2022 09:10:49 -0400 Subject: [PATCH 21/22] Enable nix-direnv for cached dev shells --- home/jacob.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/jacob.nix b/home/jacob.nix index c5fbff0..a067fad 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -130,6 +130,7 @@ bat.enable = true; direnv = { enable = true; + nix-direnv.enable = true; enableZshIntegration = true; }; firefox = { From 337a41901fccf4591c5315525a74e6e52d33589c Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Mon, 3 Oct 2022 09:41:54 -0400 Subject: [PATCH 22/22] Add M-C- binding for tmux-less term to xmonad --- home/xmonad.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/xmonad.hs b/home/xmonad.hs index d1c0c5c..87a5818 100644 --- a/home/xmonad.hs +++ b/home/xmonad.hs @@ -33,14 +33,21 @@ myConfig = def , layoutHook = myLayout } `additionalKeysP` + -- See below for help defining keymaps + -- https://hackage.haskell.org/package/xmonad-contrib-0.17.1/docs/XMonad-Util-EZConfig.html#v:mkKeymap ([ -- launch programs ("M-'", spawn "qutebrowser") , ("M-s", spawn "scrot -s") + -- launch a terminal _without_ a new tmux session + , ("M-C-", spawn "kitty") -- xrandr commands for when (dis)connecting from external monitor -- I have temporarily given up on using autorandr fo rthis , ("M-x", spawn "xrandr --output DP-1 --auto --output eDP-1 --off") -- external , ("M-c", spawn "xrandr --output eDP-1 --auto --output DP-1 --off") -- laptop only + -- Control monitor brightness + , ("", spawn "light -A 10") + , ("", spawn "light -U 10") -- cycle windows within a workspace , ("M-a", rotAllUp) , ("M-f", rotAllDown)