This commit is contained in:
mjallen18
2024-11-01 11:20:55 -05:00
parent 08511858d6
commit 7e63334b1a
11 changed files with 180 additions and 97 deletions

156
flake.lock generated
View File

@@ -7,16 +7,18 @@
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"napalm": "napalm",
"nixpkgs": "nixpkgs",
"nixpkgs": [
"nixpkgs-stable"
],
"poetry2nix": "poetry2nix",
"systems": "systems"
},
"locked": {
"lastModified": 1727699431,
"narHash": "sha256-hzfwSzrrZ/1hFPBFGraWOG5KAU0UHI9KbJWmQS0AaqU=",
"lastModified": 1730387901,
"narHash": "sha256-XnO0bx330mgfiLGIEnUEH4fBhKx5DcZTXl47VjLCeok=",
"owner": "nix-community",
"repo": "authentik-nix",
"rev": "31128721a9f879777870adb88ebc6166112ff172",
"rev": "74b5a8c5ffbca16f7af1def137e06a97a958a098",
"type": "github"
},
"original": {
@@ -28,16 +30,16 @@
"authentik-src": {
"flake": false,
"locked": {
"lastModified": 1727446911,
"narHash": "sha256-AlIzFSVfXBuvHkrlFqIBhcRohax5XFXvz/9ULelE8tw=",
"lastModified": 1730315123,
"narHash": "sha256-UYOdBlkGeIGCG/pCGLANWv1bKTdBEUp6jTiLG7BpY7E=",
"owner": "goauthentik",
"repo": "authentik",
"rev": "91d2445c61da49026f76dceb7f5b524e30335a42",
"rev": "e8b5e4c1272151f4a3666e53754f7deefb8e2fb3",
"type": "github"
},
"original": {
"owner": "goauthentik",
"ref": "version/2024.8.3",
"ref": "version/2024.8.4",
"repo": "authentik",
"type": "github"
}
@@ -47,14 +49,14 @@
"flake-schemas": "flake-schemas",
"home-manager": "home-manager",
"jovian": "jovian",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1729599319,
"narHash": "sha256-e/4JPcIRte5zkwqmGFrFo3763e0iHURX6N0apz4jbI0=",
"lastModified": 1730390431,
"narHash": "sha256-M+rMhDB69Y35IlhmAMN4ErDige+wKPwhb6HDqpF14Rw=",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "1b86b304c8eb1437d9337a760e7f930826fc4d6d",
"rev": "40388a7427ee32af175c5169ae7587ffd2dec125",
"type": "github"
},
"original": {
@@ -74,11 +76,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1729621928,
"narHash": "sha256-uQ24A8LLHnnBklWEN89N8P7yIKbjS6XF+eTQUSq9Vho=",
"lastModified": 1730338548,
"narHash": "sha256-wwAKXZr5GU36NrVy/gERRWuQjIKvZYrTD5mRahd87vI=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "658e0710371871a2e8ff72a583f5133be87c4b7d",
"rev": "bb2350119400c47be764c348e67f1b38e858435f",
"type": "github"
},
"original": {
@@ -293,11 +295,11 @@
]
},
"locked": {
"lastModified": 1729414726,
"narHash": "sha256-Dtmm1OU8Ymiy9hVWn/a2B8DhRYo9Eoyx9veERdOBR4o=",
"lastModified": 1730016908,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fe56302339bb28e3471632379d733547caec8103",
"rev": "e83414058edd339148dc142a8437edb9450574c8",
"type": "github"
},
"original": {
@@ -313,15 +315,16 @@
]
},
"locked": {
"lastModified": 1729551526,
"narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
@@ -333,16 +336,15 @@
]
},
"locked": {
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"lastModified": 1730016908,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"rev": "e83414058edd339148dc142a8437edb9450574c8",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
@@ -371,11 +373,11 @@
]
},
"locked": {
"lastModified": 1729177642,
"narHash": "sha256-DdKal+ZhB9QD/tnEwFg4cZ4j4YnrkvSljBxnyG+3eE0=",
"lastModified": 1730248099,
"narHash": "sha256-Fl7BSdpLk0uTXF6ol/MR0q1EB4XQ8tn0ftig0pyYh5Y=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "bb69165ff372ddbd3228a03513922acd783040e8",
"rev": "c11bab124fc55a37cbd854ed28ea121ed609231f",
"type": "github"
},
"original": {
@@ -439,14 +441,14 @@
},
"nix-darwin": {
"inputs": {
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1729579044,
"narHash": "sha256-0kEUVl5s8LHbK4/xEePflsdYVwG+RRFSIofSvITYmIU=",
"lastModified": 1730184279,
"narHash": "sha256-6OB+WWR6gnaWiqSS28aMJypKeK7Pjc2Wm6L0MtOrTuA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "64d9d1ae25215c274c37e3e4016977a6779cf0d3",
"rev": "b379bd4d872d159e5189053ce9a4adf86d56db4b",
"type": "github"
},
"original": {
@@ -486,11 +488,11 @@
]
},
"locked": {
"lastModified": 1690328911,
"narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=",
"lastModified": 1729697500,
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
"owner": "zhaofengli",
"repo": "nix-github-actions",
"rev": "96df4a39c52f53cb7098b923224d8ce941b64747",
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
"type": "github"
},
"original": {
@@ -503,7 +505,7 @@
"nixos-apple-silicon": {
"inputs": {
"flake-compat": "flake-compat_4",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay_3"
},
"locked": {
@@ -522,11 +524,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1729624485,
"narHash": "sha256-iEffyT68tEU5kHQuyP05QRH+JhWNNLAwHfgZAzXFS7o=",
"lastModified": 1730368399,
"narHash": "sha256-F8vJtG389i9fp3k2/UDYHMed3PLCJYfxCqwiVP7b9ig=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "22e8de2729f40d29a445c8baeaf22740b8b25daf",
"rev": "da14839ac5f38ee6adbdb4e6db09b5eef6d6ccdc",
"type": "github"
},
"original": {
@@ -538,11 +540,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1726937504,
"narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=",
"lastModified": 1730200266,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9357f4f23713673f310988025d9dc261c20e70c6",
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github"
},
"original": {
@@ -566,11 +568,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729449015,
"narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
"lastModified": 1730137625,
"narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "89172919243df199fe237ba0f776c3e3e3d72367",
"rev": "64b80bfb316b57cdb8919a9110ef63393d74382a",
"type": "github"
},
"original": {
@@ -598,11 +600,11 @@
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1729449015,
"narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
"lastModified": 1730137625,
"narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "89172919243df199fe237ba0f776c3e3e3d72367",
"rev": "64b80bfb316b57cdb8919a9110ef63393d74382a",
"type": "github"
},
"original": {
@@ -614,11 +616,11 @@
},
"nixpkgs-stable_4": {
"locked": {
"lastModified": 1729357638,
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
"lastModified": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
@@ -630,11 +632,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1729413321,
"narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"lastModified": 1730200266,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github"
},
"original": {
@@ -646,11 +648,11 @@
},
"nixpkgs-unstable-small": {
"locked": {
"lastModified": 1729577921,
"narHash": "sha256-bxktXyAj3818+okqwaR9L/F4UREnry0OEjnYqwYVdkc=",
"lastModified": 1730359060,
"narHash": "sha256-Hkk0mf4pgvX9Ut0YA397nsFqMLhzFVBdFHc4PhBrxYE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "29dccd64f527eebafce219e7ca2bfda5fee75456",
"rev": "e19cfce6f3f08d07653157d8826f5c920c770d7b",
"type": "github"
},
"original": {
@@ -661,22 +663,6 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1729413321,
"narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1718149104,
"narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=",
@@ -690,7 +676,7 @@
"type": "indirect"
}
},
"nixpkgs_4": {
"nixpkgs_3": {
"locked": {
"lastModified": 1725103162,
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
@@ -706,13 +692,13 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1729265718,
"narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=",
"lastModified": 1729951556,
"narHash": "sha256-bpb6r3GjzhNW8l+mWtRtLNg5PhJIae041sPyqcFNGb4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ccc0c2126893dd20963580b6478d1a10a4512185",
"rev": "4e0eec54db79d4d0909f45a88037210ff8eaffee",
"type": "github"
},
"original": {
@@ -806,11 +792,11 @@
]
},
"locked": {
"lastModified": 1729564184,
"narHash": "sha256-dP764PQ6YhjY7C84Txnrb2vf0H2YdQlp5c6a7G18fgw=",
"lastModified": 1730255392,
"narHash": "sha256-9pydem8OVxa0TwjUai1PJe0yHAJw556CWCEwyoAq8Ik=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d687672b4541496408068bc273d94c643005d4c9",
"rev": "7509d76ce2b3d22b40bd25368b45c0a9f7f36c89",
"type": "github"
},
"original": {
@@ -862,15 +848,15 @@
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_4"
},
"locked": {
"lastModified": 1729587807,
"narHash": "sha256-YOc4033a/j1TbdLfkaSOSX2SrvlmuM+enIFoveNTCz4=",
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "26642e8f193f547e72d38cd4c0c4e45b49236d27",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github"
},
"original": {

View File

@@ -12,7 +12,10 @@
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
# Authentik
authentik-nix.url = "github:nix-community/authentik-nix";
authentik-nix = {
url = "github:nix-community/authentik-nix";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
# Chaotic-nix
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
@@ -22,12 +25,12 @@
# Home Manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager-stable = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
@@ -81,7 +84,7 @@
nixosConfigurations = {
# Desktop
"matt-nixos" = nixpkgs-unstable-small.lib.nixosSystem {
"matt-nixos" = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs;

View File

@@ -26,6 +26,9 @@ let
modprobe iwlwifi
fi
'';
fixWifiScript = pkgs.writeScriptBin "fix-wifi" ''
/home/matt/nix-config/scripts/fix-wifi.py
'';
in
{
imports = [
@@ -35,6 +38,7 @@ in
./filesystems.nix
./sops.nix
../default.nix
../../share/amd
# specialisations
# ./cosmic
./hyprland
@@ -120,14 +124,16 @@ in
enable = lib.mkDefault true;
path = [
pkgs.bash
pkgs.python3
pkgs.networkmanager
pkgs.kmod
fixWifiScript
];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = [ "${resetNetworkScript}/bin/reset-network" ];
ExecStart = [ "${fixWifiScript}/bin/fix-wifi" ];
};
};
};
@@ -174,6 +180,7 @@ in
};
virtualisation.libvirtd.enable = lib.mkDefault true;
virtualisation.waydroid.enable = lib.mkDefault true;
programs.gamemode.enable = lib.mkDefault true;
@@ -196,6 +203,7 @@ in
clinfo
direnv
efibootmgr
fixWifiScript
gparted
grsync
kmod

View File

@@ -92,7 +92,12 @@
fsType = "vfat";
};
swapDevices = [ { device = "/dev/disk/by-uuid/c0b407c5-aaa6-4ff2-89e2-39ebee6bf235"; } ];
swapDevices = [
{
device = "/dev/disk/by-id/nvme-Samsung_SSD_980_PRO_1TB_S5P2NS0T307907H-part2";
randomEncryption.enable = true;
}
];
fileSystems."/home/matt/Games" = {
device = "/dev/disk/by-uuid/1adb3161-ef9e-45d9-be5f-dd718186f1b3";

View File

@@ -61,8 +61,11 @@ in
# gamescope # using chaotic git version
# gamescope-wsi # using chaotic git version
age
apple-cursor
bottles
chromium
colloid-icon-theme
colloid-kde
compose2nix
coolercontrol.coolercontrol-gui
deadnix

View File

@@ -84,6 +84,7 @@ in
clinfo
cmake
coolercontrol.coolercontrol-gui
deconz
duperemove
efibootmgr
ffmpeg
@@ -114,6 +115,7 @@ in
tailscale
tpm2-tools
tpm2-tss
usbutils
vim
vulkan-tools
wget

View File

@@ -29,6 +29,12 @@
group = "root";
mode = "u=rwx,g=rx,o=rx";
}
{
directory = "/media/nas";
user = "nas-apps";
group = "jallen-nas";
mode = "u=rwx,g=rx,o=rx";
}
];
files = [
"/etc/machine-id"

View File

@@ -18,8 +18,8 @@ in
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
API_ENDPOINT = "http://10.0.1.18:${cfg.portServer}";
CLIENT_ENDPOINT = "http://10.0.1.18:${cfg.portWeb}";
API_ENDPOINT = "https://your-spotify-server.mjallen.dev";
CLIENT_ENDPOINT = "https://your-spotify.mjallen.dev";
SPOTIFY_PUBLIC = "e270589d72a6494680a17d325af8670d";
SPOTIFY_SECRET = "423cb7b69fe8486e89eccd01e0c22924";
MONGO_ENDPOINT = "mongodb://10.0.1.18:27017";
@@ -34,7 +34,7 @@ in
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
API_ENDPOINT = "http://10.0.1.18:${cfg.portServer}";
API_ENDPOINT = "https://your-spotify-server.mjallen.dev";
};
};
};

View File

@@ -1,2 +0,0 @@
[Desktop Entry]
Icon=folder-script

73
scripts/fix-wifi.py Executable file
View File

@@ -0,0 +1,73 @@
#!/usr/bin/env python3
import subprocess
import socket
import logging
from typing import List, Optional
def check_internet_connection(hosts_to_check: Optional[List[str]] = None) -> bool:
"""
Check internet connectivity by attempting to connect to reliable hosts.
:param hosts_to_check: Optional list of hosts to check.
:return: Boolean indicating if internet connection is available
"""
if hosts_to_check is None:
hosts_to_check = [
"8.8.8.8", # Google DNS
"1.1.1.1", # Cloudflare DNS
"9.9.9.9" # Quad9 DNS
]
for host in hosts_to_check:
try:
# Create a socket connection with a 5-second timeout
socket.create_connection((host, 53), timeout=5)
return True
except (socket.error, socket.timeout):
continue
return False
def reset_wifi_card() -> bool:
"""
Execute WiFi card reset commands.
:return: Boolean indicating if reset commands were successful
"""
reset_commands = [
"echo 1 | sudo -u root tee /sys/bus/pci/devices/0000:09:00.0/reset",
"sudo rmmod iwlwifi",
"sudo modprobe iwlwifi"
]
try:
for command in reset_commands:
result = subprocess.run(
command,
shell=True,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
print(f"Executed: {command}")
print(f"Output: {result.stdout}")
return True
except subprocess.CalledProcessError as e:
print(f"Error resetting WiFi: {e}")
print(f"Error output: {e.stderr}")
return False
def main():
"""
Check internet connection and reset WiFi if not connected.
"""
if not check_internet_connection():
print("No internet connection detected. Attempting WiFi reset...")
reset_wifi_card()
else:
print("Internet connection is stable. No reset needed.")
if __name__ == "__main__":
main()

Submodule scripts/nix-db-repair deleted from 5a587b43da