so many sops

This commit is contained in:
mjallen18
2025-03-17 21:34:52 -05:00
parent 7741fc575f
commit 32eadb044d
53 changed files with 801 additions and 591 deletions

View File

@@ -22,6 +22,7 @@ in
"nix-command"
"flakes"
];
trusted-users = [ "@wheel" ];
};
# Garbage collect automatically every week
@@ -66,10 +67,6 @@ in
pulse.enable = lib.mkDefault true;
};
# Disable pulse audio in favor of pipewire
# pulseaudio.enable = lib.mkForce false;
# Enable Avahi for .local hostname resolution
avahi = {
enable = lib.mkDefault true;
@@ -105,8 +102,6 @@ in
zsh.enable = lib.mkDefault true;
gnupg.agent = {
enable = lib.mkDefault true;
# pinentryPackage = pkgs.pinentry-curses;
# pinentryPackage = lib.mkForce pkgs.pinentry-qt;
enableSSHSupport = lib.mkDefault true;
};
};

View File

@@ -1,7 +1,7 @@
{ lib, pkgs, ... }:
{ pkgs, ... }:
let
configLimit = 5;
default = "@saved";
# default = "@saved";
kernel = pkgs.linuxPackages_cachyos;
in
{

View File

@@ -12,100 +12,19 @@
let
user = "matt";
passwordFile = config.sops.secrets."desktop/matt_password".path;
hostname = "matt-nixos";
fixWifiScript = pkgs.writeScriptBin "fix-wifi" ''
#!/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()
'';
in
{
imports = [
# Include the results of the hardware scan.
../../modules/apps/discover-wrapped
./hardware-configuration.nix
./boot.nix
./filesystems.nix
./hardware-configuration.nix
./networking.nix
./services.nix
./sops.nix
../default.nix
../../share/amd
# specialisations
# ./cosmic
# ./hyprland
];
apps.discover-wrapped.enable = lib.mkDefault false;
chaotic.mesa-git.enable = true;
# Enable nix flakes and nix-command tools
@@ -125,99 +44,10 @@ in
"nix-command"
"flakes"
];
trusted-users = lib.mkDefault [
"root"
user
];
trusted-users = [ user ];
};
};
services = {
# Enable Desktop Environment.
xserver = {
desktopManager.gnome.enable = true;
# Enable Desktop Environment.
displayManager = {
gdm.enable = lib.mkForce true;
gdm.wayland = lib.mkForce true;
};
};
# Enable Flatpak
flatpak.enable = lib.mkDefault false;
# enable auto discovery of printers
avahi = {
enable = lib.mkDefault true;
nssmdns4 = lib.mkDefault true;
openFirewall = lib.mkDefault true;
};
restic.backups = {
jallen-nas = {
initialize = true;
createWrapper = true;
inhibitsSleep = true;
environmentFile = config.sops.templates."restic.env".path;
passwordFile = config.sops.secrets."desktop/restic/password".path;
repository = "rest:http://admin:BogieDudie1@10.0.1.18:8008";
paths = [
"/home/matt"
];
exclude = [
"/home/matt/Games"
"/home/matt/1TB"
"/home/matt/Downloads"
"/home/matt/Nextcloud"
"/home/matt/.cache"
"/home/matt/.local/share/Steam"
"/home/matt/.var/app/com.valvesoftware.Steam"
"/home/matt/.tmp"
"/home/matt/.thumbnails"
"/home/matt/.compose-cache"
];
};
proton-drive = {
initialize = true;
createWrapper = true;
inhibitsSleep = true;
passwordFile = config.sops.secrets."desktop/restic/password".path;
rcloneConfigFile = "/home/matt/.config/rclone/rclone.conf";
repository = "rclone:proton-drive:backup-nix";
paths = [
"/home/matt"
];
exclude = [
"/home/matt/Games"
"/home/matt/1TB"
"/home/matt/Downloads"
"/home/matt/Nextcloud"
"/home/matt/.cache"
"/home/matt/.local/share/Steam"
"/home/matt/.var/app/com.valvesoftware.Steam"
"/home/matt/.tmp"
"/home/matt/.thumbnails"
"/home/matt/.compose-cache"
];
};
};
btrfs = {
autoScrub.enable = lib.mkDefault true;
autoScrub.fileSystems = lib.mkDefault [
"/nix"
"/root"
"/etc"
"/var/log"
"/home"
];
};
ratbagd.enable = lib.mkDefault true;
};
# xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
share.hardware.amd = {
enable = lib.mkDefault true;
lact.enable = lib.mkDefault true;
@@ -225,62 +55,6 @@ in
share.gaming.enable = true;
systemd = {
services = {
fix-wifi = {
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 = [ "${fixWifiScript}/bin/fix-wifi" ];
};
};
};
user.services = {
rclone-home-proton = {
enable = lib.mkDefault false;
path = [
pkgs.bash
pkgs.rclone
];
script = ''
rclone sync /home/matt proton-drive:backup-nix --exclude '/home/matt/Games/**' --exclude '/home/matt/1TB/**' --exclude '/home/matt/Downloads/**'
'';
};
rsync-home = {
enable = lib.mkDefault false;
path = [
pkgs.bash
pkgs.rsync
pkgs.openssh
];
script = ''
rsync -rtpogvPlHzs --ignore-existing --exclude={'/home/matt/Games', '/home/matt/1TB', '/home/matt/Downloads/*', '/home/matt/.cache'} -e ssh /home/matt admin@10.0.1.18:/media/nas/main/backup/desktop-nix/home
'';
};
};
};
# Networking configs
networking = {
hostName = hostname;
# Enable Network Manager
networkmanager.enable = lib.mkDefault true;
networkmanager.wifi.powersave = lib.mkDefault false;
networkmanager.settings.connectivity.uri = lib.mkDefault "http://nmcheck.gnome.org/check_network_status.txt";
};
# Time config
time = {
hardwareClockInLocalTime = lib.mkDefault false;
@@ -289,11 +63,9 @@ in
virtualisation.libvirtd.enable = lib.mkDefault true;
virtualisation.waydroid.enable = lib.mkDefault true;
programs.gamemode.enable = lib.mkDefault true;
programs.coolercontrol = {
enable = true;
programs = {
gamemode.enable = true;
coolercontrol.enable = true;
};
# Configure environment
@@ -311,7 +83,6 @@ in
clinfo
direnv
efibootmgr
fixWifiScript
gparted
grsync
kmod
@@ -341,11 +112,9 @@ in
vulkan-tools
wget
winetricks
# native wayland support (unstable)
wineWowPackages.waylandFull
];
etc."lact/config.yaml".text = ''
etc."lact/config.yaml".text = ''
daemon:
log_level: info
admin_groups:
@@ -375,17 +144,22 @@ in
performance_level: auto
voltage_offset: 0
power_states: {}
'';
'';
variables = {
STEAM_FORCE_DESKTOPUI_SCALING = "1.0";
GDK_SCALE = "1";
EDITOR = "code --wait";
VISUAL = "code --wait";
};
};
# Configure nixpkgs
nixpkgs = {
overlays = [ outputs.overlays.nixpkgs-unstable outputs.overlays.nixpkgs-stable ];
overlays = [
outputs.overlays.nixpkgs-unstable
outputs.overlays.nixpkgs-stable
];
config.permittedInsecurePackages = [
# ...
];

View File

@@ -1,13 +0,0 @@
{ ... }:
{
specialisation.cosmic.configuration = {
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
# disable plasma
displayManager.sddm.enable = false;
desktopManager.plasma6.enable = false;
};
};
}

View File

