flake: cleanup and add hostname definition
This commit is contained in:
parent
2e6cf2c456
commit
0ccba9602d
5 changed files with 20 additions and 26 deletions
19
flake.nix
19
flake.nix
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "all this does now is pass inputs to other modules and set the system variable";
|
||||
description = "My configuration(s) for the NixOS Linux Distribution";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
|
|
@ -39,18 +39,21 @@
|
|||
outputs = inputs@{ ... }:
|
||||
let
|
||||
system = inputs.nixpkgs.lib.mkDefault "x86_64-linux";
|
||||
nixosSystem =
|
||||
mkHost =
|
||||
hostName:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit hostName inputs system; };
|
||||
modules = [ ./hosts/${hostName} ];
|
||||
specialArgs = { inherit inputs system; };
|
||||
modules = [
|
||||
{ networking.hostName = hostName; }
|
||||
./hosts/${hostName}
|
||||
];
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
Swordsmachine = nixosSystem "Swordsmachine";
|
||||
Earthmover = nixosSystem "Earthmover";
|
||||
Drone = nixosSystem "Drone";
|
||||
Mindflayer = nixosSystem "Mindflayer";
|
||||
Swordsmachine = mkHost "Swordsmachine";
|
||||
Earthmover = mkHost "Earthmover";
|
||||
Drone = mkHost "Drone";
|
||||
Mindflayer = mkHost "Mindflayer";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ hostName, inputs, config, lib, pkgs, ... }:
|
||||
{ inputs, config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -60,14 +60,11 @@
|
|||
|
||||
services.zfs.autoScrub.enable = true;
|
||||
|
||||
networking = {
|
||||
hostName = "${hostName}";
|
||||
firewall = lib.mkForce {
|
||||
allowedTCPPorts = [];
|
||||
allowedTCPPortRanges = [];
|
||||
allowedUDPPorts = [];
|
||||
allowedUDPPortRanges = [];
|
||||
};
|
||||
networking.firewall = lib.mkForce {
|
||||
allowedTCPPorts = [];
|
||||
allowedTCPPortRanges = [];
|
||||
allowedUDPPorts = [];
|
||||
allowedUDPPortRanges = [];
|
||||
};
|
||||
|
||||
# for cloudflare browser ssh
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./default-packages.nix
|
||||
./locales.nix
|
||||
./networking.nix
|
||||
./nix.nix
|
||||
./users.nix
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
{ hostName, config, ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "${hostName}";
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
{ hostName, config, ... }:
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
users.users.wo2w = {
|
||||
isNormalUser = true;
|
||||
description = "${hostName}";
|
||||
description = config.networking.hostName;
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
|
||||
# make new user logins (iso/vm/new machine) use a default password
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue