2020-05-16 11:20:32 +00:00
|
|
|
let
|
2021-05-18 14:33:28 +00:00
|
|
|
inherit (import (import ../nix/sources.nix).nixos-unstable { }) lib;
|
2021-07-09 11:48:25 +00:00
|
|
|
restrictedPages = [
|
|
|
|
"reddit.com"
|
|
|
|
"github.com"
|
|
|
|
"*.ccc.de"
|
|
|
|
"haskell.org"
|
|
|
|
"*.haskell.org"
|
|
|
|
"*.nixos.org"
|
|
|
|
"nixos.org"
|
|
|
|
"matrix.org"
|
|
|
|
"element.io"
|
|
|
|
"youtube.de"
|
|
|
|
"youtube.com"
|
|
|
|
"*.element.io"
|
|
|
|
"zeit.de"
|
|
|
|
"heise.de"
|
|
|
|
"spiegel.de"
|
|
|
|
"xkcd.com"
|
|
|
|
"smbc-comics.com"
|
|
|
|
"tagesschau.de"
|
|
|
|
"welt.de"
|
|
|
|
"ndr.de"
|
|
|
|
"ard.de"
|
|
|
|
"zdf.de"
|
|
|
|
"twitter.com"
|
|
|
|
"chaos.social"
|
|
|
|
];
|
2021-07-19 22:48:05 +00:00
|
|
|
setStartpage = startpage:
|
|
|
|
{ ... }: {
|
|
|
|
programs.firefox.profiles."maralorn-default".settings = {
|
|
|
|
"browser.startup.homepage" = startpage;
|
|
|
|
};
|
|
|
|
};
|
2020-05-16 11:20:32 +00:00
|
|
|
makeConfig = hostName: imports:
|
2021-03-10 09:31:37 +00:00
|
|
|
{ ... }: {
|
2021-05-18 14:33:28 +00:00
|
|
|
imports = imports ++ [ ./roles/default.nix ];
|
|
|
|
m-0.hostName = hostName;
|
|
|
|
nixpkgs.overlays = [ (_: _: (import ../channels.nix).${hostName}) ];
|
2021-03-10 09:31:37 +00:00
|
|
|
};
|
2021-07-05 00:44:32 +00:00
|
|
|
makeAutostart = name:
|
|
|
|
{ config, ... }: {
|
2021-07-05 19:18:23 +00:00
|
|
|
config.xdg.configFile."autostart/${name}.desktop".source =
|
2021-07-05 00:44:32 +00:00
|
|
|
"${config.home.path}/share/applications/${name}.desktop";
|
|
|
|
};
|
|
|
|
makeBlock = list:
|
|
|
|
{ pkgs, lib, ... }: {
|
|
|
|
systemd.user.services.blockserver = {
|
|
|
|
Unit.Description = "Serve a blocklist";
|
|
|
|
Service = {
|
|
|
|
ExecStart = "${pkgs.python3}/bin/python -m http.server 8842 -d ${pkgs.writeTextDir "blocklist" (lib.concatStringsSep "\r\n" list)}";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
|
|
|
Install.WantedBy = [ "default.target" ];
|
|
|
|
};
|
|
|
|
};
|
2021-05-18 14:33:28 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
apollo =
|
|
|
|
let
|
|
|
|
install = f: ({ pkgs, ... }: { home.packages = f pkgs; });
|
|
|
|
apolloConfig = name: imports:
|
|
|
|
makeConfig "apollo" (
|
|
|
|
imports ++ [
|
2021-07-13 14:16:14 +00:00
|
|
|
./roles/systemd-exporter.nix
|
2021-05-18 14:33:28 +00:00
|
|
|
./roles/battery.nix
|
|
|
|
./roles/beets.nix
|
2021-07-05 15:45:47 +00:00
|
|
|
./roles/daily-driver-programs.nix
|
2021-05-18 14:33:28 +00:00
|
|
|
./roles/desktop
|
|
|
|
./roles/git-sign.nix
|
2021-07-05 15:45:47 +00:00
|
|
|
./roles/hoogle.nix
|
|
|
|
./roles/kassandra.nix
|
|
|
|
./roles/khal.nix
|
|
|
|
./roles/khard.nix
|
2021-05-18 14:33:28 +00:00
|
|
|
./roles/mail.nix
|
2021-07-05 15:45:47 +00:00
|
|
|
./roles/mpclient.nix
|
|
|
|
./roles/mpd.nix
|
|
|
|
./roles/on-my-machine.nix
|
2021-05-18 14:33:28 +00:00
|
|
|
./roles/research.nix
|
|
|
|
./roles/taskwarrior-git.nix
|
2021-07-05 15:45:47 +00:00
|
|
|
./roles/taskwarrior.nix
|
|
|
|
./roles/update_tasks.nix
|
|
|
|
./roles/vdirsyncer.nix
|
|
|
|
./roles/zettelkasten.nix
|
|
|
|
(import ./roles/mode-switching.nix { modeDir = ".modes"; modeFile = "volatile/mode"; })
|
2021-05-18 14:33:28 +00:00
|
|
|
(makeAutostart "unlock-ssh")
|
|
|
|
]
|
|
|
|
);
|
|
|
|
unrestricted = [
|
|
|
|
./roles/accounting.nix
|
|
|
|
./roles/mail-client.nix
|
|
|
|
./roles/pythia.nix
|
|
|
|
./roles/tinkering.nix
|
|
|
|
./roles/chat.nix
|
2021-07-19 22:44:04 +00:00
|
|
|
(setStartpage "https://stats.maralorn.de")
|
2021-05-18 14:33:28 +00:00
|
|
|
(makeBlock [ ])
|
|
|
|
];
|
|
|
|
in
|
2021-03-10 09:31:37 +00:00
|
|
|
{
|
2021-07-13 15:37:33 +00:00
|
|
|
leisure = apolloConfig "Leisure" (unrestricted ++ [ ./roles/games.nix ]);
|
2021-03-10 09:31:37 +00:00
|
|
|
orga = apolloConfig "Orga" [
|
|
|
|
./roles/mail-client.nix
|
|
|
|
./roles/accounting.nix
|
|
|
|
./roles/pythia.nix
|
|
|
|
(setStartpage "https://habitica.com")
|
2021-07-09 11:52:45 +00:00
|
|
|
(makeBlock restrictedPages)
|
2021-03-10 09:31:37 +00:00
|
|
|
(makeAutostart "kassandra2")
|
|
|
|
(install (p: [ p.discord ])) # For teaching
|
|
|
|
];
|
|
|
|
research = apolloConfig "Research" [
|
2021-07-09 11:48:25 +00:00
|
|
|
(makeBlock restrictedPages)
|
2021-03-10 09:31:37 +00:00
|
|
|
];
|
|
|
|
};
|
2021-07-09 11:48:25 +00:00
|
|
|
zeus =
|
|
|
|
let
|
|
|
|
all = [
|
|
|
|
./roles/accounting.nix
|
|
|
|
./roles/beets.nix
|
|
|
|
./roles/daily-driver-programs.nix
|
|
|
|
./roles/desktop
|
|
|
|
./roles/git-sign.nix
|
|
|
|
./roles/hoogle.nix
|
|
|
|
./roles/hourly-maintenance.nix
|
|
|
|
./roles/kassandra.nix
|
|
|
|
./roles/khal.nix
|
|
|
|
./roles/khard.nix
|
|
|
|
./roles/mail.nix
|
|
|
|
./roles/mpclient.nix
|
|
|
|
./roles/mpd.nix
|
|
|
|
./roles/on-my-machine.nix
|
|
|
|
./roles/pythia.nix
|
|
|
|
./roles/research.nix
|
|
|
|
./roles/state.nix
|
|
|
|
./roles/taskwarrior.nix
|
|
|
|
./roles/tinkering.nix
|
|
|
|
./roles/update_tasks.nix
|
|
|
|
./roles/vdirsyncer.nix
|
2021-07-10 10:18:00 +00:00
|
|
|
(import ./roles/mode-switching.nix { modeDir = ".volatile/modes"; modeFile = ".mode"; })
|
2021-07-19 22:44:04 +00:00
|
|
|
(setStartpage "https://stats.maralorn.de")
|
2021-07-09 11:48:25 +00:00
|
|
|
(makeAutostart "kassandra2")
|
|
|
|
(makeAutostart "unlock-ssh")
|
|
|
|
];
|
|
|
|
orga = all ++ [
|
|
|
|
./roles/mail-client.nix
|
|
|
|
];
|
|
|
|
leisure = orga ++ [
|
|
|
|
./roles/games.nix
|
|
|
|
./roles/chat.nix
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
2021-07-19 22:44:04 +00:00
|
|
|
research = makeConfig "zeus" (all ++ [ (makeBlock restrictedPages) ]);
|
|
|
|
orga = makeConfig "zeus" (orga ++ [ (makeBlock restrictedPages) ]);
|
|
|
|
leisure = makeConfig "zeus" (leisure ++ [ (makeBlock [ ]) ]);
|
2021-07-09 11:48:25 +00:00
|
|
|
};
|
2020-05-16 11:20:32 +00:00
|
|
|
hera = {
|
|
|
|
default = makeConfig "hera" [
|
2020-07-03 13:18:43 +00:00
|
|
|
./roles/on-my-machine.nix
|
|
|
|
./roles/headless.nix
|
2020-07-02 19:54:17 +00:00
|
|
|
./roles/weechat
|
2020-07-03 13:18:43 +00:00
|
|
|
./roles/headless-mpd.nix
|
|
|
|
./roles/mail.nix
|
2021-04-26 02:43:01 +00:00
|
|
|
./roles/kassandra.nix
|
2020-12-12 22:39:54 +00:00
|
|
|
./roles/mail2rss.nix
|
2020-12-26 12:21:51 +00:00
|
|
|
./roles/taskwarrior.nix
|
2021-02-14 20:25:49 +00:00
|
|
|
./roles/vdirsyncer.nix
|
|
|
|
./roles/khard.nix
|
|
|
|
./roles/khal.nix
|
2020-05-16 11:20:32 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|