Please
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
# User-specific configuration (generated by make init)
|
||||
settings.nix
|
||||
hardware-configuration.nix
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
"nix:push" = "cd /etc/nixos && git add -A && git commit -m \"$(date -u +%s)\" && git push";
|
||||
"nix:pull" = "cd /etc/nixos && git pull";
|
||||
|
||||
# Git Config
|
||||
"git:config:name" = "printf \"Enter Git Name: \"; read -r name; sudo sed -i \"s/gitName = \\\".*\\\";/gitName = \\\"$name\\\";/\" /etc/nixos/settings.nix";
|
||||
"git:config:email" = "printf \"Enter Git Email: \"; read -r email; sudo sed -i \"s/gitEmail = \\\".*\\\";/gitEmail = \\\"$email\\\";/\" /etc/nixos/settings.nix";
|
||||
"git:config:key" = "printf \"Enter Git Public Key: \"; read -r key; sudo sed -i \"s|gitKey = \\\".*\\\";|gitKey = \\\"$key\\\";|\" /etc/nixos/settings.nix";
|
||||
|
||||
# Utilities
|
||||
"fixaudio" = "systemctl --user restart pipewire pipewire-pulse wireplumber";
|
||||
"nf" = "neofetch";
|
||||
};
|
||||
|
||||
@@ -16,14 +16,11 @@ in
|
||||
|
||||
# Allowed ports
|
||||
allowedTCPPorts = [
|
||||
# Sunshine
|
||||
47984 47989 48010
|
||||
# SyncThing
|
||||
8384 22000
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
# Sunshine
|
||||
47998 47999 48000 48010
|
||||
|
||||
# SyncThing
|
||||
22000 21027
|
||||
];
|
||||
|
||||
@@ -40,8 +40,8 @@ in
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
openFirewall = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
applications = {
|
||||
apps = [
|
||||
{
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SETTINGS="settings.nix"
|
||||
REPO_DIR=$(pwd)
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 1. Generate settings.nix
|
||||
if [ -f "$SETTINGS" ]; then
|
||||
echo -e "${YELLOW}settings.nix exists. overwrite? [y/N]${NC}"
|
||||
read -r confirm
|
||||
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
|
||||
echo "keeping existing settings"
|
||||
else
|
||||
GENERATE=true
|
||||
fi
|
||||
else
|
||||
GENERATE=true
|
||||
fi
|
||||
|
||||
if [ "$GENERATE" = true ]; then
|
||||
username=$(whoami)
|
||||
userdesc=$(getent passwd "$username" | cut -d: -f5 | cut -d, -f1)
|
||||
userdesc=${userdesc:-$username}
|
||||
|
||||
echo "user: $username ($userdesc)"
|
||||
echo ""
|
||||
|
||||
echo "hostname:"
|
||||
read -r hostname
|
||||
|
||||
echo "timezone [America/Edmonton]:"
|
||||
read -r tz
|
||||
tz=${tz:-America/Edmonton}
|
||||
|
||||
echo "locale [en_CA.UTF-8]:"
|
||||
read -r locale
|
||||
locale=${locale:-en_CA.UTF-8}
|
||||
|
||||
echo ""
|
||||
echo "{" > "$SETTINGS"
|
||||
echo " hostname = \"$hostname\";" >> "$SETTINGS"
|
||||
echo " username = \"$username\";" >> "$SETTINGS"
|
||||
echo " userDescription = \"$userdesc\";" >> "$SETTINGS"
|
||||
echo " timezone = \"$tz\";" >> "$SETTINGS"
|
||||
echo " locale = \"$locale\";" >> "$SETTINGS"
|
||||
echo " userGroups = [ \"networkmanager\" \"wheel\" \"docker\" \"plugdev\" ];" >> "$SETTINGS"
|
||||
echo "}" >> "$SETTINGS"
|
||||
echo "wrote $SETTINGS"
|
||||
fi
|
||||
|
||||
# 2. Copy hardware-configuration.nix
|
||||
if [ -f "/etc/nixos/hardware-configuration.nix" ]; then
|
||||
cp /etc/nixos/hardware-configuration.nix "$REPO_DIR/hardware-configuration.nix"
|
||||
echo "copied hardware-configuration.nix"
|
||||
else
|
||||
echo -e "${YELLOW}no hardware-configuration.nix found - run nixos-generate-config first${NC}"
|
||||
fi
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
hostname = "nixos";
|
||||
username = "user";
|
||||
userDescription = "User";
|
||||
timezone = "America/Edmonton";
|
||||
locale = "en_CA.UTF-8";
|
||||
userGroups = [ "networkmanager" "wheel" "docker" "plugdev" ];
|
||||
gitName = "User Name";
|
||||
gitEmail = "user@email.com";
|
||||
gitKey = "ssh-ed25519 ...";
|
||||
}
|
||||
11
settings.nix
Normal file
11
settings.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
hostname = "lavitz";
|
||||
username = "atridad";
|
||||
userDescription = "Atridad Lahiji";
|
||||
timezone = "America/Edmonton";
|
||||
locale = "en_CA.UTF-8";
|
||||
userGroups = [ "networkmanager" "wheel" "docker" "plugdev" ];
|
||||
gitName = "Atridad Lahiji";
|
||||
gitEmail = "me@atri.dad";
|
||||
gitKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILKb+pDgkHEKI7LDWvZbhoLJ11uJMaCmVyAqotDxNOI7 me@atri.dad";
|
||||
}
|
||||
Reference in New Issue
Block a user