diff options
author | Ben Sima <ben@bsima.me> | 2022-12-16 16:25:27 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-12-16 16:25:27 -0500 |
commit | 0858e7a3a39ddd2deae128f513fbdedd9edff1b9 (patch) | |
tree | fcf2f65c5579e32c40a8b6f868128ab46bac2bbe | |
parent | d1cc16ccafa8e4230226efd20a5ae5d373bac305 (diff) | |
parent | 77d7f79048484266bddde2ce9405d10411a8a1d7 (diff) |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | lib/cfg.def.h | 2 | ||||
-rw-r--r-- | lib/common.nix | 35 | ||||
-rw-r--r-- | lib/const.nix | 5 | ||||
-rw-r--r-- | lib/linux.nix | 23 | ||||
-rw-r--r-- | lib/packages.nix | 8 | ||||
-rw-r--r-- | lib/ssh.nix | 6 | ||||
-rw-r--r-- | lib/userstyles.css | 9 | ||||
-rw-r--r-- | lib/xmonad.hs | 53 | ||||
-rw-r--r-- | machines/helium.nix | 17 | ||||
-rw-r--r-- | pkgs/hledger-1.19.1.nix | 43 | ||||
-rw-r--r-- | pkgs/hledger-lib-1.19.1.nix | 35 | ||||
-rw-r--r-- | profiles/laptop.nix | 46 |
12 files changed, 157 insertions, 125 deletions
diff --git a/lib/cfg.def.h b/lib/cfg.def.h index d1e7119..57709fc 100644 --- a/lib/cfg.def.h +++ b/lib/cfg.def.h @@ -79,7 +79,7 @@ static struct command system_commands[] = { DEFCMD("R", "reboot", "reboot") DEFCMD("S", "suspend", "systemctl suspend") DEFCMD("h", "h-m switch", "home-manager switch") - DEFCMD("w", "fresh wall", "n wal") + DEFCMD("w", "fresh wall", "wal") DEFCMD("x", "restart xbindkeys", "pkill xbindkeys && xbindkeys") DEFCMD("l", "light theme", "xtheme light") diff --git a/lib/common.nix b/lib/common.nix index cdbbf6e..247a81e 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -1,11 +1,9 @@ { pkgs, lib, ... }: let + inherit (import ./const.nix) fontSize homedir gpgid; locale = "en_US.UTF-8"; - gpgid = "66A6AD150399D970DCA4C4E6C8218B7D0BFDECCD"; - homedir = builtins.getEnv "HOME"; -in -{ +in { nixpkgs.overlays = [ (import ../overlay.nix) ]; home = { stateVersion = "18.09"; @@ -17,7 +15,6 @@ in LANGUAGE = locale; PATH = "${homedir}/bin:${homedir}/.local/bin:$PATH"; PAGER = "less"; # "bat --theme=ansi"; - LEDGER_FILE = "${homedir}/.hledger.journal"; XTERM_LOCALE = locale; PYTHONSTARTUP = "${homedir}/.pythonrc"; @@ -48,14 +45,6 @@ in source = ./editorconfig; target = ".editorconfig"; }; - hledger = { - source = builtins.toFile "hledger.journal" '' - !include ${homedir}/org/fund/accounts.journal - !include ${homedir}/org/fund/ledger.journal - !include ${homedir}/org/fund/prices.journal - ''; - target = ".hledger.journal"; - }; pythonrc = { source = ./pythonrc; target = ".pythonrc"; @@ -119,13 +108,16 @@ in glog = ''log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; }; extraConfig = { - fetch.showForcedUpdate = "false"; - push.default = "simple"; - pull.rebase = "true"; commit.template = "${./git-commit-template}"; commit.verbose = "true"; - mergetool.fugitive.cmd = ''vim -f -c "Gvdiffsplit!" "$MERGED"''; + fetch.showForcedUpdate = "false"; + init.defaultBranch = "main"; + log.date = "local"; merge.tool = "fugitive"; + mergetool.fugitive.cmd = ''vim -f -c "Gvdiffsplit!" "$MERGED"''; + pull.rebase = "true"; + push.default = "current"; + remote.pushDefault = "origin"; sendemail = { #smtpuser = "ben@bsima.me"; #smtpserverport = 587; @@ -135,9 +127,7 @@ in annotate = "yes"; cccmd = "git-contacts"; }; - log = { - date = "local"; - }; + }; }; @@ -208,6 +198,7 @@ in set -g status-left-length 30 set -g status-left '#S | #(whoami)@#(hostname) | ' set -g status-right '~%Y.%m.%d..%H.%M' + set -g renumber-windows on # white-ish background with dark-grey text set -g status-style bg=colour0,fg=colour13 # highlight current window @@ -227,7 +218,9 @@ in urxvt = let font = size: "xft:Fira Mono:size=${toString size}:ant"; in { enable = true; fonts = [ - (font 6) + # for some reason, urxvt font size is much larger than every other + # program's, so i gotta cut it in half + (font (fontSize / 2)) "xft:Noto Emoji" ]; keybindings = { diff --git a/lib/const.nix b/lib/const.nix new file mode 100644 index 0000000..0accd17 --- /dev/null +++ b/lib/const.nix @@ -0,0 +1,5 @@ +{ + fontSize = 16; + homedir = builtins.getEnv "HOME"; + gpgid = "66A6AD150399D970DCA4C4E6C8218B7D0BFDECCD"; +} diff --git a/lib/linux.nix b/lib/linux.nix index 15ea28a..a4af6c2 100644 --- a/lib/linux.nix +++ b/lib/linux.nix @@ -1,11 +1,10 @@ { pkgs, lib, ... }: let - homedir = builtins.getEnv "HOME"; + inherit (import ./const.nix) fontSize homedir gpgid; getHostname = pkgs.runCommand "hostname" {} "${pkgs.hostname}/bin/hostname > $out"; hostname = lib.strings.removeSuffix "\n" (builtins.readFile "${getHostname}"); - gpgid = "66A6AD150399D970DCA4C4E6C8218B7D0BFDECCD"; base16-scheme = "atelier-sulphurpool"; base16-scheme-filename = lib.strings.concatStrings (lib.strings.splitString "-" base16-scheme); theme = lib.removeSuffix "\n" (builtins.readFile "${homedir}/.local/share/xtheme"); @@ -96,23 +95,29 @@ in xdotool xlayoutdisplay xorg.xmodmap + xsel xterm yank youtube-dl yubioath-desktop zathura - - # languages i regularly use - (haskellPackages.ghcWithPackages (a: with a; [hledger rainbow])) # for hledger scripting ]; }; fonts.fontconfig.enable = true; + gtk.enable = false; # this fails because of some missing service file + gtk.font.name = "Fira Sans"; + gtk.font.size = fontSize; + gtk.font.package = pkgs.fira; + gtk.theme.name = "Breeze"; + gtk.iconTheme.name = "hicolor"; + gtk.cursorTheme.name = "breeze_cursors"; + xresources = { properties = { - "XTerm*font" = "-*-FiraMono-medium-r-normal--10-*-*-*-*-*-iso10646-1"; + "XTerm*font" = "-*-FiraMono-medium-r-normal--${toString fontSize}-*-*-*-*-*-iso10646-1"; "XTerm*faceName" = "FireMono"; - "XTerm*faceSize" = "10"; + "XTerm*faceSize" = toString fontSize; "XTerm*termName" = "xterm-256color"; "XTerm*metaSendsEscape" = true; "XTerm*utf8" = true; @@ -145,7 +150,7 @@ in config = { "bar/top" = { background = colors."${theme}".background; - font-0 = "FiraSans:size=16"; + font-0 = "FiraSans:size=${toString fontSize}"; font-1 = "Font Awesome 5:pixelsize=11;1"; font-2 = "MaterialIcons:size=10:antialias=false;2"; foreground = colors."${theme}".foreground; @@ -303,7 +308,7 @@ in }; redshift = { - enable = true; + enable = false; latitude = "40.80"; longitude = "-81.52"; temperature = { diff --git a/lib/packages.nix b/lib/packages.nix index dd87cb2..6761da3 100644 --- a/lib/packages.nix +++ b/lib/packages.nix @@ -47,6 +47,7 @@ in { bat barrier bc + cava cloc cmatrix direnv @@ -62,6 +63,7 @@ in { fossil gcal git-lfs + git-revise github-cli gotop hashcash @@ -71,6 +73,7 @@ in { jq lsof mpc_cli + nb ncdu nmap ncmpc @@ -88,9 +91,14 @@ in { pup pv pwgen + python3 qrencode ranger ripgrep + scc + sshfs + sysz + tailscale tmux tree unrar diff --git a/lib/ssh.nix b/lib/ssh.nix index 48b79ad..29cb677 100644 --- a/lib/ssh.nix +++ b/lib/ssh.nix @@ -47,6 +47,12 @@ in { identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; + "gerrit.simatime.com" = { + hostname = "gerrit.simatime.com"; + user = "bsima"; + identityFile = [ "${homedir}/.ssh/gerrit.simatime.com" ]; + identitiesOnly = true; + }; "lithium" = { hostname = "192.168.1.9"; user = "ben"; diff --git a/lib/userstyles.css b/lib/userstyles.css index 1b1449b..e610609 100644 --- a/lib/userstyles.css +++ b/lib/userstyles.css @@ -7,3 +7,12 @@ input, input#hoogle /* gitolite.com */ body { background: transparent } + +/* huggingface */ +.lg\:.bg-gradient-to-r, +.bg-gradient-to-l, +.lg\:.bg-gradient-to-l, +.bg-gradient-to-t, +.overview-card-wrapper, +.tag, .btn +{ background: transparent } diff --git a/lib/xmonad.hs b/lib/xmonad.hs index 51ae0a8..b3cdffd 100644 --- a/lib/xmonad.hs +++ b/lib/xmonad.hs @@ -11,16 +11,21 @@ Docs: - XMonad API: https://hackage.haskell.org/package/xmonad - Contrib API: https://hackage.haskell.org/package/xmonad-contrib +Inspirations: + +- https://reddit.simatime.com/wy695w + -} -import Data.List (intercalate) import Data.Functor ((<&>)) +import Data.List (intercalate, isPrefixOf) import Graphics.X11.ExtraTypes.XF86 import XMonad import XMonad.Actions.CopyWindow import XMonad.Config import XMonad.Hooks.EwmhDesktops (ewmh) import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers (doFullFloat, isFullscreen) import XMonad.Layout.BinarySpacePartition import XMonad.Layout.Dwindle as Dwindle import XMonad.Layout.LayoutModifier @@ -31,8 +36,10 @@ import XMonad.Layout.Spiral import XMonad.Layout.Tabbed import XMonad.Layout.ThreeColumns import XMonad.Layout.TwoPane +import qualified XMonad.StackSet as W import XMonad.Util.CustomKeys (customKeys) import XMonad.Util.EZConfig (additionalKeys) +import XMonad.Util.Scratchpad -- Colors data Colors = Colors @@ -71,21 +78,39 @@ brighter = "brightnessctl s 5%+" dimmer = "brightnessctl s 5%-" +shouldntFloat :: String -> Bool +shouldntFloat = isPrefixOf "qutebrowser" + +shouldFloat :: Query Bool +shouldFloat = do + fs <- isFullscreen + name <- appName + return (fs && not (shouldntFloat name)) + +-- RationalRect is x y w h +scratchHook = scratchpadManageHook (W.RationalRect 0.125 0.125 0.75 0.75) + +myManageHook = manageDocks <+> scratchHook <+> (shouldFloat --> doFullFloat) <+> manageHook def + +-- todo: use urxvtc with daemon +termName = "/home/ben/.nix-profile/bin/urxvt" +transparentTerm = "urxvt -depth 32 -bg rgba:0000/0000/0000/4444 -fg '[80]white'" + insKeys :: XConfig l -> [((KeyMask, KeySym), X ())] insKeys conf@(XConfig {modMask = modMask}) = [ ((modMask, xK_y), spawn "passmenu"), ((modMask, xK_m), spawn "cmdtree"), ((modMask, xK_o), spawn "rofi -sidebar-mode -show run"), ((modMask, xK_n), spawn "rofi -sidebar-mode -show window"), - + ((modMask, xK_u), spawn "rofi -show calc -modi calc -no-show-match -no-sort"), + ((modMask, xK_s), scratchpadSpawnActionTerminal transparentTerm), + ((modMask, xK_h), spawn transparentTerm), -- refresh display via autorandr ( (modMask, xK_r), spawn $ "autorandr --cycle" ), - -- lock it up - ( (modMask .|. shiftMask, xK_l), spawn "xautolock -locknow"), - + ((modMask .|. shiftMask, xK_l), spawn "xautolock -locknow"), -- sticky windows ((modMask, xK_a), windows copyToAll), -- @@ Make focused window always visible ((modMask .|. shiftMask, xK_a), killAllOtherCopies), -- @@ Toggle window state back @@ -134,14 +159,15 @@ myLayout theme = ||| (addSpace $ noBorders Full) ||| twopane ||| Mirror twopane --- ||| ThreeCol 1 (3 / 100) (1 / 2) --- ||| ThreeColMid 1 (3 / 100) (1 / 2) + -- ||| ThreeCol 1 (3 / 100) (1 / 2) + -- ||| ThreeColMid 1 (3 / 100) (1 / 2) ||| tiled ||| Mirror tiled ||| emptyBSP --- ||| goldenSpiral --- ||| Spiral R Dwindle.CW (3 / 2) (11 / 10) -- L/R is where to put non-main windows where + -- ||| goldenSpiral + -- ||| Spiral R Dwindle.CW (3 / 2) (11 / 10) -- L/R is where to put non-main windows + -- The last parameter is fraction to multiply the slave window heights -- with. Useless here. tiled = addSpace $ ResizableTall nmaster delta ratio [] @@ -154,17 +180,18 @@ myLayout theme = -- Percent of screen to increment by when resizing panes delta = 3 / 100 -myConf theme = additionalKeys c (insKeys c) + +myConf theme = additionalKeys cfg (insKeys cfg) where - c = + cfg = def { modMask = mod4Mask, -- super instead of alt normalBorderColor = background theme, focusedBorderColor = highlight theme, borderWidth = 3, - manageHook = manageDocks <+> manageHook def, + manageHook = myManageHook, layoutHook = myLayout theme, - terminal = "/home/ben/.nix-profile/bin/urxvt", + terminal = termName, workspaces = myWorkspaces } diff --git a/machines/helium.nix b/machines/helium.nix index d2a054f..093b25d 100644 --- a/machines/helium.nix +++ b/machines/helium.nix @@ -7,6 +7,8 @@ let in { imports = [ ./users.nix ]; + console.font = "${pkgs.fira-mono}/share/fonts/opentype/FiraMono-Regular.otf"; + security.sudo.wheelNeedsPassword = true; security.pam.yubico.enable = true; security.pam.yubico.debug = false; @@ -60,6 +62,7 @@ in { }; }; + hardware.video.hidpi.enable = true; hardware.enableAllFirmware = true; hardware.bluetooth.enable = true; hardware.bluetooth.package = pkgs.bluezFull; @@ -103,13 +106,19 @@ in { xserver.autorun = true; xserver.layout = "us"; xserver.libinput.enable = true; + xserver.libinput.mouse.additionalOptions = '' + Option "ScrollMethod" "Button" + Option "ScrollButton" "3" + ''; + xserver.libinput.mouse.buttonMapping = "1 2 8 4 5 6 7 3 9"; xserver.xkbOptions = "caps:ctrl_modifier"; + xserver.dpi = 331; xserver.displayManager.sddm.enable = true; xserver.windowManager.xmonad.enable = true; xserver.desktopManager.xterm.enable = true; - xserver.xautolock.enable = true; + xserver.xautolock.enable = false; xserver.xautolock.locker = "${pkgs.xlockmore}/bin/xlock -mode matrix"; xserver.xautolock.nowlocker = "${pkgs.xlockmore}/bin/xlock -mode matrix"; # xautolock -locknow xserver.xautolock.time = 5; # minutes @@ -144,7 +153,7 @@ in { }; systemd.services = { "xlock" = { - enable = true; + enable = false; script = "xlock"; path = [ pkgs.xlockmore ]; # nat sure about these targets @@ -183,6 +192,10 @@ in { sshUser = "ben"; sshKey = "/home/ben/.ssh/id_rsa"; system = "x86_64-linux"; + supportedFeatures = [ + "x86_64-linux" + "big-parallel" + ]; } ]; nix.distributedBuilds = true; diff --git a/pkgs/hledger-1.19.1.nix b/pkgs/hledger-1.19.1.nix deleted file mode 100644 index 11f4678..0000000 --- a/pkgs/hledger-1.19.1.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ mkDerivation, aeson, ansi-terminal, base, base-compat-batteries -, bytestring, cmdargs, containers, data-default, Decimal, Diff -, directory, extra, filepath, hashable, haskeline, hledger-lib -, lucid, math-functions, megaparsec, mtl, old-time, parsec -, pretty-show, process, regex-tdfa, safe, shakespeare, split -, stdenv, tabular, tasty, temporary, terminfo, text, time, timeit -, transformers, unordered-containers, utf8-string, utility-ht -, wizards -}: -mkDerivation { - pname = "hledger"; - version = "1.19.1"; - sha256 = "d5c1eb6d8de5cf2d82771db1796b57a304095fa940773a6405c9cd8085f3da71"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson ansi-terminal base base-compat-batteries bytestring cmdargs - containers data-default Decimal Diff directory extra filepath - hashable haskeline hledger-lib lucid math-functions megaparsec mtl - old-time parsec pretty-show process regex-tdfa safe shakespeare - split tabular tasty temporary terminfo text time timeit - transformers unordered-containers utf8-string utility-ht wizards - ]; - executableHaskellDepends = [ - aeson ansi-terminal base base-compat-batteries bytestring cmdargs - containers data-default Decimal directory extra filepath haskeline - hledger-lib math-functions megaparsec mtl old-time parsec - pretty-show process regex-tdfa safe shakespeare split tabular tasty - temporary terminfo text time timeit transformers - unordered-containers utf8-string utility-ht wizards - ]; - testHaskellDepends = [ - aeson ansi-terminal base base-compat-batteries bytestring cmdargs - containers data-default Decimal directory extra filepath haskeline - hledger-lib math-functions megaparsec mtl old-time parsec - pretty-show process regex-tdfa safe shakespeare split tabular tasty - temporary terminfo text time timeit transformers - unordered-containers utf8-string utility-ht wizards - ]; - homepage = "http://hledger.org"; - description = "Command-line interface for the hledger accounting system"; - license = stdenv.lib.licenses.gpl3; -} diff --git a/pkgs/hledger-lib-1.19.1.nix b/pkgs/hledger-lib-1.19.1.nix deleted file mode 100644 index 329bade..0000000 --- a/pkgs/hledger-lib-1.19.1.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ mkDerivation, aeson, aeson-pretty, ansi-terminal, array, base -, base-compat-batteries, blaze-markup, bytestring, call-stack -, cassava, cassava-megaparsec, cmdargs, containers, data-default -, Decimal, directory, doctest, extra, fgl, file-embed, filepath -, Glob, hashtables, megaparsec, mtl, old-time, parsec -, parser-combinators, pretty-show, regex-tdfa, safe, split, stdenv -, tabular, tasty, tasty-hunit, template-haskell, text, time, timeit -, transformers, uglymemo, unordered-containers, utf8-string -}: -mkDerivation { - pname = "hledger-lib"; - version = "1.19.1"; - sha256 = "cabf263fe8a3c38822c9146b54a519fe56d369456c72be6db5a88c1c0208c15f"; - libraryHaskellDepends = [ - aeson aeson-pretty ansi-terminal array base base-compat-batteries - blaze-markup bytestring call-stack cassava cassava-megaparsec - cmdargs containers data-default Decimal directory extra fgl - file-embed filepath Glob hashtables megaparsec mtl old-time parsec - parser-combinators pretty-show regex-tdfa safe split tabular tasty - tasty-hunit template-haskell text time timeit transformers uglymemo - unordered-containers utf8-string - ]; - testHaskellDepends = [ - aeson aeson-pretty ansi-terminal array base base-compat-batteries - blaze-markup bytestring call-stack cassava cassava-megaparsec - cmdargs containers data-default Decimal directory doctest extra fgl - file-embed filepath Glob hashtables megaparsec mtl old-time parsec - parser-combinators pretty-show regex-tdfa safe split tabular tasty - tasty-hunit template-haskell text time timeit transformers uglymemo - unordered-containers utf8-string - ]; - homepage = "http://hledger.org"; - description = "A reusable library providing the core functionality of hledger"; - license = stdenv.lib.licenses.gpl3; -} diff --git a/profiles/laptop.nix b/profiles/laptop.nix index b571c00..b23e08d 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -27,7 +27,7 @@ fingerprint = { # get fingerprints with `autorandr --fingerprint` eDP-1 = "00ffffffffffff000daea814000000002c170104951f11780237459e55539229125054000000010101010101010101010101010101015e358096703814402c1c240034ad10000018000000fe004e3134304847452d4541310a20000000fe00434d4e0a202020202020202020000000fe004e3134304847452d4541310a20001f"; - HDMI-2 = "00ffffffffffff0006b3ba28c0f40300151f0103803e22782ab4a5ad4f449e250f50542308008140818081c081009500b300d1c001014dd000a0f0703e80303035006d552100001a565e00a0a0a02950302035006d552100001e000000fd00283c1ea03c000a202020202020000000fc00415355532056473238390a20200159020359f159010304121305141f100706025d5e5f60610e0f15161d1e20482309070783010000e200d56d030c002000383c20006001020367d85dc401788003681a00000101283ee6e305c301e50f00800100e6060701565500023a801871382d40582c45006d552100001e000000000000000000000000000000000000000063"; + HDMI-2 = "00ffffffffffff0006b3ba28c0f40300151f0103803e22782ab4a5ad4f449e250f50542308008140818081c081009500b300d1c001014dd000a0f0703e80303035006d552100001a565e00a0a0a02950302035006d552100001e000000fd00283c1ea03c000a202020202020000000fc00415355532056473238390a20200159020359f159010304121305141f100706025d5e5f60610e0f15161d1e20482309070783010000e200d56d030c001000383c20006001020367d85dc401788003681a00000101283ee6e305c301e50f00800100e6060701565500023a801871382d40582c45006d552100001e000000000000000000000000000000000000000073"; }; externalMonitor = rotate: { @@ -46,6 +46,7 @@ position = "0x0"; mode = "1920x1080"; rate = "60.00"; + dpi = 156; }; in { @@ -71,4 +72,47 @@ }; }; }; + + services.betterlockscreen.enable = true; + + services.picom = { + enable = true; + experimentalBackends = true; + backend = "glx"; + vSync = true; + + # Transparency/Opacity + inactiveOpacity = 0.70; + activeOpacity = 0.95; + opacityRules = [ + "100:class_g *?= 'Firefox'" + "100:class_g *?= 'Deadd-notification-center'" + "100:class_g *?= 'Rofi'" + ]; + + # Fading + fade = true; + fadeDelta = 5; + + # Shadows + shadowExclude = [ + "class_g = 'eww-topbar-btw'" + ]; + + settings = { + # Blur + blur-method = "dual_kawase"; + blur-strength = 8; + blur-backgroud-exclude = [ + "class_g = 'eww-topbar-btw'" + ]; + + # Radius + corner-radius = 10; + round-borders = 1; + rounded-corners-exclude = [ + "class_g = 'Custom-taffybar'" + ]; + }; + }; } |