Feature: WIP homelab kernel configuration.
This commit is contained in:
parent
88637fe95b
commit
7f3e849b8c
8 changed files with 9508 additions and 0 deletions
21
machines/homelab/kernel/config_to_nix.sh
Normal file
21
machines/homelab/kernel/config_to_nix.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
echo 'structuredExtraConfig = with pkgs.lib.kernel; {'
|
||||
while read -r line
|
||||
do
|
||||
if ! [[ -z "$line" ]] && ! [[ "$line" =~ "#" ]]; then
|
||||
export NAME=$(echo ${line:7} | cut -d= -f1)
|
||||
export VALUE=$(echo -n $line | cut -d= -f2)
|
||||
echo -n "$NAME = "
|
||||
|
||||
case $VALUE in
|
||||
"y")
|
||||
echo -n "yes";;
|
||||
"n")
|
||||
echo -n "no";;
|
||||
*)
|
||||
echo -n $VALUE;
|
||||
esac;
|
||||
echo ";";
|
||||
fi;
|
||||
done < config;
|
||||
|
||||
echo '};'
|
||||
Loading…
Add table
Add a link
Reference in a new issue