1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
This commit is contained in:
Kierán Meinhardt
2019-04-21 15:22:40 +02:00
parent 9dd2895a3c
commit 9d28068dfe
11 changed files with 32 additions and 16 deletions

View File

@@ -10,9 +10,9 @@
niveum.seafile.enable = true;
niveum.google-drive = {
niveum.google-drive = rec {
enable = true;
directory = "${config.users.users.me.home}/cloud/gdrive";
directory = "${user.home}/cloud/gdrive";
user = config.users.users.me;
};

View File

@@ -18,9 +18,11 @@
<configs/vscode.nix>
<configs/htop.nix>
<configs/dunst.nix>
# <configs/mopidy.nix>
<configs/mail.nix>
<configs/default.nix>
<configs/python.nix>
<configs/haskell.nix>
<configs/haskell>
<configs/hu-berlin.nix>
<configs/i3.nix>
<configs/mpv.nix>
@@ -43,9 +45,9 @@
<configs/zsh.nix>
<configs/bluetooth.nix>
<configs/theming.nix>
<configs/distrobump.nix>
<configs/tmux.nix>
<configs/themes/owickstrom-dark.nix>
<configs/distrobump.nix>
{
niveum.user = {
github = "kmein";

5
configs/gollum.nix Normal file
View File

@@ -0,0 +1,5 @@
{
services.gollum = {
enable = true;
};
}

View File

@@ -20,13 +20,18 @@
'';
};
services.hoogle = {
enable = true;
packages = import ./packages.nix;
};
environment.systemPackages = with pkgs; [
cabal2nix
stack2nix
cabal-install
hlint
haskellPackages.brittany
(haskellPackages.ghcWithHoogle (import <dot/haskells.nix>))
(haskellPackages.ghcWithHoogle (import ./packages.nix))
] ++ map haskell.lib.justStaticExecutables [
haskellPackages.ghcid
haskellPackages.hakyll

View File

@@ -1,4 +1,4 @@
{ config, ... }:
{ config, pkgs, ... }:
{
imports = [ <modules/hledger.nix> ];
@@ -7,6 +7,8 @@
server = {
enable = true;
user = config.users.users.me;
package = pkgs.unstable.hledger-web;
};
package = pkgs.unstable.hledger;
};
}

View File

@@ -122,7 +122,7 @@ if has("autocmd")
autocmd bufnewfile,bufread config set filetype=conf
autocmd bufnewfile,bufread *.elm packadd elm-vim | set filetype=elm shiftwidth=4
autocmd bufnewfile,bufread *.dhall packadd dhall-vim | set filetype=dhall
autocmd filetype haskell packadd haskell-vim
autocmd filetype haskell packadd haskell-vim | set keywordprg=hoogle\ -i
autocmd filetype javascript packadd vim-javascript
autocmd filetype make setlocal noexpandtab
autocmd filetype html packadd emmet-vim

View File

@@ -5,6 +5,7 @@ let
in {
options.niveum.hledger = {
enable = mkEnableOption "hledger";
package = mkOption { type = types.package; default = pkgs.hledger; };
server = {
enable = mkEnableOption "hledger server";
port = mkOption { type = pkgs.unstable.lib.types.port; default = 5000; };
@@ -15,11 +16,12 @@ in {
};
flags = mkOption { type = types.listOf types.str; default = []; };
user = mkOption { type = types.attrs; };
package = mkOption { type = types.package; default = pkgs.hledger-web; };
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.unstable.hledger ];
environment.systemPackages = [ cfg.package ];
systemd.services.hledger-web = mkIf cfg.server.enable {
description = "hledger server";
@@ -28,7 +30,7 @@ in {
serviceConfig = {
Restart = "always";
ExecStart = ''
${pkgs.unstable.hledger-web}/bin/hledger-web \
${cfg.server.package}/bin/hledger-web \
--port=${toString cfg.server.port} \
--host=${cfg.server.host} \
--capabilities=${concatStringsSep "," cfg.server.capabilities} \

View File

@@ -8,14 +8,14 @@ let
startAt = bot.time;
serviceConfig.Type = "oneshot";
wants = [ "network-online.target" ];
script = ''
script = lists.concatStringsSep "\n" (map (chatId: ''
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${bot.chatId}" \
-d chat_id="${chatId}" \
-d text="$(${bot.command})" ${
if bot.parseMode == null then ""
else "-d parse_mode=${bot.parseMode}"
}
'';
'') bot.chatIds);
};
in {
options.niveum.telegramBots = mkOption {
@@ -24,7 +24,7 @@ in {
enable = mkEnableOption "Telegram bot";
time = mkOption { type = types.str; };
token = mkOption { type = types.strMatching "[0-9A-Za-z:-]+"; };
chatId = mkOption { type = types.strMatching "[0-9]+|@[A-Za-z0-9]+"; };
chatIds = mkOption { type = types.listOf (types.strMatching "[0-9]+|@[A-Za-z0-9]+"); };
command = mkOption { type = types.str; };
parseMode = mkOption {
type = types.nullOr (types.enum ["HTML" "Markdown"]);

View File

@@ -14,7 +14,7 @@ in {
enable = true;
time = "08:00";
token = lib.strings.removeSuffix "\n" (builtins.readFile <secrets/telegram-kmein.token>);
chatId = "18980945";
chatIds = [ "18980945" ];
command = "${pkgs.literature-quote}/bin/literature-quote";
parseMode = "Markdown";
};
@@ -23,7 +23,7 @@ in {
enable = true;
time = "07:00";
token = lib.strings.removeSuffix "\n" (builtins.readFile <secrets/telegram-kmein.token>);
chatId = "@autorenkalender";
chatIds = [ "@autorenkalender" ];
command = "${pkgs.autorenkalender}/bin/autorenkalender";
};

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
{
imports = [
<configs>
<configs/default.nix>
{
services.xserver.xrandrHeads = [ "eDP1" ];
}