1
0
Fork 0
nixos-config/home-manager/machines.nix

122 lines
3.3 KiB
Nix
Raw Normal View History

2020-05-16 11:20:32 +00:00
let
2020-12-07 02:05:57 +00:00
inherit (import (import ../nix/sources.nix).nixos-unstable { }) lib;
2020-05-16 11:20:32 +00:00
makeConfig = hostName: imports:
{ ... }: {
2020-07-03 13:18:43 +00:00
imports = imports ++ [ ./roles/default.nix ];
2020-05-16 11:20:32 +00:00
m-0.hostName = hostName;
2020-12-07 02:05:57 +00:00
nixpkgs.overlays = [ (_: _: (import ../channels.nix).${hostName}) ];
2020-05-16 11:20:32 +00:00
};
in {
apollo = let
2020-10-21 15:35:04 +00:00
install = f: ({ pkgs, ... }: { home.packages = f pkgs; });
2020-10-19 13:32:40 +00:00
makeAutostart = name:
{ config, ... }: {
config.home.file.".config/autostart/${name}.desktop".source =
"${config.home.path}/share/applications/${name}.desktop";
};
2020-05-16 11:20:32 +00:00
setStartpage = startpage:
{ ... }: {
programs.firefox.profiles."fz2sm95u.default".settings = {
"browser.startup.homepage" = startpage;
};
};
makeBlock = list:
{ pkgs, lib, ... }: {
2020-10-19 13:32:40 +00:00
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";
2020-05-16 11:20:32 +00:00
};
2020-10-19 13:32:40 +00:00
Install.WantedBy = [ "default.target" ];
2020-05-16 11:20:32 +00:00
};
};
tinkerPages = [
"reddit.com"
"github.com"
"*.ccc.de"
"haskell.org"
"*.haskell.org"
"*.nixos.org"
"nixos.org"
"matrix.org"
2020-07-17 10:56:15 +00:00
"element.io"
2020-05-16 11:20:32 +00:00
"youtube.de"
"youtube.com"
2020-08-14 19:16:21 +00:00
"*.element.io"
2020-05-16 11:20:32 +00:00
];
leisurePages = [
"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"
];
apolloConfig = imports:
makeConfig "apollo" (imports ++ [
2020-07-01 23:20:18 +00:00
./roles/zettelkasten.nix
2020-08-15 01:12:48 +00:00
./roles/hoogle.nix
2020-07-03 13:18:43 +00:00
./roles/battery.nix
2020-07-03 13:07:03 +00:00
./roles/mpd.nix
./roles/beets.nix
2020-07-03 13:18:43 +00:00
./roles/mpclient.nix
./roles/on-my-machine.nix
./roles/desktop
./roles/git-sign.nix
./roles/laptop.nix
./roles/mail.nix
./roles/update_tasks.nix
2020-11-08 15:44:25 +00:00
./roles/research.nix
2020-05-16 11:20:32 +00:00
]);
2020-06-21 16:58:35 +00:00
unrestricted = [
2020-07-03 13:18:43 +00:00
./roles/accounting.nix
./roles/mail-client.nix
./roles/pythia.nix
./roles/tinkering.nix
./roles/chat.nix
2020-06-21 16:58:35 +00:00
(setStartpage "https://stats.maralorn.de/d/health-status")
2020-05-16 11:20:32 +00:00
(makeBlock [ ])
2020-10-19 13:32:40 +00:00
(makeAutostart "firefox")
(makeAutostart "chat")
2020-05-16 11:20:32 +00:00
];
2020-06-21 16:58:35 +00:00
in {
unrestricted = apolloConfig unrestricted;
2020-05-16 11:20:32 +00:00
orga = apolloConfig [
2020-07-03 13:18:43 +00:00
./roles/mail-client.nix
./roles/accounting.nix
./roles/pythia.nix
2020-06-09 21:51:46 +00:00
(setStartpage "https://habitica.com")
2020-05-16 11:20:32 +00:00
(makeBlock (tinkerPages ++ leisurePages))
2020-10-19 13:32:40 +00:00
(makeAutostart "firefox")
(makeAutostart "kassandra")
(makeAutostart "kassandra2")
2020-10-21 16:35:50 +00:00
(install (p: [ p.discord ])) # For teaching
2020-05-16 11:20:32 +00:00
];
research = apolloConfig [
(makeBlock (tinkerPages ++ leisurePages))
(setStartpage "http://localhost:8042")
];
2020-07-03 13:18:43 +00:00
gaming = apolloConfig (unrestricted ++ [ ./roles/games.nix ]);
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/kassandra-server.nix
./roles/headless-mpd.nix
./roles/mail.nix
2020-12-12 22:39:54 +00:00
./roles/mail2rss.nix
2020-05-16 11:20:32 +00:00
];
};
}