@@ -26,12 +26,29 @@ in
home.username = "matt";
home.homeDirectory = "/home/matt";
home.stateVersion = "23.11";
programs.home-manager.enable = true;
sops = {
age.keyFile = "/home/matt/.config/sops/age/keys.txt";
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
validateSopsFiles = false;
secrets = {
"ssh-keys-public/desktop-nixos" = {
path = "/home/matt/.ssh/id_ed25519.pub";
mode = "0644";
};
"ssh-keys-private/desktop-nixos" = {
path = "/home/matt/.ssh/id_ed25519";
mode = "0600";
};
};
};
programs = {
fish.enable = false;
mangohud.enable = true;
java.enable = true;
command-not-found.enable = true;
home-manager.enable = true;
zsh = {
enable = true;
@@ -56,6 +73,7 @@ in
"privacy.clearOnShutdown.downloads" = false; # Disable clearing downloads on shutdown
"privacy.clearOnShutdown.cache" = false; # Disable clearing cache on shutdown
"privacy.clearOnShutdown.cookiesAndStorage" = false; # Disable clearing cookies and storage on shutdown
"privacy.clearOnShutdown.cookies" = false; # Disable clearing cookies on shutdown
"privacy.clearOnShutdown_v2.cache" = false; # Disable clearing cache on shutdown
"privacy.clearOnShutdown_v2.cookiesAndStorage" = false; # Disable clearing cookies and storage on shutdown
"privacy.clearOnShutdown.formdata" = false; # Disable clearing form data on shutdown
@@ -63,6 +81,7 @@ in
"privacy.clearHistory.cache" = false; # Disable clearing cache on history clear
"privacy.clearHistory.cookiesAndStorage" = false; # Disable clearing cookies on history clear
"privacy.clearHistory.historyFormDataAndDownloads" = false; # Disable clearing history, form data, and downloads on history clear
"privacy.clearHistory.browsingHistoryAndDownloads" = false; # Disable clearing browsing history and downloads on history clear
"privacy.clearSiteData.cache" = false; # Disable clearing cache on site data clear
"privacy.clearSiteData.cookiesAndStorage" = false; # Disable clearing cookies on site data clear
"services.sync.prefs.sync.privacy.clearOnShutdown.cache" = true; # Enable syncing cache clear on shutdown
@@ -78,44 +97,44 @@ in
"services.sync.prefs.sync.privacy.clearOnShutdown_v2.downloads" = true; # Enable syncing downloads clear on shutdown
"services.sync.prefs.sync.privacy.clearOnShutdown_v2.historyFormDataAndDownloads" = true; # Enable syncing form data clear on shutdown
"services.sync.prefs.sync.privacy.clearOnShutdown_v2.siteSettings" = true; # Enable syncing site settings clear on shutdown
"browser.newtabpage.activity-stream.feeds.topsites" = true; # Enable top sites on new tab page
"browser.newtabpage.activity-stream.topSitesRows" = 3; # Set number of rows for top sites on new tab page
};
};
git = {
enable = true;
userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com";
aliases = gitAliases;
};
steam-rom-manager = {
enable = true;
steamUsername = "matt";
environmentVariables = {
romsDirectory = "/home/matt/Games/roms";
steamDirectory = "/home/matt/.local/share/Steam";
};
emulators = {
ryujinx = {
enable = true;
};
pcsx2 = {
enable = true;
};
"Non-SRM Shortcuts" = {
enable = true;
parserType = "Non-SRM Shortcuts";
extraArgs = "";
};
# Add other emulators as needed
};
};
};
programs.git = {
enable = true;
userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com";
aliases = gitAliases;
};
programs.steam-rom-manager = {
enable = true;
steamUsername = "matt";
environmentVariables = {
romsDirectory = "/home/matt/Games/roms";
steamDirectory = "/home/matt/.local/share/Steam";
};
emulators = {
ryujinx = {
enable = true;
};
pcsx2 = {
enable = true;
};
"Non-SRM Shortcuts" = {
enable = true;
parserType = "Non-SRM Shortcuts";
extraArgs = "";
};
# Add other emulators as needed
};
};
programs.command-not-found.enable = true;
home.packages = with pkgs; [
age
apple-cursor

View File

@@ -1,16 +0,0 @@
let configDir = ./config;
in
{
home.file = {
".config/wallpapers".source = "${configDir}/wallpapers";
".config/kitty/macchiato.conf".source = "${configDir}/kitty/macchiato.conf";
".config/kitty/nord.conf".source = "${configDir}/kitty/nord.conf";
".config/wlogout".source = "${configDir}/wlogout"; #
".config/waybar/scripts".source = "${configDir}/waybar/scripts";
".config/waybar/macchiato.css".source = "${configDir}/waybar/macchiato.css";
".config/waybar/nord.css".source = "${configDir}/waybar/nord.css";
".config/btop/themes".source = "${configDir}/btop/themes";
".config/nwg-drawer".source = "${configDir}/nwg-drawer";
".config/nwg-panel".source = "${configDir}/nwg-panel";
};
}

View File

@@ -1,73 +0,0 @@
{ pkgs, ... }:
{
programs.btop = {
enable = true;
settings = {
color_theme = "/home/matt/.config/btop/themes/nord.theme";
theme_background = true;
truecolor = true;
force_tty = false;
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty";
vim_keys = true;
rounded_corners = true;
graph_symbol = "braille";
graph_symbol_cpu = "default";
graph_symbol_mem = "default";
graph_symbol_net = "default";
graph_symbol_proc = "default";
shown_boxes = "cpu mem net proc";
update_ms = 2000;
proc_sorting = "cpu lazy";
proc_reversed = false;
proc_tree = false;
proc_colors = true;
proc_gradient = true;
proc_per_core = false;
proc_mem_bytes = true;
proc_cpu_graphs = true;
proc_info_smaps = false;
proc_left = false;
proc_filter_kernel = false;
cpu_graph_upper = "total";
cpu_graph_lower = "total";
cpu_invert_lower = true;
cpu_single_graph = false;
cpu_bottom = false;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
cpu_core_map = "";
temp_scale = "celsius";
base_10_sizes = false;
show_cpu_freq = true;
clock_format = "%X";
background_update = true;
custom_cpu_name = "";
disks_filter = "";
mem_graphs = true;
mem_below_net = false;
zfs_arc_cached = true;
show_swap = true;
swap_disk = true;
show_disks = true;
only_physical = true;
use_fstab = true;
zfs_hide_datasets = false;
disk_free_priv = false;
show_io_stat = true;
io_mode = false;
io_graph_combined = false;
io_graph_speeds = "";
net_download = 100;
net_upload = 100;
net_auto = true;
net_sync = true;
net_iface = "";
show_battery = true;
selected_battery = "Auto";
log_level = "WARNING";
};
};
}

View File

@@ -1,42 +0,0 @@
theme[main_bg]="#24273A"
theme[main_fg]="#CAD3F5"
theme[title]="#CAD3F5"
theme[hi_fg]="#8AADF4"
theme[selected_bg]="#494D64"
theme[selected_fg]="#8AADF4"
theme[inactive_fg]="#8087A2"
theme[graph_text]="#F4DBD6"
theme[meter_bg]="#494D64"
theme[proc_misc]="#F4DBD6"
theme[cpu_box]="#7DC4E4"
theme[mem_box]="#A6DA95"
theme[net_box]="#C6A0F6"
theme[proc_box]="#F0C6C6"
theme[div_line]="#6E738D"
theme[temp_start]="#EED49F"
theme[temp_mid]="#F5A97F"
theme[temp_end]="#ED8796"
theme[cpu_start]="#7DC4E4"
theme[cpu_mid]="#91D7E3"
theme[cpu_end]="#8BD5CA"
theme[free_start]="#8BD5CA"
theme[free_mid]="#8BD5CA"
theme[free_end]="#A6DA95"
theme[cached_start]="#F5BDE6"
theme[cached_mid]="#F5BDE6"
theme[cached_end]="#C6A0F6"
theme[available_start]="#F4DBD6"
theme[available_mid]="#F0C6C6"
theme[available_end]="#F0C6C6"
theme[used_start]="#F5A97F"
theme[used_mid]="#F5A97F"
theme[used_end]="#ED8796"
theme[download_start]="#B7BDF8"
theme[download_mid]="#B7BDF8"
theme[download_end]="#C6A0F6"
theme[upload_start]="#B7BDF8"
theme[upload_mid]="#B7BDF8"
theme[upload_end]="#C6A0F6"
theme[process_start]="#7DC4E4"
theme[process_mid]="#91D7E3"
theme[process_end]="#8BD5CA"

View File

@@ -1,42 +0,0 @@
theme[main_bg]="#2e3440"
theme[main_fg]="#eceff4"
theme[title]="#eceff4"
theme[hi_fg]="#8fbcbb"
theme[selected_bg]="#3b4252"
theme[selected_fg]="#8fbcbb"
theme[inactive_fg]="#434c5e"
theme[graph_text]="#eceff4"
theme[meter_bg]="#3b4252"
theme[proc_misc]="#eceff4"
theme[cpu_box]="#b48ead"
theme[mem_box]="#a3be8c"
theme[net_box]="#d08770"
theme[proc_box]="#bf616a"
theme[div_line]="#3b4252"
theme[temp_start]="#a3be8c"
theme[temp_mid]="#ebcb8b"
theme[temp_end]="#bf616a"
theme[cpu_start]="#b48ead"
theme[cpu_mid]="#d08770"
theme[cpu_end]="#bf616a"
theme[free_start]="#a3be8c"
theme[free_mid]="#ebcb8b"
theme[free_end]="#d08770"
theme[cached_start]="#a3be8c"
theme[cached_mid]="#ebcb8b"
theme[cached_end]="#d08770"
theme[available_start]="#eceff4"
theme[available_mid]="#bf616a"
theme[available_end]="#bf616a"
theme[used_start]="#a3be8c"
theme[used_mid]="#ebcb8b"
theme[used_end]="#bf616a"
theme[download_start]="#88c0d0"
theme[download_mid]="#88c0d0"
theme[download_end]="#d08770"
theme[upload_start]="#8fbcbb"
theme[upload_mid]="#8fbcbb"
theme[upload_end]="#d08770"
theme[process_start]="#b48ead"
theme[process_mid]="#d08770"
theme[process_end]="#bf616a"

View File

@@ -1,283 +0,0 @@
let
drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i Colloid-nord-dark";
in
{
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
settings = {
"$mod" = "SUPER";
# Mouse
# mouse_[up|down] - scroll wheel
# middle_mouse - 274
# thumb_up - 276
# thumb_down - 275
# l -> locked, will also work when an input inhibitor (e.g. a lockscreen) is active.
# r -> release, will trigger on release of a key.
# e -> repeat, will repeat when held.
# n -> non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher.
# m -> mouse, see below.
# t -> transparent, cannot be shadowed by other binds.
# i -> ignore mods, will ignore modifiers.
# s -> separate, will arbitrarily combine keys between each mod/key, see [Keysym combos](#keysym-combos) above.
# d -> has description, will allow you to write a description for your bind.
# p -> bypasses the app's requests to inhibit keybinds.
# https://wiki.hyprland.org/Configuring/Binds/
# https://wiki.hyprland.org/Configuring/Binds/#mouse-buttons
bind = [
"$mod, Return, exec, kitty"
"$mod, Q, killactive, "
"$mod, M, exec, wlogout --protocol layer-shell"
"$mod, E, exec, nautilus"
"$mod, V, togglefloating, "
"$mod, D, exec, ${drawer}"
"$mod, P, pseudo, " # dwindle
"$mod, S, togglesplit, " # dwindle
"$mod SHIFT, Q, exec, hyprlock"
", PRINT, exec, hyprshot -m region --clipboard-only"
"$mod,F,exec,hyprctl dispatch fullscreen active"
"$mod SHIFT, E, exec, smile"
"$mod, mouse:276, movecurrentworkspacetomonitor, DP-1"
"$mod, mouse:275, movecurrentworkspacetomonitor, DP-2"
# alt-tab between workspaces on active monitor
"ALT, Tab, workspace, m+1"
"ALT SHIFT, Tab, workspace, m-1"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, discord"
"$mod CTRL, l, resizeactive, 10 0"
"$mod CTRL, h, resizeactive, -10 0"
"$mod CTRL, k, resizeactive, 0 -10"
"$mod CTRL, j, resizeactive, 0 10"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
"$mod, b, exec, firefox"
];
bindm = [
# Move/resize windows with mod + LMB/RMB and dragging
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
# middle mouse will grab a window, mod + middle mouse will close it
"$mod SHIFT, mouse:274, movewindow"
];
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"
];
monitor = [
"DP-1,3840x2160@240.00000,0x0,1"
"DP-2,3840x2160@59.99700,3840x0,1"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
"col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg";
"col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
layout = "dwindle";
allow_tearing = true;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 2;
passes = 2;
new_optimizations = true;
xray = false;
};
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = "yes";
bezier = [
"overshot, 0.05, 0.9, 0.1, 1.05"
"smoothOut, 0.36, 0, 0.66, -0.56"
"smoothIn, 0.25, 1, 0.5, 1"
];
animation = [
"windows, 1, 5, overshot, slide"
"windowsOut, 1, 4, smoothOut, slide"
"windowsMove, 1, 4, default"
"border, 1, 10, default"
"fade, 1, 10, smoothIn"
"fadeDim, 1, 10, smoothIn"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = "yes";
preserve_split = "yes";
};
gestures = {
workspace_swipe = "off";
};
misc = {
force_default_wallpaper = 0;
};
workspace = [
"name:firefox, monitor:DP-2, default:false, special, firefox"
"name:discord, monitor:DP-2, default:true, special, vesktop, spotify"
"name:steam, monitor:DP-1, default:false, special, steam"
];
windowrule = [
"float, file_progress"
"float, confirm"
"float, dialog"
"float, download"
"float, notification"
"float, error"
"float, splash"
"float, confirmreset"
"float, title:Open File"
"float, title:branchdialog"
"float, pavucontrol"
"move onscreen cursor 0% 0%, pavucontrol"
"float, file-roller"
"fullscreen, wlogout"
"float, title:wlogout"
"fullscreen, title:wlogout"
"idleinhibit stayfocused, mpv"
];
windowrulev2 = [
"float, title:^(Media viewer)$"
"float, class:^(it.mijorus.smile)$,title:^(Smile)$"
"float, class:^(.blueman-manager-wrapped)$,title:^(Bluetooth Devices)$"
# Picture in picture windows
# "float, class:pavucontrol,title:pavucontrol" # ?????
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
# discord/vesktop
"workspace: name:discord, class:^(vesktop)$"
"float, class:^(vesktop)$,title:^(Discord Popout)$"
"pin, class:^(vesktop)$,title:^(Discord Popout)$"
# Steam
"float, class:^([Ss]team)$, title:^((?![Ss]team).*)$"
"workspace name:steam silent, class:^([Ss]team)$, title:^([Ss]team)$"
"tile, class:^([Ss]team)$, title:^([Ss]team)$"
"float, class:^(steam)$,title:^(Friends List)$"
# Code
# "pin, class:^(code)$,title:^(Save As)$"
"float, class:^(code)$,title:^(Save As)$"
"float, class:^(xdg-desktop-portal-gtk)$,title:^(Open Workspace from File)$"
# Game Tearing??? https://wiki.hyprland.org/Configuring/Tearing/
"immediate, class:gamescope"
# todo properly fix this shit instead of using gamescope
# vmware
"tag +horizonrdp, class:Remote Desktop Connection,title:BBar"
"tag +horizonrdp, class:Remote Desktop Connection,title:Remote Desktop Connection"
"noanim, tag:horizonrdp"
"noblur, tag:horizonrdp"
"norounding, tag:horizonrdp"
"noshadow, tag:horizonrdp"
"immediate, tag:horizonrdp"
"allowsinput, tag:horizonrdp"
"noborder, tag:horizonrdp"
"nodim, tag:horizonrdp"
"nomaxsize, tag:horizonrdp"
"float, class:Vmware-view,title:VMware Horizon Client"
"float, class:Remote Desktop Connection,title:^(Remote Desktop Connection)$"
"float, class:Remote Desktop Connection,title:^(5cd238b4x0)$"
"float, class:Credential Manager UI Host,title:Windows Security"
];
input = {
kb_layout = "us";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
numlock_by_default = true;
follow_mouse = 1;
touchpad = {
natural_scroll = "no";
};
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
};
extraConfig = ''
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = nwg-look -a
exec-once = nm-applet
exec-once = blueberry-tray
exec-once = [silent] firefox
exec-once = [silent] vesktop
exec-once = [silent] spotify
exec-once = [silent] steam
'';
};
}

