Create nix module drumknotty which manages worblehat and dibbler for skrot. #129
Reference in New Issue
Block a user
Delete Branch "drumknotty"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DrumknoTTY is a nix module that owns the screen session that skrot runs. Inside the screen session it spawns two windows and programs: dibbler and worblehat. This is essentially done to deploy worblehat. Both dibbler and worblehat each have a module that allows them to start in a screen session, but this essentially combines these two modules into one.
This might also require updating some inputs such as worblehat.
Kan/vil du slå sammen noen commits her, typ fixupe de fix-commitene i en interactive rebase eller noe, sånn at det blir en håndfull gode commits når vi merger inn i main?
Jeg har allerede slått sammen en del av commitsa med en interactive rebase, men ikke så mange for det meste typos og slikt.
Greien er at ting ikke egentlig funker i det hele tatt før siste commit her da, men jeg kan slå sammen sånn at man ender opp med commits som har en successful nix flake eval.
Nice, ser bra ut nå! Er det denne konfigen som kjører live på skrot, eller er den ellers testet?
Vent gjerne på ordentlig oysteikt-review, men jeg ser ingen blinkende varsellys her ved gjennomlesing
Den kjører ikke live på skrot siden den rebygger seg tilbake til forrige versjon på natten, men jeg har spesifikt testet det på skrot ja.
Jeg tror nok oysteikt har en del kommentarer på det her siden det i praksis dupliserer modulene til både dibbler og worblehat. Det er jo mulig å flytte kode og deuplisere, men det er et utgangspunkt som fungerer.
Det er derimot ett problem, og det er at worblehat er default når den starter opp. Det er fordi screen alltid starter på vinduet som nyligst ble lagd, og jeg har ikke funnet ut en kommando som lar deg bestemme hvilket vindu man skal koble til først.
Nå skal det problemet være løst.
Et annet problem er at screen bruker 0-indexing, noe som er upraktisk i forhold til keybinds. Det er fordi at man kan bytte mellom vinduer basert på index, og 0 og 1 er langt unna hverandre. Antakeligvis kan man konfigurere dette da.
395102c182toe64b75f5c5If it works in the current state, feel free to merge. The comments I left are mostly things that could be fixed later
@@ -191,2 +194,4 @@self.nixosModules.drumknottyinputs.disko.nixosModules.diskoinputs.dibbler.nixosModules.defaultinputs.worblehat.nixosModules.defaultI don't think the
dibblerandworblehatmodules are being used anymore, now that all config is made through the drumknotty module. The overlays need to stay thoughDon't you just have to remove the two lines?
Sure, that would fix it here at least. Not sure what to do about the leftover modules in the long run, they are kinda useful for testing but might become a pain to maintain.
@@ -0,0 +74,4 @@extraGroups = [ "lp" ];isNormalUser = true;# TODO: make this display the error log or error message in case thatThis is 100% gonna bootloop in the future, should probably be made a priority despite not being necessary.
@@ -0,0 +166,4 @@config = "/etc/worblehat/config.toml";};in lib.optionals cfg.worblehat.enable ["screen -t worblehat ${lib.getExe cfg.worblehat.package} ${worblehatArgs} cli"Using screen windows for now is probably fine, but it would be kinda nice at some point to add a hotkey daemon or something that would let you press a single key to toggle windows. Maybe
actkbd? Then we can bind it to a numpad key or something, and add a label on top of the key to press or use the numpad that is (were?) hanging on the wall.@@ -0,0 +95,4 @@requiredBy = [ "drumknotty-screen-session.service" ];before = [ "drumknotty-screen-session.service" ];after = [ "postgresql.service" ];You'll likely want something along the lines of
restartTriggers = config.environment.etc."dibbler/dibbler.toml".sourcehere, and for every other unit that should restart whenever the content of that file changes. Same for worblehat@@ -0,0 +149,4 @@ensureClauses.login = true;}];};Should probably add some sort of unit here that handles database migrations before startup, can be done in another pr
@@ -0,0 +138,4 @@ExecStart =letscreenrc = letWhy use screenrc? This is not necessary.
It simplified the logic quite a bit. If we want to be able to toggle worblehat/dibbler separately, we would've needed to make the command added to
ExecStartconditionally worblehat or dibbler, and the same conditionals in theExecStartPost(as not to start worblehat twice if dibbler was disabled).By just providing the screenrc script to screen, it removes the need to shuffle head and tail between two directives. The code for generating this file could likely be improved though.
Ok, that is fair.
1d8e56af7etod3562899d4