refactor(modules): reduce host repetition
This commit is contained in:
33
modules/_lib/local.nix
Normal file
33
modules/_lib/local.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
rec {
|
||||
user = {
|
||||
name = "cschmatzler";
|
||||
fullName = "Christoph Schmatzler";
|
||||
emails = {
|
||||
personal = "christoph@schmatzler.com";
|
||||
work = "christoph@tuist.dev";
|
||||
icloud = "christoph.schmatzler@icloud.com";
|
||||
};
|
||||
};
|
||||
|
||||
secretPath = name: "/run/secrets/${name}";
|
||||
|
||||
mkHome = system:
|
||||
if builtins.match ".*-darwin" system != null
|
||||
then "/Users/${user.name}"
|
||||
else "/home/${user.name}";
|
||||
|
||||
mkHost = system: {
|
||||
inherit system;
|
||||
home = mkHome system;
|
||||
};
|
||||
|
||||
hosts = {
|
||||
chidi = mkHost "aarch64-darwin";
|
||||
janet = mkHost "aarch64-darwin";
|
||||
michael = mkHost "x86_64-linux";
|
||||
tahani = mkHost "x86_64-linux";
|
||||
};
|
||||
|
||||
tailscaleDomain = "manticore-hippocampus.ts.net";
|
||||
tailscaleHost = name: "${name}.${tailscaleDomain}";
|
||||
}
|
||||
Reference in New Issue
Block a user