View File

@@ -1,26 +0,0 @@
{ pkgs, ... }:
{
programs.kitty = {
enable = true;
shellIntegration.enableZshIntegration = true;
font = {
name = "jetbrains mono nerd font";
package = pkgs.nerdfonts;
size = 12;
};
settings = {
include = "~/.config/kitty/nord.conf";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
mouse_hide_wait = "2.0";
cursor_shape = "block";
url_color = "#88c0d0";
url_style = "dotted";
confirm_os_window_close = "0";
background_opacity = "0.8";
};
};
}

View File

@@ -1,80 +0,0 @@
# vim:ft=kitty
## name: Catppuccin Kitty Macchiato
## author: Catppuccin Org
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/themes/macchiato.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #CAD3F5
background #24273A
selection_foreground #24273A
selection_background #F4DBD6
# Cursor colors
cursor #F4DBD6
cursor_text_color #24273A
# URL underline color when hovering with mouse
url_color #F4DBD6
# Kitty window border colors
active_border_color #B7BDF8
inactive_border_color #6E738D
bell_border_color #EED49F
# OS Window titlebar colors
wayland_titlebar_color #24273A
macos_titlebar_color #24273A
# Tab bar colors
active_tab_foreground #181926
active_tab_background #C6A0F6
inactive_tab_foreground #CAD3F5
inactive_tab_background #1E2030
tab_bar_background #181926
# Colors for marks (marked text in the terminal)
mark1_foreground #24273A
mark1_background #B7BDF8
mark2_foreground #24273A
mark2_background #C6A0F6
mark3_foreground #24273A
mark3_background #7DC4E4
# The 16 terminal colors
# black
color0 #494D64
color8 #5B6078
# red
color1 #ED8796
color9 #ED8796
# green
color2 #A6DA95
color10 #A6DA95
# yellow
color3 #EED49F
color11 #EED49F
# blue
color4 #8AADF4
color12 #8AADF4
# magenta
color5 #F5BDE6
color13 #F5BDE6
# cyan
color6 #8BD5CA
color14 #8BD5CA
# white
color7 #B8C0E0
color15 #A5ADCB

View File

@@ -1,72 +0,0 @@
# vim:ft=kitty
# The basic colors
foreground #eceff4
background #2e3440
selection_foreground #2e3440
selection_background #b48ead
# Cursor colors
cursor #b48ead
cursor_text_color #2e3440
# URL underline color when hovering with mouse
url_color #b48ead
# Kitty window border colors
active_border_color #5e81ac
inactive_border_color #3b4252
bell_border_color #ebcb8b
# OS Window titlebar colors
wayland_titlebar_color #2e3440
macos_titlebar_color #2e3440
# Tab bar colors
active_tab_foreground #4c566a
active_tab_background #b48ead
inactive_tab_foreground #eceff4
inactive_tab_background #3b4252
tab_bar_background #4c566a
# Colors for marks (marked text in the terminal)
mark1_foreground #2e3440
mark1_background #5e81ac
mark2_foreground #2e3440
mark2_background #b48ead
mark3_foreground #2e3440
mark3_background #7DC4E4
# The 16 terminal colors
# black
color0 #2e3440
color8 #3b4252
# red
color1 #bf616a
color9 #bf616a
# green
color2 #a3be8c
color10 #a3be8c
# yellow
color3 #ebcb8b
color11 #ebcb8b
# blue
color4 #5e81ac
color12 #5e81ac
# magenta
color5 #b48ead
color13 #b48ead
# cyan
color6 #88c0d0
color14 #88c0d0
# white
color7 #e5e9f0
color15 #d8dee9

View File

@@ -1,21 +0,0 @@
{
services.mako = {
enable = true;
font = "monospace 12";
icons = false;
width = 500;
height = 110;
layer = "overlay";
borderRadius = 15;
borderSize = 2;
maxIconSize = 64;
defaultTimeout = 5000;
sort = "-time";
ignoreTimeout = true;
backgroundColor = "#24273a";
textColor = "#cad3f5";
borderColor = "#8aadf4";
progressColor = "over #363a4f";
};
}

View File

@@ -1,34 +0,0 @@
window {
background-color: rgba (36, 47, 79, 0.95);
color: #eeeeee
}
/* search entry */
entry {
background-color: rgba (0, 0, 0, 0.2)
}
button, image {
background: none;
border: none
}
button:hover {
background-color: rgba (255, 255, 255, 0.1)
}
/* in case you wanted to give category buttons a different look */
#category-button {
margin: 0 10px 0 10px
}
#pinned-box {
padding-bottom: 5px;
border-bottom: 1px dotted gray
}
#files-box {
padding: 5px;
border: 1px dotted gray;
border-radius: 15px
}

View File

