Automatically set machine hostname
This commit is contained in:
parent
832894edfc
commit
b5dd983ba3
14
flake.nix
14
flake.nix
@ -55,7 +55,7 @@
|
||||
{
|
||||
nixosConfigurations =
|
||||
let
|
||||
modules = system: with inputs; [
|
||||
modules = system: hostname: with inputs; [
|
||||
./common
|
||||
simple-nixos-mailserver.nixosModule
|
||||
agenix.nixosModules.default
|
||||
@ -63,19 +63,23 @@
|
||||
archivebox.nixosModule
|
||||
nix-index-database.nixosModules.nix-index
|
||||
({ lib, ... }: {
|
||||
config.environment.systemPackages = [
|
||||
config = {
|
||||
environment.systemPackages = [
|
||||
agenix.packages.${system}.agenix
|
||||
];
|
||||
|
||||
networking.hostName = hostname;
|
||||
};
|
||||
|
||||
# because nixos specialArgs doesn't work for containers... need to pass in inputs a different way
|
||||
options.inputs = lib.mkOption { default = inputs; };
|
||||
options.currentSystem = lib.mkOption { default = system; };
|
||||
})
|
||||
];
|
||||
|
||||
mkSystem = system: nixpkgs: path:
|
||||
mkSystem = system: nixpkgs: path: hostname:
|
||||
let
|
||||
allModules = modules system;
|
||||
allModules = modules system hostname;
|
||||
|
||||
# allow patching nixpkgs, remove this hack once this is solved: https://github.com/NixOS/nix/issues/3920
|
||||
patchedNixpkgsSrc = nixpkgs.legacyPackages.${system}.applyPatches {
|
||||
@ -99,7 +103,7 @@
|
||||
in
|
||||
nixpkgs.lib.mapAttrs
|
||||
(hostname: cfg:
|
||||
mkSystem cfg.arch nixpkgs cfg.configurationPath)
|
||||
mkSystem cfg.arch nixpkgs cfg.configurationPath hostname)
|
||||
machines;
|
||||
|
||||
packages =
|
||||
|
@ -5,7 +5,6 @@
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "phil";
|
||||
services.gitea-runner = {
|
||||
enable = true;
|
||||
instanceUrl = "https://git.neet.dev";
|
||||
|
@ -5,8 +5,6 @@
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "ponyo";
|
||||
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
# p2p mesh network
|
||||
|
@ -5,8 +5,6 @@
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "ray";
|
||||
|
||||
# for luks onlock over tor
|
||||
services.tor.enable = true;
|
||||
services.tor.client.enable = true;
|
||||
|
@ -11,8 +11,6 @@
|
||||
# https://github.com/skogsbrus/os/blob/master/sys/router.nix
|
||||
# http://trac.gateworks.com/wiki/wireless/wifi
|
||||
|
||||
networking.hostName = "router";
|
||||
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
services.tailscale.exitNode = true;
|
||||
|
@ -5,8 +5,6 @@
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "s0";
|
||||
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
services.iperf3.enable = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user