From 51561857821558f62003b7a792286a1a7a1a11bf Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 3 Feb 2023 02:40:28 +0100 Subject: [PATCH 1/3] tv wiregrill: remove extra ! --- tv/2configs/wiregrill.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tv/2configs/wiregrill.nix b/tv/2configs/wiregrill.nix index d28a1ec29..edf65e979 100644 --- a/tv/2configs/wiregrill.nix +++ b/tv/2configs/wiregrill.nix @@ -28,8 +28,8 @@ in systemd.network.networks.wiregrill = { matchConfig.Name = "wiregrill"; address = - optional (!isNull cfg.net.ip4) (toCidrNotation cfg.net.ip4) ++ - optional (!isNull cfg.net.ip6) (toCidrNotation cfg.net.ip6); + optional (cfg.net.ip4 != null) (toCidrNotation cfg.net.ip4) ++ + optional (cfg.net.ip6 != null) (toCidrNotation cfg.net.ip6); }; tv.iptables.extra.filter.INPUT = [ "-p udp --dport ${toString cfg.net.wireguard.port} -j ACCEPT" From 3e4b31e65303581444d01156935c5cef48048079 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 3 Feb 2023 03:05:17 +0100 Subject: [PATCH 2/3] tv xmonad: allow settings gaps --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index eb61bd5cf..118f2da46 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -23,6 +23,7 @@ import System.Posix.Process (executeFile) import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace , removeEmptyWorkspace) import XMonad.Actions.CycleWS (toggleWS) +import XMonad.Layout.Gaps (Direction2D(U,R,D,L), gaps) import XMonad.Layout.NoBorders ( smartBorders ) import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall)) import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink)) @@ -58,13 +59,19 @@ main = getArgs >>= \case readEnv :: Data.Aeson.FromJSON b => String -> IO b readEnv name = - Data.Maybe.fromJust + readEnv' (error $ "could not get environment variable: " <> name) name + +readEnv' :: Data.Aeson.FromJSON b => b -> String -> IO b +readEnv' defaultValue name = + Data.Maybe.fromMaybe defaultValue . Data.Aeson.decodeStrict' . Data.ByteString.Char8.pack - <$> getEnv name + . Data.Maybe.fromMaybe mempty + <$> lookupEnv name mainNoArgs :: IO () mainNoArgs = do + myScreenGaps <- readEnv' [] "XMONAD_SCREEN_GAPS" :: IO [Int] myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension myTermFont <- getEnv "XMONAD_TERM_FONT" myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension @@ -89,6 +96,7 @@ mainNoArgs = do , workspaces = workspaces0 , layoutHook = refocusLastLayoutHook $ + gaps (zip [U,R,D,L] myScreenGaps) $ smartBorders $ ResizableTall 1 From af9e845e861b51d691102c1bc177dfe5e26fe63f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 3 Feb 2023 13:15:23 +0100 Subject: [PATCH 3/3] flameshot-once: move to tv --- lass/2configs/baseX.nix | 4 ++-- {krebs => tv}/5pkgs/haskell/flameshot-once.nix | 0 {krebs => tv}/5pkgs/simple/flameshot-once/default.nix | 0 {krebs => tv}/5pkgs/simple/flameshot-once/profile.nix | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename {krebs => tv}/5pkgs/haskell/flameshot-once.nix (100%) rename {krebs => tv}/5pkgs/simple/flameshot-once/default.nix (100%) rename {krebs => tv}/5pkgs/simple/flameshot-once/profile.nix (100%) diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index efd6c8a24..2e28d48b6 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -91,11 +91,11 @@ in { xorg.xhost xsel zathura - flameshot-once + flameshot (pkgs.writeDashBin "screenshot" '' set -efu - ${pkgs.flameshot-once}/bin/flameshot-once + ${pkgs.flameshot}/bin/flameshot ${pkgs.klem}/bin/klem '') ]; diff --git a/krebs/5pkgs/haskell/flameshot-once.nix b/tv/5pkgs/haskell/flameshot-once.nix similarity index 100% rename from krebs/5pkgs/haskell/flameshot-once.nix rename to tv/5pkgs/haskell/flameshot-once.nix diff --git a/krebs/5pkgs/simple/flameshot-once/default.nix b/tv/5pkgs/simple/flameshot-once/default.nix similarity index 100% rename from krebs/5pkgs/simple/flameshot-once/default.nix rename to tv/5pkgs/simple/flameshot-once/default.nix diff --git a/krebs/5pkgs/simple/flameshot-once/profile.nix b/tv/5pkgs/simple/flameshot-once/profile.nix similarity index 100% rename from krebs/5pkgs/simple/flameshot-once/profile.nix rename to tv/5pkgs/simple/flameshot-once/profile.nix