1
0
Fork 0

Update formatting

This commit is contained in:
Malte Brandy 2022-08-11 11:50:05 +02:00
parent 9593ab0b67
commit 442f90023e
32 changed files with 659 additions and 585 deletions

View file

@ -4,7 +4,8 @@
config,
...
}: let
battery-watch = pkgs.writeHaskellScript
battery-watch =
pkgs.writeHaskellScript
{
name = "battery-watch";
bins = [pkgs.acpi];

View file

@ -1,5 +1,6 @@
{pkgs, ...}: {
home.packages = builtins.attrValues
home.packages =
builtins.attrValues
{
inherit (pkgs) discord signal-desktop tdesktop element-desktop;
weechat = pkgs.writeShellScriptBin "weechat" "ssh -t hera 'TMUX_TMPDIR=/run/user/1000 tmux -L weechat attach'";

View file

@ -1,11 +1,13 @@
{pkgs, ...}: let
plans = pkgs.privateValue
plans =
pkgs.privateValue
{
"workDay" = "pass";
"weekend" = "pass";
}
"plans";
createPlans = pkgs.writeHaskellScript
createPlans =
pkgs.writeHaskellScript
{
name = "create-plans";
bins = [pkgs.khal pkgs.vdirsyncer];

View file

@ -20,12 +20,14 @@
inherit
(pkgs)
# web
chromium
mumble
upower
speedtest-cli
acpi
# tools & office
feh
gimp
imagemagick
@ -38,6 +40,7 @@
beets
zbar
# media
ncpamixer
pavucontrol
playerctl

View file

@ -40,7 +40,8 @@
builtins.map filter.simpleSortList lists.sortLists
++ builtins.map filter.stupidList lists.stupidLists
++ builtins.map filter.notifications lists.notifications;
sortMail = pkgs.writeHaskellScript
sortMail =
pkgs.writeHaskellScript
{
name = "sort-mail-archive";
bins = [pkgs.notmuch pkgs.coreutils pkgs.mblaze pkgs.findutils];

View file

@ -4,7 +4,8 @@
config,
...
}: let
mail2rss = pkgs.writeHaskellScript
mail2rss =
pkgs.writeHaskellScript
{
name = "mail2rss";
bins = [pkgs.notmuch pkgs.mblaze pkgs.isync pkgs.logfeed];

View file

@ -34,7 +34,8 @@ in {
exe ([i|${modeDir}/#{mode}/activate|] :: String)
whenM (elem wallpaperCmd <$> pathBins) $ exe wallpaperCmd
'';
updateModes = pkgs.writeHaskellScript
updateModes =
pkgs.writeHaskellScript
{
name = "update-modes";
bins = [activateMode pkgs.git pkgs.nix-output-monitor];
@ -50,7 +51,8 @@ in {
nom_build nixPath (params ++ ["-o", "${modeDir}"])
activate_mode
'';
quickUpdateMode = pkgs.writeHaskellScript
quickUpdateMode =
pkgs.writeHaskellScript
{
name = "quick-update-mode";
bins = [updateModes pkgs.git pkgs.home-manager pkgs.nix-output-monitor];
@ -65,7 +67,8 @@ in {
ignoreFailure (home_manager (nixPath <> ["switch", "-A", [i|${hostName}-#{mode}|]])) &!> StdOut |> nom
update_modes
'';
selectMode = pkgs.writeHaskellScript
selectMode =
pkgs.writeHaskellScript
{
name = "select-mode";
bins = [

View file

@ -32,61 +32,88 @@ in {
inherit
(pkgs.vimPlugins)
# coc-tabnine (TODO: Why doesnt it work?)
# TODO: tabnine config in home-manager
# TODO: tabnine lsp: nix, rust, pandoc/latex lsp? was noch?
# ===
# Basic IDE plugins
coc-nvim
airline
# same word highlighting when not supported by language
coc-highlight
coc-explorer
# searches
coc-fzf
fzf-vim
# general whitespace
vim-trailing-whitespace
vim-autoformat
# Git
coc-git
# statusline, numberline and explorer infos
fugitive
# various git commands
# Commenting and Uncommenting
nerdcommenter
# Theme
papercolor-theme
vim-airline-themes
LanguageTool-nvim
vim-css-color
vista-vim
# ===
# Languages
# haskell syntax highlighting
haskell-vim
vim-hoogle
# nix syntax highlighting
vim-nix
vim-markdown
# latex
vimtex
coc-vimtex
# not sure if I need two
# ledger
vim-ledger
# rust
coc-rls
# python
coc-python
# css
coc-css
# yaml
coc-yaml
# json
coc-json
# html
coc-html
# dhall
dhall-vim
;
};

View file

@ -1,5 +1,6 @@
{pkgs, ...}: let
night-shutdown = pkgs.writeHaskellScript
night-shutdown =
pkgs.writeHaskellScript
{
name = "night-shutdown";
imports = [

View file

@ -1,5 +1,6 @@
{pkgs, ...}: let
status-script = pkgs.writeHaskell "status-script"
status-script =
pkgs.writeHaskell "status-script"
{
libraries = builtins.attrValues pkgs.myHaskellScriptPackages;
ghcEnv = {

View file

@ -85,7 +85,8 @@
};
};
in {
xdg.configFile."vdirsyncer/config".source = mkConfig
xdg.configFile."vdirsyncer/config".source =
mkConfig
(
pkgs.lib.fold (a: b: a // b)
{

View file

@ -5,7 +5,8 @@
}: let
modeFile = "${config.home.homeDirectory}/.mode";
wallPapers = "${config.home.homeDirectory}/media/images/wallpapers";
randomWallpaper = pkgs.writeHaskellScript
randomWallpaper =
pkgs.writeHaskellScript
{
name = "random-wallpaper";
imports = ["System.Random"];

View file

@ -9,7 +9,8 @@ with lib; let
configure = {availablePlugins, ...}: {
plugins = builtins.attrValues (availablePlugins
// {
python = availablePlugins.python.withPackages
python =
availablePlugins.python.withPackages
(_: [pkgs.weechatScripts.weechat-matrix]);
});
scripts = [pkgs.weechatScripts.weechat-matrix];

View file

@ -4,7 +4,8 @@
}: let
configPath = "/etc/nixos";
in {
update-system = pkgs.writeHaskellScript
update-system =
pkgs.writeHaskellScript
{
name = "update-system";
bins = [nixos-rebuild pkgs.nix-output-monitor pkgs.nvd];

View file

@ -36,11 +36,13 @@ let
fetch_git = name: spec: let
ref =
spec.ref
or (if spec ? branch
or (
if spec ? branch
then "refs/heads/${spec.branch}"
else if spec ? tag
then "refs/tags/${spec.tag}"
else abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!");
else abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"
);
in
builtins.fetchGit {
url = spec.repo;

View file

@ -5,7 +5,8 @@
...
}:
with lib; let
adminCreds = pkgs.privateValue
adminCreds =
pkgs.privateValue
{
adminpass = "";
dbpass = "";

View file

@ -64,7 +64,8 @@ in {
systemd.services =
{
pg_backup = {
script = lib.concatMapStringsSep "\n"
script =
lib.concatMapStringsSep "\n"
(name: "${config.services.postgresql.package}/bin/pg_dump ${name} > /var/lib/db-backup-dumps/${name}")
config.services.postgresql.ensureDatabases;
serviceConfig = {

View file

@ -29,7 +29,8 @@ in {
};
rspamd.locals = {
"multimap.conf".text = let
allow-ip = builtins.toFile "allow-ip.map" ''
allow-ip =
builtins.toFile "allow-ip.map" ''
'';
allow-host = builtins.toFile "allow-host.map" ''
gmx.de

View file

@ -19,7 +19,8 @@
resolvconf.dnsExtensionMechanism = false; # this breaks dnssec but is necessary for certain bad-behaved hotspots
firewall.allowPing = true;
useDHCP = false; # enabled per interface
hosts = lib.zipAttrs
hosts =
lib.zipAttrs
(
lib.mapAttrsToList
(host: ip:

View file

@ -9,7 +9,8 @@
IgnoreBody = false;
SkipMarkdown = false;
};
email2matrix-config = pkgs.writeText "email2matrix-config.json"
email2matrix-config =
pkgs.writeText "email2matrix-config.json"
(builtins.toJSON {
Smtp = {
ListenInterface = "[::1]:2525";

View file

@ -20,12 +20,16 @@
inherit
(pkgs)
# For all my terminal needs.
nerdfonts
# nice text font
libertinus
# icons in my app
material-icons
# sans font, very good for displays
b612
;
};

View file

@ -5,7 +5,8 @@
...
}: let
gitoliteCfg = config.services.gitolite;
post-update = pkgs.writeHaskellScript
post-update =
pkgs.writeHaskellScript
{
name = "post-update";
bins = [pkgs.git pkgs.laminar];

View file

@ -52,7 +52,8 @@
options = {inherit empty heat active force_active only_lights;};
};
};
fenster = map (name: "binary_sensor.${name}")
fenster =
map (name: "binary_sensor.${name}")
[
"kuechenfenster"
"wohnzimmerfenster"
@ -439,7 +440,8 @@ in {
];
action = [
{
service = jinja.if'
service =
jinja.if'
(jinja.or
(jinja.isStates (util.modeSelectEntity modes.wohnzimmer) ["force_active" "only_lights"])
(jinja.and
@ -459,7 +461,8 @@ in {
];
action = [
{
service = jinja.if'
service =
jinja.if'
(jinja.or
(jinja.isStates (util.modeSelectEntity modes.schlafzimmer) ["force_active" "only_lights"])
(jinja.and
@ -527,7 +530,8 @@ in {
}
{
alias = "Warnung bei niedrigem Akkustand";
trigger = map
trigger =
map
(limit: {
platform = "numeric_state";
below = toString limit;
@ -562,7 +566,8 @@ in {
++ (map
(minutes: {
alias = "Warnung bei ${minutes} Minuten offenem Fenster oder offener Tür";
trigger = map
trigger =
map
(name:
triggers.stateTrigger name
// {

View file

@ -20,7 +20,8 @@
nix_build $ ["--show-trace", "-o", [i|/var/cache/gc-links/${name}-config-#{hostname}|]] ++ flags ++ ${drv}
say [i|Build of ${name} config for #{hostname} was successful.|]
'';
test-system-config = pkgs.writeHaskellScript
test-system-config =
pkgs.writeHaskellScript
{
name = "test-system-config";
inherit bins;
@ -31,7 +32,8 @@
buildSystemParams ++ paths ++ ["-I", [i|nixos-config=#{configDir}/nixos/machines/#{hostname}/configuration.nix|]]''
);
test-home-config = pkgs.writeHaskellScript
test-home-config =
pkgs.writeHaskellScript
{
name = "test-home-config";
inherit bins;
@ -82,7 +84,8 @@ in {
services.laminar.cfgFiles.jobs =
{
"test-config.run" = let
test-config = pkgs.writeHaskell "test-config"
test-config =
pkgs.writeHaskell "test-config"
{
libraries = builtins.attrValues pkgs.myHaskellScriptPackages;
ghcEnv = {
@ -99,7 +102,8 @@ in {
FLAGS="" PATH=${standardPath}:$PATH ${test-config}
'';
"bump-config.run" = let
bump-config = pkgs.writeHaskell "bump-config"
bump-config =
pkgs.writeHaskell "bump-config"
{
libraries = builtins.attrValues pkgs.myHaskellScriptPackages;
ghcEnv.PATH = "${standardPath}:$PATH";
@ -117,7 +121,8 @@ in {
allowedCommands = [deployCommand];
in [
{
commands = map
commands =
map
(
command: {
inherit command;

View file

@ -33,7 +33,8 @@ in {
hyperkitty.enable = false;
settings = {
mailman.default_language = "de";
"paths.fhs".template_dir = lib.mkForce
"paths.fhs".template_dir =
lib.mkForce
(
pkgs.setToDirectories {
site.de = {

View file

@ -17,7 +17,8 @@ in {
};
synapse-cleanup = {
serviceConfig = {
ExecStart = pkgs.writeHaskell "synapse-cleanup"
ExecStart =
pkgs.writeHaskell "synapse-cleanup"
{
libraries =
builtins.attrValues pkgs.myHaskellScriptPackages
@ -80,7 +81,8 @@ in {
matrix-synapse = {
enable = true;
settings = let
server-secrets = pkgs.privateValue
server-secrets =
pkgs.privateValue
{
registration_shared_secret = "";
macaroon_secret_key = "";

View file

@ -1,5 +1,6 @@
self: super: {
pass-clip = self.callPackage
pass-clip =
self.callPackage
({
stdenv,
fetchFromGitHub,

View file

@ -6,10 +6,13 @@ let
explicitUsePrivate = builtins.getEnv var == "true";
explicitNotUsePrivate = builtins.getEnv var == "false";
usePrivate = !explicitNotUsePrivate && (explicitUsePrivate || privateExists);
withSecrets = builtins.trace
(if usePrivate
withSecrets =
builtins.trace
(
if usePrivate
then assert privateExists; "Building _with_ secrets!"
else "Building _without_ secrets!")
else "Building _without_ secrets!"
)
usePrivate;
in {
inherit withSecrets;