diff --git a/add_channels.sh b/add_channels.sh deleted file mode 100755 index 5ad032b..0000000 --- a/add_channels.sh +++ /dev/null @@ -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 diff --git a/build_hm.sh b/build_hm.sh index 08a672b..67a79b8 100755 --- a/build_hm.sh +++ b/build_hm.sh @@ -2,6 +2,9 @@ #! nix-shell -i bash #! nix-shell -p bash nix-output-monitor +echo FIXME Not flakes ready +exit 1 + set -euo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/build_os.sh b/build_os.sh index 2c655d9..c64767d 100755 --- a/build_os.sh +++ b/build_os.sh @@ -2,6 +2,9 @@ #! nix-shell -i bash #! nix-shell -p bash nix-output-monitor +echo FIXME Not flakes ready +exit 1 + set -euo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/curacao/dk.nix b/curacao/dk.nix index 4f08553..d730d35 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -73,7 +73,7 @@ in type = "luks"; name = "boot"; extraFormatArgs = [ "--type luks1" ]; - passwordFile = "FIXME"; + passwordFile = passwordFile; settings = { # keyFile = "/etc/keys/boot"; }; @@ -94,7 +94,7 @@ in content = { type = "luks"; name = "razmo"; - passwordFile = "FIXME"; + passwordFile = passwordFile; settings = { # keyFile = "/etc/keys/razmo"; }; @@ -129,7 +129,7 @@ in content = { type = "luks"; name = "rapswap"; - passwordFile = "FIXME"; + passwordFile = passwordFile; settings = { # keyFile = "/etc/keys/rapswap"; allowDiscards = true; @@ -147,7 +147,7 @@ in type = "luks"; name = "rapido"; initrdUnlock = true; - passwordFile = "FIXME"; + passwordFile = passwordFile; settings = { # keyFile = "/etc/keys/rapido"; allowDiscards = true; diff --git a/flake.nix b/flake.nix index a594f80..794f3d9 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,7 @@ { nixpkgs.overlays = sharedOverlays; home-manager.sharedModules = [ self.homeManagerModules.dotfiles ]; + system.nixos.tags = [ "flakes" ]; } ]; }; diff --git a/install_os.sh b/install_os.sh index 0091fa9..57cd442 100755 --- a/install_os.sh +++ b/install_os.sh @@ -2,6 +2,9 @@ #! nix-shell -i bash #! nix-shell -p bash nixos-install-tools +echo FIXME Not flakes ready +exit 1 + set -euo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/os/default.nix b/os/default.nix index 62b711b..6cfe943 100644 --- a/os/default.nix +++ b/os/default.nix @@ -8,7 +8,6 @@ ./desktop.nix ./gaming ./geoffrey.nix - # ./wireless.nix - # FIXME networks.json is git-ignored, so flakes will not use it + ./wireless.nix ]; } diff --git a/os/wireless.nix b/os/wireless.nix index b1e2b9e..fc72db7 100644 --- a/os/wireless.nix +++ b/os/wireless.nix @@ -3,7 +3,6 @@ # wireless support via wpa_supplicant networking.wireless = { enable = true; - networks = builtins.fromJSON (builtins.readFile ./wireless/networks.json); # If this file doesn't exist, run ./wireless/import.py extraConfig = '' country=NL ''; diff --git a/os/wireless/.gitignore b/os/wireless/.gitignore index 25887d8..912374d 100644 --- a/os/wireless/.gitignore +++ b/os/wireless/.gitignore @@ -1,2 +1,2 @@ -networks.json -networks.env +wireless_networks.json +wireless_networks.env diff --git a/os/wireless/import.py b/os/wireless/import.py index d4535be..bda0449 100755 --- a/os/wireless/import.py +++ b/os/wireless/import.py @@ -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"; # sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"; # } +# TODO Very ugly, can probably do better import hashlib import json @@ -157,10 +158,14 @@ for path in list_networks(): for suffix in suffixes: 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) -with open("networks.env", "w") as fd: +with open("wireless_networks.env", "w") as fd: if SEPARATE_PASSWORDS: for k, v in Password.vars().items(): print(f"{k}={v}", file=fd) + +print("Now, execute:") +print("sudo mv -f wireless_networks.* /etc/keys") +print("sudo nixos-rebuild switch") diff --git a/result b/result new file mode 120000 index 0000000..51e26b2 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/gw0sb3b287fqdrwszimkffypb14w7yvv-nixos-system-curacao-flakes-23.11.20240103.b0b2c54 \ No newline at end of file