summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-02-03 13:28:15 +0100
committerlassulus <git@lassul.us>2023-02-03 13:28:15 +0100
commit66586d70beeb8c02a6ad695303d30709c17a1c27 (patch)
tree91f208975d677a659ac14164c36034ac44d06738
parent2fa9f8601ed3f5c81316b9b780a03d414b4de9b3 (diff)
parentaf9e845e861b51d691102c1bc177dfe5e26fe63f (diff)
Merge remote-tracking branch 'ni/master'
-rw-r--r--tv/2configs/wiregrill.nix4
-rw-r--r--tv/5pkgs/haskell/flameshot-once.nix (renamed from krebs/5pkgs/haskell/flameshot-once.nix)0
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/main.hs12
-rw-r--r--tv/5pkgs/simple/flameshot-once/default.nix (renamed from krebs/5pkgs/simple/flameshot-once/default.nix)0
-rw-r--r--tv/5pkgs/simple/flameshot-once/profile.nix (renamed from krebs/5pkgs/simple/flameshot-once/profile.nix)0
5 files changed, 12 insertions, 4 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"
diff --git a/krebs/5pkgs/haskell/flameshot-once.nix b/tv/5pkgs/haskell/flameshot-once.nix
index c8007ce9e..c8007ce9e 100644
--- a/krebs/5pkgs/haskell/flameshot-once.nix
+++ b/tv/5pkgs/haskell/flameshot-once.nix
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
diff --git a/krebs/5pkgs/simple/flameshot-once/default.nix b/tv/5pkgs/simple/flameshot-once/default.nix
index 0524c2cfa..0524c2cfa 100644
--- a/krebs/5pkgs/simple/flameshot-once/default.nix
+++ b/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
index 269f13a66..269f13a66 100644
--- a/krebs/5pkgs/simple/flameshot-once/profile.nix
+++ b/tv/5pkgs/simple/flameshot-once/profile.nix