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

143 lines
3.8 KiB
Nix
Raw Normal View History

2020-05-16 11:20:32 +00:00
let
2021-03-10 09:31:37 +00:00
inherit (import (import ../nix/sources.nix).nixos-unstable {}) lib;
2020-05-16 11:20:32 +00:00
makeConfig = hostName: imports:
2021-03-10 09:31:37 +00:00
{ ... }: {
imports = imports ++ [ ./roles/default.nix ];
m-0.hostName = hostName;
nixpkgs.overlays = [ (_: _: (import ../channels.nix).${hostName}) ];
};
in
{
2020-05-16 11:20:32 +00:00
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:
2021-03-10 09:31:37 +00:00
{ 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:
2021-03-10 09:31:37 +00:00
{ ... }: {
programs.firefox.profiles."fz2sm95u.default".settings = {
"browser.startup.homepage" = startpage;
2020-05-16 11:20:32 +00:00
};
2021-03-10 09:31:37 +00:00
};
2020-05-16 11:20:32 +00:00
makeBlock = list:
2021-03-10 09:31:37 +00:00
{ 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";
2020-05-16 11:20:32 +00:00
};
2021-03-10 09:31:37 +00:00
Install.WantedBy = [ "default.target" ];
2020-05-16 11:20:32 +00:00
};
2021-03-10 09:31:37 +00:00
};
setWorkspaceName = name:
{ pkgs, lib, ... }: {
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
workspace-names = [ name ]; # use neo
};
};
};
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"
];
2021-03-10 09:31:37 +00:00
apolloConfig = name: imports:
makeConfig "apollo" (
imports ++ [
./roles/arbtt
./roles/zettelkasten.nix
./roles/hoogle.nix
./roles/battery.nix
./roles/mpd.nix
./roles/beets.nix
./roles/mpclient.nix
./roles/on-my-machine.nix
./roles/desktop
2021-03-27 14:42:48 +00:00
./roles/git-sign.nix
2021-03-10 09:31:37 +00:00
./roles/laptop.nix
./roles/mail.nix
./roles/update_tasks.nix
./roles/research.nix
./roles/vdirsyncer.nix
./roles/khard.nix
./roles/khal.nix
./roles/taskwarrior.nix
2021-03-27 14:42:48 +00:00
./roles/taskwarrior-git.nix
2021-03-10 09:31:37 +00:00
(makeAutostart "unlock-ssh")
(setWorkspaceName name)
]
);
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")
2021-03-10 09:31:37 +00:00
(makeBlock [])
2020-05-16 11:20:32 +00:00
];
2021-03-10 09:31:37 +00:00
in
{
unrestricted = apolloConfig "Unrestricted" unrestricted;
orga = apolloConfig "Orga" [
./roles/mail-client.nix
./roles/accounting.nix
./roles/pythia.nix
(setStartpage "https://habitica.com")
(makeBlock (tinkerPages ++ leisurePages))
(makeAutostart "firefox")
(makeAutostart "kassandra")
(makeAutostart "kassandra2")
(install (p: [ p.discord ])) # For teaching
];
research = apolloConfig "Research" [
(makeBlock (tinkerPages ++ leisurePages))
(setStartpage "http://localhost:8042")
];
gaming = apolloConfig "Gaming" (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/headless-mpd.nix
./roles/mail.nix
2020-12-12 22:39:54 +00:00
./roles/mail2rss.nix
./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
];
};
}