Added networking
This commit is contained in:
+403
-370
File diff suppressed because it is too large
Load Diff
@@ -515,6 +515,7 @@ This is the top of the machine hierarchy
|
||||
./audio.nix
|
||||
./xdg.nix
|
||||
./session.nix
|
||||
./networking.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
}
|
||||
@@ -611,6 +612,31 @@ This sets the dbus implementation
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
** =assets/flake/machines/traveldroid/networking.nix=
|
||||
This sets the dbus implementation
|
||||
#+BEGIN_SRC nix :tangle assets/flake/machines/traveldroid/networking.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable NetworkManager
|
||||
services.NetworkManager = {
|
||||
enable = true;
|
||||
dhcpcd.enable = false; # Ensure dhcpcd is disabled to avoid conflicts
|
||||
};
|
||||
|
||||
# Install NetworkManager and wofi
|
||||
environment.systemPackages = with pkgs; [
|
||||
networkmanager
|
||||
wofi
|
||||
];
|
||||
|
||||
# Ensure the user is in the necessary groups
|
||||
users.users.${config.users.users."henrov".username} = {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
** =assets/flake/machines/traveldroid/session.nix=
|
||||
This sets the dbus implementation
|
||||
#+BEGIN_SRC nix :tangle assets/flake/machines/traveldroid/session.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable NetworkManager
|
||||
services.NetworkManager = {
|
||||
enable = true;
|
||||
dhcpcd.enable = false; # Ensure dhcpcd is disabled to avoid conflicts
|
||||
};
|
||||
|
||||
# Install NetworkManager and wofi
|
||||
environment.systemPackages = with pkgs; [
|
||||
networkmanager
|
||||
wofi
|
||||
];
|
||||
|
||||
# Ensure the user is in the necessary groups
|
||||
users.users.${config.users.users."henrov".username} = {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
};
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
./audio.nix
|
||||
./xdg.nix
|
||||
./session.nix
|
||||
./networking.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Get a list of available Wi-Fi networks
|
||||
networks=$(nmcli -t -f SSID device wifi list)
|
||||
|
||||
# Show the list using wofi with dmenu mode
|
||||
selected=$(echo "$networks" | wofi --show dmenu --width=300 --height=500 --prompt="Select a network")
|
||||
|
||||
# Connect to the selected network with the --ask option
|
||||
if [ -n "$selected" ]; then
|
||||
nmcli --ask device wifi connect "$selected"
|
||||
fi
|
||||
Reference in New Issue
Block a user