Fix Wi-Fi flakes
This commit is contained in:
parent
e013bcfdba
commit
6d98d85642
|
@ -1,8 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# TODO Flakes
|
|
||||||
|
|
||||||
nix-channel --add https://nixos.org/channels/nixos-23.11 nixpkgs
|
|
||||||
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
|
|
||||||
nix-channel --add https://github.com/NixOS/nixos-hardware/archive/8772491ed75f150f02552c60694e1beff9f46013.tar.gz nixos-hardware
|
|
||||||
nix-channel --update
|
|
|
@ -2,6 +2,9 @@
|
||||||
#! nix-shell -i bash
|
#! nix-shell -i bash
|
||||||
#! nix-shell -p bash nix-output-monitor
|
#! nix-shell -p bash nix-output-monitor
|
||||||
|
|
||||||
|
echo FIXME Not flakes ready
|
||||||
|
exit 1
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#! nix-shell -i bash
|
#! nix-shell -i bash
|
||||||
#! nix-shell -p bash nix-output-monitor
|
#! nix-shell -p bash nix-output-monitor
|
||||||
|
|
||||||
|
echo FIXME Not flakes ready
|
||||||
|
exit 1
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ in
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "boot";
|
name = "boot";
|
||||||
extraFormatArgs = [ "--type luks1" ];
|
extraFormatArgs = [ "--type luks1" ];
|
||||||
passwordFile = "FIXME";
|
passwordFile = passwordFile;
|
||||||
settings = {
|
settings = {
|
||||||
# keyFile = "/etc/keys/boot";
|
# keyFile = "/etc/keys/boot";
|
||||||
};
|
};
|
||||||
|
@ -94,7 +94,7 @@ in
|
||||||
content = {
|
content = {
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "razmo";
|
name = "razmo";
|
||||||
passwordFile = "FIXME";
|
passwordFile = passwordFile;
|
||||||
settings = {
|
settings = {
|
||||||
# keyFile = "/etc/keys/razmo";
|
# keyFile = "/etc/keys/razmo";
|
||||||
};
|
};
|
||||||
|
@ -129,7 +129,7 @@ in
|
||||||
content = {
|
content = {
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "rapswap";
|
name = "rapswap";
|
||||||
passwordFile = "FIXME";
|
passwordFile = passwordFile;
|
||||||
settings = {
|
settings = {
|
||||||
# keyFile = "/etc/keys/rapswap";
|
# keyFile = "/etc/keys/rapswap";
|
||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
|
@ -147,7 +147,7 @@ in
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "rapido";
|
name = "rapido";
|
||||||
initrdUnlock = true;
|
initrdUnlock = true;
|
||||||
passwordFile = "FIXME";
|
passwordFile = passwordFile;
|
||||||
settings = {
|
settings = {
|
||||||
# keyFile = "/etc/keys/rapido";
|
# keyFile = "/etc/keys/rapido";
|
||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = sharedOverlays;
|
nixpkgs.overlays = sharedOverlays;
|
||||||
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
|
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
|
||||||
|
system.nixos.tags = [ "flakes" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#! nix-shell -i bash
|
#! nix-shell -i bash
|
||||||
#! nix-shell -p bash nixos-install-tools
|
#! nix-shell -p bash nixos-install-tools
|
||||||
|
|
||||||
|
echo FIXME Not flakes ready
|
||||||
|
exit 1
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
./desktop.nix
|
./desktop.nix
|
||||||
./gaming
|
./gaming
|
||||||
./geoffrey.nix
|
./geoffrey.nix
|
||||||
# ./wireless.nix
|
./wireless.nix
|
||||||
# FIXME networks.json is git-ignored, so flakes will not use it
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
# wireless support via wpa_supplicant
|
# wireless support via wpa_supplicant
|
||||||
networking.wireless = {
|
networking.wireless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
networks = builtins.fromJSON (builtins.readFile ./wireless/networks.json); # If this file doesn't exist, run ./wireless/import.py
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
country=NL
|
country=NL
|
||||||
'';
|
'';
|
||||||
|
|
4
os/wireless/.gitignore
vendored
4
os/wireless/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
networks.json
|
wireless_networks.json
|
||||||
networks.env
|
wireless_networks.env
|
||||||
|
|
|
@ -11,6 +11,7 @@ Exports Wi-Fi networks configuration stored in pass into a format readable by Ni
|
||||||
# url = "https://letsencrypt.org/certs/isrgrootx1.pem";
|
# url = "https://letsencrypt.org/certs/isrgrootx1.pem";
|
||||||
# sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
|
# sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
|
||||||
# }
|
# }
|
||||||
|
# TODO Very ugly, can probably do better
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
|
@ -157,10 +158,14 @@ for path in list_networks():
|
||||||
for suffix in suffixes:
|
for suffix in suffixes:
|
||||||
networks[ssid + suffix] = network
|
networks[ssid + suffix] = network
|
||||||
|
|
||||||
with open("networks.json", "w") as fd:
|
with open("wireless_networks.json", "w") as fd:
|
||||||
json.dump(networks, fd, indent=4)
|
json.dump(networks, fd, indent=4)
|
||||||
|
|
||||||
with open("networks.env", "w") as fd:
|
with open("wireless_networks.env", "w") as fd:
|
||||||
if SEPARATE_PASSWORDS:
|
if SEPARATE_PASSWORDS:
|
||||||
for k, v in Password.vars().items():
|
for k, v in Password.vars().items():
|
||||||
print(f"{k}={v}", file=fd)
|
print(f"{k}={v}", file=fd)
|
||||||
|
|
||||||
|
print("Now, execute:")
|
||||||
|
print("sudo mv -f wireless_networks.* /etc/keys")
|
||||||
|
print("sudo nixos-rebuild switch")
|
||||||
|
|
Loading…
Reference in a new issue