factor out hostnames

This commit is contained in:
Sean Buckley 2022-06-15 23:20:48 -04:00
parent 004d2b1263
commit 6f3ab9c4bf
6 changed files with 14 additions and 23 deletions

View file

@ -1,9 +1,5 @@
{ config, lib, pkgs, ... }:
{
networking.hostName = "cube";
# imports = [ ./monitors.nix ];
virtualisation.libvirtd.enable = true;
environment.systemPackages = with pkgs; [
virt-manager

View file

@ -1,17 +1,20 @@
nixpkgs: hardware: nixosModule:
with hardware;
let
sys = system: mods: nixpkgs.lib.nixosSystem {
inherit system;
modules = [ nixosModule ] ++ mods;
};
builtins.mapAttrs
(name: { system, mods }: nixpkgs.lib.nixosSystem {
inherit system;
modules = mods ++ [
nixosModule
{ networking.hostName = name; }
];
})
in
{
cube = sys "x86_64-linux" [ physical ./cube ];
hp = sys "x86_64-linux" [ physical ./hp ];
lenny = sys "x86_64-linux" [ physical ./lenny ];
nixdev = sys "x86_64-linux" [ qemu ./nixdev ];
slate = sys "x86_64-linux" [ physical ./slate ];
cube = { system = "x86_64-linux"; mods = [ physical ./cube ]; };
hp = { system = "x86_64-linux"; mods = [ physical ./hp ]; };
lenny = { system = "x86_64-linux"; mods = [ physical ./lenny ]; };
nixdev = { system = "x86_64-linux"; mods = [ qemu ./nixdev ]; };
slate = { system = "x86_64-linux"; mods = [ physical ./slate ]; };
}

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }:
{
networking.hostName = "hp";
services = {
openssh.enable = true;
};

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }:
{
networking.hostName = "lenny";
services = {
openssh.enable = true;
};

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }:
{
networking.hostName = "nixdev";
sconfig = {
gnome = true;
profile = "desktop";

View file

@ -1,7 +1,5 @@
{ pkgs, ... }:
{
networking.hostName = "slate";
sconfig = {
profile = "desktop";
gnome = true;