@@ -1,8 +0,0 @@
{
"\\.pdf$": "firefox",
"\\.svg$": "inkscape",
"\\.(jpg|png|tiff|gif)$": "swayimg",
"\\.(mp3|ogg|flac|wav|wma)$": "audacious",
"\\.(avi|mp4|mkv|mov|wav)$": "mpv",
"\\.(doc|docx|xls|xlsx)$": "libreoffice"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

View File

@@ -1,363 +0,0 @@
{
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "bottom";
position = "top";
mod = "dock";
exclusive = true;
passthrough = false;
gtk-layer-shell = true;
height = 0;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
# "custom/updates"
"custom/lights"
"temperature"
"temperature#gpu"
"keyboard-state#capslock"
"keyboard-state#numlock"
"pulseaudio"
"pulseaudio#microphone"
"clock"
"custom/weather"
];
"hyprland/window" = {
separate-outputs = true;
format = { };
};
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
on-click = "activate";
persistent_workspaces = {
"*" = 1;
};
};
"custom/weather" = {
tooltip = true;
format = { };
interval = 30;
exec = "waybar-weather";
return-type = "json";
};
# "custom/updates" = {
# tooltip = true;
# format = { };
# interval = 30;
# exec = "waybar-updates";
# return-type = "json";
# };
"custom/lights" = {
tooltip = false;
format = "󱉓";
# interval = 30;
on-click = "nix-shell /home/matt/.config/waybar/scripts/hass.nix --run \"python /home/matt/.config/waybar/scripts/hass.py --toggle_light light.bedroom_lights\"";
# return-type = "json";
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input";
critical-threshold = 90;
format-critical = "{temperatureC}°C {icon}";
format = "{temperatureC}°C {icon}";
format-icons = [
"" # fa-temperature-empty
"" # fa-temperature-quarter
"" # fa-temperature-half
"" # fa-temperature-three-quarters
"" # fa-temperature-full
"" # fa-temperature-high
];
tooltip-format = "CPU: {temperatureC}°C";
};
"temperature#gpu" = {
hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input";
critical-threshold = 100;
format-critical = "{temperatureC}°C {icon}";
format = "{temperatureC}°C {icon}";
format-icons = [
"" # fa-temperature-empty
"" # fa-temperature-quarter
"" # fa-temperature-half
"" # fa-temperature-three-quarters
"" # fa-temperature-full
"" # fa-temperature-high
];
on-click = "lact";
tooltip-format = "GPU: {temperatureC}°C";
};
tray = {
icon-size = 16;
spacing = 10;
};
clock = {
format = "{:%I:%M %p}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
format = "{icon} {volume}%";
tooltip = false;
format-muted = " Muted";
on-click = "pamixer -t";
on-click-right = "pavucontrol -t 1";
on-scroll-up = "pamixer -i 5";
on-scroll-down = "pamixer -d 5";
scroll-step = 5;
format-icons = {
headphone = "󰋋";
headphone-muted = "󰟎";
hands-free = "󰋋";
headset = "󰋋";
phone = "";
portable = "󰋋";
car = "";
default = [
""
""
""
""
];
};
};
"pulseaudio#microphone" = {
format = "{format_source}";
format-source = "";
format-source-muted = "";
on-click = "pamixer --default-source -t";
on-click-right = "pavucontrol -t 2";
on-scroll-up = "pamixer --default-source -i 5";
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
"keyboard-state#capslock" = {
capslock = true;
icon-size = 20;
format = "{icon}";
format-icons = {
locked = "󰪛";
unlocked = " ";
};
};
"keyboard-state#numlock" = {
numlock = true;
icon-size = 60;
format = "{icon}";
format-icons = {
locked = "󰎣";
unlocked = " ";
};
};
};
};
# https://catppuccin.com/palette
style = ''
@define-color nord0 #2e3440;
@define-color nord1 #3b4252;
@define-color nord2 #434c5e;
@define-color nord3 #4c566a;
@define-color nord4 #d8dee9;
@define-color nord5 #e5e9f0;
@define-color nord6 #eceff4;
@define-color nord7 #8fbcbb;
@define-color nord8 #88c0d0;
@define-color nord9 #81a1c1;
@define-color nord10 #5e81ac;
@define-color nord11 #bf616a;
@define-color nord12 #d08770;
@define-color nord13 #ebcb8b;
@define-color nord14 #a3be8c;
@define-color nord15 #b48ead;
/*@import "nord.css";*/
* {
font-family:
Jetbrains Mono Nerd Font,
monospace;
font-size: 14px;
min-height: 0;
}
#waybar {
background: transparent;
color: @nord6;
margin: 5px 5px;
}
#workspaces {
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem;
background-color: @nord0;
opacity: 0.6;
margin-left: 1rem;
}
#workspaces button {
color: @nord10;
border-radius: 1rem;
padding: 0.4rem;
}
#workspaces button.active {
color: @nord8;
border-radius: 1rem;
}
#workspaces button:hover {
color: @nord7;
border-radius: 1rem;
}
#workspaces button.focused {
color: @nord6;
background: @nord13;
border-radius: 1rem;
}
#workspaces button.urgent {
color: @nord0;
background: @nord6;
border-radius: 1rem;
}
#tooltip {
background: @nord0;
border-radius: 1rem;
border-width: 1rem;
border-style: solid;
border-color: @nord0;
}
#window {
color: @nord15;
background-color: @nord0;
opacity: 0.6;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem;
margin-left: 6rem;
margin-right: 6rem;
}
#custom-weather {
color: @nord10;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 1rem;
}
#clock {
color: @nord9;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 1rem;
}
/* ------------- */
#pulseaudio.microphone {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0rem 1rem 1rem 0rem;
}
#pulseaudio {
color: @nord7;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#keyboard-state.numlock {
color: @nord8;
background-color: @nord0;
padding: 0.5rem;
margin: 5px 0;
border-radius: 0;
font-size: 10rem;
}
#keyboard-state.capslock {
color: @nord9;
background-color: @nord0;
padding: 0.5rem;
margin: 5px 0;
border-radius: 0;
font-size: 18px;
}
#temperature.gpu {
color: @nord10;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#temperature {
color: @nord9;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 0;
}
#custom-updates {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 1rem;
}
#custom-lights {
color: @nord8;
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
border-radius: 1rem 0rem 0rem 1rem;
}
/* ------------- */
#tray {
background-color: @nord0;
padding: 0.5rem 1rem;
margin: 5px 0;
margin-right: 1rem;
border-radius: 1rem;
}
'';
};
}

View File

@@ -1,26 +0,0 @@
@define-color rosewater #f4dbd6;
@define-color flamingo #f0c6c6;
@define-color pink #f5bde6;
@define-color mauve #c6a0f6;
@define-color red #ed8796;
@define-color maroon #ee99a0;
@define-color peach #f5a97f;
@define-color yellow #eed49f;
@define-color green #a6da95;
@define-color teal #8bd5ca;
@define-color sky #91d7e3;
@define-color sapphire #7dc4e4;
@define-color blue #8aadf4;
@define-color lavender #b7bdf8;
@define-color text #cad3f5;
@define-color subtext1 #b8c0e0;
@define-color subtext0 #a5adcb;
@define-color overlay2 #939ab7;
@define-color overlay1 #8087a2;
@define-color overlay0 #6e738d;
@define-color surface2 #5b6078;
@define-color surface1 #494d64;
@define-color surface0 #363a4f;
@define-color base #24273a;
@define-color mantle #1e2030;
@define-color crust #181926;

View File

@@ -1,16 +0,0 @@
@define-color nord0 #2e3440;
@define-color nord1 #3b4252;
@define-color nord2 #434c5e;
@define-color nord3 #4c566a;
@define-color nord4 #d8dee9;
@define-color nord5 #e5e9f0;
@define-color nord6 #eceff4;
@define-color nord7 #8fbcbb;
@define-color nord8 #88c0d0;
@define-color nord9 #81a1c1;
@define-color nord10 #5e81ac;
@define-color nord11 #bf616a;
@define-color nord12 #d08770;
@define-color nord13 #ebcb8b;
@define-color nord14 #a3be8c;
@define-color nord15 #b48ead;

View File

@@ -1,18 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# The Nix packages provided in the environment
packages = [
pkgs.python312
pkgs.python3Packages.pip
# Whatever other packages are required
];
shellHook = ''
export TMPDIR=/tmp
export VENV_DIR=/tmp/lights
mkdir $VENV_DIR
python -m venv $VENV_DIR/.venv
source $VENV_DIR/.venv/bin/activate
pip install homeassistant-api
'';
}

View File

@@ -1,42 +0,0 @@
import os
import argparse
import time
from homeassistant_api import Client
hass_url = 'https://hass.mjallen.dev/api'
parser = argparse.ArgumentParser(prog='hass python wrapper')
parser.add_argument('--toggle_light')
args = parser.parse_args()
def loadKey():
token_path = ""
for folder in range(1,100):
if os.path.exists("/run/secrets.d/" + str(folder) + "/desktop/hass_token"):
token_path = "/run/secrets.d/" + str(folder) + "/desktop/hass_token"
break
with open(token_path, "r") as key_file:
key = key_file.readline()
return key
def toggle_light(client, light):
lights = client.get_domain("light")
lights.toggle(entity_id=light)
time.sleep(0.5)
light_entity = client.get_entity(entity_id=light)
state = light_entity.get_state()
if state.state == 'on':
return "󰛨"
else:
return "󰹏"
def main():
token = loadKey()
with Client(hass_url, token) as client:
if args.toggle_light is not None:
status = toggle_light(client=client, light=args.toggle_light)
print("{ text: \"" + status + "\" }")
main()

View File

@@ -1,90 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3
import os
import json
import subprocess
import re
from datetime import datetime
import time
tmp_path = '/tmp/waybar-scripts/updates'
json_cache = tmp_path + "/data.json"
git_repo = 'git@github.com:mjallen18/nix-config.git'
def cache_json(data):
with open(json_cache, mode="w") as cache:
json.dump(data, cache)
def create_folders():
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
os.chdir(tmp_path)
def clone_repo():
reset_repo()
if os.path.exists(tmp_path) and len(os.listdir(tmp_path)) == 0:
subprocess.run(["git", "clone", git_repo, tmp_path])
def check_for_flake_updates():
return subprocess.run(["sudo", "nix", "flake", "update", "-I", tmp_path, tmp_path], capture_output=True, text=True)
def reset_repo():
if os.path.exists(tmp_path) and not len(os.listdir(tmp_path)) == 0:
subprocess.run(["git", "reset", "--hard"])
subprocess.run(["git", "pull"])
def parse_output(output):
updates_dict = {}
updates = re.findall(r"(• Updated input '(.+)':((\n|\r|\n)(.+\((\d\d\d\d-\d\d-\d\d\)))){2})", output)
for update in updates:
input = re.findall(r"'(.+)':", update[0])[0].strip()
dates = re.findall(r"(\d{4}-\d{2}-\d{2})", update[0])
updates_dict[input] = dates
return updates_dict
def check():
data = {}
# print("create folders")
create_folders()
# print("clone repo")
clone_repo()
# print("checking for updates")
updates = check_for_flake_updates()
updates_dict = parse_output(updates.stderr)
if len(updates_dict.keys()) > 0:
data["text"] = ("󰏕")
else:
data["text"] = (u"\u00A0")
if len(updates_dict.keys()) <= 0:
data["tooltip"] = ("flake inputs up to date")
else:
data["tooltip"] = ("flake input updates:\n\n")
for input in updates_dict.keys():
data["tooltip"] += "<b>{}</b>\n".format(input)
data["tooltip"] += "Old Ref: {0}{1}\n\n".format(updates_dict[input][0].strip(), updates_dict[input][1].strip())
cache_json(data)
print(json.dumps(data))
def read_cache():
with open(json_cache, mode="r") as cache:
print(json.dumps(json.load(cache)))
def main():
now = int(datetime.now().strftime("%H"))
if os.path.exists(json_cache):
mtime = int(time.localtime(os.stat(json_cache).st_ctime).tm_hour)
else:
mtime = now + 1
if (now % 2 == 0 and mtime < now) or not os.path.exists(json_cache):
check()
else:
read_cache()
main()

View File

