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 = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
|
|
@ -39,18 +39,21 @@
|
||||||
outputs = inputs@{ ... }:
|
outputs = inputs@{ ... }:
|
||||||
let
|
let
|
||||||
system = inputs.nixpkgs.lib.mkDefault "x86_64-linux";
|
system = inputs.nixpkgs.lib.mkDefault "x86_64-linux";
|
||||||
nixosSystem =
|
mkHost =
|
||||||
hostName:
|
hostName:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit hostName inputs system; };
|
specialArgs = { inherit inputs system; };
|
||||||
modules = [ ./hosts/${hostName} ];
|
modules = [
|
||||||
|
{ networking.hostName = hostName; }
|
||||||
|
./hosts/${hostName}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
Swordsmachine = nixosSystem "Swordsmachine";
|
Swordsmachine = mkHost "Swordsmachine";
|
||||||
Earthmover = nixosSystem "Earthmover";
|
Earthmover = mkHost "Earthmover";
|
||||||
Drone = nixosSystem "Drone";
|
Drone = mkHost "Drone";
|
||||||
Mindflayer = nixosSystem "Mindflayer";
|
Mindflayer = mkHost "Mindflayer";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ hostName, inputs, config, lib, pkgs, ... }:
|
{ inputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -60,14 +60,11 @@
|
||||||
|
|
||||||
services.zfs.autoScrub.enable = true;
|
services.zfs.autoScrub.enable = true;
|
||||||
|
|
||||||
networking = {
|
networking.firewall = lib.mkForce {
|
||||||
hostName = "${hostName}";
|
allowedTCPPorts = [];
|
||||||
firewall = lib.mkForce {
|
allowedTCPPortRanges = [];
|
||||||
allowedTCPPorts = [];
|
allowedUDPPorts = [];
|
||||||
allowedTCPPortRanges = [];
|
allowedUDPPortRanges = [];
|
||||||
allowedUDPPorts = [];
|
|
||||||
allowedUDPPortRanges = [];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# for cloudflare browser ssh
|
# for cloudflare browser ssh
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./default-packages.nix
|
./default-packages.nix
|
||||||
./locales.nix
|
./locales.nix
|
||||||
./networking.nix
|
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./users.nix
|
./users.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{ hostName, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
networking.hostName = "${hostName}";
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{ hostName, config, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
users.users.wo2w = {
|
users.users.wo2w = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "${hostName}";
|
description = config.networking.hostName;
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
|
||||||
# make new user logins (iso/vm/new machine) use a default password
|
# make new user logins (iso/vm/new machine) use a default password
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue