From 8cd8b3a3f9198aad84db64f503af1e772072ff3c Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 22 Oct 2024 11:34:51 -0400 Subject: [PATCH] flake: clean up modules --- hosts/Infini-DESKTOP/filesystems.nix | 2 +- .../Infini-DESKTOP/hardware-configuration.nix | 2 +- hosts/Infini-DL360/factorio.nix | 2 +- hosts/Infini-DL360/forgejo.nix | 12 +- hosts/Infini-DL360/freshrss.nix | 4 +- hosts/Infini-DL360/hardware-configuration.nix | 2 +- hosts/Infini-DL360/hydra.nix | 16 +- hosts/Infini-DL360/jellyfin.nix | 4 +- hosts/Infini-DL360/jitsi.nix | 4 +- hosts/Infini-DL360/jupyter.nix | 8 +- hosts/Infini-DL360/postgresql.nix | 5 +- hosts/Infini-DL360/ssh.nix | 57 ++--- hosts/Infini-DL360/thelounge.nix | 4 +- hosts/Infini-DL360/vaultwarden.nix | 8 +- hosts/Infini-DL360/web.nix | 4 +- .../hardware-configuration.nix | 2 +- hosts/Infini-OPTIPLEX/default.nix | 2 +- hosts/Infini-OPTIPLEX/filesystems.nix | 2 +- .../hardware-configuration.nix | 2 +- hosts/Infini-SD/default.nix | 2 +- hosts/Infini-SD/filesystems.nix | 2 +- hosts/Infini-SD/hardware-configuration.nix | 2 +- hosts/Infini-SERVER/default.nix | 2 +- hosts/Infini-SERVER/filesystems.nix | 2 +- .../Infini-SERVER/hardware-configuration.nix | 2 +- hosts/Infini-STICK/default.nix | 2 +- hosts/Infini-STICK/hardware-configuration.nix | 2 +- hosts/Infini-SWIFT/default.nix | 2 +- hosts/Infini-SWIFT/hardware-configuration.nix | 2 +- hosts/Infini-WSL/default.nix | 2 +- hosts/vulcan/default.nix | 2 +- modules/global/general.nix | 2 +- modules/global/graphical.nix | 2 +- modules/global/networking.nix | 2 +- modules/global/options.nix | 2 +- modules/global/ssh.nix | 4 +- modules/modules/desktop/wm.nix | 6 +- modules/modules/hardware/audio.nix | 2 +- modules/modules/hardware/form.nix | 2 +- .../modules/hardware/peripherals/printing.nix | 2 +- modules/modules/services/apcupsd.nix | 2 +- modules/vendored/thelounge.nix | 2 +- users/infinidoge/default.nix | 2 +- users/modules/functionality/bindmounts.nix | 2 +- users/modules/global/flameshot.nix | 2 +- users/modules/global/git.nix | 3 +- users/modules/global/htop.nix | 3 +- users/modules/global/keychain.nix | 2 +- users/modules/global/kitty.nix | 34 ++- users/modules/global/music.nix | 2 +- users/modules/global/neovim.nix | 2 +- users/modules/global/obs-studio.nix | 2 +- users/modules/global/shells/all.nix | 9 - users/modules/global/shells/bash.nix | 21 +- users/modules/global/shells/common.nix | 3 +- users/modules/global/shells/fish.nix | 25 +-- users/modules/global/shells/ion.nix | 13 +- users/modules/global/shells/nushell.nix | 3 +- users/modules/global/shells/zsh.nix | 195 +++++++++--------- users/modules/global/ssh.nix | 3 +- users/modules/global/starship.nix | 4 +- users/modules/global/themeing.nix | 2 +- users/modules/global/tmux.nix | 3 +- users/root/default.nix | 2 +- 64 files changed, 258 insertions(+), 273 deletions(-) delete mode 100644 users/modules/global/shells/all.nix diff --git a/hosts/Infini-DESKTOP/filesystems.nix b/hosts/Infini-DESKTOP/filesystems.nix index e46b5f2..e6b4473 100644 --- a/hosts/Infini-DESKTOP/filesystems.nix +++ b/hosts/Infini-DESKTOP/filesystems.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: let uuid = uuid: "/dev/disk/by-uuid/${uuid}"; diff --git a/hosts/Infini-DESKTOP/hardware-configuration.nix b/hosts/Infini-DESKTOP/hardware-configuration.nix index eba8071..4c18da9 100644 --- a/hosts/Infini-DESKTOP/hardware-configuration.nix +++ b/hosts/Infini-DESKTOP/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: { boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "sd_mod" ]; diff --git a/hosts/Infini-DL360/factorio.nix b/hosts/Infini-DL360/factorio.nix index 90556f5..e050755 100644 --- a/hosts/Infini-DL360/factorio.nix +++ b/hosts/Infini-DL360/factorio.nix @@ -1,4 +1,4 @@ -{ config, private, ... }: +{ private, ... }: { services.factorio = { diff --git a/hosts/Infini-DL360/forgejo.nix b/hosts/Infini-DL360/forgejo.nix index 9aa5ccf..2383c28 100644 --- a/hosts/Infini-DL360/forgejo.nix +++ b/hosts/Infini-DL360/forgejo.nix @@ -1,7 +1,7 @@ -{ config, pkgs, common, ... }: +{ config, common, pkgs, ... }: let cfg = config.services.forgejo; - domain = config.common.subdomain "git"; + domain = common.subdomain "git"; in { persist.directories = [ "/var/lib/private/gitea-runner/" ]; @@ -25,10 +25,10 @@ in settings = { server = { ROOT_URL = "https://${domain}/"; - SSH_DOMAIN = config.common.domain; + SSH_DOMAIN = common.domain; LANDING_PAGE = "explore"; }; - mailer = with config.common.email; { + mailer = with common.email; { ENABLED = true; PROTOCOL = "smtps"; SMTP_ADDR = smtp.address; @@ -49,7 +49,7 @@ in service = { DISABLE_REGISTRATION = true; OFFLINE_MODE = false; - NO_REPLY_ADDRESS = config.common.email.outgoing; + NO_REPLY_ADDRESS = common.email.outgoing; }; indexer = { REPO_INDEXER_ENABLED = true; @@ -96,7 +96,7 @@ in }; }; - services.nginx.virtualHosts.${domain} = config.common.nginx.ssl // { + services.nginx.virtualHosts.${domain} = common.nginx.ssl // { locations."/" = { proxyPass = "http://${cfg.settings.server.DOMAIN}:${toString cfg.settings.server.HTTP_PORT}"; extraConfig = '' diff --git a/hosts/Infini-DL360/freshrss.nix b/hosts/Infini-DL360/freshrss.nix index a82d6f2..cb9f525 100644 --- a/hosts/Infini-DL360/freshrss.nix +++ b/hosts/Infini-DL360/freshrss.nix @@ -1,10 +1,10 @@ -{ config, ... }: +{ config, common, ... }: let domain = "freshrss.inx.moe"; in { - services.nginx.virtualHosts.${domain} = config.common.nginx.ssl; + services.nginx.virtualHosts.${domain} = common.nginx.ssl; services.freshrss = { enable = true; diff --git a/hosts/Infini-DL360/hardware-configuration.nix b/hosts/Infini-DL360/hardware-configuration.nix index 988c6fc..b71478d 100644 --- a/hosts/Infini-DL360/hardware-configuration.nix +++ b/hosts/Infini-DL360/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ diff --git a/hosts/Infini-DL360/hydra.nix b/hosts/Infini-DL360/hydra.nix index 5924f5d..1482cdf 100644 --- a/hosts/Infini-DL360/hydra.nix +++ b/hosts/Infini-DL360/hydra.nix @@ -1,11 +1,11 @@ -{ config, pkgs, lib, ... }: +{ config, common, ... }: let - domain = config.common.subdomain "hydra"; + domain = common.subdomain "hydra"; in { - services.nginx.virtualHosts.${domain} = config.common.nginx.ssl // { + services.nginx.virtualHosts.${domain} = common.nginx.ssl // { locations."/" = { - proxyPass = "http://localhost:${builtins.toString config.services.hydra.port}"; + proxyPass = "http://localhost:${toString config.services.hydra.port}"; }; }; @@ -14,13 +14,13 @@ in port = 3333; baseDir = "/srv/hydra"; hydraURL = "https://${domain}"; - notificationSender = config.common.email.withSubaddress "hydra"; - smtpHost = config.common.email.smtp.address; + notificationSender = common.email.withSubaddress "hydra"; + smtpHost = common.email.smtp.address; useSubstitutes = true; environmentFile = config.secrets.hydra; extraEnv = { - EMAIL_SENDER_TRANSPORT_sasl_username = config.common.email.outgoing; - EMAIL_SENDER_TRANSPORT_port = builtins.toString config.common.email.smtp.SSLTLS; + EMAIL_SENDER_TRANSPORT_sasl_username = common.email.outgoing; + EMAIL_SENDER_TRANSPORT_port = toString common.email.smtp.SSLTLS; EMAIL_SENDER_TRANSPORT_ssl = "ssl"; }; extraConfig = '' diff --git a/hosts/Infini-DL360/jellyfin.nix b/hosts/Infini-DL360/jellyfin.nix index 38a2acb..8d54390 100644 --- a/hosts/Infini-DL360/jellyfin.nix +++ b/hosts/Infini-DL360/jellyfin.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, common, ... }: let address = "127.0.0.1"; port = 8096; @@ -13,7 +13,7 @@ let ''; in { - services.nginx.virtualHosts."jellyfin.inx.moe" = config.common.nginx.ssl // { + services.nginx.virtualHosts."jellyfin.inx.moe" = common.nginx.ssl // { extraConfig = '' client_max_body_size 20M; ''; diff --git a/hosts/Infini-DL360/jitsi.nix b/hosts/Infini-DL360/jitsi.nix index 80a3747..56eb20d 100644 --- a/hosts/Infini-DL360/jitsi.nix +++ b/hosts/Infini-DL360/jitsi.nix @@ -1,12 +1,12 @@ # Unused -{ config, pkgs, lib, ... }: +{ config, common, ... }: let cfg = config.services.jitsi-meet; in { services.jitsi-meet = { enable = true; - hostName = config.common.subdomain "meet"; + hostName = common.subdomain "meet"; config = { prejoinPageEnabled = true; disableModeratorIndicator = true; diff --git a/hosts/Infini-DL360/jupyter.nix b/hosts/Infini-DL360/jupyter.nix index 7cbc6ef..3442ace 100644 --- a/hosts/Infini-DL360/jupyter.nix +++ b/hosts/Infini-DL360/jupyter.nix @@ -1,5 +1,7 @@ -{ config, pkgs, ... }: +{ config, common, pkgs, ... }: let + cfg = config.services.jupyter; + mkPythonKernel = displayName: env: { inherit displayName; language = "python"; @@ -53,10 +55,10 @@ in }) ]; - services.nginx.virtualHosts."jupyter.internal.inx.moe" = config.common.nginx.ssl // { + services.nginx.virtualHosts."jupyter.internal.inx.moe" = common.nginx.ssl // { listenAddresses = [ "100.101.102.124" ]; locations."/" = { - proxyPass = "http://localhost:${toString config.services.jupyter.port}"; + proxyPass = "http://localhost:${toString cfg.port}"; proxyWebsockets = true; }; }; diff --git a/hosts/Infini-DL360/postgresql.nix b/hosts/Infini-DL360/postgresql.nix index a757390..702987b 100644 --- a/hosts/Infini-DL360/postgresql.nix +++ b/hosts/Infini-DL360/postgresql.nix @@ -1,5 +1,6 @@ -{ pkgs, config, lib, ... }: +{ config, pkgs, ... }: let + cfg = config.services.postgresql; directory = "/srv/postgresql"; in { @@ -8,6 +9,6 @@ in services.postgresql = { enable = true; package = pkgs.postgresql_16; - dataDir = "${directory}/${config.services.postgresql.package.psqlSchema}"; + dataDir = "${directory}/${cfg.package.psqlSchema}"; }; } diff --git a/hosts/Infini-DL360/ssh.nix b/hosts/Infini-DL360/ssh.nix index 6ecd45d..e9b65d1 100644 --- a/hosts/Infini-DL360/ssh.nix +++ b/hosts/Infini-DL360/ssh.nix @@ -1,31 +1,38 @@ -{ pkgs, config, ... }: +{ config, pkgs, ... }: +let + cfg = config.services.openssh; +in { - users.users.incoming = { - description = "User for incoming files with a chroot jail"; - isSystemUser = true; - group = "incoming"; - }; - users.groups.incoming = { }; + users.users = { + incoming = { + description = "User for incoming files with a chroot jail"; + isSystemUser = true; + group = "incoming"; + }; - users.users.jump = { - description = "User for ssh jumping"; - isSystemUser = true; - group = "nogroup"; - }; + jump = { + description = "User for ssh jumping"; + isSystemUser = true; + group = "nogroup"; + }; - users.users.neofetch = { - description = "SSH Neofetch"; - isSystemUser = true; - group = "nogroup"; - hashedPassword = "$y$j9T$pixfaOyCz4Sbf8KE8AGVk.$TQKPzMvPan8qrO08kqjuJZO4LlUY7Yjxho0wIbcsmV3"; # :) - shell = pkgs.bash; - }; + neofetch = { + description = "SSH Neofetch"; + isSystemUser = true; + group = "nogroup"; + hashedPassword = "$y$j9T$pixfaOyCz4Sbf8KE8AGVk.$TQKPzMvPan8qrO08kqjuJZO4LlUY7Yjxho0wIbcsmV3"; # :) + shell = pkgs.bash; + }; - users.users.guest = { - description = "Guest shell account for temporary access"; - group = "users"; - isNormalUser = true; - shell = pkgs.bash; + guest = { + description = "Guest shell account for temporary access"; + group = "users"; + isNormalUser = true; + shell = pkgs.bash; + }; + }; + users.groups = { + incoming = { }; }; security.pam.services.sshd.allowNullPassword = true; @@ -41,7 +48,7 @@ Match user incoming AuthorizedKeysFile /etc/ssh/authorized_keys.d/infinidoge /etc/ssh/authorized_keys.d/%u ChrootDirectory /srv/external - ForceCommand ${config.services.openssh.sftpServerExecutable} -d incoming -u 007 + ForceCommand ${cfg.sftpServerExecutable} -d incoming -u 007 X11Forwarding no AllowTcpForwarding no KbdInteractiveAuthentication no diff --git a/hosts/Infini-DL360/thelounge.nix b/hosts/Infini-DL360/thelounge.nix index 8d5adde..dbef6b9 100644 --- a/hosts/Infini-DL360/thelounge.nix +++ b/hosts/Infini-DL360/thelounge.nix @@ -1,7 +1,7 @@ -{ config, pkgs, ... }: +{ config, common, pkgs, ... }: { - services.nginx.virtualHosts."thelounge.inx.moe" = config.common.nginx.ssl // { + services.nginx.virtualHosts."thelounge.inx.moe" = common.nginx.ssl // { locations."/" = { proxyPass = "http://localhost:${toString config.services.thelounge.port}"; }; diff --git a/hosts/Infini-DL360/vaultwarden.nix b/hosts/Infini-DL360/vaultwarden.nix index 5bb61c1..614247a 100644 --- a/hosts/Infini-DL360/vaultwarden.nix +++ b/hosts/Infini-DL360/vaultwarden.nix @@ -1,11 +1,11 @@ -{ config, lib, pkgs, ... }: +{ config, common, lib, pkgs, ... }: let - domain = config.common.subdomain "bitwarden"; + domain = common.subdomain "bitwarden"; in { persist.directories = [ config.services.vaultwarden.dataDir ]; - services.nginx.virtualHosts.${domain} = config.common.nginx.ssl // { + services.nginx.virtualHosts.${domain} = common.nginx.ssl // { locations."/" = { proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}"; }; @@ -15,7 +15,7 @@ in enable = true; environmentFile = config.secrets."vaultwarden"; dataDir = "/srv/vaultwarden"; - config = with config.common.email; { + config = with common.email; { DOMAIN = "https://${domain}"; SIGNUPS_ALLOWED = false; diff --git a/hosts/Infini-DL360/web.nix b/hosts/Infini-DL360/web.nix index 3720770..dbc2fc6 100644 --- a/hosts/Infini-DL360/web.nix +++ b/hosts/Infini-DL360/web.nix @@ -1,6 +1,6 @@ -{ config, pkgs, lib, ... }: +{ config, common, pkgs, lib, ... }: let - inherit (config.common.nginx) ssl ssl-optional; + inherit (common.nginx) ssl ssl-optional; tryFiles = "$uri $uri.html $uri/ =404"; websiteConfig = '' diff --git a/hosts/Infini-FRAMEWORK/hardware-configuration.nix b/hosts/Infini-FRAMEWORK/hardware-configuration.nix index c068438..858eb83 100644 --- a/hosts/Infini-FRAMEWORK/hardware-configuration.nix +++ b/hosts/Infini-FRAMEWORK/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: { boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; diff --git a/hosts/Infini-OPTIPLEX/default.nix b/hosts/Infini-OPTIPLEX/default.nix index a4547b8..a4963ee 100644 --- a/hosts/Infini-OPTIPLEX/default.nix +++ b/hosts/Infini-OPTIPLEX/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, private, ... }: { +{ ... }: { imports = [ ./hardware-configuration.nix ./filesystems.nix diff --git a/hosts/Infini-OPTIPLEX/filesystems.nix b/hosts/Infini-OPTIPLEX/filesystems.nix index d3fb7c1..d130187 100644 --- a/hosts/Infini-OPTIPLEX/filesystems.nix +++ b/hosts/Infini-OPTIPLEX/filesystems.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: let uuid = uuid: "/dev/disk/by-uuid/${uuid}"; main = uuid "9d4bf2d8-f139-42e7-937a-541a7870d806"; diff --git a/hosts/Infini-OPTIPLEX/hardware-configuration.nix b/hosts/Infini-OPTIPLEX/hardware-configuration.nix index 858405a..6a6ed5d 100644 --- a/hosts/Infini-OPTIPLEX/hardware-configuration.nix +++ b/hosts/Infini-OPTIPLEX/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: { boot.initrd.availableKernelModules = [ "ahci" "nvme" "sd_mod" "usb_storage" "usbhid" "xhci_pci" ]; diff --git a/hosts/Infini-SD/default.nix b/hosts/Infini-SD/default.nix index ae18566..cadbeb9 100644 --- a/hosts/Infini-SD/default.nix +++ b/hosts/Infini-SD/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: { +{ pkgs, ... }: { imports = [ ./hardware-configuration.nix ./filesystems.nix diff --git a/hosts/Infini-SD/filesystems.nix b/hosts/Infini-SD/filesystems.nix index 210da69..281c425 100644 --- a/hosts/Infini-SD/filesystems.nix +++ b/hosts/Infini-SD/filesystems.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: let uuid = uuid: "/dev/disk/by-uuid/${uuid}"; diff --git a/hosts/Infini-SD/hardware-configuration.nix b/hosts/Infini-SD/hardware-configuration.nix index 614e9bf..730f52e 100644 --- a/hosts/Infini-SD/hardware-configuration.nix +++ b/hosts/Infini-SD/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ diff --git a/hosts/Infini-SERVER/default.nix b/hosts/Infini-SERVER/default.nix index a5a5125..8045cd0 100644 --- a/hosts/Infini-SERVER/default.nix +++ b/hosts/Infini-SERVER/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, private, ... }: { +{ ... }: { imports = [ ./hardware-configuration.nix ./filesystems.nix diff --git a/hosts/Infini-SERVER/filesystems.nix b/hosts/Infini-SERVER/filesystems.nix index e47d012..5c65da6 100644 --- a/hosts/Infini-SERVER/filesystems.nix +++ b/hosts/Infini-SERVER/filesystems.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: let uuid = uuid: "/dev/disk/by-uuid/${uuid}"; diff --git a/hosts/Infini-SERVER/hardware-configuration.nix b/hosts/Infini-SERVER/hardware-configuration.nix index d017e16..ff6d44b 100644 --- a/hosts/Infini-SERVER/hardware-configuration.nix +++ b/hosts/Infini-SERVER/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: { boot.initrd.availableKernelModules = [ "nvme" "usb_storage" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; diff --git a/hosts/Infini-STICK/default.nix b/hosts/Infini-STICK/default.nix index 780e26b..ab76c6c 100644 --- a/hosts/Infini-STICK/default.nix +++ b/hosts/Infini-STICK/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: { +{ pkgs, ... }: { imports = [ ./hardware-configuration.nix ./filesystems.nix diff --git a/hosts/Infini-STICK/hardware-configuration.nix b/hosts/Infini-STICK/hardware-configuration.nix index e58f0b2..f66ccdd 100644 --- a/hosts/Infini-STICK/hardware-configuration.nix +++ b/hosts/Infini-STICK/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ diff --git a/hosts/Infini-SWIFT/default.nix b/hosts/Infini-SWIFT/default.nix index c13b106..e9cae06 100644 --- a/hosts/Infini-SWIFT/default.nix +++ b/hosts/Infini-SWIFT/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: { imports = [ ./hardware-configuration.nix diff --git a/hosts/Infini-SWIFT/hardware-configuration.nix b/hosts/Infini-SWIFT/hardware-configuration.nix index 91fdeea..b9a9829 100644 --- a/hosts/Infini-SWIFT/hardware-configuration.nix +++ b/hosts/Infini-SWIFT/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = diff --git a/hosts/Infini-WSL/default.nix b/hosts/Infini-WSL/default.nix index c83617d..b2d21ea 100644 --- a/hosts/Infini-WSL/default.nix +++ b/hosts/Infini-WSL/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ ... }: { system.stateVersion = "22.05"; diff --git a/hosts/vulcan/default.nix b/hosts/vulcan/default.nix index c7b1c4c..12f45d2 100644 --- a/hosts/vulcan/default.nix +++ b/hosts/vulcan/default.nix @@ -1,4 +1,4 @@ -{ private, config, lib, pkgs, ... }: +{ pkgs, ... }: { modules.hardware.form.server = true; diff --git a/modules/global/general.nix b/modules/global/general.nix index ec7d909..523133e 100644 --- a/modules/global/general.nix +++ b/modules/global/general.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, ... }: { programs = { # Enable dconf for programs that need it diff --git a/modules/global/graphical.nix b/modules/global/graphical.nix index ff9d9a9..aea199c 100644 --- a/modules/global/graphical.nix +++ b/modules/global/graphical.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, ... }: +{ config, lib, ... }: lib.mkIf config.info.graphical { boot.extraModulePackages = with config.boot.kernelPackages; [ diff --git a/modules/global/networking.nix b/modules/global/networking.nix index 81971dc..62f458f 100644 --- a/modules/global/networking.nix +++ b/modules/global/networking.nix @@ -1,4 +1,4 @@ -{ pkgs, config, private, ... }: +{ config, pkgs, private, ... }: { imports = [ private.nixosModules.networking ]; diff --git a/modules/global/options.nix b/modules/global/options.nix index cac12bf..3444ae1 100644 --- a/modules/global/options.nix +++ b/modules/global/options.nix @@ -1,5 +1,5 @@ # Heavily inspired by hlissner: https://github.com/hlissner/dotfiles/blob/master/modules/options.nix -{ config, options, lib, home-manager, ... }: +{ config, options, lib, ... }: with lib; with lib.our; let diff --git a/modules/global/ssh.nix b/modules/global/ssh.nix index e6a6cdc..cce7ce9 100644 --- a/modules/global/ssh.nix +++ b/modules/global/ssh.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ common, lib, ... }: with lib; { # For rage encryption, all hosts need a ssh key pair @@ -17,7 +17,7 @@ with lib; }; programs.ssh = { - extraConfig = with config.common; '' + extraConfig = with common; '' Host rsync.net Hostname ${rsyncnet.host} User ${rsyncnet.user} diff --git a/modules/modules/desktop/wm.nix b/modules/modules/desktop/wm.nix index 09c20ea..6674669 100644 --- a/modules/modules/desktop/wm.nix +++ b/modules/modules/desktop/wm.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ config, common, pkgs, lib, ... }: with lib; with lib.our; let @@ -30,7 +30,7 @@ in programs.xss-lock = { enable = true; - lockerCommand = lib.getExe config.common.wm.locker; + lockerCommand = lib.getExe common.wm.locker; }; # Automatically attach/detatch connected/disconnected monitors @@ -64,7 +64,7 @@ in pavucontrol - config.common.wm.locker + common.wm.locker ]; } (mkIf cfg.qtile.enable { diff --git a/modules/modules/hardware/audio.nix b/modules/modules/hardware/audio.nix index 30e2958..afa8970 100644 --- a/modules/modules/hardware/audio.nix +++ b/modules/modules/hardware/audio.nix @@ -1,4 +1,4 @@ -{ options, config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: with lib; with lib.our; diff --git a/modules/modules/hardware/form.nix b/modules/modules/hardware/form.nix index 0dcdff1..01425aa 100644 --- a/modules/modules/hardware/form.nix +++ b/modules/modules/hardware/form.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, inputs, ... }: +{ config, lib, pkgs, ... }: with lib; with lib.our; let diff --git a/modules/modules/hardware/peripherals/printing.nix b/modules/modules/hardware/peripherals/printing.nix index 2bb211c..5b1462a 100644 --- a/modules/modules/hardware/peripherals/printing.nix +++ b/modules/modules/hardware/peripherals/printing.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, private, ... }: +{ config, lib, private, ... }: with lib; with lib.our; let diff --git a/modules/modules/services/apcupsd.nix b/modules/modules/services/apcupsd.nix index 9ab334d..aa899d0 100644 --- a/modules/modules/services/apcupsd.nix +++ b/modules/modules/services/apcupsd.nix @@ -1,4 +1,4 @@ -{ config, options, lib, pkgs, ... }: +{ config, lib, ... }: with lib; with lib.our; let diff --git a/modules/vendored/thelounge.nix b/modules/vendored/thelounge.nix index a14a459..94b5a87 100644 --- a/modules/vendored/thelounge.nix +++ b/modules/vendored/thelounge.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ config, pkgs, lib, ... }: with lib; diff --git a/users/infinidoge/default.nix b/users/infinidoge/default.nix index c9b128a..b43591f 100644 --- a/users/infinidoge/default.nix +++ b/users/infinidoge/default.nix @@ -1,4 +1,4 @@ -{ config, self, lib, pkgs, inputs, ... }: +{ config, lib, pkgs, ... }: let inherit (lib) flatten optional mkIf; ifGraphical = lib.optionals config.info.graphical; diff --git a/users/modules/functionality/bindmounts.nix b/users/modules/functionality/bindmounts.nix index 3f0a6df..ebf77fc 100644 --- a/users/modules/functionality/bindmounts.nix +++ b/users/modules/functionality/bindmounts.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ config, pkgs, lib, ... }: # Modified from https://github.com/nix-community/impermanence/blob/master/home-manager.nix diff --git a/users/modules/global/flameshot.nix b/users/modules/global/flameshot.nix index f075c24..ec71f0f 100644 --- a/users/modules/global/flameshot.nix +++ b/users/modules/global/flameshot.nix @@ -1,4 +1,4 @@ -{ config, main, pkgs, lib, ... }: +{ main, ... }: { services.flameshot = { enable = main.info.graphical; diff --git a/users/modules/global/git.nix b/users/modules/global/git.nix index 6befbe7..6605f7c 100644 --- a/users/modules/global/git.nix +++ b/users/modules/global/git.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ gh git-absorb diff --git a/users/modules/global/htop.nix b/users/modules/global/htop.nix index 08babb0..9d1ccd6 100644 --- a/users/modules/global/htop.nix +++ b/users/modules/global/htop.nix @@ -1,4 +1,5 @@ -{ config, ... }: { +{ config, ... }: +{ programs.htop = { enable = true; settings = { diff --git a/users/modules/global/keychain.nix b/users/modules/global/keychain.nix index 05d10ca..01cef80 100644 --- a/users/modules/global/keychain.nix +++ b/users/modules/global/keychain.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { programs.keychain = { enable = true; diff --git a/users/modules/global/kitty.nix b/users/modules/global/kitty.nix index 403f6b3..cf0d05b 100644 --- a/users/modules/global/kitty.nix +++ b/users/modules/global/kitty.nix @@ -1,23 +1,21 @@ -{ main, pkgs, lib, ... }: +{ pkgs, ... }: { - config = { - programs.kitty = { - enable = true; - font = { - package = (pkgs.nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }); - name = "DejaVuSansMono"; - size = 12; - }; - settings = { - confirm_os_window_close = 0; - scrollback_lines = 100000; - }; - #theme = "Doom One"; + programs.kitty = { + enable = true; + font = rec { + package = (pkgs.nerdfonts.override { fonts = [ name ]; }); + name = "DejaVuSansMono"; + size = 12; }; + settings = { + confirm_os_window_close = 0; + scrollback_lines = 100000; + }; + #theme = "Doom One"; + }; - home.shellAliases = { - #ssh = "kitty +kitten ssh"; - icat = "kitty +kitten icat"; - }; + home.shellAliases = { + #ssh = "kitty +kitten ssh"; + icat = "kitty +kitten icat"; }; } diff --git a/users/modules/global/music.nix b/users/modules/global/music.nix index b633cdf..cc0992d 100644 --- a/users/modules/global/music.nix +++ b/users/modules/global/music.nix @@ -1,4 +1,4 @@ -{ main, config, lib, pkgs, ... }: +{ main, lib, pkgs, ... }: lib.mkIf main.info.graphical { services = { diff --git a/users/modules/global/neovim.nix b/users/modules/global/neovim.nix index 0189ca7..e3591ec 100644 --- a/users/modules/global/neovim.nix +++ b/users/modules/global/neovim.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { programs.nixvim = { enable = true; diff --git a/users/modules/global/obs-studio.nix b/users/modules/global/obs-studio.nix index 35010b8..f0d09b5 100644 --- a/users/modules/global/obs-studio.nix +++ b/users/modules/global/obs-studio.nix @@ -1,4 +1,4 @@ -{ pkgs, main, config, ... }: +{ main, pkgs, ... }: { programs.obs-studio = { diff --git a/users/modules/global/shells/all.nix b/users/modules/global/shells/all.nix deleted file mode 100644 index 700e6c1..0000000 --- a/users/modules/global/shells/all.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: { - imports = [ - ./bash.nix - ./fish.nix - ./ion.nix - ./nushell.nix - ./zsh.nix - ]; -} diff --git a/users/modules/global/shells/bash.nix b/users/modules/global/shells/bash.nix index 959c25e..d298ef7 100644 --- a/users/modules/global/shells/bash.nix +++ b/users/modules/global/shells/bash.nix @@ -1,15 +1,10 @@ -{ config, pkgs, lib, ... }: { - imports = [ ./common.nix ]; - - programs = { - bash = { - enable = true; - enableVteIntegration = true; - initExtra = '' - source <(${lib.getExe config.programs.kitty.package} + complete setup bash) - ''; - }; - - starship.enableBashIntegration = true; +{ config, lib, ... }: +{ + programs.bash = { + enable = true; + enableVteIntegration = true; + initExtra = '' + source <(${lib.getExe config.programs.kitty.package} + complete setup bash) + ''; }; } diff --git a/users/modules/global/shells/common.nix b/users/modules/global/shells/common.nix index cc2befa..0707371 100644 --- a/users/modules/global/shells/common.nix +++ b/users/modules/global/shells/common.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ programs.nix-index = { enable = true; enableBashIntegration = false; diff --git a/users/modules/global/shells/fish.nix b/users/modules/global/shells/fish.nix index 8addee3..6b4db9d 100644 --- a/users/modules/global/shells/fish.nix +++ b/users/modules/global/shells/fish.nix @@ -1,17 +1,12 @@ -{ config, lib, pkgs, ... }: { - imports = [ ./common.nix ]; - - programs = { - fish = { - enable = true; - functions = { }; - shellAbbrs = { }; - interactiveShellInit = '' - kitty + complete setup fish | source - set -U fish_greeting - ''; - }; - - starship.enableFishIntegration = lib.mkIf config.programs.starship.enable true; +{ config, lib, ... }: +{ + programs.fish = { + enable = true; + functions = { }; + shellAbbrs = { }; + interactiveShellInit = '' + kitty + complete setup fish | source + set -U fish_greeting + ''; }; } diff --git a/users/modules/global/shells/ion.nix b/users/modules/global/shells/ion.nix index 9fc5651..38f4f8c 100644 --- a/users/modules/global/shells/ion.nix +++ b/users/modules/global/shells/ion.nix @@ -1,11 +1,6 @@ -{ config, pkgs, ... }: { - imports = [ ./common.nix ]; - - programs = { - ion = { - enable = true; - }; - - starship.enableIonIntegration = true; +{ ... }: +{ + programs.ion = { + enable = true; }; } diff --git a/users/modules/global/shells/nushell.nix b/users/modules/global/shells/nushell.nix index 4ba52bb..f41b0ef 100644 --- a/users/modules/global/shells/nushell.nix +++ b/users/modules/global/shells/nushell.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ programs.nushell = { enable = true; extraConfig = '' diff --git a/users/modules/global/shells/zsh.nix b/users/modules/global/shells/zsh.nix index 1c04681..3875d4b 100644 --- a/users/modules/global/shells/zsh.nix +++ b/users/modules/global/shells/zsh.nix @@ -1,118 +1,113 @@ -{ config, lib, pkgs, main, ... }: { - imports = [ ./common.nix ]; +{ config, main, pkgs, ... }: +{ + programs.zsh = rec { + enable = true; - programs = { - zsh = rec { - enable = true; + enableCompletion = true; + enableVteIntegration = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; - enableCompletion = true; - enableVteIntegration = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; + # defaultKeymap = "emacs"; - # defaultKeymap = "emacs"; + initExtraFirst = '' + [[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return + ''; - initExtraFirst = '' - [[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return - ''; + initExtra = '' + ${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin + ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin - initExtra = '' - ${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin - ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin + functions -c precmd precmd_any_nix_shell - functions -c precmd precmd_any_nix_shell + precmd() { + precmd_any_nix_shell - precmd() { - precmd_any_nix_shell - - if [[ -s ~/TODO.txt && ! -v __TODO_PRINTED ]] then - export __TODO_PRINTED=1 - if [[ "$(cat ~/TODO.txt)" != "" ]] then - echo TODO: - \cat ~/TODO.txt - fi + if [[ -s ~/TODO.txt && ! -v __TODO_PRINTED ]] then + export __TODO_PRINTED=1 + if [[ "$(cat ~/TODO.txt)" != "" ]] then + echo TODO: + \cat ~/TODO.txt fi - } + fi + } - if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then - PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9+-]\+\/bin:\?//g' | sed 's/:$//') + if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then + PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9+-]\+\/bin:\?//g' | sed 's/:$//') + fi + + j() { + if [[ $# -eq 0 ]] then + \builtin cd -- "$(fd -H -t d | fzf --filepath-word)" + else + \builtin cd -- "$(fd -H -t d | fzf --filepath-word -1 -q "$*")" + fi + } + + alias "jh"="cd ~ && j" + alias "gj"="gcd && j" + + mktmpunzip() { + dir=$(mktemp -t -d unzip.XXX) + if ! file=$(realpath -e "$1"); then + echo "error: file does not exist" + return 1 + fi + shift 1 + unzip "$file" "$@" -d "$dir" + \builtin cd $dir + mv $file . + } + + mktmpclone() { + location="$1" + if [ "$2" != "" ]; then + dirspec="$2.XXX" + shift 2 + else + dirspec="clone.XXX" + shift 1 + fi + if ! dir=$(mktemp -t -d "$dirspec"); then + echo "error: couldn't create temp directory" + return 1 fi - j() { - if [[ $# -eq 0 ]] then - \builtin cd -- "$(fd -H -t d | fzf --filepath-word)" - else - \builtin cd -- "$(fd -H -t d | fzf --filepath-word -1 -q "$*")" - fi - } + git clone "$location" "$dir" "$@" + \builtin cd "$dir" + } + ''; - alias "jh"="cd ~ && j" - alias "gj"="gcd && j" + dotDir = ".config/zsh"; - mktmpunzip() { - dir=$(mktemp -t -d unzip.XXX) - if ! file=$(realpath -e "$1"); then - echo "error: file does not exist" - return 1 - fi - shift 1 - unzip "$file" "$@" -d "$dir" - \builtin cd $dir - mv $file . - } + history.path = "$HOME/${dotDir}/.zsh_history"; - mktmpclone() { - location="$1" - if [ "$2" != "" ]; then - dirspec="$2.XXX" - shift 2 - else - dirspec="clone.XXX" - shift 1 - fi - if ! dir=$(mktemp -t -d "$dirspec"); then - echo "error: couldn't create temp directory" - return 1 - fi - - git clone "$location" "$dir" "$@" - \builtin cd "$dir" - } - ''; - - dotDir = ".config/zsh"; - - history.path = "$HOME/${dotDir}/.zsh_history"; - - shellAliases = main.environment.shellAliases // config.home.shellAliases // { - lsdiskw = "while true; do clear; lsdisk; sleep 1; done"; - }; - - oh-my-zsh = { - enable = true; - plugins = [ - # Display - "colorize" - "colored-man-pages" - - # zsh modifications - "zsh-interactive-cd" - "sudo" - - # Aliases - "alias-finder" - - # Applications - ## Python - "pip" - ## Git - "gitignore" - ## Vim - "fancy-ctrl-z" - ]; - }; + shellAliases = main.environment.shellAliases // config.home.shellAliases // { + lsdiskw = "while true; do clear; lsdisk; sleep 1; done"; }; - starship.enableZshIntegration = lib.mkIf config.programs.starship.enable true; + oh-my-zsh = { + enable = true; + plugins = [ + # Display + "colorize" + "colored-man-pages" + + # zsh modifications + "zsh-interactive-cd" + "sudo" + + # Aliases + "alias-finder" + + # Applications + ## Python + "pip" + ## Git + "gitignore" + ## Vim + "fancy-ctrl-z" + ]; + }; }; } diff --git a/users/modules/global/ssh.nix b/users/modules/global/ssh.nix index 8f667ec..b677070 100644 --- a/users/modules/global/ssh.nix +++ b/users/modules/global/ssh.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ programs.ssh = { enable = true; controlMaster = "auto"; diff --git a/users/modules/global/starship.nix b/users/modules/global/starship.nix index f52f920..d52cdfc 100644 --- a/users/modules/global/starship.nix +++ b/users/modules/global/starship.nix @@ -1,7 +1,7 @@ -{ ... }: { +{ ... }: +{ programs.starship = { enable = true; - enableBashIntegration = true; settings = let diff --git a/users/modules/global/themeing.nix b/users/modules/global/themeing.nix index cf273a3..d08ceaf 100644 --- a/users/modules/global/themeing.nix +++ b/users/modules/global/themeing.nix @@ -1,4 +1,4 @@ -{ lib, main, config, pkgs, ... }: +{ config, main, lib, pkgs, ... }: lib.mkIf main.info.graphical { gtk = { diff --git a/users/modules/global/tmux.nix b/users/modules/global/tmux.nix index 90f36ef..8dd4ff0 100644 --- a/users/modules/global/tmux.nix +++ b/users/modules/global/tmux.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ programs.tmux = { enable = true; mouse = true; diff --git a/users/root/default.nix b/users/root/default.nix index d5eeceb..40c693b 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: { +{ config, lib, pkgs, ... }: { users.users.root = { shell = pkgs.zsh; hashedPasswordFile = lib.mkIf config.modules.secrets.enable config.secrets.root-password;