Compare commits

...

9 commits

Author SHA1 Message Date
Anish Lakhwara 0897332293 add nix-matrix-appserivce overlay 2023-01-02 19:59:00 +10:00
Anish Lakhwara 90db0af0ec move scripts from xinit to cli 2023-01-02 19:58:34 +10:00
Anish Lakhwara 2236734ded add my-mautrix-discord 2023-01-02 19:58:26 +10:00
Anish Lakhwara a98ede44c7 fix mautrix signal service
use my-discord-mautrix
2023-01-02 19:57:23 +10:00
Anish Lakhwara 5e49e3bb44 tk-calendar drv 2023-01-01 16:49:09 +10:00
Anish Lakhwara 19aebb049d bspwm terminal swallowing, dosen't work for mpv?? 2023-01-01 16:48:35 +10:00
Anish Lakhwara 801a5e1e23 live-reloading fennel with love! 2023-01-01 16:48:25 +10:00
Anish Lakhwara 55aea142fe add more matrix bridges through flake input 2023-01-01 16:48:11 +10:00
Anish Lakhwara a8b735e34d add kobo utils 2023-01-01 16:48:01 +10:00
14 changed files with 321 additions and 45 deletions

View file

@ -67,6 +67,21 @@
"type": "github" "type": "github"
} }
}, },
"devshell": {
"locked": {
"lastModified": 1642188268,
"narHash": "sha256-DNz4xScpXIn7rSDohdayBpPR9H9OWCMDOgTYegX081k=",
"owner": "numtide",
"repo": "devshell",
"rev": "696acc29668b644df1740b69e1601119bf6da83b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"dirt-samples-src": { "dirt-samples-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -140,6 +155,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1641205782,
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1638122382,
@ -260,7 +291,59 @@
"type": "github" "type": "github"
} }
}, },
"nix-matrix-appservices": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_3",
"nixlib": "nixlib",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1663958238,
"narHash": "sha256-l4VrBCswq500YwsgjK7M8HUmnVWrHYY7DKZ7uZK5Abg=",
"owner": "coffeetables",
"repo": "nix-matrix-appservices",
"rev": "efdc09f26e3b01801edaa3b0e2bdd46d9d133bba",
"type": "gitlab"
},
"original": {
"owner": "coffeetables",
"repo": "nix-matrix-appservices",
"type": "gitlab"
}
},
"nixlib": {
"locked": {
"lastModified": 1643502816,
"narHash": "sha256-Wrbt6Gs+hjXD3HUICPBJHKnHEUqiyx8rzHCgvqC1Bok=",
"owner": "divnix",
"repo": "nixpkgs.lib",
"rev": "ebed7ec5bcb5d01e298535989c6c321df18b631a",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1662099760,
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "67e45078141102f45eff1589a831aeaa3182b41e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1670193339, "lastModified": 1670193339,
"narHash": "sha256-oHTAhX4p6+uxcabq0rKL4EyKWPbDLGKec88ocPIU/2Y=", "narHash": "sha256-oHTAhX4p6+uxcabq0rKL4EyKWPbDLGKec88ocPIU/2Y=",
@ -276,7 +359,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1662446902, "lastModified": 1662446902,
"narHash": "sha256-Dmsd3jSG2ldZUlhFaIwunqgMf14EEK7ylXpw+OPDLxE=", "narHash": "sha256-Dmsd3jSG2ldZUlhFaIwunqgMf14EEK7ylXpw+OPDLxE=",
@ -308,15 +391,15 @@
}, },
"poonam": { "poonam": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"vimwiki-cli": "vimwiki-cli" "vimwiki-cli": "vimwiki-cli"
}, },
"locked": { "locked": {
"lastModified": 1672200014, "lastModified": 1672372801,
"narHash": "sha256-gJW+GktGJAMmb5WRs2rcUQI673Jx148pWwwejJjIL04=", "narHash": "sha256-/Zqrr9zs8z7cpQOsO3VIxVMCV1lvDu/KfPski3q+lRs=",
"ref": "main", "ref": "main",
"rev": "7143809a518037b4ad4ef0762a3e8f42cd99a790", "rev": "273db2bb490748ad07755421278acec1538b9e5c",
"revCount": 473, "revCount": 476,
"type": "git", "type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
}, },
@ -335,7 +418,8 @@
"grasp": "grasp", "grasp": "grasp",
"hardware": "hardware", "hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nix-matrix-appservices": "nix-matrix-appservices",
"nixpkgs": "nixpkgs_2",
"nur": "nur", "nur": "nur",
"poonam": "poonam", "poonam": "poonam",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",

