formating

This commit is contained in:
Don Harper 2025-09-18 21:56:27 -05:00
parent 45c20d9cbe
commit 7016e89c79
12 changed files with 121 additions and 201 deletions

View file

@ -1,9 +1,4 @@
{
pkgs,
inputs,
osConfig,
...
}: {
{ pkgs, inputs, osConfig, ... }: {
imports = [
./aerc.nix
./bash.nix
@ -119,7 +114,8 @@
programs.keychain = {
enable = true;
enableBashIntegration = true;
keys = "id_aur id_dsa id_ed25519 git C7E41C9F79C846984163693FCCD8E76F07EA701B";
keys =
"id_aur id_dsa id_ed25519 git C7E41C9F79C846984163693FCCD8E76F07EA701B";
};
home.file.".links/links.cfg".source = files/links.cfg;
xdg.configFile."nix/nix.conf".text = ''

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
./hardware-configuration.nix
# ../disko/mmcblk.nix
@ -18,7 +11,5 @@
gui.enable = true;
kmscon.enable = true;
};
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.google-pixelbook
./hardware-configuration.nix
@ -24,7 +17,5 @@
auto-cpufreq.enable = true;
gnome-calendar.enable = true;
};
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -1,9 +1,4 @@
{
inputs,
config,
pkgs,
...
}: {
{ inputs, config, pkgs, ... }: {
imports = [
./hardware-configuration.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel
@ -20,7 +15,5 @@
kmscon.enable = true;
auto-cpufreq.enable = true;
};
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.google-pixelbook
./hardware-configuration.nix
@ -21,7 +14,5 @@
kmscon.enable = true;
auto-cpufreq.enable = true;
};
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.framework-amd-ai-300-series
./hardware-configuration.nix
@ -13,7 +6,7 @@
../workstation
];
networking.hostName = "loki";
boot.binfmt.emulatedSystems = ["aarch64-linux"];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
variables.address = "100.72.0.1";
variables.swayScale = "1.2";
@ -27,7 +20,5 @@
gnome-calendar.enable = true;
};
primary.enable = true;
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -10,10 +10,6 @@
networking.hostName = "pocket2";
variables.swayScale = "1.7";
roles = {
gui.enable = true;
};
wm = {
sway.enable = true;
};
roles = { gui.enable = true; };
wm = { sway.enable = true; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x260
inputs.nixos-hardware.nixosModules.common-pc-laptop
@ -24,7 +17,5 @@
auto-cpufreq.enable = true;
gnome-calendar.enable = true;
};
wm = {
sway.enable = true;
};
wm = { sway.enable = true; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
./hardware-configuration.nix
# ../disko/mmcblk.nix

View file

@ -1,11 +1,5 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: let
{ inputs, outputs, lib, config, pkgs, ... }:
let
my-python-packages = python-packages:
with python-packages; [
# pipx
@ -24,7 +18,7 @@ in {
# experimental-features = ["nix-command" "flakes"];
warn-dirty = false;
auto-optimise-store = true;
trusted-users = ["root" "don"];
trusted-users = [ "root" "don" ];
};
gc = {
automatic = true;
@ -58,26 +52,23 @@ in {
networking = {
networkmanager.enable = true;
enableIPv6 = true;
networkmanager = {wifi = {powersave = true;};};
networkmanager = { wifi = { powersave = true; }; };
useDHCP = false;
firewall = {
enable = true;
trustedInterfaces = ["tailscale0"]; # always allow traffic from your Tailscale network
trustedInterfaces =
[ "tailscale0" ]; # always allow traffic from your Tailscale network
checkReversePath = "loose";
allowedUDPPorts = [config.services.tailscale.port];
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedTCPPorts = [22];
allowedUDPPorts = [ config.services.tailscale.port ];
allowedTCPPortRanges = [{
from = 1714;
to = 1764;
}];
allowedUDPPortRanges = [{
from = 1714;
to = 1764;
}];
allowedTCPPorts = [ 22 ];
};
};
@ -93,7 +84,7 @@ in {
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5.addons = with pkgs; [fcitx5-mozc fcitx5-gtk];
fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-gtk ];
};
};
@ -101,38 +92,33 @@ in {
boot = {
# kernelPackages = pkgs.linuxPackages_latest;
kernelPackages = pkgs.linuxPackages_zen;
kernelParams = ["consoleblank=60" "mem_sleep_default=deep"];
kernelParams = [ "consoleblank=60" "mem_sleep_default=deep" ];
# extraModulePackages = [config.boot.kernelPackages.ddcci-driver];
# kernelModules = ["i2c-dev" "ddcci_backlight"];
loader =
if (pkgs.hostPlatform != lib.mkDefault "aarch64-linux")
then {
systemd-boot = {enable = true;};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
}
else {
grub.enable = false;
generic-extlinux-compatible.enable = true;
loader = if (pkgs.hostPlatform != lib.mkDefault "aarch64-linux") then {
systemd-boot = { enable = true; };
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
plymouth = {enable = true;};
kernel = {sysctl = {"vm.swappiness" = 10;};};
} else {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
plymouth = { enable = true; };
kernel = { sysctl = { "vm.swappiness" = 10; }; };
};
security = {
polkit = {enable = true;};
polkit = { enable = true; };
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = ["don"];
keepEnv = true;
noPass = true;
}
];
extraRules = [{
users = [ "don" ];
keepEnv = true;
noPass = true;
}];
};
};
@ -149,15 +135,17 @@ in {
userServices = true;
};
};
bpftune = {enable = true;};
flatpak = {enable = true;};
fstrim = {enable = true;};
fwupd = {enable = true;};
bpftune = { enable = true; };
flatpak = { enable = true; };
fstrim = { enable = true; };
fwupd = { enable = true; };
locate = {
enable = true;
package = pkgs.mlocate;
};
logind = {
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "ignore";
settings = {
Login = {
HandleLidSwitchDocked = "ignore";
@ -165,7 +153,7 @@ in {
};
};
};
nscd = {enableNsncd = true;};
nscd = { enableNsncd = true; };
openssh = {
enable = true;
settings = {
@ -173,34 +161,34 @@ in {
KbdInteractiveAuthentication = false;
};
};
pcscd = {enable = true;};
pcscd = { enable = true; };
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse = {enable = true;};
pulse = { enable = true; };
};
printing = {
enable = true;
drivers = [pkgs.hplipWithPlugin];
drivers = [ pkgs.hplipWithPlugin ];
};
pulseaudio = {enable = false;};
tailscale = {enable = true;};
pulseaudio = { enable = false; };
tailscale = { enable = true; };
udev = {
extraRules = ''
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="ext4", ATTR{../queue/scheduler}="none" '';
};
udisks2 = {enable = true;};
udisks2 = { enable = true; };
};
hardware = {
bluetooth = {enable = true;};
bluetooth = { enable = true; };
sane = {
enable = true;
extraBackends = [pkgs.sane-airscan];
disabledDefaultBackends = ["escl" "v4l"];
extraBackends = [ pkgs.sane-airscan ];
disabledDefaultBackends = [ "escl" "v4l" ];
};
};
security.rtkit.enable = true;
@ -227,7 +215,8 @@ in {
isNormalUser = true;
initialPassword = "changeme";
description = "Don Harper";
extraGroups = ["networkmanager" "wheel" "scanner" "lp" "video" "mlocate" "disk"];
extraGroups =
[ "networkmanager" "wheel" "scanner" "lp" "video" "mlocate" "disk" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINd8AdVbQQ/Fmw+b9mI8EMYqIoRkwmSwAOtmlte3incL don@loki"
];
@ -246,9 +235,9 @@ in {
config = {
allowUnfree = true;
allowUnfreePredicate = true;
permittedInsecurePackages = ["libsoup-2.74.3" "qtwebengine-5.15.19"];
permittedInsecurePackages = [ "libsoup-2.74.3" "qtwebengine-5.15.19" ];
allowInsecurePredicate = pkg:
builtins.elem (lib.getName pkg) ["broadcom-sta"];
builtins.elem (lib.getName pkg) [ "broadcom-sta" ];
};
};
@ -321,10 +310,10 @@ in {
];
programs = {
dconf = {enable = true;};
light = {enable = true;};
mtr = {enable = true;};
kdeconnect = {enable = true;};
dconf = { enable = true; };
light = { enable = true; };
mtr = { enable = true; };
kdeconnect = { enable = true; };
gnupg = {
agent = {
enable = true;
@ -336,14 +325,14 @@ in {
nixpkgs.overlays = [
(final: prev: {
qutebrowser = prev.qutebrowser.override {enableWideVine = true;};
qutebrowser = prev.qutebrowser.override { enableWideVine = true; };
})
(final: super: {
khal = super.khal.overridePythonAttrs (_: {doCheck = false;});
khal = super.khal.overridePythonAttrs (_: { doCheck = false; });
})
];
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -374,5 +363,6 @@ in {
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
};
environment.sessionVariables.DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser";
environment.sessionVariables.DEFAULT_BROWSER =
"${pkgs.qutebrowser}/bin/qutebrowser";
}

View file

@ -1,65 +1,63 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.primary;
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.primary;
in {
options.primary = {enable = mkEnableOption "is primary host";};
options.primary = { enable = mkEnableOption "is primary host"; };
config = mkIf cfg.enable {
systemd = {
user = {
services = {
do_agenda = {
description = "Send today's agenda";
unitConfig = {Type = "simple";};
unitConfig = { Type = "simple"; };
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/do_agenda";
};
};
do_agenda_tomorrow = {
description = "Send tomorrow's agenda";
unitConfig = {Type = "simple";};
unitConfig = { Type = "simple"; };
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/do_agenda_tomorrow";
};
};
gosleep = {
description = "Adjust tailscale MTU based on location";
unitConfig = {Type = "simple";};
unitConfig = { Type = "simple"; };
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/gosleep";
};
};
};
timers = {
do_agenda = {
wantedBy = ["timers.target"];
partOf = ["do_agenda.service"];
wantedBy = [ "timers.target" ];
partOf = [ "do_agenda.service" ];
timerConfig = {
OnCalendar = "05:00";
Unit = "do_agenda.service";
};
};
do_agenda_tomorrow = {
wantedBy = ["timers.target"];
partOf = ["do_agenda_tomorrow.service"];
wantedBy = [ "timers.target" ];
partOf = [ "do_agenda_tomorrow.service" ];
timerConfig = {
OnCalendar = "20:00";
Unit = "do_agenda_tomorrow.service";
};
};
gosleep = {
wantedBy = ["timers.target"];
partOf = ["gosleep.service"];
wantedBy = [ "timers.target" ];
partOf = [ "gosleep.service" ];
timerConfig = {
OnCalendar = "1m";
Unit = "gosleep.service";

View file

@ -1,19 +1,16 @@
{
pkgs,
lib,
...
}: let
{ pkgs, lib, ... }:
let
readlink = "${pkgs.coreutils}/bin/readlink";
notify-send = "${pkgs.libnotify}/bin/notify-send";
in {
systemd = {
services = {
systemd-lock-handler = {enable = true;};
systemd-lock-handler = { enable = true; };
NetworkManager-wait-online.enable = lib.mkForce false;
systemd-networkd-wait-online.enable = lib.mkForce false;
clean-keychain = {
description = "Clean up .keychain on boot";
wantedBy = ["multi-user.target"];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.coreutils-full}/bin/rm -rf /home/don/.keychain";
@ -24,14 +21,15 @@ in {
services = {
swaylock = {
description = "Screen locker for Wayland";
documentation = ["man:swaylock(1)"];
onSuccess = ["unlock.target"];
partOf = ["lock.target"];
before = ["lock.target"];
wantedBy = ["lock.target"];
documentation = [ "man:swaylock(1)" ];
onSuccess = [ "unlock.target" ];
partOf = [ "lock.target" ];
before = [ "lock.target" ];
wantedBy = [ "lock.target" ];
serviceConfig = {
Type = "forking";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/lock.sh -m";
Restart = "on-failure";
RestartSec = 0;
@ -48,30 +46,31 @@ in {
${notify-send} --urgency=low --icon=system-reboot "Reboot is needed for a NixOS upgrade."
fi
'';
serviceConfig = {Type = "oneshot";};
serviceConfig = { Type = "oneshot"; };
};
check-nic = {
description = "Adjust tailscale MTU based on location";
unitConfig = {Type = "simple";};
unitConfig = { Type = "simple"; };
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/check-nic";
};
};
};
timers = {
check-nic = {
wantedBy = ["timers.target"];
partOf = ["check-nic.service"];
wantedBy = [ "timers.target" ];
partOf = [ "check-nic.service" ];
timerConfig = {
OnCalendar = "1m";
Unit = "check-nic.service";
};
};
detect-reboot-for-upgrade = {
wantedBy = ["timers.target"];
partOf = ["detect-reboot-for-upgrade.service"];
wantedBy = [ "timers.target" ];
partOf = [ "detect-reboot-for-upgrade.service" ];
timerConfig = {
OnCalendar = "hourly";
Unit = "detect-reboot-for-upgrade.service";