@@ -1,379 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3 python3Packages.requests
import json
from datetime import datetime
import requests
WWO_CODE = {
"113": "Sunny",
"116": "PartlyCloudy",
"119": "Cloudy",
"122": "VeryCloudy",
"143": "Fog",
"176": "LightShowers",
"179": "LightSleetShowers",
"182": "LightSleet",
"185": "LightSleet",
"200": "ThunderyShowers",
"227": "LightSnow",
"230": "HeavySnow",
"248": "Fog",
"260": "Fog",
"263": "LightShowers",
"266": "LightRain",
"281": "LightSleet",
"284": "LightSleet",
"293": "LightRain",
"296": "LightRain",
"299": "HeavyShowers",
"302": "HeavyRain",
"305": "HeavyShowers",
"308": "HeavyRain",
"311": "LightSleet",
"314": "LightSleet",
"317": "LightSleet",
"320": "LightSnow",
"323": "LightSnowShowers",
"326": "LightSnowShowers",
"329": "HeavySnow",
"332": "HeavySnow",
"335": "HeavySnowShowers",
"338": "HeavySnow",
"350": "LightSleet",
"353": "LightShowers",
"356": "HeavyShowers",
"359": "HeavyRain",
"362": "LightSleetShowers",
"365": "LightSleetShowers",
"368": "LightSnowShowers",
"371": "HeavySnowShowers",
"374": "LightSleetShowers",
"377": "LightSleet",
"386": "ThunderyShowers",
"389": "ThunderyHeavyRain",
"392": "ThunderySnowShowers",
"395": "HeavySnowShowers",
}
WEATHER_SYMBOL_EMOJI = {
"Unknown": "",
"Cloudy": "☁️",
"Fog": "🌫",
"HeavyRain": "🌧",
"HeavyShowers": "🌧",
"HeavySnow": "❄️",
"HeavySnowShowers": "❄️",
"LightRain": "🌦",
"LightShowers": "🌦",
"LightSleet": "🌧",
"LightSleetShowers": "🌧",
"LightSnow": "🌨",
"LightSnowShowers": "🌨",
"PartlyCloudy": "⛅️",
"Sunny": "☀️",
"ThunderyHeavyRain": "🌩",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "☁️",
}
WEATHER_SYMBOL = {
"Unknown": "",
"Cloudy": "☁️",
"Fog": "🌫",
"HeavyRain": "🌧",
"HeavyShowers": "🌧",
"HeavySnow": "❄️",
"HeavySnowShowers": "❄️",
"LightRain": "🌦",
"LightShowers": "🌦",
"LightSleet": "🌧",
"LightSleetShowers": "🌧",
"LightSnow": "🌨",
"LightSnowShowers": "🌨",
"PartlyCloudy": "⛅️",
"Sunny": "☀️",
"ThunderyHeavyRain": "🌩",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "☁️",
}
WEATHER_CODES = {key: WEATHER_SYMBOL[value] for key, value in WWO_CODE.items()}
WIND_DIRECTION = [
"", "", "", "", "", "", "", "",
]
MOON_PHASES = (
"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"
)
WEATHER_SYMBOL_WI_DAY = {
"Unknown": "",
"Cloudy": "",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "",
}
WEATHER_CODES_WI_DAY = {key: WEATHER_SYMBOL_WI_DAY[value] for key, value in WWO_CODE.items()}
WEATHER_SYMBOL_WI_NIGHT = {
"Unknown": "",
"Cloudy": "",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "",
}
WEATHER_CODES_WI_NIGHT = {key: WEATHER_SYMBOL_WI_NIGHT[value] for key, value in WWO_CODE.items()}
WIND_DIRECTION_WI = [
"", "", "", "", "", "", "", "",
]
WIND_SCALE_WI = [
"", "", "", "", "", "", "", "", "", "", "", "", "",
]
MOON_PHASES_WI = (
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"", "", "", "", "", "", "",
)
WEATHER_SYMBOL_WEGO = {
"Unknown": [
" .-. ",
" __) ",
" ( ",
" `- ",
""],
"Sunny": [
"\033[38;5;226m \\ / \033[0m",
"\033[38;5;226m .-. \033[0m",
"\033[38;5;226m ― ( ) ― \033[0m",
"\033[38;5;226m `- \033[0m",
"\033[38;5;226m / \\ \033[0m"],
"PartlyCloudy": [
"\033[38;5;226m \\ /\033[0m ",
"\033[38;5;226m _ /\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m \\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
" "],
"Cloudy": [
" ",
"\033[38;5;250m .--. \033[0m",
"\033[38;5;250m .-( ). \033[0m",
"\033[38;5;250m (___.__)__) \033[0m",
" "],
"VeryCloudy": [
" ",
"\033[38;5;240;1m .--. \033[0m",
"\033[38;5;240;1m .-( ). \033[0m",
"\033[38;5;240;1m (___.__)__) \033[0m",
" "],
"LightShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;111m \033[0m",
"\033[38;5;111m \033[0m"],
"HeavyShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
"\033[38;5;21;1m \033[0m",
"\033[38;5;21;1m \033[0m"],
"LightSnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;255m * * * \033[0m",
"\033[38;5;255m * * * \033[0m"],
"HeavySnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
"\033[38;5;255;1m * * * * \033[0m",
"\033[38;5;255;1m * * * * \033[0m"],
"LightSleetShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[38;5;255m* \033[0m",
"\033[38;5;255m *\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[0m"],
"ThunderyShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;228;5m ⚡\033[38;5;111;25m \033[38;5;228;5m⚡\033[38;5;111;25m \033[0m",
"\033[38;5;111m \033[0m"],
"ThunderyHeavyRain": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;21;1m \033[38;5;228;5m⚡\033[38;5;21;25m\033[38;5;228;5m⚡\033[38;5;21;25m \033[0m",
"\033[38;5;21;1m \033[38;5;228;5m⚡\033[38;5;21;25m \033[0m"],
"ThunderySnowShowers": [
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
"\033[38;5;255m *\033[38;5;228;5m⚡\033[38;5;255;25m*\033[38;5;228;5m⚡\033[38;5;255;25m* \033[0m",
"\033[38;5;255m * * * \033[0m"],
"LightRain": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;111m \033[0m",
"\033[38;5;111m \033[0m"],
"HeavyRain": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;21;1m \033[0m",
"\033[38;5;21;1m \033[0m"],
"LightSnow": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;255m * * * \033[0m",
"\033[38;5;255m * * * \033[0m"],
"HeavySnow": [
"\033[38;5;240;1m .-. \033[0m",
"\033[38;5;240;1m ( ). \033[0m",
"\033[38;5;240;1m (___(__) \033[0m",
"\033[38;5;255;1m * * * * \033[0m",
"\033[38;5;255;1m * * * * \033[0m"],
"LightSleet": [
"\033[38;5;250m .-. \033[0m",
"\033[38;5;250m ( ). \033[0m",
"\033[38;5;250m (___(__) \033[0m",
"\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[38;5;255m* \033[0m",
"\033[38;5;255m *\033[38;5;111m \033[38;5;255m*\033[38;5;111m \033[0m"],
"Fog": [
" ",
"\033[38;5;251m _ - _ - _ - \033[0m",
"\033[38;5;251m _ - _ - _ \033[0m",
"\033[38;5;251m _ - _ - _ - \033[0m",
" "],
}
data = {}
weather = requests.get("https://wttr.in/?u&format=j1").json()
moon = requests.get("https://wttr.in/?format=%m").text
def format_time(time):
return datetime.strptime(format_24_time(time), "%H").strftime("%I %p")
def format_24_time(time):
return time.replace("00", "").zfill(2)
def format_temp(temp):
return (hour["FeelsLikeF"] + "°").ljust(3)
def format_chances(hour):
chances = {
"chanceoffog": "Fog",
"chanceoffrost": "Frost",
"chanceofovercast": "Overcast",
"chanceofrain": "Rain",
"chanceofsnow": "Snow",
"chanceofsunshine": "Sunshine",
"chanceofthunder": "Thunder",
"chanceofwindy": "Wind",
}
conditions = []
for event in chances.keys():
if int(hour[event]) > 0:
conditions.append(chances[event] + " " + hour[event] + "%")
return ", ".join(conditions)
tempint = int(weather["current_condition"][0]["FeelsLikeF"])
extrachar = ""
if tempint > 0 and tempint < 10:
extrachar = "+"
data["text"] = (
""
+ WEATHER_CODES[weather["current_condition"][0]["weatherCode"]]
+ " "
+ extrachar
+ weather["current_condition"][0]["FeelsLikeF"]
+ "°F"
)
data["tooltip"] = (
f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_F']}°</b>\n"
)
data["tooltip"] += f"Feels like: {weather['current_condition'][0]['FeelsLikeF']}°\n"
data["tooltip"] += f"Wind: {weather['current_condition'][0]['windspeedMiles']}mph\n"
data["tooltip"] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
data["tooltip"] += f"Moon phase: {weather["weather"][0]['astronomy'][0]['moon_phase']} " + moon + "\n"
for i, day in enumerate(weather["weather"]):
data["tooltip"] += f"\n<b>"
if i == 0:
data["tooltip"] += "Today, "
if i == 1:
data["tooltip"] += "Tomorrow, "
date = datetime.strptime(day['date'], "%Y-%m-%d").strftime("%a %b %d %Y")
data["tooltip"] += f"{date}</b>\n"
data["tooltip"] += f"{day['maxtempF']}°F  {day['mintempF']}°F"
data[
"tooltip"
] += f"{day['astronomy'][0]['sunrise']}{day['astronomy'][0]['sunset']}\n"
for hour in day["hourly"]:
if i == 0:
if int(format_24_time(hour["time"])) < datetime.now().hour - 2:
continue
if int(format_24_time(hour["time"])) > datetime.strptime(day['astronomy'][0]['sunset'], "%I:%M %p").hour or int(format_24_time(hour["time"])) < datetime.strptime(day['astronomy'][0]['sunrise'], "%I:%M %p").hour:
codes = WEATHER_CODES_WI_NIGHT
else:
codes = WEATHER_CODES_WI_DAY
data[
"tooltip"
] += f"{format_time(hour['time'])} {codes[hour['weatherCode']]} {format_temp(hour['FeelsLikeF'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n"
print(json.dumps(data))

View File

@@ -1,166 +0,0 @@
@import "macchiato.css";
* {
border: none;
border-radius: 0;
font-family:
Jetbrains Mono Nerd Font,
monospace;
font-weight: bold;
font-size: 14px;
min-height: 0;
}
#window.waybar {
background-color: shade(@base, 0.9);
color: @text;
}
#tooltip {
background: #1e1e2e;
border-radius: 10px;
border-width: 2px;
border-style: solid;
border-color: #11111b;
}
#workspaces button {
padding: 5px;
color: #313244;
margin-right: 5px;
}
#workspaces button.active {
color: #a6adc8;
}
#workspaces button.focused {
color: #a6adc8;
background: #eba0ac;
border-radius: 10px;
}
#workspaces button.urgent {
color: #11111b;
background: #a6e3a1;
border-radius: 10px;
}
#workspaces button:hover {
background: #11111b;
color: #cdd6f4;
border-radius: 10px;
}
/*#window,
#custom-weather,
#clock,
#network,
#pulseaudio,
#keyboard-state,
#temperature,
#custom-updates,
#tray,
#workspaces,*/
#workspaces {
/* background: #1e1e2e; */
background: #1e2030; /* Mantle */
border-radius: 10px;
margin-left: 10px;
padding-right: 0px;
padding-left: 5px;
}
#tray {
border-radius: 10px;
margin-right: 10px;
}
/* ------------- */
#custom-updates {
color: #f5c2e7;
border-radius: 10px 0px 0px 10px;
border-left: 0px;
border-right: 0px;
}
#window {
border-radius: 10px;
margin-left: 60px;
margin-right: 60px;
}
#temperature {
color: #a6da95;/* Green */
border-left: 0px;
border-right: 0px;
}
#temperature.gpu {
color: #eed49f;/* Yellow */
border-left: 0px;
border-right: 0px;
}
#keyboard-state.capslock {
color: #f5a97f;/* Peach */
border-left: 0px;
border-right: 0px;
}
#keyboard-state.numlock {
color: #ee99a0;/* Maroon */
border-left: 0px;
border-right: 0px;
}
#pulseaudio {
color: #ed8796;/* Red */
border-radius: 0px 0px 0px 0px;
border-left: 0px;
border-right: 0px;
margin-left: 0px;
padding-right: 0px;
padding-top: 0px;
}
#pulseaudio.microphone {
color: #c6a0f6; /* Mauve */
border-radius: 0px 10px 10px 0px;
border-left: 0px;
border-right: 0px;
padding-top: 5px;
}
/* ------------- */
#network {
color: #f5bde6; /* Pink */
border-left: 0px;
border-right: 0px;
border-radius: 10px 10px 10px 10px;
margin-left: 5px;
padding-right: 15px;
}
/* ------------- */
#clock {
color: #f0c6c6; /* Flamingo */
border-radius: 10px 0px 0px 10px;
margin-left: 5px;
border-right: 0px;
}
#custom-weather {
color: #f4dbd6; /* Rosewater */
border-radius: 0px 10px 10px 0px;
border-right: 0px;
margin-left: 0px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,36 +0,0 @@
{
"label" : "lock",
"action" : "swaylock",
"text" : "Lock",
"keybind" : "l"
}
{
"label" : "hibernate",
"action" : "systemctl hibernate",
"text" : "Hibernate",
"keybind" : "h"
}
{
"label" : "logout",
"action" : "sleep 1; hyprctl dispatch exit",
"text" : "Logout",
"keybind" : "e"
}
{
"label" : "shutdown",
"action" : "systemctl poweroff",
"text" : "Shutdown",
"keybind" : "s"
}
{
"label" : "suspend",
"action" : "systemctl suspend",
"text" : "Suspend",
"keybind" : "u"
}
{
"label" : "reboot",
"action" : "systemctl reboot",
"text" : "Reboot",
"keybind" : "r"
}

