diff options
42 files changed, 687 insertions, 347 deletions
@@ -16,83 +16,165 @@ }; }; - outputs = { ... } @ inputs: let - helpers = import ./modules { inherit inputs; }; - inherit (helpers) mergeSets mkSystem; - in { - nixosConfigurations = mergeSets [ - (mkSystem "woodpecker" inputs.nixpkgs [ - { - type = "profiles"; - modules = [ "common" "cosmic" "fstrim" "libvirtd" "nvidia" "pipewire" "security" "steam" "wireshark" ]; - } - ]) - (mkSystem "sparrow" inputs.nixpkgs [ - { - type = "profiles"; - modules = [ "common" "cosmic" "pipewire" "security" "vpn" ]; - } - ]) - (mkSystem "frigg" inputs.nixpkgs [ - { - type = "profiles"; - modules = [ "common" "podman" "security" "upgrade" "wireguard" "zfs" ]; - } - { - type = "scripts"; - modules = [ "motd" "pushover" "zquota" ]; - } - { - type = "services"; - modules = [ "cgit" "proxy" "sftpgo" "ssh" ]; - } - ]) - (mkSystem "heimdall" inputs.nixpkgs [ - { - type = "profiles"; - modules = [ "common" "security" "upgrade" ]; - } - { - type = "scripts"; - modules = [ "motd" "pushover" ]; - } - { - type = "services"; - modules = [ "dns" "searx" "ssh" ]; - } - ]) - (mkSystem "odin" inputs.nixpkgs [ - { - type = "containers"; - modules = [ "freshrss" "jellyfin" "lubelogger" "pinchflat" "vaultwarden" "watchtower" ]; - } - { - type = "profiles"; - modules = [ "common" "podman" "security" "share" "upgrade" "wireguard" "zfs" ]; - } - { - type = "scripts"; - modules = [ "motd" "pushover" "zquota" ]; - } - { - type = "services"; - modules = [ "immich" "proxy" "ssh" ]; - } - ]) - (mkSystem "thor" inputs.nixpkgs [ - { - type = "profiles"; - modules = [ "common" "security" "upgrade" "wireguard" ]; - } - { - type = "scripts"; - modules = [ "motd" "pushover"]; - } - { - type = "services"; - modules = [ "fediverse" "proxy" "ssh" "web" ]; - } - ]) - ]; - }; + outputs = + { ... }@inputs: + let + helpers = import ./modules { inherit inputs; }; + inherit (helpers) mergeSets mkSystem; + in + { + nixosConfigurations = mergeSets [ + (mkSystem "frigg" inputs.nixpkgs [ + { + type = "profiles"; + modules = [ + "common" + "podman" + "security" + "upgrade" + "wireguard" + "zfs" + ]; + } + { + type = "scripts"; + modules = [ + "motd" + "pushover" + "zquota" + ]; + } + { + type = "services"; + modules = [ + "cgit" + "proxy" + "sftpgo" + "ssh" + ]; + } + ]) + (mkSystem "heimdall" inputs.nixpkgs [ + { + type = "profiles"; + modules = [ + "common" + "security" + "upgrade" + ]; + } + { + type = "scripts"; + modules = [ + "motd" + "pushover" + ]; + } + { + type = "services"; + modules = [ + "dns" + "searx" + "ssh" + ]; + } + ]) + (mkSystem "odin" inputs.nixpkgs [ + { + type = "containers"; + modules = [ + "freshrss" + "jellyfin" + "lubelogger" + "pinchflat" + "vaultwarden" + "watchtower" + ]; + } + { + type = "profiles"; + modules = [ + "common" + "podman" + "security" + "share" + "upgrade" + "wireguard" + "zfs" + ]; + } + { + type = "scripts"; + modules = [ + "motd" + "pushover" + "zquota" + ]; + } + { + type = "services"; + modules = [ + "immich" + "proxy" + "ssh" + ]; + } + ]) + (mkSystem "sparrow" inputs.nixpkgs ( + inputs.nixpkgs.lib.singleton { + type = "profiles"; + modules = [ + "common" + "cosmic" + "pipewire" + "security" + "vpn" + ]; + } + )) + (mkSystem "thor" inputs.nixpkgs [ + { + type = "profiles"; + modules = [ + "common" + "security" + "upgrade" + "wireguard" + ]; + } + { + type = "scripts"; + modules = [ + "motd" + "pushover" + ]; + } + { + type = "services"; + modules = [ + "fediverse" + "proxy" + "ssh" + "web" + ]; + } + ]) + (mkSystem "woodpecker" inputs.nixpkgs ( + inputs.nixpkgs.lib.singleton { + type = "profiles"; + modules = [ + "common" + "cosmic" + "fstrim" + "libvirtd" + "nvidia" + "pipewire" + "security" + "steam" + "wireshark" + ]; + } + )) + ]; + }; } diff --git a/hosts/frigg/default.nix b/hosts/frigg/default.nix index 4803133..cde7436 100644 --- a/hosts/frigg/default.nix +++ b/hosts/frigg/default.nix @@ -21,10 +21,10 @@ defaultGateway.address = "10.44.0.1"; interfaces.enp59s0 = { useDHCP = false; - ipv4.addresses = [{ + ipv4.addresses = lib.singleton { address = "10.44.4.103"; prefixLength = 16; - }]; + }; }; }; @@ -40,14 +40,20 @@ services.zquota = { enable = true; - quotas = { "tank/sftpgo" = 512; }; + quotas = { + "tank/sftpgo" = 512; + }; }; services.sftpgo.dataDir = "/tank/sftpgo"; programs.motd = { enable = true; - networkInterfaces = lib.lists.singleton "enp59s0"; - servicesToCheck = [ "caddy" "sftpgo" "zfs-zed" ]; + networkInterfaces = [ "enp59s0" ]; + servicesToCheck = [ + "caddy" + "sftpgo" + "zfs-zed" + ]; }; } diff --git a/hosts/heimdall/default.nix b/hosts/heimdall/default.nix index 7aed928..38b523a 100644 --- a/hosts/heimdall/default.nix +++ b/hosts/heimdall/default.nix @@ -20,10 +20,10 @@ defaultGateway.address = "10.44.0.1"; interfaces.eno1 = { useDHCP = false; - ipv4.addresses = [{ + ipv4.addresses = lib.singleton { address = "10.44.4.100"; prefixLength = 16; - }]; + }; }; }; @@ -36,7 +36,10 @@ programs.motd = { enable = true; - networkInterfaces = lib.lists.singleton "eno1"; - servicesToCheck = [ "searx" "unbound" ]; + networkInterfaces = [ "eno1" ]; + servicesToCheck = [ + "searx" + "unbound" + ]; }; } diff --git a/hosts/odin/default.nix b/hosts/odin/default.nix index 47515e8..52a2ace 100644 --- a/hosts/odin/default.nix +++ b/hosts/odin/default.nix @@ -21,10 +21,10 @@ defaultGateway.address = "10.44.0.1"; interfaces.eno1 = { useDHCP = false; - ipv4.addresses = [{ + ipv4.addresses = lib.singleton { address = "10.44.4.101"; prefixLength = 16; - }]; + }; }; }; @@ -48,7 +48,7 @@ programs.motd = { enable = true; - networkInterfaces = lib.lists.singleton "eno1"; + networkInterfaces = [ "eno1" ]; servicesToCheck = [ "caddy" "immich-machine-learning" diff --git a/hosts/sparrow/default.nix b/hosts/sparrow/default.nix index 824f5df..c7b175f 100644 --- a/hosts/sparrow/default.nix +++ b/hosts/sparrow/default.nix @@ -26,7 +26,10 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; + binfmt.emulatedSystems = [ + "aarch64-linux" + "riscv64-linux" + ]; }; # Since I don't always carry my split keyboard, remap CAPS to left CTRL. diff --git a/hosts/thor/default.nix b/hosts/thor/default.nix index 0ec2fa9..62071e8 100644 --- a/hosts/thor/default.nix +++ b/hosts/thor/default.nix @@ -20,10 +20,10 @@ defaultGateway.address = "10.44.0.1"; interfaces.eno1 = { useDHCP = false; - ipv4.addresses = [{ + ipv4.addresses = lib.singleton { address = "10.44.4.102"; prefixLength = 16; - }]; + }; }; }; @@ -36,7 +36,10 @@ programs.motd = { enable = true; - networkInterfaces = lib.lists.singleton "eno1"; - servicesToCheck = [ "caddy" "gotosocial" ]; + networkInterfaces = [ "eno1" ]; + servicesToCheck = [ + "caddy" + "gotosocial" + ]; }; } diff --git a/hosts/woodpecker/default.nix b/hosts/woodpecker/default.nix index 4f1dc2f..b049cab 100644 --- a/hosts/woodpecker/default.nix +++ b/hosts/woodpecker/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ lib, inputs, ... }: { system.stateVersion = "24.05"; @@ -20,10 +20,10 @@ defaultGateway.address = "10.44.0.1"; interfaces.enp42s0 = { useDHCP = false; - ipv4.addresses = [{ + ipv4.addresses = lib.singleton { address = "10.44.4.50"; prefixLength = 16; - }]; + }; }; }; @@ -34,6 +34,9 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; + binfmt.emulatedSystems = [ + "aarch64-linux" + "riscv64-linux" + ]; }; } diff --git a/modules/containers/freshrss/default.nix b/modules/containers/freshrss/default.nix index 5f352a7..7cbe944 100644 --- a/modules/containers/freshrss/default.nix +++ b/modules/containers/freshrss/default.nix @@ -1,16 +1,15 @@ -{ lib, ... }: +{ ... }: let - inherit (lib.lists) singleton; directory = "/opt/freshrss"; port = "8888"; in { - systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.freshrss = { image = "freshrss/freshrss:latest"; autoStart = true; - ports = singleton "${port}:80"; + ports = [ "${port}:80" ]; volumes = [ "${directory}/data:/var/www/FreshRSS/data" "${directory}/extensions:/var/www/FreshRSS/extensions" diff --git a/modules/containers/jellyfin/default.nix b/modules/containers/jellyfin/default.nix index d4923ae..a7b9557 100644 --- a/modules/containers/jellyfin/default.nix +++ b/modules/containers/jellyfin/default.nix @@ -1,16 +1,15 @@ -{ lib, ... }: +{ ... }: let - inherit (lib.lists) singleton; directory = "/opt/jellyfin"; in { - systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.jellyfin = { image = "jellyfin/jellyfin:latest"; autoStart = true; user = "994:994"; - ports = singleton "8096:8096/tcp"; + ports = [ "8096:8096/tcp" ]; volumes = [ "${directory}/config:/config" "${directory}/cache:/cache" diff --git a/modules/containers/lubelogger/default.nix b/modules/containers/lubelogger/default.nix index 37155dc..6ff2b0d 100644 --- a/modules/containers/lubelogger/default.nix +++ b/modules/containers/lubelogger/default.nix @@ -1,16 +1,15 @@ -{ lib, ... }: +{ ... }: let - inherit (lib.lists) singleton; directory = "/opt/lubelogger"; port = "8889"; in { - systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.lubelogger = { image = "ghcr.io/hargata/lubelogger:latest"; autoStart = true; - ports = singleton "${port}:8080"; + ports = [ "${port}:8080" ]; volumes = [ "${directory}/config:/App/config" "${directory}/data:/App/data" diff --git a/modules/containers/pinchflat/default.nix b/modules/containers/pinchflat/default.nix index 996476d..6f9c825 100644 --- a/modules/containers/pinchflat/default.nix +++ b/modules/containers/pinchflat/default.nix @@ -1,15 +1,14 @@ -{ lib, ... }: +{ ... }: let - inherit (lib.lists) singleton; directory = "/opt/pinchflat"; in { - systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.pinchflat = { image = "keglin/pinchflat:latest"; autoStart = true; - ports = singleton "8945:8945"; + ports = [ "8945:8945" ]; volumes = [ "${directory}:/config" "/tank/media/yt:/downloads" diff --git a/modules/containers/vaultwarden/default.nix b/modules/containers/vaultwarden/default.nix index 9211c63..7fb4ae0 100644 --- a/modules/containers/vaultwarden/default.nix +++ b/modules/containers/vaultwarden/default.nix @@ -1,18 +1,17 @@ -{ lib, ... }: +{ ... }: let - inherit (lib.lists) singleton; directory = "/opt/vaultwarden"; domain = "steel-mountain.brownbread.net"; port = "11001"; in { - systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.vaultwarden = { image = "vaultwarden/server:latest"; autoStart = true; - ports = singleton "${port}:80"; - volumes = singleton "${directory}/data:/data"; + ports = [ "${port}:80" ]; + volumes = [ "${directory}/data:/data" ]; environment = { DOMAIN = domain; WEBSOCKET_ENABLED = "true"; diff --git a/modules/customs/cgit/default.nix b/modules/customs/cgit/default.nix index dfbfb96..2d493a7 100644 --- a/modules/customs/cgit/default.nix +++ b/modules/customs/cgit/default.nix @@ -1,27 +1,35 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.services.cgit; - mkCgitrc = cfg: - pkgs.writeText "cgitrc" (let - cgitConfig = { - css = "/cgit.css"; - logo = "/cgit.png"; - favicon = "/favicon.ico"; - about-filter = "${cfg.package}/lib/cgit/filters/about-formatting.sh"; - source-filter = "${cfg.package}/lib/cgit/filters/syntax-highlighting.py"; - enable-git-config = 1; - enable-http-clone = 1; - remove-suffix = 1; - clone-url = "https://${cfg.virtualHost}/$CGIT_REPO_URL"; - scan-path = cfg.scanPath; - }; - in + mkCgitrc = + cfg: + pkgs.writeText "cgitrc" ( + let + cgitConfig = { + css = "/cgit.css"; + logo = "/cgit.png"; + favicon = "/favicon.ico"; + about-filter = "${cfg.package}/lib/cgit/filters/about-formatting.sh"; + source-filter = "${cfg.package}/lib/cgit/filters/syntax-highlighting.py"; + enable-git-config = 1; + enable-http-clone = 1; + remove-suffix = 1; + clone-url = "https://${cfg.virtualHost}/$CGIT_REPO_URL"; + scan-path = cfg.scanPath; + }; + in generators.toKeyValue { } (cfg.settings // cgitConfig) ); - mkCgitAssets = pkg: files: + mkCgitAssets = + pkg: files: strings.concatStringsSep "\n" ( builtins.map (f: '' handle_path /${f} { @@ -30,7 +38,8 @@ let } '') files ); -in { +in +{ disabledModules = [ "services/networking/cgit.nix" ]; options = { @@ -64,7 +73,15 @@ in { }; settings = mkOption { default = { }; - type = with types; let settingType = oneOf [ bool int str ]; in + type = + with types; + let + settingType = oneOf [ + bool + int + str + ]; + in attrsOf (oneOf [ settingType (listOf settingType) @@ -89,7 +106,7 @@ in { openssh.authorizedKeys.keys = cfg.authorizedKeys; }; - users.groups.${cfg.group} = {}; + users.groups.${cfg.group} = { }; # Harden git user to prevent SSH port forwarding to other servers. services.openssh = { @@ -112,21 +129,26 @@ in { socket = { inherit (config.services.caddy) user group; }; }; - services.caddy.virtualHosts.${cfg.virtualHost}.extraConfig = let - socket = config.services.fcgiwrap.instances.cgit.socket.address; - in '' - encode zstd gzip + services.caddy.virtualHosts.${cfg.virtualHost}.extraConfig = + let + socket = config.services.fcgiwrap.instances.cgit.socket.address; + in + '' + encode zstd gzip - reverse_proxy unix/${socket} { - transport fastcgi { - env SCRIPT_FILENAME ${cfg.package}/cgit/cgit.cgi - env CGIT_CONFIG ${mkCgitrc cfg} + reverse_proxy unix/${socket} { + transport fastcgi { + env SCRIPT_FILENAME ${cfg.package}/cgit/cgit.cgi + env CGIT_CONFIG ${mkCgitrc cfg} + } } - } - ${mkCgitAssets cfg.package [ - "cgit.css" "cgit.png" "favicon.ico" "robots.txt" - ]} - ''; + ${mkCgitAssets cfg.package [ + "cgit.css" + "cgit.png" + "favicon.ico" + "robots.txt" + ]} + ''; }; } diff --git a/modules/customs/soft-serve/default.nix b/modules/customs/soft-serve/default.nix index 05156fd..102ee1c 100644 --- a/modules/customs/soft-serve/default.nix +++ b/modules/customs/soft-serve/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.services.soft-serve; @@ -39,10 +44,10 @@ in systemd.services.soft-serve = { description = "Soft Serve git server"; - documentation = lists.singleton docUrl; - requires = lists.singleton "network-online.target"; - after = lists.singleton "network-online.target"; - wantedBy = lists.singleton "multi-user.target"; + documentation = [ docUrl ]; + requires = [ "network-online.target" ]; + after = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; environment.SOFT_SERVE_DATA_PATH = dataDir; serviceConfig = { Type = "simple"; diff --git a/modules/default.nix b/modules/default.nix index bfa1760..a8ac000 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,10 +1,9 @@ { inputs }: let - genModules = { type, modules }: - builtins.map (module: "${inputs.self}/modules/${type}/${module}") modules; + genModules = + { type, modules }: builtins.map (module: "${inputs.self}/modules/${type}/${module}") modules; - mkModules = moduleAttrList: - builtins.concatMap (moduleAttr: genModules moduleAttr) moduleAttrList; + mkModules = moduleAttrList: builtins.concatMap (moduleAttr: genModules moduleAttr) moduleAttrList; in { mkSystem = hostname: nixpkgsVersion: modules: { diff --git a/modules/profiles/common/default.nix b/modules/profiles/common/default.nix index 67d228a..da7df0f 100644 --- a/modules/profiles/common/default.nix +++ b/modules/profiles/common/default.nix @@ -1,9 +1,20 @@ -{ inputs, lib, pkgs, ... }: +{ + inputs, + lib, + pkgs, + ... +}: { nix = { settings = { - trusted-users = [ "@wheel" "root" ]; - experimental-features = lib.mkDefault [ "nix-command" "flakes" ]; + trusted-users = [ + "@wheel" + "root" + ]; + experimental-features = lib.mkDefault [ + "nix-command" + "flakes" + ]; auto-optimise-store = true; }; gc = { @@ -19,7 +30,7 @@ allowUnfreePredicate = (_: true); }; overlays = [ - (final: prev: { + (final: _prev: { unstable = import inputs.nixpkgs-unstable { system = final.system; config.allowUnfree = true; diff --git a/modules/profiles/libvirtd/default.nix b/modules/profiles/libvirtd/default.nix index 222fdab..f10a5ce 100644 --- a/modules/profiles/libvirtd/default.nix +++ b/modules/profiles/libvirtd/default.nix @@ -14,6 +14,9 @@ # Add any users in the 'wheel' group to the 'libvirtd' group. users.groups.libvirtd.members = - with builtins; let users = config.users.users; in - filter (u: elem "wheel" users.${u}.extraGroups) (attrNames users); + with builtins; + let + users = config.users.users; + in + filter (u: elem "wheel" users.${u}.extraGroups) (attrNames users); } diff --git a/modules/profiles/upgrade/default.nix b/modules/profiles/upgrade/default.nix index 32c49a8..80fd3e3 100644 --- a/modules/profiles/upgrade/default.nix +++ b/modules/profiles/upgrade/default.nix @@ -17,7 +17,8 @@ let hostname = config.networking.hostName; dependencies = [ "network-online.target" ]; - in { + in + { wantedBy = [ "multi-user.target" ]; wants = dependencies; after = dependencies; diff --git a/modules/profiles/wireshark/default.nix b/modules/profiles/wireshark/default.nix index ab741ff..6b3dd3d 100644 --- a/modules/profiles/wireshark/default.nix +++ b/modules/profiles/wireshark/default.nix @@ -7,6 +7,9 @@ # Add any users in the 'wheel' group to the 'wireshark' group. users.groups.wireshark.members = - with builtins; let users = config.users.users; in - filter (u: elem "wheel" users.${u}.extraGroups) (attrNames users); + with builtins; + let + users = config.users.users; + in + filter (u: elem "wheel" users.${u}.extraGroups) (attrNames users); } diff --git a/modules/retired/blocky/default.nix b/modules/retired/blocky/default.nix index ca58f4f..302ef8e 100644 --- a/modules/retired/blocky/default.nix +++ b/modules/retired/blocky/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { services.blocky = { enable = true; @@ -11,10 +11,10 @@ "149.112.112.112" ]; }; - bootstrapDns = [{ + bootstrapDns = lib.singleton { upstream = "https://dns.quad9.net/dns-query"; ips = [ "9.9.9.9" ]; - }]; + }; ports = { dns = 53; tls = 853; @@ -87,7 +87,11 @@ }; networking.firewall = { - allowedTCPPorts = [ 53 443 853 ]; + allowedTCPPorts = [ + 53 + 443 + 853 + ]; allowedUDPPorts = [ 53 ]; }; } diff --git a/modules/retired/forgejo/default.nix b/modules/retired/forgejo/default.nix index 9db55b2..cf4e101 100644 --- a/modules/retired/forgejo/default.nix +++ b/modules/retired/forgejo/default.nix @@ -1,4 +1,10 @@ -{ inputs, config, lib, pkgs, ... }: +{ + inputs, + config, + lib, + pkgs, + ... +}: let domain = "git.tdback.net"; port = 3000; @@ -37,7 +43,8 @@ in password = config.age.secrets.forgejoAdminPass.path; user = "tdback"; email = "tyler@tdback.net"; - in '' + in + '' ${adminCmd} create --admin --email ${email} --username ${user} --password "$(tr -d '\n' < ${password})" || true ''; diff --git a/modules/retired/mumble/default.nix b/modules/retired/mumble/default.nix index 29e3339..fa08d64 100644 --- a/modules/retired/mumble/default.nix +++ b/modules/retired/mumble/default.nix @@ -5,7 +5,7 @@ package = pkgs.murmur; port = 64738; openFirewall = true; - environmentFile = "/var/lib/murmur/murmurd.env"; + environmentFile = "/var/lib/murmur/murmurd.env"; password = "$MURMURD_PASSWORD"; }; } diff --git a/modules/retired/navidrome/default.nix b/modules/retired/navidrome/default.nix index 30a6b3f..aeb8f18 100644 --- a/modules/retired/navidrome/default.nix +++ b/modules/retired/navidrome/default.nix @@ -1,10 +1,9 @@ -{ lib, ... }: +{ ... }: let directory = "/opt/navidrome"; in { - systemd.tmpfiles.rules = - map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.navidrome = { image = "deluan/navidrome:latest"; diff --git a/modules/retired/pihole/default.nix b/modules/retired/pihole/default.nix index 034c91b..3a95f8a 100644 --- a/modules/retired/pihole/default.nix +++ b/modules/retired/pihole/default.nix @@ -1,15 +1,15 @@ -{ inputs, config, lib, ... }: +{ + inputs, + config, + ... +}: let - # TODO: Think about changing this to config.networking.interface... - # Will have to pull the first value in the list, which might be messy but it - # will definitely make it more producible across machines. ip = "10.0.0.203"; interface = "eno1"; directory = "/opt/pihole"; in { - systemd.tmpfiles.rules = - map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") [ directory ]; virtualisation.oci-containers.containers.pihole = { image = "pihole/pihole:latest"; @@ -41,12 +41,16 @@ in systemd.services.podman-pihole.postStart = let password = config.age.secrets.piholeAdminPass.path; - in '' + in + '' podman exec -it pihole pihole -a -p "$(tr -d '\n' < ${password})" ''; networking.firewall = { - allowedTCPPorts = [ 53 80 ]; + allowedTCPPorts = [ + 53 + 80 + ]; allowedUDPPorts = [ 53 ]; }; } diff --git a/modules/scripts/motd/default.nix b/modules/scripts/motd/default.nix index c4b0c6b..6d95119 100644 --- a/modules/scripts/motd/default.nix +++ b/modules/scripts/motd/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.programs.motd; @@ -35,9 +40,12 @@ let printf "\n" printf "''${BOLD}Good $TIME $(whoami), welcome to $(hostname)!$ENDCOLOR\n" printf "\n" - ${strings.concatStrings (lists.forEach cfg.networkInterfaces ( - int: "printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${int}\" \"$(ip -4 addr show ${int} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n" - ))} + ${strings.concatStrings ( + lists.forEach cfg.networkInterfaces ( + int: + "printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${int}\" \"$(ip -4 addr show ${int} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n" + ) + )} printf "$BOLD * %-20s$ENDCOLOR %s\n" "Release" "$(awk -F= '/PRETTY_NAME/ { print $2 }' /etc/os-release | tr -d '"')" printf "$BOLD * %-20s$ENDCOLOR %s\n" "Kernel" "$(uname -rs)" printf "\n" @@ -68,7 +76,8 @@ let done <<< "$SERVICES" printf "\n" ''; -in { +in +{ options = { programs.motd = { enable = mkEnableOption "motd"; diff --git a/modules/scripts/pushover/default.nix b/modules/scripts/pushover/default.nix index a5644e4..979e96b 100644 --- a/modules/scripts/pushover/default.nix +++ b/modules/scripts/pushover/default.nix @@ -1,4 +1,9 @@ -{ inputs, config, pkgs, ... }: +{ + inputs, + config, + pkgs, + ... +}: let pushover = pkgs.writeShellScriptBin "pushover" '' set -e @@ -35,7 +40,8 @@ let --form-string "message=$MESSAGE" \ https://api.pushover.net/1/messages.json ''; -in { +in +{ age.secrets = { pushoverAppToken.file = "${inputs.self}/secrets/pushoverAppToken.age"; pushoverUserToken.file = "${inputs.self}/secrets/pushoverUserToken.age"; diff --git a/modules/scripts/zquota/default.nix b/modules/scripts/zquota/default.nix index 5741e0e..bd35546 100644 --- a/modules/scripts/zquota/default.nix +++ b/modules/scripts/zquota/default.nix @@ -1,13 +1,19 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.services.zquota; - zquota = let - bc = getExe pkgs.bc; - zfs = getExe pkgs.zfs; - hostname = config.networking.hostName; - in + zquota = + let + bc = getExe pkgs.bc; + zfs = getExe pkgs.zfs; + hostname = config.networking.hostName; + in pkgs.writeShellScriptBin "zquota" '' set -e @@ -38,7 +44,8 @@ let "dataset $DATASET on ${hostname} has exceeded quota by ''${DIFF}GB" fi ''; -in { +in +{ options = { services.zquota = { enable = mkEnableOption "zquota"; @@ -66,12 +73,11 @@ in { systemd.services."zquota" = { description = "Perform and report scheduled quota checks on ZFS datasets."; serviceConfig.Type = "oneshot"; - script = - strings.concatStringsSep "\n" ( - mapAttrsToList (dataset: quota: - "/run/current-system/sw/bin/zquota ${dataset} ${builtins.toString quota}" - ) cfg.quotas - ); + script = strings.concatStringsSep "\n" ( + mapAttrsToList ( + dataset: quota: "/run/current-system/sw/bin/zquota ${dataset} ${builtins.toString quota}" + ) cfg.quotas + ); }; systemd.timers."zquota" = { wantedBy = [ "timers.target" ]; diff --git a/modules/services/cgit/default.nix b/modules/services/cgit/default.nix index 5309e6f..7e2955a 100644 --- a/modules/services/cgit/default.nix +++ b/modules/services/cgit/default.nix @@ -1,10 +1,14 @@ -{ inputs, lib, pkgs, ... }: +{ + inputs, + pkgs, + ... +}: let scanPath = "/tank/git"; domain = "git.tdback.net"; in { - imports = lib.lists.singleton "${inputs.self}/modules/customs/cgit"; + imports = [ "${inputs.self}/modules/customs/cgit" ]; services.cgit = { enable = true; diff --git a/modules/services/proxy/default.nix b/modules/services/proxy/default.nix index e11beab..c70bb54 100644 --- a/modules/services/proxy/default.nix +++ b/modules/services/proxy/default.nix @@ -5,5 +5,8 @@ package = pkgs.caddy; }; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; } diff --git a/modules/services/sftpgo/default.nix b/modules/services/sftpgo/default.nix index 27318b2..de8b5b1 100644 --- a/modules/services/sftpgo/default.nix +++ b/modules/services/sftpgo/default.nix @@ -1,15 +1,20 @@ -{ config, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { services.sftpgo = { enable = true; package = pkgs.sftpgo; settings = { - httpd.bindings = [{ + httpd.bindings = lib.singleton { port = 8080; address = "0.0.0.0"; enable_web_client = true; enable_web_admin = true; - }]; + }; }; }; diff --git a/modules/users/default.nix b/modules/users/default.nix index 027ca0f..219f577 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -6,7 +6,13 @@ uid = 1000; home = "/home/tdback"; group = "tdback"; - extraGroups = [ "wheel" "users" "networkmanager" "video" "audio" ]; + extraGroups = [ + "wheel" + "users" + "networkmanager" + "video" + "audio" + ]; shell = pkgs.bash; ignoreShellProgramCheck = true; }; diff --git a/users/tdback/default.nix b/users/tdback/default.nix index 8457428..b6dd00c 100644 --- a/users/tdback/default.nix +++ b/users/tdback/default.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, headless ? true, ... }: +{ + config, + lib, + pkgs, + headless ? true, + ... +}: { # Hacky way to import our desktop modules if we aren't a headless system. imports = (lib.optional (!headless) ./desktop.nix) ++ [ diff --git a/users/tdback/desktop.nix b/users/tdback/desktop.nix index 081487a..1d57042 100644 --- a/users/tdback/desktop.nix +++ b/users/tdback/desktop.nix @@ -1,20 +1,30 @@ { config, pkgs, ... }: let - mkDirs = defined: + mkDirs = + defined: let home = config.home.homeDirectory; - dirs = [ "desktop" "documents" "download" "music" "pictures" "publicShare" "templates" "videos" ]; + dirs = [ + "desktop" + "documents" + "download" + "music" + "pictures" + "publicShare" + "templates" + "videos" + ]; in - builtins.listToAttrs ( - builtins.map (dir: { - name = dir; - value = - if builtins.hasAttr dir defined then - "${home}/${defined.${dir}}" - else - null; - }) dirs - ); + { + enable = true; + createDirectories = true; + } + // (builtins.listToAttrs ( + builtins.map (dir: { + name = dir; + value = if builtins.hasAttr dir defined then "${home}/${defined.${dir}}" else null; + }) dirs + )); in { imports = [ @@ -29,11 +39,11 @@ in home.packages = with pkgs.unstable; [ clang + element-desktop gimp gitu mpv pciutils - signal-desktop tidal-dl yt-dlp zathura @@ -41,10 +51,10 @@ in xdg = { enable = true; - userDirs = { - enable = true; - createDirectories = true; - } // (mkDirs { documents = "documents"; download = "downloads"; }); + userDirs = mkDirs { + documents = "documents"; + download = "downloads"; + }; }; qt = { diff --git a/users/tdback/modules/email/default.nix b/users/tdback/modules/email/default.nix index e5dd56d..34eef65 100644 --- a/users/tdback/modules/email/default.nix +++ b/users/tdback/modules/email/default.nix @@ -2,7 +2,6 @@ { accounts.email = { maildirBasePath = "mail"; - accounts.fastmail = { primary = true; address = "tyler@tdback.net"; diff --git a/users/tdback/modules/firefox/default.nix b/users/tdback/modules/firefox/default.nix index ab4c34e..a4e78e8 100644 --- a/users/tdback/modules/firefox/default.nix +++ b/users/tdback/modules/firefox/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let lock-false = { Value = false; @@ -26,7 +31,7 @@ in SearchBar = "unified"; OfferToSaveLogins = false; EnableTrackingProtection = { - Value= true; + Value = true; Locked = true; Cryptomining = true; Fingerprinting = true; @@ -34,7 +39,10 @@ in # about:config Preferences = { - "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "browser.contentblocking.category" = { + Value = "strict"; + Status = "locked"; + }; "extensions.pocket.enabled" = lock-false; "extensions.screenshots.disabled" = lock-true; "browser.topsites.contile.enabled" = lock-false; @@ -89,9 +97,9 @@ in "Google".metaData.hidden = true; "Wikipedia (en)".metaData.alias = "@w"; "searx" = { - urls = [{ + urls = lib.singleton { template = "http://10.44.4.100:8888/?q={searchTerms}"; - }]; + }; updateInterval = 24 * 60 * 60 * 1000; definedAliases = [ "@sx" ]; }; diff --git a/users/tdback/modules/mpd/default.nix b/users/tdback/modules/mpd/default.nix index 7c6381d..374add8 100644 --- a/users/tdback/modules/mpd/default.nix +++ b/users/tdback/modules/mpd/default.nix @@ -11,15 +11,12 @@ extraConfig = '' log_file "syslog" max_output_buffer_size "16384" - restore_paused "yes" auto_update "yes" - audio_output { type "pulse" name "pulseaudio" } - audio_output { type "fifo" name "Visualizer feed" diff --git a/users/tdback/modules/ncmpcpp/default.nix b/users/tdback/modules/ncmpcpp/default.nix index 970dba3..839ce34 100644 --- a/users/tdback/modules/ncmpcpp/default.nix +++ b/users/tdback/modules/ncmpcpp/default.nix @@ -35,31 +35,120 @@ }; bindings = [ - { key = "j"; command = "scroll_down"; } - { key = "k"; command = "scroll_up"; } - { key = "h"; command = [ "previous_column" "jump_to_parent_directory" ]; } - { key = "l"; command = [ "next_column" "enter_directory" "run_action" "play_item" ]; } - { key = "u"; command = "page_up"; } - { key = "d"; command = "page_down"; } - { key = "ctrl-u"; command = "page_up"; } - { key = "ctrl-d"; command = "page_down"; } - { key = "g"; command = "move_home"; } - { key = "G"; command = "move_end"; } - { key = "n"; command = "next_found_item"; } - { key = "N"; command = "previous_found_item"; } - { key = "J"; command = "move_sort_order_down"; } - { key = "K"; command = "move_sort_order_up"; } - { key = "f"; command = [ "show_browser" "change_browse_mode" ]; } - { key = "s"; command = [ "reset_search_engine" "show_search_engine" ]; } - { key = "m"; command = "toggle_media_library_columns_mode"; } - { key = "x"; command = "delete_playlist_items"; } - { key = "U"; command = "update_database"; } - { key = "P"; command = "show_playlist"; } - { key = "t"; command = "show_tag_editor"; } - { key = "v"; command = "show_visualizer"; } - { key = "."; command = "show_lyrics"; } - { key = "+"; command = "show_clock"; } - { key = "="; command = "volume_up"; } + { + key = "j"; + command = "scroll_down"; + } + { + key = "k"; + command = "scroll_up"; + } + { + key = "h"; + command = [ + "previous_column" + "jump_to_parent_directory" + ]; + } + { + key = "l"; + command = [ + "next_column" + "enter_directory" + "run_action" + "play_item" + ]; + } + { + key = "u"; + command = "page_up"; + } + { + key = "d"; + command = "page_down"; + } + { + key = "ctrl-u"; + command = "page_up"; + } + { + key = "ctrl-d"; + command = "page_down"; + } + { + key = "g"; + command = "move_home"; + } + { + key = "G"; + command = "move_end"; + } + { + key = "n"; + command = "next_found_item"; + } + { + key = "N"; + command = "previous_found_item"; + } + { + key = "J"; + command = "move_sort_order_down"; + } + { + key = "K"; + command = "move_sort_order_up"; + } + { + key = "f"; + command = [ + "show_browser" + "change_browse_mode" + ]; + } + { + key = "s"; + command = [ + "reset_search_engine" + "show_search_engine" + ]; + } + { + key = "m"; + command = "toggle_media_library_columns_mode"; + } + { + key = "x"; + command = "delete_playlist_items"; + } + { + key = "U"; + command = "update_database"; + } + { + key = "P"; + command = "show_playlist"; + } + { + key = "t"; + command = "show_tag_editor"; + } + { + key = "v"; + command = "show_visualizer"; + } + { + key = "."; + command = "show_lyrics"; + } + { + key = "+"; + command = "show_clock"; + } + { + key = "="; + command = "volume_up"; + } ]; }; } diff --git a/users/tdback/modules/neomutt/default.nix b/users/tdback/modules/neomutt/default.nix index bc066d9..413172a 100644 --- a/users/tdback/modules/neomutt/default.nix +++ b/users/tdback/modules/neomutt/default.nix @@ -17,17 +17,26 @@ binds = [ { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "\\Cp"; action = "sidebar-prev"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "\\Cn"; action = "sidebar-next"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "\\Cy"; action = "sidebar-open"; } @@ -35,27 +44,42 @@ macros = [ { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "gi"; action = "<change-folder>=Inbox<enter>"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "gs"; action = "<change-folder>=Sent<enter>"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "gd"; action = "<change-folder>=Drafts<enter>"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "gt"; action = "<change-folder>=Trash<enter>"; } { - map = [ "index" "pager" ]; + map = [ + "index" + "pager" + ]; key = "ga"; action = "<change-folder>=Archive<enter>"; } diff --git a/users/tdback/modules/shell/default.nix b/users/tdback/modules/shell/default.nix index 1150cf3..3237cda 100644 --- a/users/tdback/modules/shell/default.nix +++ b/users/tdback/modules/shell/default.nix @@ -10,7 +10,10 @@ bash = { enable = true; historyFile = "~/.bash_history"; - historyControl = [ "ignoredups" "ignorespace" ]; + historyControl = [ + "ignoredups" + "ignorespace" + ]; shellOptions = [ "histappend" ]; initExtra = '' PS1=" diff --git a/users/tdback/retired/alacritty/default.nix b/users/tdback/retired/alacritty/default.nix index 6614030..a18239a 100644 --- a/users/tdback/retired/alacritty/default.nix +++ b/users/tdback/retired/alacritty/default.nix @@ -41,24 +41,24 @@ foreground = "#eaeaea"; }; normal = { - black = "#000000"; - red = "#d54e53"; - green = "#b9ca4a"; - yellow = "#e6c547"; - blue = "#7aa6da"; + black = "#000000"; + red = "#d54e53"; + green = "#b9ca4a"; + yellow = "#e6c547"; + blue = "#7aa6da"; magenta = "#c397d8"; - cyan = "#70c0ba"; - white = "#424242"; + cyan = "#70c0ba"; + white = "#424242"; }; bright = { - black = "#666666"; - red = "#ff3334"; - green = "#9ec400"; - yellow = "#e7c547"; - blue = "#7aa6da"; + black = "#666666"; + red = "#ff3334"; + green = "#9ec400"; + yellow = "#e7c547"; + blue = "#7aa6da"; magenta = "#b77ee0"; - cyan = "#54ced6"; - white = "#2a2a2a"; + cyan = "#54ced6"; + white = "#2a2a2a"; }; }; }; diff --git a/users/tdback/retired/rofi/default.nix b/users/tdback/retired/rofi/default.nix index 8a439c4..4399265 100644 --- a/users/tdback/retired/rofi/default.nix +++ b/users/tdback/retired/rofi/default.nix @@ -22,7 +22,7 @@ bg = mkLiteral "#050505"; bg-alt = mkLiteral "#191919"; fg = mkLiteral "#FFFFFF"; - fg-alt = mkLiteral"#787c99"; + fg-alt = mkLiteral "#787c99"; background-color = mkLiteral "@bg"; border = 0; margin = 0; @@ -61,7 +61,10 @@ }; "inputbar" = { - children = map mkLiteral [ "prompt" "entry" ]; + children = map mkLiteral [ + "prompt" + "entry" + ]; }; "listview" = { diff --git a/users/tdback/retired/x11/default.nix b/users/tdback/retired/x11/default.nix index 06c1e2c..13fe1fc 100644 --- a/users/tdback/retired/x11/default.nix +++ b/users/tdback/retired/x11/default.nix @@ -3,23 +3,27 @@ xsession.windowManager.bspwm = { enable = true; package = pkgs.unstable.bspwm; - settings = let color = "#3B4252"; in { - window_gap = 0; - top_padding = 0; - bottom_padding = 0; - right_padding = 0; - left_padding = 0; - top_monocle_padding = 0; - bottom_monocle_padding = 0; - right_monocle_padding = 0; - left_monocle_padding = 0; - split_ratio = 0.5; - borderless_monocle = true; - gapless_monocle = true; - normal_border_color = color; - active_border_color = color; - focused_border_color = color; - }; + settings = + let + color = "#3B4252"; + in + { + window_gap = 0; + top_padding = 0; + bottom_padding = 0; + right_padding = 0; + left_padding = 0; + top_monocle_padding = 0; + bottom_monocle_padding = 0; + right_monocle_padding = 0; + left_monocle_padding = 0; + split_ratio = 0.5; + borderless_monocle = true; + gapless_monocle = true; + normal_border_color = color; + active_border_color = color; + focused_border_color = color; + }; rules = { "Zathura".state = "tiled"; @@ -37,45 +41,50 @@ ''; }; - services.sxhkd = let bspc = lib.getExe' pkgs.unstable.bspwm "bspc"; in { - enable = true; - package = pkgs.unstable.sxhkd; - keybindings = { - # Program hotkeys. - "alt + Tab" = "${lib.getExe pkgs.unstable.rofi} -show window"; - "super + r" = "${lib.getExe pkgs.unstable.rofi} -show drun"; - "super + x" = "${lib.getExe pkgs.unstable.alacritty}"; - "super + b" = "$BROWSER"; - "super + p" = "${lib.getExe pkgs.unstable.flameshot} full -p $HOME/.local/screenshots"; - "super + shift + p" = "${lib.getExe pkgs.unstable.flameshot} gui -p $HOME/.local/screenshots"; - "super + Escape" = "systemctl --user restart polybar"; - "super + alt + {q,r}" = "${bspc} {quit,wm -r}"; + services.sxhkd = + let + bspc = lib.getExe' pkgs.unstable.bspwm "bspc"; + in + { + enable = true; + package = pkgs.unstable.sxhkd; + keybindings = { + # Program hotkeys. + "alt + Tab" = "${lib.getExe pkgs.unstable.rofi} -show window"; + "super + r" = "${lib.getExe pkgs.unstable.rofi} -show drun"; + "super + x" = "${lib.getExe pkgs.unstable.alacritty}"; + "super + b" = "$BROWSER"; + "super + p" = "${lib.getExe pkgs.unstable.flameshot} full -p $HOME/.local/screenshots"; + "super + shift + p" = "${lib.getExe pkgs.unstable.flameshot} gui -p $HOME/.local/screenshots"; + "super + Escape" = "systemctl --user restart polybar"; + "super + alt + {q,r}" = "${bspc} {quit,wm -r}"; - # Function hotkeys. - "XF86AudioPrev" = "${lib.getExe pkgs.unstable.mpc} prev"; - "XF86AudioNext" = "${lib.getExe pkgs.unstable.mpc} next"; - "XF86AudioPlay" = "${lib.getExe pkgs.unstable.mpc} toggle"; - "XF86AudioLowerVolume" = "${lib.getExe pkgs.unstable.pamixer} -d 5"; - "XF86AudioRaiseVolume" = "${lib.getExe pkgs.unstable.pamixer} -i 5"; - "XF86AudioMute" = "${lib.getExe pkgs.pamixer} -t"; + # Function hotkeys. + "XF86AudioPrev" = "${lib.getExe pkgs.unstable.mpc} prev"; + "XF86AudioNext" = "${lib.getExe pkgs.unstable.mpc} next"; + "XF86AudioPlay" = "${lib.getExe pkgs.unstable.mpc} toggle"; + "XF86AudioLowerVolume" = "${lib.getExe pkgs.unstable.pamixer} -d 5"; + "XF86AudioRaiseVolume" = "${lib.getExe pkgs.unstable.pamixer} -i 5"; + "XF86AudioMute" = "${lib.getExe pkgs.pamixer} -t"; - # Manipulate window manager. - "super + q" = "${bspc} node -{c,k}"; - "super + f" = "${bspc} node focused.tiled -t fullscreen"; - "super + t" = "${bspc} node focused.fullscreen -t tiled"; - "super + shift + f" = "${bspc} node focused.tiled -t floating"; - "super + shift + t" = "${bspc} node focused.floating -t tiled"; - "super + {_,shift + }{h,j,k,l}" = "${bspc} node -{f,s} {west,south,north,east}"; - "super + {_,shift}c" = "${bspc} node -f {next,prev}.local.!hidden.window"; - "super + bracket{left,right}" = "${bspc} desktop -f {prev,next}.local"; - "super + {grave,Tab}" = "${bspc} {node,desktop} -f last"; - "super + {o,i}" = "${bspc} wm -h off; ${bspc} node {older,newer} -f; ${bspc} wm -h on"; - "super + {_,shift + }{1-9,0}" = "${bspc} {desktop -f, node -d} '^{1-9,10}'"; - "super + alt + {h,j,k,l}" = "${bspc} node -z {left -20 0, bottom 0 20, top 0 -20, right 20 0}"; - "super + alt + shift {h,j,k,l}" = "${bspc} node -z {right -20 0, top 0 20, bottom 0 -20, left 20 0}"; - "super + {Left,Down,Up,Right}" = "${bspc} node -v {-20 0,0 20,0 -20,20 0}"; + # Manipulate window manager. + "super + q" = "${bspc} node -{c,k}"; + "super + f" = "${bspc} node focused.tiled -t fullscreen"; + "super + t" = "${bspc} node focused.fullscreen -t tiled"; + "super + shift + f" = "${bspc} node focused.tiled -t floating"; + "super + shift + t" = "${bspc} node focused.floating -t tiled"; + "super + {_,shift + }{h,j,k,l}" = "${bspc} node -{f,s} {west,south,north,east}"; + "super + {_,shift}c" = "${bspc} node -f {next,prev}.local.!hidden.window"; + "super + bracket{left,right}" = "${bspc} desktop -f {prev,next}.local"; + "super + {grave,Tab}" = "${bspc} {node,desktop} -f last"; + "super + {o,i}" = "${bspc} wm -h off; ${bspc} node {older,newer} -f; ${bspc} wm -h on"; + "super + {_,shift + }{1-9,0}" = "${bspc} {desktop -f, node -d} '^{1-9,10}'"; + "super + alt + {h,j,k,l}" = "${bspc} node -z {left -20 0, bottom 0 20, top 0 -20, right 20 0}"; + "super + alt + shift {h,j,k,l}" = + "${bspc} node -z {right -20 0, top 0 20, bottom 0 -20, left 20 0}"; + "super + {Left,Down,Up,Right}" = "${bspc} node -v {-20 0,0 20,0 -20,20 0}"; + }; }; - }; # Generate X11 init scripts. home.file = { |