hosts/data.cs.purdue.edu: init
This commit is contained in:
parent
33e3b52b2f
commit
93f0bd5357
4 changed files with 56 additions and 0 deletions
|
@ -129,6 +129,8 @@
|
|||
] ++ (self.lib.leaves ./modules);
|
||||
})
|
||||
(self.lib.flattenLeaves ./hosts);
|
||||
|
||||
homeConfigurations = self.lib.mkHomeConfigurations { inherit (self.nixosConfigurations) "data.cs.purdue.edu"; };
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
|
16
hosts/data.cs.purdue.edu/default.nix
Normal file
16
hosts/data.cs.purdue.edu/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
modules.hardware.form.server = true;
|
||||
|
||||
networking = {
|
||||
domain = "cs.purdue.edu";
|
||||
hostName = "data";
|
||||
};
|
||||
|
||||
home = { ... }: {
|
||||
home.packages = with pkgs; [
|
||||
home-manager
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{ lib }:
|
||||
# Importers from digga: https://github.com/divnix/digga/blob/main/src/importers.nix
|
||||
# Plus the mkHomeConfigurations generator from digga: https://github.com/divnix/digga/blob/main/src/generators.nix
|
||||
let
|
||||
flattenTree =
|
||||
/*
|
||||
|
@ -120,9 +121,45 @@ let
|
|||
lib.filterAttrs (n: v: v != { }) (lib.mapAttrs' collect files);
|
||||
|
||||
flattenLeaves = dir: flattenTree (rakeLeaves dir);
|
||||
|
||||
getFqdn = c:
|
||||
let
|
||||
net = c.config.networking;
|
||||
fqdn =
|
||||
if (net ? domain) && (net.domain != null)
|
||||
then "${net.hostName}.${net.domain}"
|
||||
else net.hostName;
|
||||
in
|
||||
fqdn;
|
||||
in
|
||||
{
|
||||
inherit rakeLeaves flattenTree flattenLeaves;
|
||||
|
||||
leaves = dir: builtins.attrValues (flattenLeaves dir);
|
||||
|
||||
mkHomeConfigurations = systemConfigurations:
|
||||
/*
|
||||
*
|
||||
Synopsis: mkHomeConfigurations _systemConfigurations_
|
||||
|
||||
Generate the `homeConfigurations` attribute expected by `home-manager` cli
|
||||
from _nixosConfigurations_ or _darwinConfigurations_ in the form
|
||||
_user@hostname_.
|
||||
*
|
||||
*/
|
||||
let
|
||||
op = attrs: c:
|
||||
attrs
|
||||
// (
|
||||
lib.mapAttrs'
|
||||
(user: v: {
|
||||
name = "${user}@${getFqdn c}";
|
||||
value = v.home;
|
||||
})
|
||||
c.config.home-manager.users
|
||||
);
|
||||
mkHmConfigs = lib.foldl op { };
|
||||
in
|
||||
mkHmConfigs (builtins.attrValues systemConfigurations);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwo8TGBe91mmkc/QonsXtTBKCJtsAGz3YzphDZlzmaO infinidoge@Infini-FRAMEWORK"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJbNOMgVDM/hJQgzd1ff5uuouDtTLOAgmTt57cNNySif infinidoge@Infini-SERVER"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBE2YScxTK7JOCXBn4KjFWp9Lwcp4OovesYXrPCpRP4X Project Infinity"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIltuTbxiBxOox2DAW5LACjGjJ9UFvJOAcrFYK7WMHkV [redacted-infinidoge]@data.cs.purdue.edu"
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue