19 lines
374 B
Plaintext
19 lines
374 B
Plaintext
|
#!/usr/bin/env python3
|
||
|
from pathlib import Path
|
||
|
import shutil
|
||
|
|
||
|
|
||
|
def main() -> None:
|
||
|
with open("/etc/hostname", "r") as f:
|
||
|
content = f.read()
|
||
|
hostname = content.strip()
|
||
|
source = Path("/etc/nixos")
|
||
|
destination = Path(__file__).parent / hostname
|
||
|
print(source, destination)
|
||
|
shutil.copytree(source, destination, dirs_exist_ok=True)
|
||
|
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|