View File

@@ -1,50 +0,0 @@
* {
background-image: none;
}
window {
background-color: rgba(36, 39, 58, 0.9);
}
button {
margin: 8px;
color: #cad3f5;
background-color: #363a4f;
border-style: solid;
border-width: 2px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
}
button:active,
button:focus,
button:hover {
color: #8bd5ca;
background-color: #24273a;
outline-style: none;
}
#lock {
background-image: image(url("icons/lock.png"));
}
#logout {
background-image: image(url("icons/logout.png"));
}
#suspend {
background-image: image(url("icons/suspend.png"));
}
#hibernate {
background-image: image(url("icons/hibernate.png"));
}
#shutdown {
background-image: image(url("icons/shutdown.png"));
}
#reboot {
background-image: image(url("icons/reboot.png"));
}

View File

@@ -1,145 +0,0 @@
{
programs.wofi = {
enable = false;
style = ''
@define-color rosewater #f4dbd6;
@define-color rosewater-rgb rgb(244, 219, 214);
@define-color flamingo #f0c6c6;
@define-color flamingo-rgb rgb(240, 198, 198);
@define-color pink #f5bde6;
@define-color pink-rgb rgb(245, 189, 230);
@define-color mauve #c6a0f6;
@define-color mauve-rgb rgb(198, 160, 246);
@define-color red #ed8796;
@define-color red-rgb rgb(237, 135, 150);
@define-color maroon #ee99a0;
@define-color maroon-rgb rgb(238, 153, 160);
@define-color peach #f5a97f;
@define-color peach-rgb rgb(245, 169, 127);
@define-color yellow #eed49f;
@define-color yellow-rgb rgb(238, 212, 159);
@define-color green #a6da95;
@define-color green-rgb rgb(166, 218, 149);
@define-color teal #8bd5ca;
@define-color teal-rgb rgb(139, 213, 202);
@define-color sky #91d7e3;
@define-color sky-rgb rgb(145, 215, 227);
@define-color sapphire #7dc4e4;
@define-color sapphire-rgb rgb(125, 196, 228);
@define-color blue #8aadf4;
@define-color blue-rgb rgb(138, 173, 244);
@define-color lavender #b7bdf8;
@define-color lavender-rgb rgb(183, 189, 248);
@define-color text #cad3f5;
@define-color text-rgb rgb(202, 211, 245);
@define-color subtext1 #b8c0e0;
@define-color subtext1-rgb rgb(184, 192, 224);
@define-color subtext0 #a5adcb;
@define-color subtext0-rgb rgb(165, 173, 203);
@define-color overlay2 #939ab7;
@define-color overlay2-rgb rgb(147, 154, 183);
@define-color overlay1 #8087a2;
@define-color overlay1-rgb rgb(128, 135, 162);
@define-color overlay0 #6e738d;
@define-color overlay0-rgb rgb(110, 115, 141);
@define-color surface2 #5b6078;
@define-color surface2-rgb rgb(91, 96, 120);
@define-color surface1 #494d64;
@define-color surface1-rgb rgb(73, 77, 100);
@define-color surface0 #363a4f;
@define-color surface0-rgb rgb(54, 58, 79);
@define-color base #24273a;
@define-color base-rgb rgb(36, 39, 58);
@define-color mantle #1e2030;
@define-color mantle-rgb rgb(30, 32, 48);
@define-color crust #181926;
@define-color crust-rgb rgb(24, 25, 38);
* {
font-family: "Inconsolata Nerd Font", monospace;
font-size: 14px;
}
/* Window */
window {
margin: 0px;
padding: 10px;
border: 0.16em solid @lavender;
border-radius: 0.1em;
background-color: @base;
}
/* Inner Box */
#inner-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base;
}
/* Outer Box */
#outer-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base;
}
/* Scroll */
#scroll {
margin: 0px;
padding: 10px;
border: none;
background-color: @base;
}
/* Input */
#input {
margin: 5px 20px;
padding: 10px;
border: none;
border-radius: 0.1em;
color: @text;
background-color: @base;
}
#input image {
border: none;
color: @red;
}
#input * {
outline: 4px solid @red!important;
}
/* Text */
#text {
margin: 5px;
border: none;
color: @text;
}
#entry {
background-color: @base;
}
#entry arrow {
border: none;
color: @lavender;
}
/* Selected Entry */
#entry:selected {
border: 0.11em solid @lavender;
}
#entry:selected #text {
color: @mauve;
}
#entry:drop(active) {
background-color: @lavender!important;
}
'';
};
}

View File

