From 103a17e6ff5a40cd62cc920179f1cba316c4b250 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Wed, 22 May 2024 23:57:13 -0500 Subject: [PATCH] Add serial commands, app image support, home-manager cli, and network manager profile configuration example. --- configure.sh | 1 + flake.nix | 1 + modules/nixos/common.nix | 2 + modules/nixos/desktop.nix | 1 + modules/nixos/network.nix | 1 + modules/nixos/users.nix | 1 + settings-default.nix | 3 +- settings-server-example.nix | 136 ++++++++++++++++++++++++++++++++++++ 8 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 settings-server-example.nix diff --git a/configure.sh b/configure.sh index 266accd..fb45a54 100755 --- a/configure.sh +++ b/configure.sh @@ -237,6 +237,7 @@ rec { name = "${gitName}"; email = "${gitEmail}"; }; + networkmanager.profiles = {}; } EOF diff --git a/flake.nix b/flake.nix index ff19c3d..c6be9b9 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,7 @@ else inputs.home-manager-unstable ); + # Setup an overlay for unstable packages to include on stable environments. overlay-unstable = final: prev: { unstable = import inputs.nixpkgs-unstable { diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index d1f257e..3a52f14 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -71,6 +71,8 @@ cron mlocate tmux + screen + picocom killall pciutils diff --git a/modules/nixos/desktop.nix b/modules/nixos/desktop.nix index caf57e2..00acd35 100644 --- a/modules/nixos/desktop.nix +++ b/modules/nixos/desktop.nix @@ -69,6 +69,7 @@ # Desktop polybar + appimage-run # Software defined radio gqrx diff --git a/modules/nixos/network.nix b/modules/nixos/network.nix index f951041..c27fbe0 100644 --- a/modules/nixos/network.nix +++ b/modules/nixos/network.nix @@ -11,6 +11,7 @@ # Or disable the firewall altogether. networking.firewall.enable = false; networking.networkmanager.enable = true; + networking.networkmanager.ensureProfiles.profiles = settings.networkmanager.profiles; environment.systemPackages = with pkgs; [ dnsutils diff --git a/modules/nixos/users.nix b/modules/nixos/users.nix index 7c6284b..c06e330 100644 --- a/modules/nixos/users.nix +++ b/modules/nixos/users.nix @@ -36,6 +36,7 @@ unstable.nodejs_22 pure-prompt fastfetch + home-manager ]; home-manager = { diff --git a/settings-default.nix b/settings-default.nix index dc5c7ae..915bf55 100644 --- a/settings-default.nix +++ b/settings-default.nix @@ -2,7 +2,7 @@ rec { system = "x86_64-linux"; timezone = "America/Chicago"; locale = "en_US.UTF-8"; - packages = "stable"; + packages = "unstable"; profile = "desktop"; hostId = (builtins.substring 0 8 (builtins.readFile "/etc/machine-id")); hostName = "nixos"; @@ -27,4 +27,5 @@ rec { name = "GRMrGecko"; email = "grmrgecko@gmail.com"; }; + networkmanager.profiles = {}; } \ No newline at end of file diff --git a/settings-server-example.nix b/settings-server-example.nix new file mode 100644 index 0000000..cf3b2bd --- /dev/null +++ b/settings-server-example.nix @@ -0,0 +1,136 @@ +rec { + system = "x86_64-linux"; + timezone = "America/Chicago"; + locale = "en_US.UTF-8"; + packages = "stable"; + profile = "virtual-machine-host"; + hostId = (builtins.substring 0 8 (builtins.readFile "/etc/machine-id")); + hostName = "nixos"; + videoDrivers = "unknown"; + disk = { + device = "/dev/sda"; + swapSize = "8G"; + luks = false; + }; + user = { + name = "grmrgecko"; + description = "James Coleman"; + hashedPassword = ""; + openssh.authorizedKeys.keys = []; + autoLogin = false; + }; + root = { + hashedPassword = user.hashedPassword; + openssh.authorizedKeys.keys = user.openssh.authorizedKeys.keys; + }; + git = { + name = "GRMrGecko"; + email = "grmrgecko@gmail.com"; + }; + network.interface = "enp1s0"; + network.suffix = "2"; + networkmanager.profiles = { + ${network.interface} = { + connection = { + id = network.interface; + type = "ethernet"; + interface-name = network.interface; + }; + ethernet = { + mtu = 9000; + }; + ipv4 = { + method = "disabled"; + }; + ipv6 = { + method = "disabled"; + }; + }; + "vlan-${network.interface}.1" = { + connection = { + id = "vlan-${network.interface}.1"; + type = "vlan"; + interface-name = "${network.interface}.1"; + master = "br0"; + slave-type = "bridge"; + }; + ethernet = { + mtu = 1500; + }; + vlan = { + flags = 1; + id = 1; + parent = network.interface; + }; + }; + "vlan-${network.interface}.10" = { + connection = { + id = "vlan-${network.interface}.10"; + type = "vlan"; + interface-name = "${network.interface}.10"; + master = "br1"; + slave-type = "bridge"; + }; + ethernet = { + mtu = 1500; + }; + vlan = { + flags = 1; + id = 10; + parent = network.interface; + }; + }; + "vlan-${network.interface}.100" = { + connection = { + id = "vlan-${network.interface}.100"; + type = "vlan"; + interface-name = "${network.interface}.100"; + }; + ethernet = { + mtu = 9000; + }; + vlan = { + flags = 1; + id = 100; + parent = network.interface; + }; + ipv4 = { + address1 = "10.0.100.${network.suffix}/24"; + method = "manual"; + }; + ipv6 = { + method = "disabled"; + }; + }; + "bridge-br0" = { + connection = { + id = "bridge-br0"; + type = "bridge"; + interface-name = "br0"; + }; + ipv4 = { + address1 = "10.0.0.${network.suffix}/24,10.0.0.1"; + dns = "10.0.0.33;10.0.0.1;"; + method = "manual"; + }; + ipv6 = { + addr-gen-mode = "stable-privacy"; + method = "auto"; + }; + }; + "bridge-br1" = { + connection = { + id = "bridge-br1"; + type = "bridge"; + interface-name = "br1"; + }; + ipv4 = { + address1 = "10.0.10.${network.suffix}/24"; + method = "manual"; + }; + ipv6 = { + method = "disabled"; + }; + }; + }; +} \ No newline at end of file