View file

@ -24,6 +24,8 @@
basant.inputs.poonam.follows = "poonam"; basant.inputs.poonam.follows = "poonam";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main"; grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs"; grasp.inputs.nixpkgs.follows = "nixpkgs";
# Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
# Others # Others
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
rust-overlay = { rust-overlay = {
@ -55,6 +57,7 @@
, agenix , agenix
, basant , basant
, grasp , grasp
, nix-matrix-appservices
, nur , nur
, tidalcycles , tidalcycles
, rust-overlay , rust-overlay
@ -92,6 +95,7 @@
tidalcycles.overlays.default tidalcycles.overlays.default
agenix.overlay agenix.overlay
nur.overlay nur.overlay
nix-matrix-appservices.overlay
unstableOverlay unstableOverlay
self.overlays.additions self.overlays.additions
self.overlays.modifications self.overlays.modifications
@ -177,6 +181,7 @@
agenix.nixosModules.age agenix.nixosModules.age
self.nixosModules.backup self.nixosModules.backup
self.nixosModules.hesienbridge self.nixosModules.hesienbridge
nix-matrix-appservices.nixosModule
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -244,6 +249,7 @@
}; };
lituus = { lituus = {
hostname = "sealight.xyz"; hostname = "sealight.xyz";
autoRollback = false;
profiles.system = { profiles.system = {
user = "root"; user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus;

View file

@ -83,6 +83,40 @@
#!/usr/bin/env bash #!/usr/bin/env bash
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
'') '')
(pkgs.writeScriptBin "monitor" ''
# hotplug
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto
xrandr --output HDMI-2 --same-as eDP-1
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "disconnect-keyboard" ''
# keyboard on curve is busted
get_keyboard_id() {
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
}
disconnect_keyboard() {
id=$(get_keyboard_id)
xinput float $id
unset id
}
attach_keyboard() {
id=$(get_keyboard_id)
xinput reattach $id 3
unset id
}
disconnect_keyboard
'')
]; ];
programs.zsh = { programs.zsh = {
@ -99,15 +133,15 @@
TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo"; # Needed to run home-manager switch on non-nixOS TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo"; # Needed to run home-manager switch on non-nixOS
}; };
plugins = [ plugins = [
# { {
# name = "zsh-autocomplete"; name = "zsh-autocomplete";
# src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
# owner = "marlonrichert"; owner = "marlonrichert";
# repo = "zsh-autocomplete"; repo = "zsh-autocomplete";
# rev = "22.01.21"; rev = "22.01.21";
# sha256 = "+UziTYsjgpiumSulrLojuqHtDrgvuG91+XNiaMD7wIs="; sha256 = "+UziTYsjgpiumSulrLojuqHtDrgvuG91+XNiaMD7wIs=";
# }; };
# } }
{ {
name = "zsh-autopair"; name = "zsh-autopair";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {

View file

@ -117,6 +117,7 @@ in
".local/bin/screenshot".source = ./bin/screenshot; ".local/bin/screenshot".source = ./bin/screenshot;
".local/bin/mpv-ify".source = ./bin/mpv-ify; ".local/bin/mpv-ify".source = ./bin/mpv-ify;
".local/bin/bspwallow".source = ./bin/bspswallow; ".local/bin/bspwallow".source = ./bin/bspswallow;
".config/bspwm/terminals".text = "Kitty";
".config/eww/eww.yuck".source = ./eww/eww.yuck; ".config/eww/eww.yuck".source = ./eww/eww.yuck;
".config/eww/eww.scss".source = ./eww/eww.scss; ".config/eww/eww.scss".source = ./eww/eww.scss;
".config/eww/widgets.yuck".source = ./eww/widgets.yuck; ".config/eww/widgets.yuck".source = ./eww/widgets.yuck;

View file

@ -260,6 +260,8 @@ in
" Sexp in Conjure (since it's fennel) " Sexp in Conjure (since it's fennel)
let g:sexp_filetypes = "clojure,scheme,lisp,janet,fennel,yuck" let g:sexp_filetypes = "clojure,scheme,lisp,janet,fennel,yuck"
let g:conjure#filetype#fennel = "conjure.client.fennel.stdio" let g:conjure#filetype#fennel = "conjure.client.fennel.stdio"
" we only use fennel with love
let g:conjure#client#fennel#stdio#command = "love ."
" let g:conjure#extract#tree_sitter#enabled = true " let g:conjure#extract#tree_sitter#enabled = true
map <localleader>lt :ConjureLogToggle<CR> map <localleader>lt :ConjureLogToggle<CR>

View file

@ -166,35 +166,6 @@ in
*.color240: #6272a4 *.color240: #6272a4
*.color241: #b6b6b2 *.color241: #b6b6b2
EOF EOF
# hotplug
connect() {
xrandr --output HDMI-2 --same-as eDP-1
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
# keyboard on curve is busted
get_keyboard_id() {
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
}
disconnect_keyboard() {
id=$(get_keyboard_id)
xinput float $id
unset id
}
attach_keyboard() {
id=$(get_keyboard_id)
xinput reattach $id 3
}
disconnect_keyboard
''; '';
lightdm = { lightdm = {
enable = true; enable = true;

View file

@ -3,6 +3,7 @@
{ {
imports = [ imports = [
./mautrix-telegram.nix ./mautrix-telegram.nix
./mautrix-services.nix
# ./mautrix-discord.nix # ./mautrix-discord.nix
# ./mautrix-whatsapp.nix # ./mautrix-whatsapp.nix
# ./mautrix-slack.nix # ./mautrix-slack.nix
@ -40,11 +41,15 @@
tls = false; tls = false;
} }
]; ];
app_service_config_files = [ app_service_config_files = [
# The registration file is automatically generated after starting the appservice for the first time. # The registration file is automatically generated after starting the appservice for the first time.
# cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/ # cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/
# chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml # chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml
"/var/lib/matrix-synapse/telegram-registration.yaml" "/var/lib/matrix-synapse/telegram-registration.yaml"
"/var/lib/matrix-synapse/signal-registration.yaml"
"/var/lib/matrix-as-whatsapp/whatsapp-registration.yaml"
"/var/lib/matrix-as-discord/discord-registration.yaml"
# "/var/lib/matrix-synapse/slack-registration.yaml" # "/var/lib/matrix-synapse/slack-registration.yaml"
# "/var/lib/matrix-synapse/discord-registration.yaml" # "/var/lib/matrix-synapse/discord-registration.yaml"
# "/var/lib/matrix-synapse/whatsapp-registration.yaml" # "/var/lib/matrix-synapse/whatsapp-registration.yaml"

View file

@ -0,0 +1,52 @@
{ config, lib, pkgs, ... }:
{
# Mautrix-signal settings
services.signald.enable = true;
systemd.services.matrix-as-signal = {
requires = [ "signald.service" ];
after = [ "signald.service" ];
unitConfig = {
JoinsNamespaceOf = "signald.service";
};
path = [
pkgs.ffmpeg # voice messages need `ffmpeg`
];
};
services.matrix-appservices = {
addRegistrationFiles = false;
homeserverURL = "https://sealight.xyz/";
homeserverDomain = "sealight.xyz";
services = {
whatsapp = {
port = 29183;
format = "mautrix-go";
package = pkgs.mautrix-whatsapp;
};
discord = {
port = 29188;
format = "mautrix-go";
package = pkgs.my-mautrix-discord;
};
signal = {
port = 29184;
format = "mautrix-python";
package = pkgs.mautrix-signal;
serviceConfig = {
StateDirectory = [ "matrix-as-signal" "signald" ];
SupplementaryGroups = [ "signald" ];
TimeoutStopSec = 1; # work around the service ignoring SIGTERM, see https://gitlab.com/coffeetables/nix-matrix-appservices/-/issues/12
User = lib.mkForce config.services.signald.user;
Group = lib.mkForce config.services.signald.group;
};
settings.signal = {
socket_path = config.services.signald.socketPath;
outgoing_attachment_dir = "/var/lib/signald/tmp";
};
};
};
};
}

View file

@ -10,6 +10,33 @@
calibre-web = prev.calibre-web.overrideAttrs (prevAttrs: rec { calibre-web = prev.calibre-web.overrideAttrs (prevAttrs: rec {
propagatedBuildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.jsonschema ]; # allow kobo sync stuff propagatedBuildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.jsonschema ]; # allow kobo sync stuff
}); });
# Need to do server and agent too, maybe
# woodpecker-cli-next =
# let
# common = prev.callPackage "${inputs.unstable}/pkgs/development/tools/continuous-integration/woodpecker/common.nix" { };
# in
# (prev.buildGoModule rec {
# pname = "woodpecker-cli";
# version = "next-${inputs.woodpecker.shortRev}";
# src = inputs.woodpecker;
# vendorSha256 = "sha256-8st1LdgrQQqEZ6oSBm/nE1WI/v7NI+f56qZJySJIFJw=";
# inherit (common) postBuild;
# subPackages = "cmd/cli";
# ldflags = [
# "-s"
# "-w"
# "-X github.com/woodpecker-ci/woodpecker/version.Version=${version}"
# ];
# CGO_ENABLED = 0;
# meta = common.meta // {
# description = "Command line client for the Woodpecker Continuous Integration server";
# };
# });
# example = prev.example.overrideAttrs (oldAttrs: rec { # example = prev.example.overrideAttrs (oldAttrs: rec {
# ... # ...
# }); # });

View file

@ -5,4 +5,6 @@
plymouth-themes = pkgs.callPackage ./plymouth.nix { }; plymouth-themes = pkgs.callPackage ./plymouth.nix { };
tic-80 = pkgs.callPackage ./tic-80.nix { }; tic-80 = pkgs.callPackage ./tic-80.nix { };
fennel-ls = pkgs.callPackage ./fennel-ls.nix { }; fennel-ls = pkgs.callPackage ./fennel-ls.nix { };
kobopatch = pkgs.callPackage ./kobopatch.nix { };
my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input
} }

22
pkgs/kobopatch.nix Normal file
View file

@ -0,0 +1,22 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
name = "kobopatch";
version = "0.15.0";
vendorSha256 = "1i6srhyig4x8mywyc2l8wzzm1afvb7wxmjsr84c447sb1xss6p7x";
src = fetchFromGitHub {
owner = "geek1011";
repo = "kobopatch";
rev = "653070c67c83ec61884854efc4f8a3132d82a2e5";
sha256 = "09hr3zh0w0f78cx40d2yydqv0mmjdh4iwdgia7sikraphvha85nn";
};
meta = with lib; {
description = "A patch maker for kobo eReader devices.";
homepage = "https://github.com/geek1011/kobopatch";
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
};
}

23
pkgs/koboutils.nix Normal file
View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
name = "koboutils";
version = "git_2020-04-08";
vendorSha256 = "1hqvizvbc29yib6awmvlklxkq7j8c0d32gxsipdiwhkh79xbd6wq";
deleteVendor = true;
src = fetchFromGitHub {
owner = "geek1011";
repo = "koboutils";
rev = "50024f2afc6b20205a273ffcbb72c934b80bba96";
sha256 = "0zpmjya13wbmpxbwrpbvw7d2rb040wmc09djhnn6dszlqpflwxmy";
};
meta = with lib; {
description = "Various utilities for Kobo eReaders";
homepage = "https://github.com/geek1011/koboutils";
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
};
}

29
pkgs/mautrix-discord.nix Normal file
View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub, olm }:
buildGoModule rec {
pname = "mautrix-discord";
version = "unstable-2022-11-04";
src = fetchFromGitHub {
owner = "mautrix";
repo = "discord";
rev = "f53975cc91e3c643a722adf0d3e0dfb98d0127a2";
hash = "sha256-xUALcN5oQfwC6gmOeygCkOAXJrJzNitBxHRFAKKgFvE=";
};
buildInputs = [ olm ];
vendorHash = "sha256-yday2mSnPwuhXWkCG4XY7qoBl3DXHcSvzBoZbjgYz/c=";
ldflags = [ "-s" "-w" ]; # https://github.com/NixOS/nixpkgs/issues/177698
doCheck = false; # No tests available
meta = with lib; {
homepage = "https://go.mau.fi/mautrix-discord";
description = "Matrix to Discord hybrid puppeting/relaybot bridge";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ robin ];
};
}

18
pkgs/tkcalendar-py.nix Normal file
View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
pkgs.python.buildPythonPackage rec {
pname = "tkcalendar";
version = "1.6.1";
src = pkgs.fetchFromGitHub {
owner = "j4321";
repo = "tkcalendar";
rev = "v${version}";
sha256 = "";
};
propagatedBuildInputs = [
pkgs.python310Packages.babel
];
pythonImportsCheck = [ "tkcalendar" ];
}