nix/modules/nixos/default.nix

1299 lines
28 KiB
Nix
Raw Normal View History

{
disko,
sops-nix,
2024-09-12 11:22:43 -05:00
style,
flakeInputs,
homeManagerModules,
home-manager,
2024-07-29 11:29:05 -05:00
home-manager-unstable,
helix,
nixosModules,
pubkey,
overlays,
}: {
2024-09-12 11:22:43 -05:00
ewwbar = {pkgs, ...}: {
# imports = with nixosModules; [];
environment.systemPackages = with pkgs; [eww upower jq];
# TODO: include the home-manager modules for daniel?
};
hyprland = {pkgs, ...}: {
imports = with nixosModules; [
ewwbar
pipewire
];
programs.hyprland = {
enable = true;
};
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge socat];
programs.hyprland = {
package = flakeInputs.hyprland.packages.${pkgs.system}.hyprland;
};
2024-11-24 16:44:17 -06:00
home-manager.users.daniel = {
imports = with homeManagerModules; [
hyprland
];
};
2024-09-12 11:22:43 -05:00
# TODO: include the home-manager modules for daniel?
};
sway = {pkgs, ...}: {
imports = with nixosModules; [
pipewire
];
2024-10-18 10:29:50 -05:00
systemd.user.services."wait-for-full-path" = {
description = "wait for systemd units to have full PATH";
wantedBy = ["xdg-desktop-portal.service"];
before = ["xdg-desktop-portal.service"];
path = with pkgs; [systemd coreutils gnugrep];
script = ''
ispresent () {
systemctl --user show-environment | grep -E '^PATH=.*/.nix-profile/bin'
}
while ! ispresent; do
sleep 0.1;
done
'';
serviceConfig = {
Type = "oneshot";
TimeoutStartSec = "60";
};
};
2024-09-12 11:22:43 -05:00
home-manager.users.daniel = {
imports = with homeManagerModules; [
sway
];
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
# services.xserver.libinput.enable = true;
# TODO: a lot of this probably needs de-duping with hyprland?
services.gnome.gnome-keyring.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
];
};
services.dbus.enable = true;
2024-10-08 10:17:56 -05:00
security.polkit.enable = true; # needed for home-manager integration
2024-09-12 11:22:43 -05:00
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
services.gvfs = {
enable = true;
};
environment = {
variables = {
VISUAL = "hx";
PAGER = "less";
MANPAGER = "less";
};
systemPackages = with pkgs; [
brightnessctl
feh
grim
libinput
libinput-gestures
libnotify
mako
noto-fonts
pamixer
playerctl
pulseaudio
pulsemixer
slurp
swaybg
swayidle
swaylock
swayosd
tofi
waybar
wl-clipboard
zathura
2024-09-12 13:24:57 -05:00
2024-09-12 12:05:22 -05:00
/*
gimp
inkscape
krita
lutris
nil
nixpkgs-fmt
pavucontrol
rclone
restic
steam
vlc
vulkan-tools
weechat
wine
*/
2024-09-12 11:22:43 -05:00
];
};
};
deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix;
fallback-hostname = {lib, ...}: {
networking.hostName = lib.mkDefault "set-a-hostname-dingus";
};
no-giant-logs = {lib, ...}: {
services.journald.extraConfig = lib.mkDefault "SystemMaxUse=1G";
};
allow-redistributable-firmware = {lib, ...}: {
hardware.enableRedistributableFirmware = lib.mkDefault true;
};
home-manager-defaults = {
imports = [
# enable home-manager
home-manager.nixosModules.home-manager
];
home-manager.useGlobalPkgs = true;
home-manager.backupFileExtension = "hm-backup";
};
2024-07-29 11:29:05 -05:00
home-manager-unstable-defaults = {
imports = [
# enable home-manager
home-manager-unstable.nixosModules.home-manager
];
home-manager.useGlobalPkgs = true;
home-manager.backupFileExtension = "hm-backup";
};
mdns-and-lan-service-discovery = {
services.avahi = {
enable = true;
reflector = true;
openFirewall = true;
nssmdns4 = true;
};
};
less-pager = {pkgs, ...}: {
environment = {
systemPackages = [
pkgs.less
];
variables = {
PAGER = "less";
MANPAGER = "less";
};
};
};
helix-text-editor = {pkgs, ...}: {
environment = {
systemPackages = [
pkgs.less
helix.packages.${pkgs.system}.helix
];
variables = {
EDITOR = "hx";
SYSTEMD_EDITOR = "hx";
VISUAL = "hx";
};
};
};
zellij-multiplexer = {pkgs, ...}: {
environment.systemPackages = [
pkgs.zellij
];
};
fish-shell = {
pkgs,
lib,
...
}: {
programs.fish = {
enable = true;
};
users = {
defaultUserShell = pkgs.fish;
};
};
nix-index = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
my-favorite-default-system-apps = {pkgs, ...}: {
imports = with nixosModules; [
less-pager
helix-text-editor
zellij-multiplexer
fish-shell
];
environment.systemPackages = with pkgs; [
curl
dua
eza # TODO: needs shell aliases
fd
file
iputils
nettools
2024-09-12 12:05:22 -05:00
/*
nodePackages.bash-language-server # just pull in as needed?
shellcheck
shfmt
*/
killall
ripgrep
rsync
sd
];
programs = {
traceroute.enable = true;
git = {
enable = true;
package = pkgs.gitFull;
lfs.enable = true;
};
};
};
mosh = {lib, ...}: {
programs.mosh = {
enable = true;
openFirewall = lib.mkDefault true;
};
};
2024-07-29 10:43:11 -05:00
remote-disk-key-entry-on-boot = {
lib,
pkgs,
...
}: {
2024-09-12 12:05:22 -05:00
/*
https://nixos.wiki/wiki/Remote_disk_unlocking
"When using DHCP, make sure your computer is always attached to the network and is able to get an IP adress, or the boot process will hang."
^ seems less than ideal
*/
2024-07-29 10:43:11 -05:00
boot.kernelParams = ["ip=dhcp"];
boot.initrd = {
# availableKernelModules = ["r8169"]; # ethernet drivers
systemd.users.root.shell = "/bin/cryptsetup-askpass";
network = {
enable = true;
ssh = {
enable = true;
port = 22;
authorizedKeys = [pubkey];
hostKeys = ["/etc/secrets/initrd/ssh_host_rsa_key"];
};
};
};
};
ssh-server = {lib, ...}: {
# enable an ssh server and provide root access with my primary public key
users.users.root = {
openssh.authorizedKeys.keys = [pubkey];
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = lib.mkForce "prohibit-password";
};
openFirewall = lib.mkDefault true;
2024-09-12 12:05:22 -05:00
/*
listenAddresses = [
{ addr = "0.0.0.0"; port = 22; }
];
*/
};
};
2024-07-10 09:57:10 -05:00
password-manager = {pkgs, ...}: {
2024-09-12 12:05:22 -05:00
/*
programs.goldwarden = {
## NOTE: This didn't seem to work for me, but would be awesome! (but I can't remember why?)
enable = true;
};
*/
2024-07-10 09:57:10 -05:00
home-manager.users.daniel = {
imports = with homeManagerModules; [
password-manager
];
};
};
2024-07-17 15:08:24 -05:00
linux = {pkgs, ...}: {
home-manager.users.daniel = {
imports = with homeManagerModules; [
linux
];
};
};
tailscale = {lib, ...}: {
services.tailscale = {
enable = true;
useRoutingFeatures = lib.mkDefault "client";
};
};
2024-10-10 11:46:03 -05:00
cross-compiler = {config, ...}: {
2024-10-15 10:10:28 -05:00
boot.binfmt.emulatedSystems = ["aarch64-linux" "i686-linux"];
2024-10-10 11:46:03 -05:00
};
default-nix-configuration-and-overlays = {
lib,
config,
...
}: {
nixpkgs = {
overlays = with overlays; [
additions
2024-06-29 01:40:25 -05:00
modifications
unstable-packages
];
config.allowUnfree = true;
};
nix = {
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
2024-07-29 10:01:59 -05:00
# registry = lib.mapAttrs (_: value: {flake = value;}) flakeInputs;
settings = {
trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"];
2024-10-15 10:10:28 -05:00
extra-platforms = ["i686-linux" "aarch64-linux"];
2024-10-10 11:46:03 -05:00
substituters = [
# TODO: dedupe with flake's config? is that even necessary?
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
2024-09-11 13:39:57 -05:00
"https://nix.h.lyte.dev"
"https://hyprland.cachix.org"
];
trusted-public-keys = [
# TODO: dedupe with flake's config? is that even necessary?
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
auto-optimise-store = true;
};
};
};
laptop = {pkgs, ...}: {
imports = with nixosModules; [
family-users
wifi
];
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
'';
2024-09-22 20:20:15 -05:00
services.upower.enable = true;
# NOTE: I previously let plasma settings handle this
services.logind = {
lidSwitch = "suspend-then-hibernate";
extraConfig = ''
HandleLidSwitchDocked=ignore
HandlePowerKey=suspend-then-hibernate
IdleActionSec=11m
IdleAction=suspend-then-hibernate
'';
};
};
emacs = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
emacs
];
home-manager.users.daniel = {
imports = with homeManagerModules; [
emacs
];
};
};
development-tools = {pkgs, ...}: {
imports = with nixosModules; [
postgres
podman
2024-07-13 14:41:30 -05:00
troubleshooting-tools
emacs
];
environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.neovim = {
enable = true;
2024-09-12 12:05:22 -05:00
/*
plugins = [
pkgs.vimPlugins.nvim-treesitter.withAllGrammars
];
*/
};
environment.systemPackages = with pkgs; [
taplo # toml language server for editing helix configs per repo
2024-10-24 14:52:40 -05:00
picocom # serial
pgcli
2024-11-20 09:46:11 -06:00
oils-for-unix
watchexec
android-tools
kubectl
stern
libresprite
2024-07-29 10:01:59 -05:00
# logseq
audacity
wol
shellcheck
skim
sops
gron
shfmt
vscode-langservers-extracted
nodePackages.bash-language-server
nodePackages.yaml-language-server
xh
curl
google-chrome
];
hardware.gpgSmartcards.enable = true;
services.udev.packages = with pkgs; [
2024-06-29 02:10:34 -05:00
# TODO: I think these get the whole package pulled in... should find out
# if there's a way to get just the rules and not 4 chromes
platformio
openocd
pkgs.yubikey-personalization
via
];
programs.adb.enable = true;
users.users.daniel.extraGroups = ["adbusers"];
home-manager.users.daniel = {
home.packages = with pkgs; [
yubikey-personalization
yubikey-manager
yubico-piv-tool
];
2024-07-16 15:38:46 -05:00
programs.thunderbird = {
enable = true;
profiles = {
daniel = {
isDefault = true;
# name = "daniel";
};
};
};
programs.nushell = {
enable = true;
};
programs.jujutsu = {
2024-11-12 10:54:34 -06:00
enable = false; # disabling for now due to CVE
};
programs.k9s = {
enable = true;
};
programs.vscode = {
enable = true;
};
programs.jq = {
enable = true;
};
programs.chromium = {
enable = true;
};
programs.btop = {
enable = true;
package = pkgs.btop.override {
rocmSupport = true;
};
};
};
};
troubleshooting-tools = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
2024-09-19 11:32:33 -05:00
comma
2024-09-09 10:05:45 -05:00
iftop
bottom
2024-07-18 10:01:56 -05:00
btop
dnsutils
dogdns
2024-07-18 10:01:56 -05:00
htop
2024-07-13 14:41:30 -05:00
inetutils
2024-07-18 10:01:56 -05:00
nmap
pciutils
2024-08-19 19:29:18 -05:00
hexyl
pkgs.unixtools.xxd
2024-07-18 10:01:56 -05:00
usbutils
2024-09-23 10:21:22 -05:00
comma
];
};
2024-07-26 11:28:28 -05:00
music-consumption = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
spotube
spotdl
];
};
};
2024-08-21 11:24:08 -05:00
video-tools = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
ffmpeg-full
obs-studio
];
};
};
2024-10-24 21:09:13 -05:00
android-dev = {pkgs, ...}: {
services.udev.packages = [
pkgs.android-udev-rules
];
environment.systemPackages = [pkgs.android-studio];
};
graphical-workstation = {
pkgs,
lib,
options,
config,
...
}: {
imports = with nixosModules; [
2024-09-12 11:22:43 -05:00
sway
2024-11-24 16:44:17 -06:00
hyprland
enable-flatpaks-and-appimages
fonts
development-tools
printing
2024-07-26 11:28:28 -05:00
music-consumption
2024-08-21 11:24:08 -05:00
video-tools
2024-10-09 13:44:02 -05:00
radio-tools
2024-10-24 21:09:13 -05:00
android-dev
];
xdg.portal.enable = true;
hardware =
if builtins.hasAttr "graphics" options.hardware
then {
graphics = {
enable = true;
2024-09-12 12:05:22 -05:00
/*
driSupport32Bit = true;
driSupport = true;
*/
};
}
else {
opengl = {
enable = true;
driSupport32Bit = true;
driSupport = true;
};
};
2024-07-16 15:38:46 -05:00
environment = {
systemPackages = with pkgs; [
libnotify
2024-08-26 13:09:49 -05:00
slides
2024-10-18 10:29:50 -05:00
slack
discord
2024-07-16 15:38:46 -05:00
];
variables = {
2024-09-12 12:05:22 -05:00
/*
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
GTK_USE_PORTAL = "1";
*/
2024-07-16 15:38:46 -05:00
};
};
};
# gnome = {};
# intel = {};
2024-10-09 13:44:02 -05:00
radio-tools = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
chirp
];
};
};
kde-connect = {
programs.kdeconnect.enable = true;
2024-09-12 12:05:22 -05:00
/*
# handled by enabling
2024-09-12 12:05:22 -05:00
networking.firewall = {
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
};
*/
};
fonts = {pkgs, ...}: {
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
pkgs.iosevkaLyteTerm
];
};
2024-07-10 09:57:10 -05:00
plasma6 = {
pkgs,
lib,
...
}: {
imports = with nixosModules; [
kde-connect
pipewire
];
services.xserver.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
};
services.desktopManager.plasma6.enable = true;
programs.dconf.enable = true;
services.xrdp.enable = false;
2024-06-29 03:57:06 -05:00
services.xrdp.defaultWindowManager = "plasma";
services.xrdp.openFirewall = false;
2024-06-29 01:00:18 -05:00
environment.systemPackages = with pkgs; [
wl-clipboard
2024-06-29 00:51:22 -05:00
inkscape
krita
noto-fonts
vlc
wl-clipboard
2024-06-29 01:00:18 -05:00
kdePackages.qtvirtualkeyboard
2024-06-29 00:51:22 -05:00
maliit-keyboard
maliit-framework
2024-06-29 01:00:18 -05:00
kdePackages.kate
kdePackages.kcalc
kdePackages.filelight
kdePackages.krdc
kdePackages.krfb
kdePackages.kclock
kdePackages.kweather
kdePackages.ktorrent
kdePackages.kdeplasma-addons
2024-06-29 01:40:25 -05:00
unstable-packages.kdePackages.krdp
2024-09-12 12:05:22 -05:00
/*
kdePackages.kdenlive
kdePackages.merkuro
kdePackages.neochat
kdePackages.kdevelop
kdePackages.kdialog
*/
];
2024-11-20 09:46:11 -06:00
programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-qt;
};
lutris = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
wineWowPackages.waylandFull
lutris
winetricks
];
};
};
2024-08-23 14:23:49 -05:00
gaming = {pkgs, ...}: {
imports = with nixosModules; [
lutris
steam
];
2024-08-23 14:23:49 -05:00
environment = {
systemPackages = with pkgs; [
ludusavi
# ludusavi uses rclone
rclone
];
};
};
pipewire = {
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
# wireplumber.enable = true; # this is default now
wireplumber.extraConfig = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = ["hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag"];
};
};
extraConfig.pipewire."91-null-sinks" = {
"context.objects" = [
{
# A default dummy driver. This handles nodes marked with the "node.always-driver"
# properyty when no other driver is currently active. JACK clients need this.
factory = "spa-node-factory";
args = {
"factory.name" = "support.node.driver";
"node.name" = "Dummy-Driver";
"priority.driver" = 8000;
};
}
{
factory = "adapter";
args = {
"factory.name" = "support.null-audio-sink";
"node.name" = "Microphone-Proxy";
"node.description" = "Microphone";
"media.class" = "Audio/Source/Virtual";
"audio.position" = "MONO";
};
}
{
factory = "adapter";
args = {
"factory.name" = "support.null-audio-sink";
"node.name" = "Main-Output-Proxy";
"node.description" = "Main Output";
"media.class" = "Audio/Sink";
"audio.position" = "FL,FR";
};
}
];
};
2024-09-12 12:05:22 -05:00
/*
extraConfig.pipewire."92-low-latency" = {
context.properties = {
default.clock.rate = 48000;
default.clock.quantum = 32;
default.clock.min-quantum = 32;
default.clock.max-quantum = 32;
};
};
*/
};
# recommended by https://nixos.wiki/wiki/PipeWire
security.rtkit.enable = true;
2024-09-12 12:05:22 -05:00
/*
services.pipewire = {
enable = true;
2024-09-12 12:05:22 -05:00
wireplumber.enable = true;
pulse.enable = true;
jack.enable = true;
2024-09-12 12:05:22 -05:00
alsa = {
enable = true;
support32Bit = true;
};
};
2024-09-12 12:05:22 -05:00
hardware = {
pulseaudio = {
enable = false;
support32Bit = true;
};
};
2024-09-12 12:05:22 -05:00
security = {
# I forget why I need these exactly...
polkit.enable = true;
2024-09-12 12:05:22 -05:00
rtkit.enable = true;
};
*/
};
music-production = {pkgs, ...}: {
2024-09-12 12:05:22 -05:00
/*
TODO: may want to force nixpkgs-stable for a more-stable music production
environment?
*/
imports = [
{
environment.systemPackages = with pkgs; [
helvum # pipewire graph/patchbay GUI
ardour # DAW
helm # synth
];
}
];
2024-09-12 12:05:22 -05:00
/*
TODO: things to look into for music production:
- https://linuxmusicians.com/viewtopic.php?t=27016
- KXStudio?
- falktx (https://github.com/DISTRHO/Cardinal)
*/
};
podman = {pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
podman-compose
];
};
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
2024-07-24 13:05:09 -05:00
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true;
2024-07-24 13:05:09 -05:00
# networkSocket.enable = true;
};
oci-containers = {
backend = "podman";
};
};
2024-10-18 10:29:50 -05:00
networking = {
extraHosts = ''
127.0.0.1 host.docker.internal
::1 host.docker.internal
127.0.0.1 host.containers.internal
::1 host.containers.internal
'';
};
};
2024-10-03 09:23:44 -05:00
virtual-machines = {pkgs, ...}: {
virtualisation.libvirtd.enable = true;
users.users.daniel.extraGroups = ["libvirtd"];
};
virtual-machines-gui = {pkgs, ...}: {
programs.virt-manager.enable = true;
};
postgres = {pkgs, ...}: {
# this is really just for development usage
services.postgresql = {
enable = true;
ensureDatabases = ["daniel"];
ensureUsers = [
{
name = "daniel";
ensureDBOwnership = true;
}
];
# enableTCPIP = true;
package = pkgs.postgresql_15;
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method
local all postgres peer map=superuser_map
local all daniel peer map=superuser_map
local sameuser all peer map=superuser_map
# lan ipv4
host all all 10.0.0.0/24 trust
host all all 127.0.0.1/32 trust
# tailnet ipv4
host all all 100.64.0.0/10 trust
'';
identMap = ''
# ArbitraryMapName systemUser DBUser
superuser_map root postgres
superuser_map postgres postgres
superuser_map daniel postgres
superuser_map /^(.*)$ \1 # Let other names login as themselves
'';
};
environment.systemPackages = with pkgs; [
pgcli
];
};
printing = {pkgs, ...}: {
services.printing.enable = true;
services.printing.browsing = true;
services.printing.browsedConf = ''
BrowseDNSSDSubTypes _cups,_print
BrowseLocalProtocols all
BrowseRemoteProtocols all
CreateIPPPrinterQueues All
BrowseProtocols all
'';
services.printing.drivers = [pkgs.gutenprint];
};
enable-flatpaks-and-appimages = {
services.flatpak.enable = true;
programs.appimage.binfmt = true;
};
wifi = {lib, ...}: let
inherit (lib) mkDefault;
in {
networking.networkmanager.enable = mkDefault true;
systemd.services.NetworkManager-wait-online.enable = mkDefault false;
2024-09-12 12:05:22 -05:00
/*
TODO: networking.networkmanager.wifi.backend = "iwd"; ?
TODO: powersave?
TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets?
*/
2024-09-22 20:20:15 -05:00
hardware.wirelessRegulatoryDatabase = true;
boot.extraModprobeConfig = ''
options cfg80211 ieee80211_regdom="US"
'';
};
steam = {pkgs, ...}: {
# programs.gamescope.enable = true;
programs.steam = {
enable = true;
2024-09-12 12:05:22 -05:00
/*
extest.enable = true;
gamescopeSession.enable = true;
extraPackages = with pkgs; [
gamescope
];
*/
extraCompatPackages = with pkgs; [
proton-ge-bin
];
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;
};
hardware.steam-hardware.enable = true;
services.udev.packages = with pkgs; [steam];
environment.systemPackages = with pkgs; [
dualsensectl # for interfacing with dualsense controllers programmatically
];
# remote play ports - should be unnecessary due to programs.steam.remotePlay.openFirewall = true;
2024-09-12 12:05:22 -05:00
/*
networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
*/
};
2024-07-30 17:02:42 -05:00
root = {
pkgs,
lib,
...
}: {
users.users.root = {
home = "/root";
createHome = true;
openssh.authorizedKeys.keys = [pubkey];
shell = lib.mkForce pkgs.fish;
};
home-manager.users.root = {
imports = [homeManagerModules.common];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = pkgs.lib.mkDefault "24.05";
};
};
};
daniel = {pkgs, ...}: let
username = "daniel";
in {
users.groups.${username} = {};
users.users.${username} = {
isNormalUser = true;
home = "/home/${username}/.home";
createHome = true;
openssh.authorizedKeys.keys = [pubkey];
group = username;
extraGroups = ["users" "wheel" "video" "dialout" "uucp" "kvm"];
packages = [];
};
home-manager.users.daniel = {
imports = [homeManagerModules.common];
home = {
username = "daniel";
homeDirectory = "/home/daniel/.home";
stateVersion = pkgs.lib.mkDefault "24.05";
};
accounts.email.accounts = {
primary = {
primary = true;
address = "daniel@lyte.dev";
};
legacy = {
address = "wraithx2@gmail.com";
};
io = {
# TODO: finalize deprecation
address = "daniel@lytedev.io";
};
};
};
};
valerie = let
username = "valerie";
in {
users.groups.${username} = {};
users.users.${username} = {
isNormalUser = true;
home = "/home/${username}";
createHome = true;
openssh.authorizedKeys.keys = [pubkey];
group = username;
extraGroups = ["users" "video"];
packages = [];
};
};
flanfam = let
username = "flanfam";
in {
users.groups.${username} = {};
users.users.${username} = {
isNormalUser = true;
home = "/home/${username}";
createHome = true;
openssh.authorizedKeys.keys = [pubkey];
group = username;
extraGroups = ["users" "video"];
packages = [];
};
};
family-users = {
imports = with nixosModules; [
2024-06-28 22:04:37 -05:00
# daniel # part of common
valerie
flanfam
];
};
# a common module that is intended to be imported by all NixOS systems
common = {
lib,
2024-07-10 08:54:39 -05:00
pkgs,
modulesPath,
...
}: {
imports = with nixosModules; [
(modulesPath + "/installer/scan/not-detected.nix")
default-nix-configuration-and-overlays
# allow any machine to make use of sops secrets
sops-nix.nixosModules.sops
# allow disko modules to manage disk config
disko.nixosModules.disko
fallback-hostname
no-giant-logs
allow-redistributable-firmware
mdns-and-lan-service-discovery
tailscale
ssh-server
my-favorite-default-system-apps
mosh
daniel
2024-07-30 17:02:42 -05:00
root
];
2024-08-21 20:11:39 -05:00
boot.tmp.useTmpfs = true;
systemd.services.nix-daemon = {
environment.TMPDIR = "/var/tmp";
};
boot.tmp.cleanOnBoot = true;
2024-11-20 09:46:11 -06:00
# services.irqbalance.enable = true;
2024-08-21 20:11:39 -05:00
2024-10-08 19:42:33 -05:00
# this is not ready for primetime yet
# services.kanidm = {
# enableClient = true;
# enablePam = true;
# package = pkgs.kanidm;
# clientSettings.uri = "https://idm.h.lyte.dev";
# unixSettings = {
# # hsm_pin_path = "/somewhere/else";
# pam_allowed_login_groups = [];
# };
# };
# systemd.tmpfiles.rules = [
# "d /etc/kanidm 1755 nobody users -"
# ];
2024-08-06 15:55:07 -05:00
# module has the incorrect file permissions out of the box
2024-10-08 19:42:33 -05:00
# environment.etc = {
/*
"kanidm" = {
enable = true;
user = "nobody";
group = "users";
mode = "0755";
2024-08-06 15:55:07 -05:00
};
2024-10-08 19:42:33 -05:00
*/
# "kanidm/unixd" = {
# user = "kanidm-unixd";
# group = "kanidm-unixd";
# mode = "0700";
# };
# "kanidm/config" = {
# user = "nobody";
# group = "users";
# mode = "0755";
# };
# };
2024-08-06 15:55:07 -05:00
2024-07-10 09:57:10 -05:00
programs.gnupg.agent = {
enable = true;
2024-11-20 09:46:11 -06:00
# pinentryPackage = lib.mkDefault pkgs.pinentry-tty;
2024-07-10 09:57:10 -05:00
};
2024-06-29 01:43:12 -05:00
time = {
2024-09-11 11:57:27 -05:00
timeZone = "America/Chicago";
};
i18n = {
defaultLocale = lib.mkDefault "en_US.UTF-8";
};
services = {
xserver.xkb = {
layout = lib.mkDefault "us";
# have the caps-lock key instead be a ctrl key
options = lib.mkDefault "ctrl:nocaps";
};
smartd.enable = true;
fwupd.enable = true;
};
console = {
# font = "Lat2-Terminus16"; # TODO: would like this font for non-hidpi displays, but this is not dynamic enough?
useXkbConfig = lib.mkDefault true;
earlySetup = lib.mkDefault true;
2024-09-12 11:22:43 -05:00
colors = with style.colors; [
bg
red
green
orange
blue
purple
yellow
fg3
fgdim
red
green
orange
blue
purple
yellow
fg
];
};
networking = {
useDHCP = lib.mkDefault true;
firewall = {
enable = lib.mkDefault true;
allowPing = lib.mkDefault true;
};
};
system.stateVersion = lib.mkDefault "24.05";
};
# intended to be auto-logged in and only run a certain application
# flanfamkiosk = {};
}