Compare commits

..

No commits in common. "8f4e907bce705e1b9cbb54c1ef842d9347550ae5" and "c2ea64512ce849b62f8e6068799b29cee4824ba0" have entirely different histories.

6 changed files with 21 additions and 64 deletions

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, namespace, host, ... }: { config, lib, pkgs, namespace, host, ... }:
let let
inherit (lib) types mkIf; inherit (lib) types mkIf;
inherit (lib.${namespace}) mkBoolOpt mkOpt; inherit (lib.${namespace}) mkBoolOpt mkOpt;
@ -14,14 +14,6 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
nix = nix =
let let
mappedRegistry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // {
nixpkgs.flake = if pkgs.stdenv.hostPlatform.isLinux then inputs.nixpkgs else inputs.nixpkgs-unstable;
})
(x: if pkgs.stdenv.hostPlatform.isDarwin then lib.removeAttrs x [ "nixpkgs-unstable" ] else x)
];
users = [ users = [
"root" "root"
"@wheel" "@wheel"
@ -56,9 +48,6 @@ in
optimise.automatic = true; optimise.automatic = true;
# Pin the registry to avoid downloading and evaluating a new nixpkgs version everytime
registry = mappedRegistry;
settings = { settings = {
allowed-users = users; allowed-users = users;
auto-optimise-store = pkgs.stdenv.hostPlatform.isLinux; auto-optimise-store = pkgs.stdenv.hostPlatform.isLinux;

View File

@ -22,6 +22,5 @@ in
}; };
}; };
}; };
networking.hostName = lib.mkForce "";
}; };
} }

View File

@ -11,35 +11,6 @@ in
enableIWD = mkEnableOption "Enable IWD"; enableIWD = mkEnableOption "Enable IWD";
useDHCP = mkBoolOpt true "Use DHCP"; useDHCP = mkBoolOpt true "Use DHCP";
useNetworkd = mkBoolOpt false "Use networkd"; useNetworkd = mkBoolOpt false "Use networkd";
useStatic = lib.mkOption {
type = lib.types.submodule {
options = {
interface = lib.mkOption {
type = lib.types.str;
description = "Network interface name";
example = "enp0s3";
};
address = lib.mkOption {
type = lib.types.str;
description = "Static IP address";
example = "10.0.20.200";
};
defaultGateway = lib.mkOption {
type = lib.types.str;
description = "Default gateway IP";
example = "10.0.20.254";
};
nameservers = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "List of DNS servers";
example = [ "10.0.20.254" "8.8.8.8" ];
default = [ "8.8.8.8" "8.8.4.4" ];
};
};
};
default = null;
description = "Static Network Configuration";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -53,19 +24,24 @@ in
networking = { networking = {
firewall = enabled; firewall = enabled;
useDHCP = mkIf (cfg.useStatic == null) (mkDefault cfg.useDHCP); useDHCP = mkDefault cfg.useDHCP;
useNetworkd = cfg.useNetworkd; useNetworkd = cfg.useNetworkd;
} // (lib.optionalAttrs (cfg.enableIWD) { } // (lib.optionalAttrs cfg.enableIWD) {
wireless.iwd = { wireless.iwd = {
enable = true; enable = true;
settings.General.EnableNetworkConfiguration = true; settings.General.EnableNetworkConfiguration = true;
}; };
}) // (lib.optionalAttrs (cfg.useStatic != null) { };
inherit (cfg.useStatic) defaultGateway nameservers;
interfaces.${cfg.useStatic.interface}.ipv4.addresses = [{ # TODO - Network Configuration
inherit (cfg.useStatic) address; # (lib.mkIf (config.network != null) {
prefixLength = 24; # networking = {
}]; # inherit (config.network) defaultGateway nameservers;
}); # interfaces.${config.network.interface}.ipv4.addresses = [{
# inherit (config.network) address;
# prefixLength = 24;
# }];
# };
# })
}; };
} }

View File

@ -11,7 +11,9 @@ in
extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned."; extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned.";
extraOptions = mkOpt attrs { } "Extra options passed to <option>users.users.<name></option>."; extraOptions = mkOpt attrs { } "Extra options passed to <option>users.users.<name></option>.";
fullName = mkOpt str "Evan Reichard" "The full name of the user."; fullName = mkOpt str "Evan Reichard" "The full name of the user.";
initialPassword = mkOpt str "changeMe2025!" "The initial password to use when the user is first created."; initialPassword =
mkOpt str "password"
"The initial password to use when the user is first created.";
name = mkOpt str "evanreichard" "The name to use for the user account."; name = mkOpt str "evanreichard" "The name to use for the user account.";
}; };

View File

@ -15,8 +15,8 @@ sops:
SC91WFNocEN2K1NFK2dBUHYwZTQrVFkKKb3AlaRX96vJwEmxNNAThTlO9ZwtD1tv SC91WFNocEN2K1NFK2dBUHYwZTQrVFkKKb3AlaRX96vJwEmxNNAThTlO9ZwtD1tv
c6aBELEbmJFdHOcIJITzmS3YOssDOgTL2TbcSFu8mdAQYsRvxC96HA== c6aBELEbmJFdHOcIJITzmS3YOssDOgTL2TbcSFu8mdAQYsRvxC96HA==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2025-04-09T00:53:28Z" lastmodified: "2025-04-05T02:29:22Z"
mac: ENC[AES256_GCM,data:NKv91i8Ms4TfbU0t9td4QoGD+9d9KYGQ9Mu1QlFdCc4AjMfRCcUCrvb9SVMF5JbYa8oZAH4Qp9FEJ5fFmgoTNrewspLUMpyjUYRgARYQWiHYhZjE/uTNhFo2FxXYLWsAlQjEJ8abbwUyr2y6NsK2tcQcOBDIWUssb4XqajNcylE=,iv:gvwQZB20JR4bKfMMR6sYjTnf3CNiOjcd8T30s2drKwY=,tag:mF9etyVyPVw5YblI8VdtTw==,type:str] mac: ENC[AES256_GCM,data:2rI+pEYmQIPmtcnDTuyroAbfIvLIZKvsyAMEbQM2y9xYXhLyK8Vt7IzmdHy//hQRBSWdBV7/HfCMWJcg9i1B/P9fXrKx+OxaIb654SkthWhkORq32Sr1Gee3Yj195MffIUrEZ4rVauCeprzdEXqN6oTVXjHvnqV2/VXuTkkbztE=,iv:gCgo+8uLH6H9R3OQvzf2K9SgXb3tXG7Lvu6lxL0P2xo=,tag:ev+vMOn6UAfKexfyUnMP5Q==,type:str]
pgp: [] pgp: []
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.4 version: 3.9.4

View File

@ -15,16 +15,7 @@ in
enable = true; enable = true;
diskPath = "/dev/xvda"; diskPath = "/dev/xvda";
}; };
networking = { networking = enabled; # TODO - Network Config
enable = true;
useDHCP = false;
useStatic = {
interface = "enX0";
address = "10.0.50.130";
defaultGateway = "10.0.50.254";
nameservers = [ "10.0.50.254" ];
};
};
}; };
services = { services = {