From 57d42270b6579cda5463fa03bd09ac05bc4ddec6 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 May 2020 16:44:53 +0200 Subject: tv imgur config: init --- tv/2configs/imgur.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tv/2configs/imgur.nix diff --git a/tv/2configs/imgur.nix b/tv/2configs/imgur.nix new file mode 100644 index 0000000..ba84fd2 --- /dev/null +++ b/tv/2configs/imgur.nix @@ -0,0 +1,25 @@ +with import ; +{ config, pkgs, ... }: { + + services.nginx.virtualHosts."ni.r" = { + locations."/image" = { + extraConfig = /* nginx */ '' + client_max_body_size 20M; + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port}; + proxy_pass_header Server; + ''; + }; + }; + + krebs.htgen.imgur = { + port = 7771; + script = /* sh */ '' + (. ${pkgs.htgen-imgur}/bin/htgen-imgur) + ''; + }; +} -- cgit v1.2.3 From 18accefeaf45648e8e88da3a9f97ecc49a59c833 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 May 2020 17:37:18 +0200 Subject: tv xmonad: add flameshot-once --- tv/2configs/xserver/default.nix | 7 +++++++ tv/5pkgs/haskell/xmonad-tv/src/Paths.hs | 3 +++ tv/5pkgs/haskell/xmonad-tv/src/main.hs | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 3577445..4e9e307 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -108,6 +108,13 @@ in { }; path = [ config.tv.slock.package + (pkgs.flameshot-once.override { + config.imgur.enable = true; + config.imgur.createUrl = "http://ni.r/image"; + config.imgur.deleteUrl = "http://ni.r/image/delete/%1"; + config.imgur.xdg-open.browser = "/etc/profiles/per-user/tv/bin/cr"; + config.timeout = 200; + }) pkgs.fzmenu pkgs.pulseaudioLight.out pkgs.rxvt_unicode diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs index dd21511..6b72355 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs @@ -3,6 +3,9 @@ module Paths where import Helpers.Path +flameshot :: FilePath +flameshot = findExecutable "flameshot-once" + otpmenu :: FilePath otpmenu = findExecutable "otpmenu" diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 400c87a..047239e 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -22,7 +22,8 @@ import qualified XMonad.StackSet as W import Data.Map (Map) import qualified Data.Map as Map import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook) -import XMonad.Hooks.ManageHelpers (doCenterFloat) +import XMonad.Hooks.ManageHelpers (doCenterFloat,doRectFloat) +import Data.Ratio import XMonad.Hooks.Place (placeHook, smart) import XMonad.Actions.PerWorkspaceKeys (chooseAction) @@ -66,6 +67,8 @@ mainNoArgs = do composeAll [ appName =? "fzmenu-urxvt" --> doCenterFloat , appName =? "pinentry" --> doCenterFloat + , title =? "Upload to Imgur" --> + doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8)) , placeHook (smart (1,0)) ] , startupHook = @@ -163,6 +166,8 @@ myKeys conf = Map.fromList $ , ((_4, xF86XK_AudioMute), pavucontrol []) , ((_4, xK_Prior), forkFile Paths.xcalib ["-invert", "-alter"] Nothing) + + , ((0, xK_Print), forkFile Paths.flameshot [] Nothing) ] where _4 = mod4Mask -- cgit v1.2.3 From 5588920842f989efede0890bbd23f863692986d1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 2 Jun 2020 23:32:15 +0200 Subject: tv xu: modernize luks config --- tv/1systems/xu/config.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 33f9539..503142b 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -113,9 +113,7 @@ with import ; boot.initrd.luks = { cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "xuca"; device = "/dev/sda2"; } - ]; + devices.xuca.device = "/dev/sda2"; }; fileSystems = { -- cgit v1.2.3 From 73da1e209e56ff0a3525e6e74a56db0c1c6b85f4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Jun 2020 00:44:03 +0200 Subject: tv urlwatch: add workaround for thp.io --- tv/2configs/urlwatch.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index 378b5d1..619b044 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -24,7 +24,13 @@ in { http://www.exim.org/ # ref src/nixpkgs/pkgs/tools/networking/urlwatch/default.nix - https://thp.io/2008/urlwatch/ + { + url = https://thp.io/2008/urlwatch/; + # workaround: ('Received response with content-encoding: gzip, but + # failed to decode it.', error('Error -3 while decompressing data: + # incorrect header check',)) + ignore_cached = true; + } # 2015-02-18 # ref ~/src/nixpkgs/pkgs/tools/text/qprint/default.nix -- cgit v1.2.3 From 55a0cd397b80c9d899dfccfb132e6c0940b82904 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Jun 2020 00:46:03 +0200 Subject: tv dnsmasq: listen only on configured interfaces --- tv/3modules/dnsmasq.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tv/3modules/dnsmasq.nix b/tv/3modules/dnsmasq.nix index ec927f9..ab24ac0 100644 --- a/tv/3modules/dnsmasq.nix +++ b/tv/3modules/dnsmasq.nix @@ -31,8 +31,9 @@ in { }; services.dnsmasq.enable = true; services.dnsmasq.extraConfig = '' + bind-interfaces dhcp-range=${cfg.dhcp-range} - interface=${cfg.interface} + listen-address=${cfg.address} ''; tv.iptables.extra.filter.INPUT = [ "-i ${cfg.interface} -p tcp -m tcp --dport bootps -j ACCEPT" -- cgit v1.2.3 From ab4bc6eddcfa371e28dbdbae4e1a8571ed183653 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Jun 2020 10:38:48 +0200 Subject: tv Xresources: enable service when using xserver --- tv/3modules/Xresources.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/3modules/Xresources.nix b/tv/3modules/Xresources.nix index ce7ac9a..ab233dd 100644 --- a/tv/3modules/Xresources.nix +++ b/tv/3modules/Xresources.nix @@ -1,7 +1,7 @@ with import ; { config, pkgs, ... }: let cfg = { - enable = config.tv.Xresources != {}; + enable = config.services.xserver.enable && config.tv.Xresources != {}; user = config.krebs.build.user; }; in { -- cgit v1.2.3 From 48e1ae48456d82015160fef74f548496385b40da Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Jun 2020 20:41:10 +0200 Subject: tv xmonad: configure prompt font --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 047239e..c83b411 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -18,6 +18,7 @@ import XMonad.Actions.CycleWS (toggleWS) import XMonad.Layout.NoBorders ( smartBorders ) import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall)) import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink)) +import qualified XMonad.Prompt import qualified XMonad.StackSet as W import Data.Map (Map) import qualified Data.Map as Map @@ -154,8 +155,8 @@ myKeys conf = Map.fromList $ , ((_4 , xK_comma ), sendMessage $ IncMasterN 1) , ((_4 , xK_period ), sendMessage $ IncMasterN (-1)) - , ((_4 , xK_a ), addWorkspacePrompt def) - , ((_4 , xK_r ), renameWorkspace def) + , ((_4 , xK_a ), addWorkspacePrompt promptXPConfig) + , ((_4 , xK_r ), renameWorkspace promptXPConfig) , ((_4 , xK_Delete ), removeEmptyWorkspace) , ((_4 , xK_Return ), toggleWS) @@ -189,6 +190,9 @@ myKeys conf = Map.fromList $ resetLayout = setLayout $ XMonad.layoutHook conf + promptXPConfig = + def { XMonad.Prompt.font = myFont } + pagerConfig :: PagerConfig pagerConfig = def -- cgit v1.2.3 From 2f58f18af7812f6da5e02969965e33aa50002111 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 17:30:22 +0200 Subject: tv zu: modernize luks config --- tv/1systems/zu/config.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index bbfcfaf..5a69601 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -18,9 +18,7 @@ with import ; boot.initrd.luks = { cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "zuca"; device = "/dev/sda2"; } - ]; + devices.zuca.device = "/dev/sda2"; }; fileSystems = { -- cgit v1.2.3 From b04c3a87f2b04680aee9430f60a6c81a7501a67b Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 18:00:21 +0200 Subject: tv nomic: modernize luks config --- tv/1systems/nomic/config.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix index 86f9b7e..cd8988d 100644 --- a/tv/1systems/nomic/config.nix +++ b/tv/1systems/nomic/config.nix @@ -17,9 +17,7 @@ with import ; boot.initrd.luks = { cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "luks1"; device = "/dev/sda2"; } - ]; + devices.luks1.device = "/dev/sda2"; }; # Don't use UEFI because current disk was partitioned/formatted for AO753. -- cgit v1.2.3 From e6ec05a09f13809583d820e45d430b2d3ca9e72f Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 20:04:18 +0200 Subject: tv querel displayManager: auto -> lightdm --- tv/1systems/querel/config.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tv/1systems/querel/config.nix b/tv/1systems/querel/config.nix index ac51f54..0640740 100644 --- a/tv/1systems/querel/config.nix +++ b/tv/1systems/querel/config.nix @@ -75,10 +75,7 @@ with import ; }; services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.auto = { - enable = true; - user = "itak"; - }; + services.xserver.displayManager.lightdm.enable = true; users.users.itak = { inherit (config.krebs.users.itak) home uid; -- cgit v1.2.3 From 5314afd05ad5cdb569c03954e4f13e63791cd7c7 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 20:20:49 +0200 Subject: tv querel: enable autoLogin --- tv/1systems/querel/config.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/1systems/querel/config.nix b/tv/1systems/querel/config.nix index 0640740..e58a9b2 100644 --- a/tv/1systems/querel/config.nix +++ b/tv/1systems/querel/config.nix @@ -75,6 +75,9 @@ with import ; }; services.xserver.desktopManager.plasma5.enable = true; + + services.xserver.displayManager.lightdm.autoLogin.enable = true; + services.xserver.displayManager.lightdm.autoLogin.user = "itak"; services.xserver.displayManager.lightdm.enable = true; users.users.itak = { -- cgit v1.2.3 From 171eb06e64a482b2ac84f3f7186026149fb22ad3 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 20:22:42 +0200 Subject: tv nomic: enable ~/bin --- tv/1systems/nomic/config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix index cd8988d..38cc623 100644 --- a/tv/1systems/nomic/config.nix +++ b/tv/1systems/nomic/config.nix @@ -45,6 +45,8 @@ with import ; fsType = "btrfs"; }; + environment.homeBinInPath = true; + environment.systemPackages = with pkgs; [ (writeDashBin "play" '' set -euf -- cgit v1.2.3 From 3d29789420e35df28dae751111e0807e3669eb07 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Jun 2020 20:26:53 +0200 Subject: tv alnus: modernize luks config --- tv/1systems/alnus/config.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tv/1systems/alnus/config.nix b/tv/1systems/alnus/config.nix index d54d5fc..21583f7 100644 --- a/tv/1systems/alnus/config.nix +++ b/tv/1systems/alnus/config.nix @@ -11,10 +11,8 @@ with import ; boot = { initrd = { availableKernelModules = [ "ahci" ]; - luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ { name = "luksroot"; device = "/dev/sda2"; } ]; - }; + luks.cryptoModules = [ "aes" "sha512" "xts" ]; + luks.devices.luksroot.devices = "/dev/sda2"; }; }; -- cgit v1.2.3 From 4dbed8bfab522b7b2bbb0f16ca695588ed054ab3 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 7 Jun 2020 11:05:26 +0200 Subject: tv wu: modernize luks config --- tv/1systems/wu/config.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index 4c491d6..d4114f0 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -18,9 +18,7 @@ with import ; boot.initrd.luks = { cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "wuca"; device = "/dev/sda2"; } - ]; + devices.wuca.device = "/dev/sda2"; }; fileSystems = { -- cgit v1.2.3