@@ -1,108 +0,0 @@
{ pkgs, ... }:
let
sddmTheme = "catppuccin-mocha";
in
{
specialisation.hyprland.configuration = {
imports = [
./environment.nix
];
home-manager.users.matt = import ./home.nix;
services = {
displayManager.sddm.enable = true;
displayManager.sddm.package = pkgs.kdePackages.sddm;
displayManager.sddm.theme = sddmTheme;
displayManager.defaultSession = "hyprland";
# disable plasma
desktopManager.plasma6.enable = false;
dbus.enable = true;
ddccontrol.enable = true;
blueman.enable = true;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
programs.nm-applet.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
};
security = {
polkit.enable = true;
# configure sudo
sudo.extraRules = [
{
commands = [
{
command = "/run/current-system/sw/bin/waybar-weather";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/waybar-updates";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
xdg.portal = {
enable = true;
wlr.enable = false;
xdgOpenUsePortal = false;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
fonts.packages = with pkgs; [
font-awesome
noto-fonts
noto-fonts-color-emoji
nerdfonts
meslo-lgs-nf
];
fonts.fontconfig.defaultFonts = {
emoji = [
"Noto Color Emoji"
];
};
nixpkgs.overlays = [
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
};
}

View File

@@ -1,64 +0,0 @@
{ pkgs, ... }:
let
waybarWeatherScript = pkgs.writeScriptBin "waybar-weather" ''
/home/matt/.config/waybar/scripts/waybar-wttr.py
'';
waybarUpdatesScript = pkgs.writeScriptBin "waybar-updates" ''
/home/matt/.config/waybar/scripts/waybar-updates.py
'';
in
{
environment.systemPackages = with pkgs; [
unstable.adwaita-icon-theme
apple-cursor
catppuccin-sddm
colloid-gtk-theme
colloid-icon-theme
ddcutil
dunst
egl-wayland
unstable.file-roller
glib
unstable.gnome-tweaks
unstable.gnome-disk-utility
unstable.gnome-system-monitor
unstable.gsettings-desktop-schemas
hyprcursor
hyprland
hyprshot
libnotify
mako
meson
unstable.nautilus
networkmanagerapplet
nm-tray
nwg-drawer
nwg-look
pamixer
papirus-folders
pavucontrol
playerctl
polkit
polkit_gnome
qt5.qtwayland
qt6.qtwayland
rocmPackages.rocm-smi
rofi-wayland
waybar
waybarUpdatesScript
waybarWeatherScript
wayland-protocols
wayland-utils
wev
wl-clipboard
wlogout
wlroots
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xsettingsd
xwayland
];
}

View File

@@ -1,198 +0,0 @@
{ pkgs, ... }:
let
wallpaper = "/home/matt/.config/wallpapers/wall.png";
cursorTheme = "macOS";
cursorThemePkg = pkgs.apple-cursor;
cursorSize = 24;
gtkThemeSize = "compact";
gtkThemeAccent = "all";
gtkThemeVariant = "nord";
gtkThemeColor = "dark";
gtkTheme = "Colloid-Dark-Compact-Nord";
gtkThemePkg = pkgs.colloid-gtk-theme.override {
sizeVariants = [ gtkThemeSize ];
colorVariants = [ gtkThemeColor ];
themeVariants = [ gtkThemeAccent ];
tweaks = [ gtkThemeVariant ];
};
# iconThemeColor = "dark"; # "" "light" "dark"
# iconThemeVariant = ""; # "" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey"
iconThemeScheme = "nord"; # "" "nord" "dracula" "gruvbox" "everforest" "catppuccin"
iconTheme = "Colloid-Nord";
iconThemePkg = pkgs.colloid-icon-theme.override {
schemeVariants = [ iconThemeScheme ];
colorVariants = [ "default" ];
};
in
{
imports = [
./config.nix
./config/btop
./config/hypr
./config/kitty
./config/mako
./config/waybar
./config/wofi
];
services = {
hyprpaper = {
enable = true;
settings = {
preload = [ wallpaper ];
wallpaper = [
"DP-1, ${wallpaper}"
"DP-2, ${wallpaper}"
];
splash = false;
};
};
hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
};
listener = [
# {
# timeout = 300; # 5min
# on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
# on-resume = "brightnessctl -r"; # monitor backlight restore.
# }
{
timeout = 900; # 15 min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 930; # 15.5 min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 3600; # 1hr
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
};
programs.hyprlock = {
enable = true;
settings = {
background = [
{
monitor = "";
path = wallpaper; # supports png, jpg, webp (no animations, though)
color = "rgba(25, 20, 20, 1.0)";
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = "3"; # 0 disables blurring
blur_size = "7";
noise = "0.0117";
contrast = "0.8916";
brightness = "0.8172";
vibrancy = "0.1696";
vibrancy_darkness = "0.0";
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "DP-1";
dots_center = true;
fade_on_empty = true;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
bothlock_color = -1;
outline_thickness = 5;
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
shadow_passes = 2;
}
];
};
};
home.sessionVariables = {
BROWSER = "firefox";
EDITOR = "nano";
TERMINAL = "kitty";
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
GTK_CSD = "0";
# WLR_DRM_DEVICES = "/dev/dri/card0";
# WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
# WLR_RENDERER = "vulkan";
XCURSOR_THEME = cursorTheme;
XCURSOR_SIZE = cursorSize;
HYPRCURSOR_THEME = cursorTheme;
HYPRCURSOR_SIZE = cursorSize;
GTK_THEME = gtkTheme;
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
GTK_USE_PORTAL = "1";
NIXOS_XDG_OPEN_USE_PORTAL = "1";
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
#XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
ICON_THEME = iconTheme;
};
home.pointerCursor = {
gtk.enable = true;
package = cursorThemePkg;
name = cursorTheme;
size = cursorSize;
};
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface".cursor-theme = cursorTheme;
"org/gnome/desktop/interface".icon-theme = iconTheme;
};
};
gtk = {
enable = true;
cursorTheme = {
name = cursorTheme; # macOS-[BigSur, Monterey]-[ , White, White-Windows, Windows]
package = cursorThemePkg;
};
theme = {
name = gtkTheme;
package = gtkThemePkg;
};
iconTheme = {
name = iconTheme;
package = iconThemePkg;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
};
}

View File

@@ -0,0 +1,15 @@
{ lib, ... }:
let
hostname = "matt-nixos";
in
{
# Networking configs
networking = {
hostName = hostname;
# Enable Network Manager
networkmanager.enable = lib.mkDefault true;
networkmanager.wifi.powersave = lib.mkDefault false;
networkmanager.settings.connectivity.uri = lib.mkDefault "http://nmcheck.gnome.org/check_network_status.txt";
};
}

209
hosts/desktop/services.nix Normal file
View File

@@ -0,0 +1,209 @@
{ config, lib, pkgs, ... }:
let
fixWifiScript = pkgs.writeScriptBin "fix-wifi" ''
#!/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()
'';
in
{
services = {
# Enable Desktop Environment.
xserver = {
desktopManager.gnome.enable = true;
# Enable Desktop Environment.
displayManager = {
gdm.enable = lib.mkForce true;
gdm.wayland = lib.mkForce true;
};
};
# Enable Flatpak
flatpak.enable = lib.mkDefault false;
# enable auto discovery of printers
avahi = {
enable = lib.mkDefault true;
nssmdns4 = lib.mkDefault true;
openFirewall = lib.mkDefault true;
};
restic.backups = {
jallen-nas = {
initialize = true;
createWrapper = true;
inhibitsSleep = true;
environmentFile = config.sops.templates."restic.env".path;
passwordFile = config.sops.secrets."desktop/restic/password".path;
repository = "rest:http://admin:BogieDudie1@10.0.1.18:8008";
paths = [
"/home/matt"
];
exclude = [
"/home/matt/Games"
"/home/matt/1TB"
"/home/matt/Downloads"
"/home/matt/Nextcloud"
"/home/matt/.cache"
"/home/matt/.local/share/Steam"
"/home/matt/.var/app/com.valvesoftware.Steam"
"/home/matt/.tmp"
"/home/matt/.thumbnails"
"/home/matt/.compose-cache"
];
};
proton-drive = {
initialize = true;
createWrapper = true;
inhibitsSleep = true;
passwordFile = config.sops.secrets."desktop/restic/password".path;
rcloneConfigFile = "/home/matt/.config/rclone/rclone.conf";
repository = "rclone:proton-drive:backup-nix";
paths = [
"/home/matt"
];
exclude = [
"/home/matt/Games"
"/home/matt/1TB"
"/home/matt/Downloads"
"/home/matt/Nextcloud"
"/home/matt/.cache"
"/home/matt/.local/share/Steam"
"/home/matt/.var/app/com.valvesoftware.Steam"
"/home/matt/.tmp"
"/home/matt/.thumbnails"
"/home/matt/.compose-cache"
];
};
};
btrfs = {
autoScrub.enable = lib.mkDefault true;
autoScrub.fileSystems = lib.mkDefault [
"/nix"
"/root"
"/etc"
"/var/log"
"/home"
];
};
ratbagd.enable = lib.mkDefault true;
};
systemd = {
services = {
fix-wifi = {
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 = [ "${fixWifiScript}/bin/fix-wifi" ];
};
};
};
user.services = {
rclone-home-proton = {
enable = lib.mkDefault false;
path = [
pkgs.bash
pkgs.rclone
];
script = ''
rclone sync /home/matt proton-drive:backup-nix --exclude '/home/matt/Games/**' --exclude '/home/matt/1TB/**' --exclude '/home/matt/Downloads/**'
'';
};
rsync-home = {
enable = lib.mkDefault false;
path = [
pkgs.bash
pkgs.rsync
pkgs.openssh
];
script = ''
rsync -rtpogvPlHzs --ignore-existing --exclude={'/home/matt/Games', '/home/matt/1TB', '/home/matt/Downloads/*', '/home/matt/.cache'} -e ssh /home/matt admin@10.0.1.18:/media/nas/main/backup/desktop-nix/home
'';
};
};
};
}

View File

@@ -17,4 +17,57 @@
'';
sops.secrets."wifi" = { };
sops.secrets."ssh-keys-public/desktop-nixos" = {
mode = "0644";
};
sops.secrets."ssh-keys-private/desktop-nixos" = {
mode = "0600";
};
sops.secrets."ssh-keys-public/desktop-nixos-root" = {
path = "/root/.ssh/id_ed25519.pub";
mode = "0600";
};
sops.secrets."ssh-keys-private/desktop-nixos-root" = {
path = "/root/.ssh/id_ed25519";
mode = "0600";
};
sops.secrets."secureboot/GUID" = {
path = "/etc/secureboot/GUID";
mode = "0600";
};
sops.secrets."secureboot/keys/db-key" = {
path = "/etc/secureboot/keys/db/db.key";
mode = "0600";
};
sops.secrets."secureboot/keys/db-pem" = {
path = "/etc/secureboot/keys/db/db.pem";
mode = "0600";
};
sops.secrets."secureboot/keys/KEK-key" = {
path = "/etc/secureboot/keys/KEK/KEK.key";
mode = "0600";
};
sops.secrets."secureboot/keys/KEK-pem" = {
path = "/etc/secureboot/keys/KEK/KEK.pem";
mode = "0600";
};
sops.secrets."secureboot/keys/PK-key" = {
path = "/etc/secureboot/keys/PK/PK.key";
mode = "0600";
};
sops.secrets."secureboot/keys/PK-pem" = {
path = "/etc/secureboot/keys/PK/PK.pem";
mode = "0600";
};
}

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
let
adminpass = config.sops.secrets."jallen-nas/nextcloud/adminpassword".path;
smtppassword = config.sops.templates."nextcloud-smtp".content;
smtppassword = builtins.readFile config.sops.secrets."jallen-nas/nextcloud/smtppassword".path;
nextcloudUserId = config.users.users.nix-apps.uid;
nextcloudGroupId = config.users.groups.jallen-nas.gid;
nextcloudPackage = pkgs.unstable.nextcloud30;

View File

@@ -3,15 +3,9 @@
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{
outputs,
config,
pkgs,
...
}:
let
user = "admin";
passwordFile = config.sops.secrets."jallen-nas/admin_password".path;
in
{
imports = [
# Include the results of the hardware scan.
@@ -21,45 +15,15 @@ in
./apps.nix
./grafana.nix
./networking.nix
./nixpkgs.nix
./ups.nix
./users.nix
./samba.nix
./services.nix
./sops.nix
../default.nix
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# enable cuda support
nixpkgs.config.cudaSupport = true;
nixpkgs.config.allowUnfreePredicate =
p:
builtins.all (
license:
license.free
|| builtins.elem license.shortName [
"CUDA EULA"
"cuDNN EULA"
"cuTENSOR EULA"
"NVidia OptiX EULA"
]
) (if builtins.isList p.meta.license then p.meta.license else [ p.meta.license ]);
# Cockpit
services.cockpit = {
enable = false;
port = 9090;
settings = {
WebService = {
AllowUnencrypted = true;
};
};
};
nix.settings.trusted-users = [ "@wheel" ];
powerManagement.cpuFreqGovernor = "powersave";
share.hardware.nvidia = {
@@ -86,14 +50,9 @@ in
hdd5 UUID=2b4be219-613d-4512-8277-0260989d5377 none tpm2-device=auto
'';
etc.machine-id.source = ./machine-id;
# List packages installed in system profile. To search, run:
# $ nix search wget
sessionVariables = {
CACHIX_AGENT_TOKEN = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkYmNkZWNjYi04ZTI4LTQwOTAtYWIxOC02MTU5OTYwZTgxMTAiLCJzY29wZXMiOiJjYWNoZSJ9.G-9wCfKc3d8ld_zDJNjTxNWlkS3_yojI-6gaRpUT-i0";
};
etc.machine-id.text = ''
57cdf5fc27f3469f80d0a339f1238aeb
'';
systemPackages = with pkgs; [
authentik
@@ -158,115 +117,6 @@ in
};
};
# Configure nixpkgs
nixpkgs = {
overlays = [
outputs.overlays.nixpkgs-unstable
outputs.overlays.nixpkgs-stable
];
config = {
# Enable non free
allowUnfree = true;
permittedInsecurePackages = [
# ...
"authentik-2024.6.4" # todo: remove these
"python3.12-authentik-django-2024.6.4"
"authentik-webui-2024.6.4"
"authentik-client-api-2024.6.4"
"authentik-website-2024.6.4"
"authentik-proxy-2024.6.4"
"aspnetcore-runtime-6.0.36"
"aspnetcore-runtime-wrapped-6.0.36"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];
};
};
# Define a user account. Don't forget to set a password with passwd.
users = {
# See https://search.nixos.org/options?channel=unstable&show=users.mutableUsers&from=0&size=50&sort=relevance&type=packages&query=users.users
mutableUsers = false;
groups.jallen-nas.gid = 1000; # create nas group cause truenas perms
# Admin account
users."${user}" = {
isNormalUser = true;
linger = true;
extraGroups = [
"wheel"
"networkmanager"
"docker"
"podman"
"libvirtd"
"nix-apps"
"jallen-nas"
"media"
"nscd"
]; # Enable sudo for the user.
hashedPasswordFile = passwordFile;
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
# macBook
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCw9zq8DLGByI5v2gAn95hKNyOsm3g61a2buxu2BBMFysQJgmZPCCLUqRJKhSM5Vm/JOgsAmdpRBRZQoHD+6S844CJHb4v4VIbjkyQgYCuM7Rst2IOZ5QybvsA2/D0nwytZ+HXQqDj2AagUYDbz0gyyIHkDQ5YGBMkvkWz/h1Vci6aoBM7VihEDM4KlWoTVuPeASGM8r5IZ2FS83Djbqo4ov6AYvLMrKB9Z7hmFgH6R3LE0gxOkzbGVXtSuvJyrjvgytoT22UhATjjxSQ9D+YJXXkQoB3lUdg8OoIquUPjMZpl4mR8ffvseWPfcvD1XlD5t+TOHFqKpESO547tlOBYhdpew+NSgAXpamCU6oyV8tDCywLQu2ucxHRn78u6WXzWHkDtffdhzmk6TZaPhWqVHuTGjR4higBgGqUfSaKOMszt+FDRZAr3HtuQ2+zJ8bowK9fW5OqilTtK2HtQqroD9ApegDNbqOz6kGy5IycSXvqPURy/M4lxZxbtBPuemcJs= mattjallen@MacBook-Pro.local"
# desktop windows
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDZ2PYPjZddOzR8OJj16G88KcUhCDLkvrEmpUQP0wKHDUuA27HQQ2ORo66asadwGHY3k1VDZ1ei9l9H++SIIeKOaaUr5yZdktvj4POUNtbd9ZhcS7sZU7BSF+NMDM+h3tImh6z0S7mWvRQOUv3ZM+ZER+5xTWJVG1OOJEpb1drxJk6Qz0wbZKSR7TPNFBLLXlVy7hkNYf07RtDyhCCxNB3hJfa8c+oztnWumwDhDQWLqiUXWIU2QH6iRLGl/WYnujtNvVVaV/Hn3JJkS6MM9dnV3cpoIO0+J7+WfsN9rZ0wXt5yY3GhiGXwmcO5eYVli8lHlLWtK7aYSETyry6CBsLbojzOQO5rSqhpwfF2njAAFAQU0UjLc8PahisIuFKCwHH4iyXXOagiv5K1Mc/0Ak+WhhMPee6vV2p7NTyNpXRvouDbWy5cSRH31WgQ9fK5mIGe5v8nGGqtEhUubUkiOgP+H3UbT2V/nTv/TFKdJcKw+WmizvTrxBmaMjWALlkYl+s= mattl@Jallen-PC"
# desktop nixos
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTBMydhOc6SnOdB5WrEd7X07DrboAtagCUgXiOJjLov matt@matt-nixos"
];
packages = with pkgs; [
cachix
fastfetch
git
parted
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aha
papirus-icon-theme
firefox
swtpm
tigervnc
];
};
# Nix app account
users.nix-apps = {
isSystemUser = true;
uid = 911;
group = "jallen-nas";
extraGroups = [
"jallen-nas"
"docker"
"podman"
]; # Enable sudo for the user.
hashedPasswordFile = passwordFile;
};
groups.nut.name = "nut";
users.upsuser = {
group = "nut";
isNormalUser = false;
isSystemUser = true;
createHome = true;
home = "/var/lib/nut";
homeMode = "750";
hashedPasswordFile = passwordFile;
};
users.nextcloud = {
isNormalUser = true;
extraGroups = [
"jallen-nas"
"nix-apps"
];
hashedPasswordFile = passwordFile;
};
};
hardware.fancontrol = {
enable = false;
config = ''
@@ -306,8 +156,5 @@ in
};
libvirtd.enable = true;
# tpm.enable = true;
# useSecureBoot = true;
};
}

View File

@@ -1,12 +1,48 @@
{ ... }:
{
let
shellAliases = {
ll = "ls -alh";
update-boot = "sudo nixos-rebuild boot --max-jobs 10";
update-switch = "sudo nixos-rebuild switch --max-jobs 10";
update-flake = "nix flake update ~/nix-config";
ducks = "du -cksh * | sort -hr | head -n 15";
};
gitAliases = {
co = "checkout";
ci = "commit";
cia = "commit --amend";
s = "status";
st = "status";
b = "branch";
p = "pull --rebase";
pu = "push";
};
in
{
home.username = "admin";
home.homeDirectory = "/home/admin";
home.stateVersion = "23.11";
programs.home-manager.enable = true;
sops = {
age.keyFile = "/home/admin/.config/sops/age/keys.txt";
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
validateSopsFiles = false;
secrets = {
"ssh-keys-public/desktop-nixos" = {
path = "/home/admin/.ssh/id_ed25519.pub";
mode = "0644";
};
"ssh-keys-private/desktop-nixos" = {
path = "/home/admin/.ssh/id_ed25519";
mode = "0600";
};
};
};
programs = {
home-manager.enable = true;
command-not-found.enable = true;
fish.enable = false;
mangohud.enable = true;
java.enable = true;
@@ -19,10 +55,7 @@
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
update = "sudo nixos-rebuild switch";
ducks = "du -cksh * | sort -hr | head -n 15";
};
shellAliases = shellAliases;
oh-my-zsh = {
enable = true;
@@ -30,23 +63,12 @@
theme = "fishy";
};
};
};
programs.git = {
enable = true;
userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com";
aliases = {
co = "checkout";
ci = "commit";
cia = "commit --amend";
s = "status";
st = "status";
b = "branch";
p = "pull --rebase";
pu = "push";
git = {
enable = true;
userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com";
aliases = gitAliases;
};
};
programs.command-not-found.enable = true;
}

View File

@@ -1 +0,0 @@
57cdf5fc27f3469f80d0a339f1238aeb

43
hosts/nas/nixpkgs.nix Normal file
View File

@@ -0,0 +1,43 @@
{ outputs, ... }:
{
# Configure nixpkgs
nixpkgs = {
overlays = [
outputs.overlays.nixpkgs-unstable
outputs.overlays.nixpkgs-stable
];
config = {
# Enable non free
allowUnfree = true;
# enable cuda support
cudaSupport = true;
allowUnfreePredicate = p:
builtins.all (
license:
license.free
|| builtins.elem license.shortName [
"CUDA EULA"
"cuDNN EULA"
"cuTENSOR EULA"
"NVidia OptiX EULA"
]
) (if builtins.isList p.meta.license then p.meta.license else [ p.meta.license ]);
permittedInsecurePackages = [
# ...
"authentik-2024.6.4" # todo: remove these
"python3.12-authentik-django-2024.6.4"
"authentik-webui-2024.6.4"
"authentik-client-api-2024.6.4"
"authentik-website-2024.6.4"
"authentik-proxy-2024.6.4"
"aspnetcore-runtime-6.0.36"
"aspnetcore-runtime-wrapped-6.0.36"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];
};
};
}

View File

@@ -130,6 +130,16 @@ in
'';
};
};
cockpit = {
enable = false;
port = 9090;
settings = {
WebService = {
AllowUnencrypted = true;
};
};
};
tailscale = {
enable = true;

View File

@@ -92,6 +92,26 @@
${config.sops.secrets."jallen-nas/paperless/authentik-client-secret".path}
'';
sops.secrets."ssh-keys-public/desktop-nixos" = {
mode = "0644";
};
sops.secrets."ssh-keys-public/desktop-windows" = {
mode = "0644";
};
sops.secrets."ssh-keys-public/macbook-macos" = {
mode = "0644";
};
sops.secrets."ssh-keys-public/jallen-nas-root" = {
path = "/root/.ssh/id_ed25519.pub";
mode = "0600";
};
sops.secrets."ssh-keys-private/jallen-nas-root" = {
path = "/root/.ssh/id_ed25519";
mode = "0600";
};
# Permission modes are in octal representation (same as chmod),
# the digits represent: user|group|others
# 7 - full (rwx)

93
hosts/nas/users.nix Normal file
View File

@@ -0,0 +1,93 @@
{ pkgs, config, ... }:
let
user = "admin";
passwordFile = config.sops.secrets."jallen-nas/admin_password".path;
authorizedKeyFiles = [
config.sops.secrets."ssh-keys-public/desktop-nixos".path
config.sops.secrets."ssh-keys-public/desktop-nixos-root".path
config.sops.secrets."ssh-keys-public/desktop-windows".path
config.sops.secrets."ssh-keys-public/macbook-macos".path
];
in
{
# Define a user account. Don't forget to set a password with passwd.
users = {
# See https://search.nixos.org/options?channel=unstable&show=users.mutableUsers&from=0&size=50&sort=relevance&type=packages&query=users.users
mutableUsers = false;
groups.jallen-nas.gid = 1000; # create nas group cause truenas perms
# Admin account
users."${user}" = {
isNormalUser = true;
linger = true;
extraGroups = [
"wheel"
"networkmanager"
"docker"
"podman"
"libvirtd"
"nix-apps"
"jallen-nas"
"media"
"nscd"
"grafana"
"traefik"
"avahi"
"62900"
"1001"
];
hashedPasswordFile = passwordFile;
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = authorizedKeyFiles;
packages = with pkgs; [
cachix
fastfetch
git
parted
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aha
papirus-icon-theme
firefox
swtpm
tigervnc
];
};
# Nix app account
users.nix-apps = {
isSystemUser = true;
uid = 911;
group = "jallen-nas";
extraGroups = [
"jallen-nas"
"docker"
"podman"
];
hashedPasswordFile = passwordFile;
};
groups.nut.name = "nut";
users.upsuser = {
group = "nut";
isNormalUser = false;
isSystemUser = true;
createHome = true;
home = "/var/lib/nut";
homeMode = "750";
hashedPasswordFile = passwordFile;
};
users.nextcloud = {
isNormalUser = true;
extraGroups = [
"jallen-nas"
"nix-apps"
];
hashedPasswordFile = passwordFile;
};
};
}