From 91f4393800382350ea44b4bddeebcba5bcb4655e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Schwarz=C3=A4ugl?= Date: Mon, 23 Feb 2026 01:02:44 +0100 Subject: [PATCH] feat[client]: add shikane --- .github/README.md | 8 +- SwarselSystems.org | 3565 +++++++++-------- files/emacs/init.el | 2 +- files/{wallpaper => icons}/swarsel.png | Bin files/{wallpaper => icons}/user.png | Bin files/scripts/niri-resize.sh | 2 +- files/templates/hosts/nixos/default.nix | 2 +- .../wallpaper/{ => landscape}/botanicswp.png | Bin files/wallpaper/{ => landscape}/lenovowp.png | Bin files/wallpaper/{ => landscape}/serverwp.png | Bin files/wallpaper/{ => landscape}/standwp.png | Bin files/wallpaper/{ => landscape}/surfacewp.png | Bin files/wallpaper/{ => portrait}/op6wp.png | Bin files/wallpaper/{ => services}/navidrome.png | Bin .../home/aarch64-linux/treehouse/default.nix | 2 +- hosts/nixos/x86_64-linux/bakery/default.nix | 2 +- hosts/nixos/x86_64-linux/hotel/default.nix | 2 +- hosts/nixos/x86_64-linux/pyramid/default.nix | 2 +- hosts/nixos/x86_64-linux/summers/default.nix | 1 + hosts/nixos/x86_64-linux/toto/default.nix | 2 +- install/installer-config.nix | 5 + modules/home/common/kanshi.nix | 6 +- modules/home/common/packages.nix | 2 +- modules/home/common/shikane.nix | 77 + modules/home/common/sway.nix | 46 +- modules/home/common/swayidle.nix | 7 +- modules/home/optional/niri.nix | 36 +- modules/home/optional/noctalia.nix | 98 +- modules/home/optional/work.nix | 90 +- modules/nixos/client/login.nix | 4 +- modules/nixos/server/router.nix | 3 +- modules/shared/config-lib.nix | 17 +- modules/shared/options.nix | 2 +- profiles/home/personal/default.nix | 1 + 34 files changed, 2182 insertions(+), 1802 deletions(-) rename files/{wallpaper => icons}/swarsel.png (100%) rename files/{wallpaper => icons}/user.png (100%) rename files/wallpaper/{ => landscape}/botanicswp.png (100%) rename files/wallpaper/{ => landscape}/lenovowp.png (100%) rename files/wallpaper/{ => landscape}/serverwp.png (100%) rename files/wallpaper/{ => landscape}/standwp.png (100%) rename files/wallpaper/{ => landscape}/surfacewp.png (100%) rename files/wallpaper/{ => portrait}/op6wp.png (100%) rename files/wallpaper/{ => services}/navidrome.png (100%) create mode 100644 modules/home/common/shikane.nix diff --git a/.github/README.md b/.github/README.md index bc87ee8..644a1fd 100644 --- a/.github/README.md +++ b/.github/README.md @@ -118,12 +118,12 @@ |---------------|-----------------------------------------------------------------------------------------------------------------------------| |🐚 **Shell** | [zsh](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) | |πŸšͺ **DM** | [greetd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/common/login.nix) | - |πŸͺŸ **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) | - |⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) | + |πŸͺŸ **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) or [Niri](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/niri.nix) | + |⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | |βœ’οΈ **Editor** | [Emacs](https://github.com/Swarsel/.dotfiles/tree/main/files/emacs/init.el) | |πŸ–₯️ **Terminal**| [Kitty](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/kitty.nix) | - |πŸš€ **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) | - |🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) | + |πŸš€ **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | + |🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | |🌐 **Browser** | [Firefox](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) | |🎨 **Theme** | [City-Lights (managed by stylix)](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sharedsetup.nix) | diff --git a/SwarselSystems.org b/SwarselSystems.org index a18c4a9..bf3e8f8 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -16,7 +16,7 @@ *{{{NOTE(If you can see this, you might want to switch to [[https://swarsel.github.io/.dotfiles/][the hmtl version of this document]] in order to have working links and other QoL functions while reading this file.)}}}* -* Introduction (no code) +* Introduction (no config code) :PROPERTIES: :CUSTOM_ID: h:a86fe971-f169-4052-aacf-15e0f267c6cd :END: @@ -39,7 +39,7 @@ This project manages my entire IT infrastructure. In particular: - A mailserver ([[#h:81bc8746-b46b-4d29-87de-ddbd77788b43][Eagleland (Hetzner)]]) - My home router ([[#h:58c7563e-6954-42e6-a622-9d06523e8e24][Hintbooth (Router: HUNSN RM02)]]) and its MicroVMs -- Two homeservers ([[#h:82bf7fb1-631b-4acd-966b-d0c71a9eb463][Summers (Server: ASUS Z10PA-D8)]], [[#h:932ef6b0-4c14-4200-8e3f-2e208e748746][Winters (Server: ASRock J4105-ITX)]] and their respective MicroVMs) and one cloud server ([[#h:f547ed16-5e6e-4744-9e33-af090e0a175b][Moonside (OCI)]]) that are using other services defined in [[#h:79f3258f-ed9d-434d-b50a-e58d57ade2a7][Services]] +- Two homeservers ([[#h:82bf7fb1-631b-4acd-966b-d0c71a9eb463][Summers (Server: ASUS Z10PA-D8)]], [[#h:932ef6b0-4c14-4200-8e3f-2e208e748746][Winters (Server: ASRock J4105-ITX)]] and their respective MicroVMs) and one cloud server ([[#h:f547ed16-5e6e-4744-9e33-af090e0a175b][Moonside (OCI)]]) that are using other services defined in [[#h:79f3258f-ed9d-434d-b50a-e58d57ade2a7][Services]] (a list can be found in [[#h:191e82b6-6ae5-4ec8-ae6d-dc683ce325d9][Services]]) - Two servers (the cloud host [[#h:19300583-322b-4e0b-b657-857fbf23dfa1][Twothreetunnel (OCI)]] and one microvm [[#h:90dc7f71-f9da-49ef-b273-edfab7daaa05][Nginx]] hosted on [[#h:58c7563e-6954-42e6-a622-9d06523e8e24][Hintbooth (Router: HUNSN RM02)]]) that proxy requests to those services - A NixOS hydra buildfarm ([[#h:90457194-6b97-4cd6-90bc-4f42d0d69f51][Belchsfactory (OCI)]]) with binary caching that helps me build derivations faster and cache them for reuse - An authoritative DNS server ([[#h:1888ded8-69dc-431f-bb39-5089a8e8b1f4][Stoicclub (OCI)]]) that pushes records to both Hetzner and Hurricane Electric DNS @@ -330,21 +330,25 @@ Here I give a brief overview over the host machines that I am using. This is hel This is meant to give a brief overview over the main programs/components that I use on a daily basis on my client machines. This should be mostly useful for people wanting to rice their config, or people who believed this repos title and are looking for =.dotfiles= :p +On [[#h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20][Sway]], I run a combination of different services that are all replaced by [[#h:385cc6c7-416c-4570-a5d3-bf8fb7c841e7][Noctalia Shell]] when I am running on [[#h:06e77ca4-28ff-4cfd-bc60-b7fd848bfedb][Niri]], which has grown to become my default recently. + #+begin_src markdown :tangle no :noweb-ref programs | Topic | Program | |---------------|-----------------------------------------------------------------------------------------------------------------------------| |🐚 **Shell** | [zsh](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) | |πŸšͺ **DM** | [greetd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/common/login.nix) | - |πŸͺŸ **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) | - |⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) | + |πŸͺŸ **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) or [Niri](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/niri.nix) | + |⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | |βœ’οΈ **Editor** | [Emacs](https://github.com/Swarsel/.dotfiles/tree/main/files/emacs/init.el) | |πŸ–₯️ **Terminal**| [Kitty](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/kitty.nix) | - |πŸš€ **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) | - |🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) | + |πŸš€ **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | + |🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) or [Noctalia Shell](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/optional/noctalia.nix) | |🌐 **Browser** | [Firefox](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) | |🎨 **Theme** | [City-Lights (managed by stylix)](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sharedsetup.nix) | #+end_src + + ** Services :PROPERTIES: :CUSTOM_ID: h:191e82b6-6ae5-4ec8-ae6d-dc683ce325d9 @@ -3507,7 +3511,7 @@ TODO: I dont think this template would currently work out of the box swarselsystems = lib.recursiveUpdate { - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = true; @@ -3720,7 +3724,7 @@ My work machine. Built for more security, this is the gold standard of my config sharescreen = "eDP-2"; info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM"; firewall = lib.mkForce true; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = false; @@ -3996,7 +4000,7 @@ My personal laptop. Closely follows the =pyramid= config, but leaves out some se sharescreen = "eDP-1"; info = "Lenovo Ideapad 720S-13IKB"; firewall = lib.mkForce true; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = true; @@ -4407,6 +4411,7 @@ This is my main server that I run at home. It handles most tasks that require bi swarselmodules.server = { wireguard = true; restic = true; + podman = true; opkssh = true; }; @@ -4420,7 +4425,7 @@ This is my main server that I run at home. It handles most tasks that require bi // confLib.mkMicrovm "freshrss" { withZfs = true; } // confLib.mkMicrovm "homebox" { withZfs = true; } // confLib.mkMicrovm "immich" { withZfs = true; eternorPaths = [ "Pictures" ]; } - // confLib.mkMicrovm "jellyfin" { withZfs = true; eternorPaths = [ "Videos" ]; } + // confLib.mkMicrovm "jellyfin" { withZfs = true; eternorPaths = [ "Videos" ]; } // confLib.mkMicrovm "kanidm" { withZfs = true; } // confLib.mkMicrovm "kavita" { withZfs = true; eternorPaths = [ "Books" ]; } // confLib.mkMicrovm "koillection" { withZfs = true; } @@ -5610,10 +5615,10 @@ This is my main server that I run at home. It handles most tasks that require bi topology.self = { interfaces = { - lan2.physicalConnections = [ { node = "summers"; interface = "lan";} ]; - lan3.physicalConnections = [ { node = "summers"; interface = "bmc";} ]; - lan4.physicalConnections = [ { node = "switch-bedroom"; interface = "eth1";} ]; - lan5.physicalConnections = [ { node = "switch-livingroom"; interface = "eth1";} ]; + lan2.physicalConnections = [{ node = "summers"; interface = "lan"; }]; + lan3.physicalConnections = [{ node = "summers"; interface = "bmc"; }]; + lan4.physicalConnections = [{ node = "switch-bedroom"; interface = "eth1"; }]; + lan5.physicalConnections = [{ node = "switch-livingroom"; interface = "eth1"; }]; }; }; @@ -5686,8 +5691,8 @@ This is my main server that I run at home. It handles most tasks that require bi guests = lib.mkIf (!minimal && config.swarselsystems.withMicroVMs) ( { } - // confLib.mkMicrovm "adguardhome" { } - // confLib.mkMicrovm "nginx" { } + // confLib.mkMicrovm "adguardhome" { } + // confLib.mkMicrovm "nginx" { } ); } @@ -6109,7 +6114,7 @@ My phone. I use only a minimal config for remote debugging here. swarselsystems = { isLaptop = false; isNixos = false; - wallpaper = self + /files/wallpaper/surfacewp.png; + wallpaper = self + /files/wallpaper/landscape/surfacewp.png; }; swarselprofiles = { @@ -7160,7 +7165,7 @@ This machine mainly acts as my proxy server to stand before my local machines. after = [ "conntrack" ]; rules = [ "ct status dnat accept" ]; }; - }; + }; } @@ -7585,7 +7590,7 @@ This is a slim setup for developing base configuration. I do not track the hardw swarselsystems = { info = "~SwarselSystems~ remote install helper"; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; isImpermanence = true; isCrypted = true; isSecureBoot = false; @@ -7752,19 +7757,29 @@ NOTE: Yes, the path to this system does not follow the scheme outlined above - I TODO: cleanup this mess +Steps to recover using live ISO: + - unlock LUKS: =cryptsetup luksOpen /dev/ cryptroot= + - mount root: =mount -t btrfs -o subvol=root /dev/mapper/cryptroot /mnt= + - mounted other subvolumes: =mount -t btrfs -o subvol= /dev/mapper/cryptroot /mnt/= for all subvolumes + - mounted boot: =mount -o umask=077 /dev/ /mnt/boot= + - mount sbctl keys: =mount -o bind /mnt/persist/var/lib/sbctl /mnt/var/lib/sbctl= + - make it look like nixos system: =touch /mnt/etc/NIXOS= + - chroot: =nixos-enter= + - Then to e.g. fix missing bootloader entries: =/nix/var/nix/profiles/system/bin/switch-to-configuration boot= + #+begin_src nix-ts :tangle install/installer-config.nix { self, config, pkgs, lib, ... }: let pubKeys = lib.filesystem.listFilesRecursive "${self}/secrets/public/ssh"; stateVersion = lib.mkDefault "23.05"; - homeFiles = { - ".bash_history" = { - text = '' - swarsel-install -n hotel - ''; - }; - }; + homeFiles = { + ".bash_history" = { + text = '' + swarsel-install -n hotel + ''; + }; + }; in { @@ -7840,6 +7855,11 @@ TODO: cleanup this mess vim just sbctl + lsof + dig + + cryptsetup + btrfs-progs ]; programs = { @@ -8082,7 +8102,7 @@ I also set the =WLR_RENDERER_ALLOW_SOFTWARE=1= to allow this configuration to ru swarselsystems = { info = "~SwarselSystems~ demo host"; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; isImpermanence = true; isCrypted = true; isSecureBoot = false; @@ -8398,7 +8418,7 @@ in inherit (lib) mkOption types - ; + ; firewallOptions = { allowedTCPPorts = mkOption { @@ -8537,152 +8557,152 @@ in }; }; in - { - options = { - globals = mkOption { - default = { }; - type = types.submodule { - options = { - root = { - hashedPassword = mkOption { - type = types.str; - }; + { + options = { + globals = mkOption { + default = { }; + type = types.submodule { + options = { + root = { + hashedPassword = mkOption { + type = types.str; }; + }; - user = { - name = mkOption { - type = types.str; - }; - work = mkOption { - type = types.str; - }; + user = { + name = mkOption { + type = types.str; }; + work = mkOption { + type = types.str; + }; + }; - services = mkOption { - type = types.attrsOf ( - types.submodule (serviceSubmod: { - options = { - domain = mkOption { - type = types.str; - }; - subDomain = mkOption { - readOnly = true; - type = types.str; - default = lib.swarselsystems.getSubDomain serviceSubmod.config.domain; - }; - baseDomain = mkOption { - readOnly = true; - type = types.str; - default = lib.swarselsystems.getBaseDomain serviceSubmod.config.domain; - }; - proxyAddress4 = mkOption { - type = types.nullOr types.str; - default = null; - }; - proxyAddress6 = mkOption { - type = types.nullOr types.str; - default = null; - }; - serviceAddress = mkOption { - type = types.nullOr types.str; - default = null; - }; - homeServiceAddress = mkOption { - type = types.nullOr types.str; - default = null; - }; - isHome = mkOption { - type = types.bool; - default = false; - }; + services = mkOption { + type = types.attrsOf ( + types.submodule (serviceSubmod: { + options = { + domain = mkOption { + type = types.str; }; - }) - ); - }; + subDomain = mkOption { + readOnly = true; + type = types.str; + default = lib.swarselsystems.getSubDomain serviceSubmod.config.domain; + }; + baseDomain = mkOption { + readOnly = true; + type = types.str; + default = lib.swarselsystems.getBaseDomain serviceSubmod.config.domain; + }; + proxyAddress4 = mkOption { + type = types.nullOr types.str; + default = null; + }; + proxyAddress6 = mkOption { + type = types.nullOr types.str; + default = null; + }; + serviceAddress = mkOption { + type = types.nullOr types.str; + default = null; + }; + homeServiceAddress = mkOption { + type = types.nullOr types.str; + default = null; + }; + isHome = mkOption { + type = types.bool; + default = false; + }; + }; + }) + ); + }; - networks = mkOption { - default = { }; - type = types.attrsOf ( - types.submodule (netSubmod: { - options = networkOptions netSubmod // { - vlans = mkOption { - default = { }; - type = types.attrsOf ( - types.submodule (vlanNetSubmod: { - options = networkOptions vlanNetSubmod // { - id = mkOption { - type = types.ints.between 1 4094; - description = "The VLAN id"; - }; - - name = mkOption { - description = "The name of this VLAN"; - default = vlanNetSubmod.config._module.args.name; - type = types.str; - }; + networks = mkOption { + default = { }; + type = types.attrsOf ( + types.submodule (netSubmod: { + options = networkOptions netSubmod // { + vlans = mkOption { + default = { }; + type = types.attrsOf ( + types.submodule (vlanNetSubmod: { + options = networkOptions vlanNetSubmod // { + id = mkOption { + type = types.ints.between 1 4094; + description = "The VLAN id"; }; - }) - ); - }; + + name = mkOption { + description = "The name of this VLAN"; + default = vlanNetSubmod.config._module.args.name; + type = types.str; + }; + }; + }) + ); }; - }) - ); - }; + }; + }) + ); + }; - hosts = mkOption { - type = types.attrsOf ( - types.submodule { - options = { - defaultGateway4 = mkOption { - type = types.nullOr types.net.ipv4; - }; - defaultGateway6 = mkOption { - type = types.nullOr types.net.ipv6; - }; - wanAddress4 = mkOption { - type = types.nullOr types.net.ipv4; - }; - wanAddress6 = mkOption { - type = types.nullOr types.net.ipv6; - }; - isHome = mkOption { - type = types.bool; - }; + hosts = mkOption { + type = types.attrsOf ( + types.submodule { + options = { + defaultGateway4 = mkOption { + type = types.nullOr types.net.ipv4; }; - } - ); - }; + defaultGateway6 = mkOption { + type = types.nullOr types.net.ipv6; + }; + wanAddress4 = mkOption { + type = types.nullOr types.net.ipv4; + }; + wanAddress6 = mkOption { + type = types.nullOr types.net.ipv6; + }; + isHome = mkOption { + type = types.bool; + }; + }; + } + ); + }; - domains = { - main = mkOption { - type = types.str; - }; - externalDns = mkOption { - type = types.listOf types.str; - description = "List of external dns nameservers"; - }; + domains = { + main = mkOption { + type = types.str; }; - - general = lib.mkOption { - type = types.submodule { - freeformType = types.unspecified; - }; + externalDns = mkOption { + type = types.listOf types.str; + description = "List of external dns nameservers"; }; + }; + general = lib.mkOption { + type = types.submodule { + freeformType = types.unspecified; + }; }; }; - }; - _globalsDefs = mkOption { - type = types.unspecified; - default = options.globals.definitions; - readOnly = true; - internal = true; }; }; - } + + _globalsDefs = mkOption { + type = types.unspecified; + default = options.globals.definitions; + readOnly = true; + internal = true; + }; + }; + } #+end_src **** Expose home-manager sops secrets in NixOS (automatically active) @@ -8704,7 +8724,7 @@ in let modules = config.home-manager.users.${mainUser}.swarselmodules; in - { + { secrets = (lib.optionalAttrs modules.mail { address1-token = { owner = mainUser; }; address2-token = { owner = mainUser; }; @@ -10634,14 +10654,14 @@ This section houses the greetd related settings. I do not really want to use a d enable = true; settings = { # initial_session.command = "sway"; - initial_session.command = "uwsm start -- sway-uwsm.desktop"; - # --cmd sway + initial_session.command = "uwsm start -- niri-uwsm.desktop"; + # --cmd sway default_session.command = '' ${pkgs.tuigreet}/bin/tuigreet \ --time \ --asterisks \ --user-menu \ - --cmd "uwsm start -- sway-uwsm.desktop" + --cmd "uwsm start -- niri-uwsm.desktop" ''; }; }; @@ -10991,37 +11011,39 @@ This turns off the display when the lid is closed. Since I hide the waybar completely during normal operation, I run the risk of not noticing when my battery is about to run out. This module sends a notification when the battery level falls below 10%. Written by [[https://gist.github.com/cafkafk][cafkafk]]. #+begin_src nix-ts :tangle modules/nixos/client/lowbattery.nix - { pkgs, lib, config, ... }: - { - options.swarselmodules.lowBattery = lib.mkEnableOption "low battery notification config"; - config = lib.mkIf config.swarselmodules.lowBattery { - systemd.user.services."battery-low" = let - target = "sway-session.target"; - in { - enable = true; - description = "Timer for battery check that alerts at 10% or less"; - partOf = [ target ]; - wantedBy = [ target ]; - serviceConfig = { - Type = "simple"; - ExecStart = pkgs.writeShellScript "battery-low-notification" - '' - if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") && $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") > 0 )); - then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")"; - fi; - ''; - }; - }; - systemd.user.timers."battery-low" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - # Every Minute - OnCalendar = "*-*-* *:*:00"; - Unit = "battery-low.service"; - }; - }; - }; - } + { pkgs, lib, config, ... }: + { + options.swarselmodules.lowBattery = lib.mkEnableOption "low battery notification config"; + config = lib.mkIf config.swarselmodules.lowBattery { + systemd.user.services."battery-low" = + let + target = "sway-session.target"; + in + { + enable = true; + description = "Timer for battery check that alerts at 10% or less"; + partOf = [ target ]; + wantedBy = [ target ]; + serviceConfig = { + Type = "simple"; + ExecStart = pkgs.writeShellScript "battery-low-notification" + '' + if (( 10 >= $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") && $(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%" | ${lib.getExe pkgs.ripgrep} -o "\d+") > 0 )); + then ${lib.getExe pkgs.libnotify} --urgency=critical "low battery" "$(${lib.getExe pkgs.acpi} -b | head -n 1 | ${lib.getExe pkgs.ripgrep} -o "\d+%")"; + fi; + ''; + }; + }; + systemd.user.timers."battery-low" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + # Every Minute + OnCalendar = "*-*-* *:*:00"; + Unit = "battery-low.service"; + }; + }; + }; + } #+end_src **** Auto-login @@ -12472,7 +12494,8 @@ This is the configuration to make [[#h:58c7563e-6954-42e6-a622-9d06523e8e24][Hin lan2VLANs = selectVLANs [ "home" "devices" "services" ]; lan3VLANs = selectVLANs [ "home" "devices" "services" ]; lan4VLANs = lan3VLANs; - lan5VLANs = selectVLANs [ "home" "devices" "guests" ]; + # TODO: remove services and reset ports 5+6 on swLR to guest when kitchen construction is finished + lan5VLANs = selectVLANs [ "home" "devices" "services" "guests" ]; inherit (globals.general) homeDnsServer; in { @@ -19194,7 +19217,7 @@ This section sets up all the imports that are used in the home-manager section. let macUser = globals.user.work; in - { + { imports = [ ]; @@ -19256,35 +19279,35 @@ Auto login for the initial session. #+begin_src nix-ts :tangle modules/nixos/optional/niri.nix { self, inputs, config, pkgs, ... }: - { - imports = [ - inputs.niri-flake.nixosModules.niri + { + imports = [ + inputs.niri-flake.nixosModules.niri + ]; + config = { + + niri-flake.cache.enable = true; + home-manager.users.${config.swarselsystems.mainUser}.imports = [ + "${self}/modules/home/optional/niri.nix" ]; - config = { - niri-flake.cache.enable = true; - home-manager.users.${config.swarselsystems.mainUser}.imports = [ - "${self}/modules/home/optional/niri.nix" - ]; - - environment.systemPackages = with pkgs; [ - wl-clipboard - wayland-utils - libsecret - cage - gamescope - xwayland-satellite-unstable - ]; + environment.systemPackages = with pkgs; [ + wl-clipboard + wayland-utils + libsecret + cage + gamescope + xwayland-satellite-unstable + ]; - programs = { - niri = { - enable = true; - package = pkgs.niri-stable; # the actual niri that will be installed and used - }; + programs = { + niri = { + enable = true; + package = pkgs.niri-stable; # the actual niri that will be installed and used }; }; - } + }; + } #+end_src **** Noctalia @@ -19544,35 +19567,35 @@ This holds configuration that is specific to framework laptops. #+begin_src nix-ts :tangle modules/nixos/optional/hibernation.nix { lib, config, ... }: - { - options.swarselsystems = { - hibernation = { - offset = lib.mkOption { - type = lib.types.int; - default = 0; - }; - resumeDevice = lib.mkOption { - type = lib.types.str; - default = "/dev/disk/by-label/nixos"; - }; + { + options.swarselsystems = { + hibernation = { + offset = lib.mkOption { + type = lib.types.int; + default = 0; + }; + resumeDevice = lib.mkOption { + type = lib.types.str; + default = "/dev/disk/by-label/nixos"; }; }; - config = { - boot = { - kernelParams = [ - "resume_offset=${builtins.toString config.swarselsystems.hibernation.offset}" - # "mem_sleep_default=deep" - ]; - inherit (config.swarselsystems.hibernation) resumeDevice; - }; - systemd.services."systemd-suspend-then-hibernate".aliases = [ "systemd-suspend.service" ]; - powerManagement.enable = true; - systemd.sleep.extraConfig = '' - HibernateDelaySec=120m - SuspendState=freeze - ''; + }; + config = { + boot = { + kernelParams = [ + "resume_offset=${builtins.toString config.swarselsystems.hibernation.offset}" + # "mem_sleep_default=deep" + ]; + inherit (config.swarselsystems.hibernation) resumeDevice; }; - } + systemd.services."systemd-suspend-then-hibernate".aliases = [ "systemd-suspend.service" ]; + powerManagement.enable = true; + systemd.sleep.extraConfig = '' + HibernateDelaySec=120m + SuspendState=freeze + ''; + }; + } #+end_src **** work @@ -19843,7 +19866,7 @@ When setting up a new machine: #+begin_src nix-ts :tangle modules/nixos/optional/uni.nix :noweb yes { self, config, withHomeManager, ... }: { - config = {} // lib.optionalAttrs withHomeManager { + config = { } // lib.optionalAttrs withHomeManager { home-manager.users."${config.swarselsystems.mainUser}" = { imports = [ @@ -19852,7 +19875,6 @@ When setting up a new machine: }; }; } - #+end_src **** microvm-host @@ -19878,7 +19900,8 @@ Some standard options that should be set for every microvm host. mode = "0750"; }; }; - }) (builtins.attrNames config.guests) + }) + (builtins.attrNames config.guests) ); users.persistentIds.microvm = confLib.mkIds 999; @@ -20094,7 +20117,7 @@ A VLAN can also be used as the initrd network - this is however disabled for the #+begin_src nix-ts :tangle modules/nixos/optional/systemd-networkd-server-home.nix - { self,lib, config, globals, ... }: + { self, lib, config, globals, ... }: let inherit (globals.general) routerServer; inherit (config.swarselsystems) withMicroVMs isCrypted initrdVLAN; @@ -20103,110 +20126,110 @@ A VLAN can also be used as the initrd network - this is however disabled for the localVLANsList = config.swarselsystems.localVLANs; localVLANs = lib.genAttrs localVLANsList (x: globals.networks.home-lan.vlans.${x}); in - { - imports = [ - "${self}/modules/nixos/optional/systemd-networkd-server.nix" + { + imports = [ + "${self}/modules/nixos/optional/systemd-networkd-server.nix" + ]; + config = { + assertions = [ + { + assertion = ((localVLANsList != [ ]) && (initrdVLAN != null)) || (localVLANsList == [ ]) || (!isCrypted); + message = "This host uses VLANs and disk encryption, thus a VLAN must be specified for initrd or disk encryption must be removed."; + } ]; - config = { - assertions = [ - { - assertion = ((localVLANsList != []) && (initrdVLAN != null)) || (localVLANsList == []) || (!isCrypted); - message = "This host uses VLANs and disk encryption, thus a VLAN must be specified for initrd or disk encryption must be removed."; - } - ]; - - boot.initrd = lib.mkIf (isCrypted && (localVLANsList != []) && (!isRouter)) { - availableKernelModules = [ "8021q" ]; - kernelModules = [ "8021q" ]; # at least summers needs this to actually find the interfaces - systemd.network = { - enable = true; - netdevs."30-vlan-${initrdVLAN}" = { - netdevConfig = { - Kind = "vlan"; - Name = "vlan-${initrdVLAN}"; - }; - vlanConfig.Id = globals.networks.home-lan.vlans.${initrdVLAN}.id; - }; - networks = { - "10-lan" = { - matchConfig.Name = "lan"; - # This interface should only be used from attached vlans. - # So don't acquire a link local address and only wait for - # this interface to gain a carrier. - networkConfig.LinkLocalAddressing = "no"; - linkConfig.RequiredForOnline = "carrier"; - vlan = [ "vlan-${initrdVLAN}" ]; - }; - "30-vlan-${initrdVLAN}" = { - address = [ - globals.networks.home-lan.vlans.${initrdVLAN}.hosts.${config.node.name}.cidrv4 - globals.networks.home-lan.vlans.${initrdVLAN}.hosts.${config.node.name}.cidrv6 - ]; - matchConfig.Name = "vlan-${initrdVLAN}"; - networkConfig = { - IPv6PrivacyExtensions = "yes"; - }; - linkConfig.RequiredForOnline = "routable"; - }; - }; - }; - }; - - topology.self.interfaces = (lib.mapAttrs' - (vlanName: _: - lib.nameValuePair "vlan-${vlanName}" { - network = lib.mkForce vlanName; - } - ) - localVLANs) // (lib.mapAttrs' - (vlanName: _: - lib.nameValuePair "me-${vlanName}" { - network = lib.mkForce vlanName; - } - ) - localVLANs); + boot.initrd = lib.mkIf (isCrypted && (localVLANsList != [ ]) && (!isRouter)) { + availableKernelModules = [ "8021q" ]; + kernelModules = [ "8021q" ]; # at least summers needs this to actually find the interfaces systemd.network = { - netdevs = lib.flip lib.concatMapAttrs localVLANs ( - vlanName: vlanCfg: { - "30-vlan-${vlanName}" = { - netdevConfig = { - Kind = "vlan"; - Name = "vlan-${vlanName}"; - }; - vlanConfig.Id = vlanCfg.id; - }; - # Create a MACVTAP for ourselves too, so that we can communicate with - # our guests on the same interface. - "40-me-${vlanName}" = lib.mkIf withMicroVMs { - netdevConfig = { - Name = "me-${vlanName}"; - Kind = "macvlan"; - }; - extraConfig = '' - [MACVLAN] - Mode=bridge - ''; - }; - } - ); + enable = true; + netdevs."30-vlan-${initrdVLAN}" = { + netdevConfig = { + Kind = "vlan"; + Name = "vlan-${initrdVLAN}"; + }; + vlanConfig.Id = globals.networks.home-lan.vlans.${initrdVLAN}.id; + }; networks = { - "10-lan" = lib.mkIf (!isRouter) { + "10-lan" = { matchConfig.Name = "lan"; # This interface should only be used from attached vlans. # So don't acquire a link local address and only wait for # this interface to gain a carrier. networkConfig.LinkLocalAddressing = "no"; linkConfig.RequiredForOnline = "carrier"; - vlan = map (name: "vlan-${name}") (builtins.attrNames localVLANs); + vlan = [ "vlan-${initrdVLAN}" ]; }; - # Remaining macvtap interfaces should not be touched. - "90-macvtap-ignore" = lib.mkIf withMicroVMs { - matchConfig.Kind = "macvtap"; - linkConfig.ActivationPolicy = "manual"; - linkConfig.Unmanaged = "yes"; + "30-vlan-${initrdVLAN}" = { + address = [ + globals.networks.home-lan.vlans.${initrdVLAN}.hosts.${config.node.name}.cidrv4 + globals.networks.home-lan.vlans.${initrdVLAN}.hosts.${config.node.name}.cidrv6 + ]; + matchConfig.Name = "vlan-${initrdVLAN}"; + networkConfig = { + IPv6PrivacyExtensions = "yes"; + }; + linkConfig.RequiredForOnline = "routable"; + }; + }; + }; + }; + + topology.self.interfaces = (lib.mapAttrs' + (vlanName: _: + lib.nameValuePair "vlan-${vlanName}" { + network = lib.mkForce vlanName; + } + ) + localVLANs) // (lib.mapAttrs' + (vlanName: _: + lib.nameValuePair "me-${vlanName}" { + network = lib.mkForce vlanName; + } + ) + localVLANs); + + systemd.network = { + netdevs = lib.flip lib.concatMapAttrs localVLANs ( + vlanName: vlanCfg: { + "30-vlan-${vlanName}" = { + netdevConfig = { + Kind = "vlan"; + Name = "vlan-${vlanName}"; + }; + vlanConfig.Id = vlanCfg.id; + }; + # Create a MACVTAP for ourselves too, so that we can communicate with + # our guests on the same interface. + "40-me-${vlanName}" = lib.mkIf withMicroVMs { + netdevConfig = { + Name = "me-${vlanName}"; + Kind = "macvlan"; + }; + extraConfig = '' + [MACVLAN] + Mode=bridge + ''; }; } + ); + networks = { + "10-lan" = lib.mkIf (!isRouter) { + matchConfig.Name = "lan"; + # This interface should only be used from attached vlans. + # So don't acquire a link local address and only wait for + # this interface to gain a carrier. + networkConfig.LinkLocalAddressing = "no"; + linkConfig.RequiredForOnline = "carrier"; + vlan = map (name: "vlan-${name}") (builtins.attrNames localVLANs); + }; + # Remaining macvtap interfaces should not be touched. + "90-macvtap-ignore" = lib.mkIf withMicroVMs { + matchConfig.Kind = "macvtap"; + linkConfig.ActivationPolicy = "manual"; + linkConfig.Unmanaged = "yes"; + }; + } // lib.flip lib.concatMapAttrs localVLANs ( vlanName: vlanCfg: let @@ -20222,24 +20245,24 @@ A VLAN can also be used as the initrd network - this is however disabled for the }; in - { - "30-vlan-${vlanName}" = if (!withMicroVMs) then me else { - matchConfig.Name = "vlan-${vlanName}"; - # This interface should only be used from attached macvlans. - # So don't acquire a link local address and only wait for - # this interface to gain a carrier. - networkConfig.LinkLocalAddressing = "no"; - networkConfig.MACVLAN = "me-${vlanName}"; - linkConfig.RequiredForOnline = if isRouter then "no" else "carrier"; - }; - "40-me-${vlanName}" = lib.mkIf withMicroVMs (lib.mkDefault me); - } + { + "30-vlan-${vlanName}" = if (!withMicroVMs) then me else { + matchConfig.Name = "vlan-${vlanName}"; + # This interface should only be used from attached macvlans. + # So don't acquire a link local address and only wait for + # this interface to gain a carrier. + networkConfig.LinkLocalAddressing = "no"; + networkConfig.MACVLAN = "me-${vlanName}"; + linkConfig.RequiredForOnline = if isRouter then "no" else "carrier"; + }; + "40-me-${vlanName}" = lib.mkIf withMicroVMs (lib.mkDefault me); + } ); - }; - }; - } + }; + + } #+end_src @@ -20361,7 +20384,7 @@ This section sets up all the imports that are used in the home-manager section. in { # config.swarselsystems = mirrorAttrs; - config.swarselsystems = lib.mkIf (nixosConfig != null) (mkDefaultCommonAttrs config.swarselsystems (nixosConfig.swarselsystems or {})); + config.swarselsystems = lib.mkIf (nixosConfig != null) (mkDefaultCommonAttrs config.swarselsystems (nixosConfig.swarselsystems or { })); } #+end_src @@ -20374,122 +20397,122 @@ Again, we adapt =nix= to our needs, enable the home-manager command for non-NixO #+begin_src nix-ts :tangle modules/home/common/settings.nix { self, outputs, lib, pkgs, config, globals, confLib, ... }: - let - inherit (config.swarselsystems) mainUser flakePath isNixos isLinux; - inherit (confLib.getConfig.repo.secrets.common) atticPublicKey; - in - { - options.swarselmodules.general = lib.mkEnableOption "general nix settings"; - config = + let + inherit (config.swarselsystems) mainUser flakePath isNixos isLinux; + inherit (confLib.getConfig.repo.secrets.common) atticPublicKey; + in + { + options.swarselmodules.general = lib.mkEnableOption "general nix settings"; + config = + let + nix-version = "2_30"; + in + lib.mkIf config.swarselmodules.general { + nix = lib.mkIf (!config.swarselsystems.isNixos) { + package = lib.mkForce pkgs.nixVersions."nix_${nix-version}"; + # extraOptions = '' + # plugin-files = ${pkgs.dev.nix-plugins}/lib/nix/plugins + # extra-builtins-file = ${self + /nix/extra-builtins.nix} + # ''; + extraOptions = let - nix-version = "2_30"; + nix-plugins = pkgs.nix-plugins.override { + nixComponents = pkgs.nixVersions."nixComponents_${nix-version}"; + }; in - lib.mkIf config.swarselmodules.general { - nix = lib.mkIf (!config.swarselsystems.isNixos) { - package = lib.mkForce pkgs.nixVersions."nix_${nix-version}"; - # extraOptions = '' - # plugin-files = ${pkgs.dev.nix-plugins}/lib/nix/plugins - # extra-builtins-file = ${self + /nix/extra-builtins.nix} - # ''; - extraOptions = - let - nix-plugins = pkgs.nix-plugins.override { - nixComponents = pkgs.nixVersions."nixComponents_${nix-version}"; - }; - in - '' - plugin-files = ${nix-plugins}/lib/nix/plugins - extra-builtins-file = ${self + /nix/extra-builtins.nix} - ''; - settings = { - experimental-features = [ - "nix-command" - "flakes" - "ca-derivations" - "cgroups" - "pipe-operators" - ]; - substituters = [ - "https://${globals.services.attic.domain}/${mainUser}" - ]; - trusted-public-keys = [ - atticPublicKey - ]; - trusted-users = [ - "@wheel" - "${mainUser}" - (lib.mkIf ((config.swarselmodules ? server) ? ssh-builder) "builder") - ]; - connect-timeout = 5; - bash-prompt-prefix = lib.mkIf config.swarselsystems.isClient "$SHLVL:\\w "; - bash-prompt = lib.mkIf config.swarselsystems.isClient "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)Ξ» "; - fallback = true; - min-free = 128000000; - max-free = 1000000000; - auto-optimise-store = true; - warn-dirty = false; - max-jobs = 1; - use-cgroups = lib.mkIf isLinux true; + '' + plugin-files = ${nix-plugins}/lib/nix/plugins + extra-builtins-file = ${self + /nix/extra-builtins.nix} + ''; + settings = { + experimental-features = [ + "nix-command" + "flakes" + "ca-derivations" + "cgroups" + "pipe-operators" + ]; + substituters = [ + "https://${globals.services.attic.domain}/${mainUser}" + ]; + trusted-public-keys = [ + atticPublicKey + ]; + trusted-users = [ + "@wheel" + "${mainUser}" + (lib.mkIf ((config.swarselmodules ? server) ? ssh-builder) "builder") + ]; + connect-timeout = 5; + bash-prompt-prefix = lib.mkIf config.swarselsystems.isClient "$SHLVL:\\w "; + bash-prompt = lib.mkIf config.swarselsystems.isClient "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)Ξ» "; + fallback = true; + min-free = 128000000; + max-free = 1000000000; + auto-optimise-store = true; + warn-dirty = false; + max-jobs = 1; + use-cgroups = lib.mkIf isLinux true; + }; + }; + + nixpkgs = lib.mkIf (!isNixos) { + overlays = [ + outputs.overlays.default + (final: prev: + let + additions = final: _: import "${self}/pkgs/config" { + inherit self config lib; + pkgs = final; + homeConfig = config; }; - }; + in + additions final prev + ) + ]; + config = { + allowUnfree = true; + }; + }; - nixpkgs = lib.mkIf (!isNixos) { - overlays = [ - outputs.overlays.default - (final: prev: - let - additions = final: _: import "${self}/pkgs/config" { - inherit self config lib; - pkgs = final; - homeConfig = config; - }; - in - additions final prev - ) - ]; - config = { - allowUnfree = true; - }; - }; + programs = { + # home-manager.enable = lib.mkIf (!isNixos) true; + man = { + enable = true; + generateCaches = true; + }; + }; - programs = { - # home-manager.enable = lib.mkIf (!isNixos) true; - man = { - enable = true; - generateCaches = true; - }; - }; + targets.genericLinux.enable = lib.mkIf (!isNixos) true; - targets.genericLinux.enable = lib.mkIf (!isNixos) true; + home = { + username = lib.mkDefault mainUser; + homeDirectory = lib.mkDefault "/home/${mainUser}"; + stateVersion = lib.mkDefault "23.05"; + keyboard.layout = "us"; + sessionVariables = { + FLAKE = "/home/${mainUser}/.dotfiles"; + }; + extraOutputsToInstall = [ + "doc" + "info" + "devdoc" + ]; + packages = lib.mkIf (!isNixos) [ + (pkgs.symlinkJoin { + name = "home-manager"; + buildInputs = [ pkgs.makeWrapper ]; + paths = [ pkgs.home-manager ]; + postBuild = '' + wrapProgram $out/bin/home-manager \ + --append-flags '--flake ${flakePath}#$(hostname)' + ''; + }) + ]; + }; + }; - home = { - username = lib.mkDefault mainUser; - homeDirectory = lib.mkDefault "/home/${mainUser}"; - stateVersion = lib.mkDefault "23.05"; - keyboard.layout = "us"; - sessionVariables = { - FLAKE = "/home/${mainUser}/.dotfiles"; - }; - extraOutputsToInstall = [ - "doc" - "info" - "devdoc" - ]; - packages = lib.mkIf (!isNixos) [ - (pkgs.symlinkJoin { - name = "home-manager"; - buildInputs = [ pkgs.makeWrapper ]; - paths = [ pkgs.home-manager ]; - postBuild = '' - wrapProgram $out/bin/home-manager \ - --append-flags '--flake ${flakePath}#$(hostname)' - ''; - }) - ]; - }; - }; - - } + } #+end_src **** nixGL @@ -20657,7 +20680,7 @@ This holds packages that I can use as provided, or with small modifications (as tridactyl-native # mako related - mako + # mako libnotify # general utilities @@ -20729,8 +20752,8 @@ This holds packages that I can use as provided, or with small modifications (as # latex and related packages (texlive.combine { inherit (pkgs.texlive) scheme-full - dvisvgm dvipng# for preview and export as html - wrapfig amsmath ulem hyperref capt-of; + dvisvgm dvipng# for preview and export as html + wrapfig amsmath ulem hyperref capt-of; }) # font stuff @@ -20819,18 +20842,18 @@ I use sops-nix to handle secrets that I want to have available on my machines at let inherit (config.swarselsystems) homeDir; in - { - options.swarselmodules.sops = lib.mkEnableOption "sops settings"; - config = lib.optionalAttrs (type != "nixos") { - sops = lib.mkIf (!config.swarselsystems.isNixos) { - age.sshKeyPaths = [ "${if config.swarselsystems.isImpermanence then "/persist" else ""}${homeDir}/.ssh/sops" ]; - # defaultSopsFile = "${if config.swarselsystems.isImpermanence then "/persist" else ""}${homeDir}/.dotfiles/secrets/repo/common.yaml"; - defaultSopsFile = self + "/secrets/repo/common.yaml"; + { + options.swarselmodules.sops = lib.mkEnableOption "sops settings"; + config = lib.optionalAttrs (type != "nixos") { + sops = lib.mkIf (!config.swarselsystems.isNixos) { + age.sshKeyPaths = [ "${if config.swarselsystems.isImpermanence then "/persist" else ""}${homeDir}/.ssh/sops" ]; + # defaultSopsFile = "${if config.swarselsystems.isImpermanence then "/persist" else ""}${homeDir}/.dotfiles/secrets/repo/common.yaml"; + defaultSopsFile = self + "/secrets/repo/common.yaml"; - validateSopsFiles = false; - }; + validateSopsFiles = false; }; - } + }; + } #+end_src **** Yubikey @@ -21275,14 +21298,14 @@ nix-index provides a way to find out which packages are provided by which deriva ''; in - { + { - enable = true; - package = pkgs.symlinkJoin { - name = "nix-index"; - paths = [ commandNotFound ]; - }; + enable = true; + package = pkgs.symlinkJoin { + name = "nix-index"; + paths = [ commandNotFound ]; }; + }; programs.nix-index-database.comma.enable = true; }; } @@ -21645,15 +21668,17 @@ The theme is handled by stylix. config = lib.mkIf config.swarselmodules.kitty { programs.kitty = { enable = true; - keybindings = let - bindWithModifier = lib.mapAttrs' (key: lib.nameValuePair ("ctrl+shift" + key)); - in bindWithModifier { - "page_up" = "scroll_page_up"; - "up" = "scroll_page_up"; - "page_down" = "scroll_page_down"; - "down" = "scroll_page_down"; - "w" = "no_op"; - }; + keybindings = + let + bindWithModifier = lib.mapAttrs' (key: lib.nameValuePair ("ctrl+shift" + key)); + in + bindWithModifier { + "page_up" = "scroll_page_up"; + "up" = "scroll_page_up"; + "page_down" = "scroll_page_down"; + "down" = "scroll_page_down"; + "w" = "no_op"; + }; settings = { cursor_blink_interval = 0; disable_ligatures = "cursor"; @@ -21847,7 +21872,7 @@ Currently I only use it as before with =initExtra= though. github-nixpkgs-review-token = { }; }; - }); + }); } #+end_src @@ -21914,14 +21939,14 @@ Currently I only use it as before with =initExtra= though. copy_command = if pkgs.stdenv.hostPlatform.isLinux then - "wl-copy" + "wl-copy" else if pkgs.stdenv.hostPlatform.isDarwin then - "pbcopy" + "pbcopy" else - ""; + ""; ui.pane_frames = { - rounded_corners = true; - hide_session_name = true; + rounded_corners = true; + hide_session_name = true; }; plugins = { tab-bar.path = "tab-bar"; @@ -24639,434 +24664,434 @@ Currently, I am too lazy to explain every option here, but most of it is very se #+begin_src nix-ts :tangle modules/home/common/sway.nix { config, lib, vars, confLib, ... }: - let - eachOutput = _: monitor: { - inherit (monitor) name; - value = builtins.removeAttrs monitor [ "mode" "name" "scale" "transform" "position" ]; + let + eachOutput = _: monitor: { + inherit (monitor) name; + value = builtins.removeAttrs monitor [ "mode" "name" "scale" "transform" "position" ]; + }; + in + { + options.swarselmodules.sway = lib.mkEnableOption "sway settings"; + options.swarselsystems = { + inputs = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = { }; + }; + monitors = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = { }; + }; + keybindings = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = { }; }; - in - { - options.swarselmodules.sway = lib.mkEnableOption "sway settings"; - options.swarselsystems = { - inputs = lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); - default = { }; - }; - monitors = lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); - default = { }; - }; - keybindings = lib.mkOption { - type = lib.types.attrsOf lib.types.str; - default = { }; - }; - startup = lib.mkOption { - type = lib.types.listOf (lib.types.attrsOf lib.types.str); - default = [ - # { command = "nextcloud --background"; } - # { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } - # { command = "element-desktop --hidden --enable-features=useozoneplatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } - # { command = "anki"; } - # { command = "obsidian"; } - # { command = "nm-applet"; } - # { command = "feishin"; } + startup = lib.mkOption { + type = lib.types.listOf (lib.types.attrsOf lib.types.str); + default = [ + # { command = "nextcloud --background"; } + # { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } + # { command = "element-desktop --hidden --enable-features=useozoneplatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } + # { command = "anki"; } + # { command = "obsidian"; } + # { command = "nm-applet"; } + # { command = "feishin"; } + ]; + }; + kyria = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = { + "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + "7504:24926:Kyria_Keyboard" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; + internal = true; + }; + standardinputs = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; + internal = true; + }; + touchpad = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = { }; + internal = true; + }; + swayfxConfig = lib.mkOption { + type = lib.types.str; + default = '' + blur enable + blur_xray disable + blur_passes 1 + blur_radius 1 + shadows enable + corner_radius 2 + titlebar_separator disable + default_dim_inactive 0.02 + ''; + internal = true; + }; + }; + config = lib.mkIf config.swarselmodules.sway { + swarselsystems = { + touchpad = lib.mkIf config.swarselsystems.isLaptop { + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + drag_lock = "disabled"; + }; + }; + swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " "; + }; + + wayland.windowManager.sway = { + enable = true; + # checkConfig = false; # delete this line once SwayFX is fixed upstream + package = lib.mkIf config.swarselsystems.isNixos null; + systemd = { + enable = true; + xdgAutostart = true; + variables = [ + "DISPLAY" + "WAYLAND_DISPLAY" + "SWAYSOCK" + "XDG_CURRENT_DESKTOP" + "XDG_SESSION_TYPE" + "NIXOS_OZONE_WL" + "XCURSOR_THEME" + "XCURSOR_SIZE" + ]; + }; + wrapperFeatures = { + base = true; + gtk = true; + }; + config = rec { + modifier = "Mod4"; + # terminal = "kitty"; + menu = "fuzzel"; + bars = [{ + command = "waybar"; + mode = "hide"; + hiddenState = "hide"; + position = "top"; + extraConfig = "modifier Mod4"; + }]; + keybindings = + let + inherit (config.wayland.windowManager.sway.config) modifier; + in + lib.recursiveUpdate + { + "${modifier}+0" = "workspace 10:十"; + "${modifier}+1" = "workspace 1:δΈ€"; + "${modifier}+2" = "workspace 2:二"; + "${modifier}+3" = "workspace 3:δΈ‰"; + "${modifier}+4" = "workspace 4:ε››"; + "${modifier}+5" = "workspace 5:δΊ”"; + "${modifier}+6" = "workspace 6:ε…­"; + "${modifier}+7" = "workspace 7:δΈƒ"; + "${modifier}+8" = "workspace 8:ε…«"; + "${modifier}+9" = "workspace 9:九"; + "${modifier}+Ctrl+Shift+c" = "reload"; + "${modifier}+Ctrl+Shift+e" = "move container to workspace 13:E"; + "${modifier}+Ctrl+Shift+f" = "move container to workspace 16:F"; + "${modifier}+Ctrl+Shift+l" = "move container to workspace 15:L"; + "${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M"; + "${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower"; + "${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S"; + "${modifier}+Ctrl+Shift+t" = "move container to workspace 14:T"; + "${modifier}+Ctrl+e" = "workspace 13:E"; + "${modifier}+Ctrl+f" = "workspace 16:F"; + "${modifier}+Ctrl+l" = "workspace 15:L"; + "${modifier}+Ctrl+m" = "workspace 11:M"; + "${modifier}+Ctrl+p" = "exec 1password --quick-acces"; + "${modifier}+Ctrl+s" = "workspace 12:S"; + "${modifier}+Ctrl+t" = "workspace 14:T"; + "${modifier}+Down" = "focus down"; + "${modifier}+Escape" = "exec wlogout"; + "${modifier}+F12" = "scratchpad show"; + "${modifier}+Left" = "focus left"; + "${modifier}+Return" = "exec swarselzellij"; + "${modifier}+Right" = "focus right"; + "${modifier}+Shift+0" = "move container to workspace 10:十"; + "${modifier}+Shift+1" = "move container to workspace 1:δΈ€"; + "${modifier}+Shift+2" = "move container to workspace 2:二"; + "${modifier}+Shift+3" = "move container to workspace 3:δΈ‰"; + "${modifier}+Shift+4" = "move container to workspace 4:ε››"; + "${modifier}+Shift+5" = "move container to workspace 5:δΊ”"; + "${modifier}+Shift+6" = "move container to workspace 6:ε…­"; + "${modifier}+Shift+7" = "move container to workspace 7:δΈƒ"; + "${modifier}+Shift+8" = "move container to workspace 8:ε…«"; + "${modifier}+Shift+9" = "move container to workspace 9:九"; + "${modifier}+Shift+Down" = "move down 40px"; + "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; + "${modifier}+Shift+F12" = "move scratchpad"; + "${modifier}+Shift+Left" = "move left 40px"; + "${modifier}+Shift+Right" = "move right 40px"; + "${modifier}+Shift+Space" = "floating toggle"; + "${modifier}+Shift+Up" = "move up 40px"; + "${modifier}+Shift+a" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-swarsel/open-calendar)'"; + "${modifier}+Shift+c" = "exec qalculate-gtk"; + "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; + "${modifier}+Shift+f" = "exec swaymsg fullscreen"; + "${modifier}+Shift+m" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-mu4e)'"; + "${modifier}+Shift+o" = "exec pass-fuzzel --otp --type"; + "${modifier}+Shift+p" = "exec pass-fuzzel --type"; + "${modifier}+Shift+s" = "exec slurp | grim -g - Pictures/Screenshots/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"; + "${modifier}+Shift+t" = "exec opacitytoggle"; + "${modifier}+Shift+v" = "exec wf-recorder -g '$(slurp -f %o -or)' -f ~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv"; + "${modifier}+Space" = "exec fuzzel"; + "${modifier}+Up" = "focus up"; + "${modifier}+a" = "exec swarselcheck -s"; + "${modifier}+c" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-org-capture)'"; + "${modifier}+d" = "exec swarselcheck -d"; + "${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\""; + "${modifier}+f" = "exec firefox"; + "${modifier}+h" = "exec hyprpicker | wl-copy"; + "${modifier}+m" = "exec swaymsg workspace back_and_forth"; + "${modifier}+o" = "exec pass-fuzzel --otp"; + "${modifier}+p" = "exec pass-fuzzel"; + "${modifier}+q" = "kill"; + "${modifier}+r" = "mode resize"; + "${modifier}+s" = "exec grim -g \"$(slurp)\" -t png - | wl-copy -t image/png"; + "${modifier}+t" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-org-agenda)'"; + "${modifier}+w" = "exec swarselcheck -e"; + "${modifier}+x" = "exec swarselcheck -k"; + # "${modifier}+Escape" = "mode $exit"; + # "${modifier}+Return" = "exec kitty"; + "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; + "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; + "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; + "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; + "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; + "XF86Display" = "exec wl-mirror eDP-1"; + # "--no-repeat Super_L" = "exec killall -SIGUSR1 .waybar-wrapped"; + # "${modifier}+z" = "exec killall -SIGUSR1 .waybar-wrapped"; + } + config.swarselsystems.keybindings; + modes = { + resize = { + Down = "resize grow height 10 px or 10 ppt"; + Escape = "mode default"; + Left = "resize shrink width 10 px or 10 ppt"; + Return = "mode default"; + Right = "resize grow width 10 px or 10 ppt"; + Up = "resize shrink height 10 px or 10 ppt"; + Tab = "move position center, resize set width 50 ppt height 50 ppt"; + }; + }; + defaultWorkspace = "workspace 1:δΈ€"; + # output = { + # "${config.swarselsystems.sharescreen}" = { + # bg = "${self}/files/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}"; + # }; + # "Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = { + # bg = "${self}/files/wallpaper/standwp.png ${config.stylix.imageScalingMode}"; + # }; + # }; + input = config.swarselsystems.standardinputs; + workspaceOutputAssign = + let + workplaceSets = lib.mapAttrs' eachOutput config.swarselsystems.monitors; + workplaceOutputs = map (key: lib.getAttr key workplaceSets) (lib.attrNames workplaceSets); + in + workplaceOutputs; + startup = config.swarselsystems.startup ++ [ + { command = "kitty -T kittyterm -o confirm_os_window_close=0 zellij attach --create kittyterm"; } + { command = "sleep 60; kitty -T spotifytui -o confirm_os_window_close=0 spotify_player"; } + { command = "mako"; } + ]; + seat = { + "*" = { + hide_cursor = "when-typing enable"; + }; + }; + window = { + border = 1; + titlebar = false; + }; + assigns = { + "15:L" = [{ app_id = "teams-for-linux"; }]; + }; + floating = { + border = 1; + criteria = [ + { app_id = "qalculate-gtk"; } + { app_id = "blueman"; } + { app_id = "pavucontrol"; } + { app_id = "syncthingtray"; } + { app_id = "Element"; } + { app_id = "1Password"; } + { app_id = "com.nextcloud.desktopclient.nextcloud"; } + { title = "(?:Open|Save) (?:File|Folder|As)"; } + { title = "^Add$"; } + { title = "^Picture-in-Picture$"; } + { title = "Syncthing Tray"; } + { title = "^Emacs Popup Frame$"; } + { title = "^Emacs Popup Anchor$"; } + { title = "^spotifytui$"; } + { title = "^kittyterm$"; } + { app_id = "vesktop"; } + { window_role = "pop-up"; } + { window_role = "bubble"; } + { window_role = "dialog"; } + { window_role = "task_dialog"; } + { window_role = "menu"; } + { window_role = "Preferences"; } + ]; + titlebar = false; + }; + window = { + commands = [ + { + command = "opacity 0.95"; + criteria = { + class = ".*"; + }; + } + { + command = "opacity 1"; + criteria = { + app_id = "at.yrlf.wl_mirror"; + }; + } + { + command = "opacity 1"; + criteria = { + app_id = "Gimp-2.10"; + }; + } + { + command = "opacity 0.99"; + criteria = { + app_id = "firefox"; + }; + } + { + command = "opacity 0.99"; + criteria = { + app_id = "chromium-browser"; + }; + } + { + command = "sticky enable, shadows enable"; + criteria = { + title = "^Picture-in-Picture$"; + }; + } + { + command = "resize set width 60 ppt height 60 ppt, opacity 0.99, sticky enable"; + criteria = { + title = "^Emacs Popup Frame$"; + }; + } + { + command = "move container to scratchpad"; + criteria = { + title = "^Emacs Popup Anchor$"; + }; + } + { + command = "resize set width 60 ppt height 60 ppt, opacity 0.8, sticky enable, border normal, move container to scratchpad"; + criteria = { + title = "^kittyterm$"; + }; + } + { + command = "resize set width 60 ppt height 60 ppt, opacity 0.95, sticky enable, border normal, move container to scratchpad"; + criteria = { + title = "^spotifytui$"; + }; + } + { + + command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad"; + criteria = { + class = "Spotify"; + }; + } + { + command = "resize set width 60 ppt height 60 ppt, sticky enable"; + criteria = { + app_id = "vesktop"; + }; + } + { + command = "resize set width 60 ppt height 60 ppt, sticky enable"; + criteria = { + class = "Element"; + }; + } + # { + # command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad"; + # criteria = { + # app_id="^$"; + # class="^$"; + # }; + # } ]; }; - kyria = lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); - default = { - "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - "7504:24926:Kyria_Keyboard" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - }; - internal = true; - }; - standardinputs = lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); - default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; - internal = true; - }; - touchpad = lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); - default = { }; - internal = true; - }; - swayfxConfig = lib.mkOption { - type = lib.types.str; - default = '' - blur enable - blur_xray disable - blur_passes 1 - blur_radius 1 - shadows enable - corner_radius 2 - titlebar_separator disable - default_dim_inactive 0.02 - ''; - internal = true; + gaps = { + inner = 5; }; }; - config = lib.mkIf config.swarselmodules.sway { - swarselsystems = { - touchpad = lib.mkIf config.swarselsystems.isLaptop { - "type:touchpad" = { - dwt = "enabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - drag_lock = "disabled"; - }; - }; - swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " "; - }; + extraSessionCommands = '' + export XDG_CURRENT_DESKTOP=sway; + export XDG_SESSION_DESKTOP=sway; + export _JAVA_AWT_WM_NONREPARENTING=1; + export GITHUB_NOTIFICATION_TOKEN_PATH=${confLib.getConfig.sops.secrets.github-notifications-token.path}; + '' + vars.waylandExports; + # extraConfigEarly = " + # exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK + # exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + # "; + extraConfig = + let + inherit (config.wayland.windowManager.sway.config) modifier; + swayfxSettings = config.swarselsystems.swayfxConfig; + in + " + # exec_always autotiling + # set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\" - wayland.windowManager.sway = { - enable = true; - # checkConfig = false; # delete this line once SwayFX is fixed upstream - package = lib.mkIf config.swarselsystems.isNixos null; - systemd = { - enable = true; - xdgAutostart = true; - variables = [ - "DISPLAY" - "WAYLAND_DISPLAY" - "SWAYSOCK" - "XDG_CURRENT_DESKTOP" - "XDG_SESSION_TYPE" - "NIXOS_OZONE_WL" - "XCURSOR_THEME" - "XCURSOR_SIZE" - ]; - }; - wrapperFeatures = { - base = true; - gtk = true; - }; - config = rec { - modifier = "Mod4"; - # terminal = "kitty"; - menu = "fuzzel"; - bars = [{ - command = "waybar"; - mode = "hide"; - hiddenState = "hide"; - position = "top"; - extraConfig = "modifier Mod4"; - }]; - keybindings = - let - inherit (config.wayland.windowManager.sway.config) modifier; - in - lib.recursiveUpdate - { - "${modifier}+0" = "workspace 10:十"; - "${modifier}+1" = "workspace 1:δΈ€"; - "${modifier}+2" = "workspace 2:二"; - "${modifier}+3" = "workspace 3:δΈ‰"; - "${modifier}+4" = "workspace 4:ε››"; - "${modifier}+5" = "workspace 5:δΊ”"; - "${modifier}+6" = "workspace 6:ε…­"; - "${modifier}+7" = "workspace 7:δΈƒ"; - "${modifier}+8" = "workspace 8:ε…«"; - "${modifier}+9" = "workspace 9:九"; - "${modifier}+Ctrl+Shift+c" = "reload"; - "${modifier}+Ctrl+Shift+e" = "move container to workspace 13:E"; - "${modifier}+Ctrl+Shift+f" = "move container to workspace 16:F"; - "${modifier}+Ctrl+Shift+l" = "move container to workspace 15:L"; - "${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M"; - "${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower"; - "${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S"; - "${modifier}+Ctrl+Shift+t" = "move container to workspace 14:T"; - "${modifier}+Ctrl+e" = "workspace 13:E"; - "${modifier}+Ctrl+f" = "workspace 16:F"; - "${modifier}+Ctrl+l" = "workspace 15:L"; - "${modifier}+Ctrl+m" = "workspace 11:M"; - "${modifier}+Ctrl+p" = "exec 1password --quick-acces"; - "${modifier}+Ctrl+s" = "workspace 12:S"; - "${modifier}+Ctrl+t" = "workspace 14:T"; - "${modifier}+Down" = "focus down"; - "${modifier}+Escape" = "exec wlogout"; - "${modifier}+F12" = "scratchpad show"; - "${modifier}+Left" = "focus left"; - "${modifier}+Return" = "exec swarselzellij"; - "${modifier}+Right" = "focus right"; - "${modifier}+Shift+0" = "move container to workspace 10:十"; - "${modifier}+Shift+1" = "move container to workspace 1:δΈ€"; - "${modifier}+Shift+2" = "move container to workspace 2:二"; - "${modifier}+Shift+3" = "move container to workspace 3:δΈ‰"; - "${modifier}+Shift+4" = "move container to workspace 4:ε››"; - "${modifier}+Shift+5" = "move container to workspace 5:δΊ”"; - "${modifier}+Shift+6" = "move container to workspace 6:ε…­"; - "${modifier}+Shift+7" = "move container to workspace 7:δΈƒ"; - "${modifier}+Shift+8" = "move container to workspace 8:ε…«"; - "${modifier}+Shift+9" = "move container to workspace 9:九"; - "${modifier}+Shift+Down" = "move down 40px"; - "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; - "${modifier}+Shift+F12" = "move scratchpad"; - "${modifier}+Shift+Left" = "move left 40px"; - "${modifier}+Shift+Right" = "move right 40px"; - "${modifier}+Shift+Space" = "floating toggle"; - "${modifier}+Shift+Up" = "move up 40px"; - "${modifier}+Shift+a" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-swarsel/open-calendar)'"; - "${modifier}+Shift+c" = "exec qalculate-gtk"; - "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; - "${modifier}+Shift+f" = "exec swaymsg fullscreen"; - "${modifier}+Shift+m" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-mu4e)'"; - "${modifier}+Shift+o" = "exec pass-fuzzel --otp --type"; - "${modifier}+Shift+p" = "exec pass-fuzzel --type"; - "${modifier}+Shift+s" = "exec slurp | grim -g - Pictures/Screenshots/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"; - "${modifier}+Shift+t" = "exec opacitytoggle"; - "${modifier}+Shift+v" = "exec wf-recorder -g '$(slurp -f %o -or)' -f ~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv"; - "${modifier}+Space" = "exec fuzzel"; - "${modifier}+Up" = "focus up"; - "${modifier}+a" = "exec swarselcheck -s"; - "${modifier}+c" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-org-capture)'"; - "${modifier}+d" = "exec swarselcheck -d"; - "${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\""; - "${modifier}+f" = "exec firefox"; - "${modifier}+h" = "exec hyprpicker | wl-copy"; - "${modifier}+m" = "exec swaymsg workspace back_and_forth"; - "${modifier}+o" = "exec pass-fuzzel --otp"; - "${modifier}+p" = "exec pass-fuzzel"; - "${modifier}+q" = "kill"; - "${modifier}+r" = "mode resize"; - "${modifier}+s" = "exec grim -g \"$(slurp)\" -t png - | wl-copy -t image/png"; - "${modifier}+t" = "exec emacsclient -cF '((name . \"Emacs Popup Anchor\"))' -e '(prot-window-popup-org-agenda)'"; - "${modifier}+w" = "exec swarselcheck -e"; - "${modifier}+x" = "exec swarselcheck -k"; - # "${modifier}+Escape" = "mode $exit"; - # "${modifier}+Return" = "exec kitty"; - "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; - "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; - "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; - "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; - "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; - "XF86Display" = "exec wl-mirror eDP-1"; - # "--no-repeat Super_L" = "exec killall -SIGUSR1 .waybar-wrapped"; - # "${modifier}+z" = "exec killall -SIGUSR1 .waybar-wrapped"; - } - config.swarselsystems.keybindings; - modes = { - resize = { - Down = "resize grow height 10 px or 10 ppt"; - Escape = "mode default"; - Left = "resize shrink width 10 px or 10 ppt"; - Return = "mode default"; - Right = "resize grow width 10 px or 10 ppt"; - Up = "resize shrink height 10 px or 10 ppt"; - Tab = "move position center, resize set width 50 ppt height 50 ppt"; - }; - }; - defaultWorkspace = "workspace 1:δΈ€"; - # output = { - # "${config.swarselsystems.sharescreen}" = { - # bg = "${self}/files/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}"; - # }; - # "Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = { - # bg = "${self}/files/wallpaper/standwp.png ${config.stylix.imageScalingMode}"; - # }; - # }; - input = config.swarselsystems.standardinputs; - workspaceOutputAssign = - let - workplaceSets = lib.mapAttrs' eachOutput config.swarselsystems.monitors; - workplaceOutputs = map (key: lib.getAttr key workplaceSets) (lib.attrNames workplaceSets); - in - workplaceOutputs; - startup = config.swarselsystems.startup ++ [ - { command = "kitty -T kittyterm -o confirm_os_window_close=0 zellij attach --create kittyterm"; } - { command = "sleep 60; kitty -T spotifytui -o confirm_os_window_close=0 spotify_player"; } - { command = "mako"; } - ]; - seat = { - "*" = { - hide_cursor = "when-typing enable"; - }; - }; - window = { - border = 1; - titlebar = false; - }; - assigns = { - "15:L" = [{ app_id = "teams-for-linux"; }]; - }; - floating = { - border = 1; - criteria = [ - { app_id = "qalculate-gtk"; } - { app_id = "blueman"; } - { app_id = "pavucontrol"; } - { app_id = "syncthingtray"; } - { app_id = "Element"; } - { app_id = "1Password"; } - { app_id = "com.nextcloud.desktopclient.nextcloud"; } - { title = "(?:Open|Save) (?:File|Folder|As)"; } - { title = "^Add$"; } - { title = "^Picture-in-Picture$"; } - { title = "Syncthing Tray"; } - { title = "^Emacs Popup Frame$"; } - { title = "^Emacs Popup Anchor$"; } - { title = "^spotifytui$"; } - { title = "^kittyterm$"; } - { app_id = "vesktop"; } - { window_role = "pop-up"; } - { window_role = "bubble"; } - { window_role = "dialog"; } - { window_role = "task_dialog"; } - { window_role = "menu"; } - { window_role = "Preferences"; } - ]; - titlebar = false; - }; - window = { - commands = [ - { - command = "opacity 0.95"; - criteria = { - class = ".*"; - }; - } - { - command = "opacity 1"; - criteria = { - app_id = "at.yrlf.wl_mirror"; - }; - } - { - command = "opacity 1"; - criteria = { - app_id = "Gimp-2.10"; - }; - } - { - command = "opacity 0.99"; - criteria = { - app_id = "firefox"; - }; - } - { - command = "opacity 0.99"; - criteria = { - app_id = "chromium-browser"; - }; - } - { - command = "sticky enable, shadows enable"; - criteria = { - title = "^Picture-in-Picture$"; - }; - } - { - command = "resize set width 60 ppt height 60 ppt, opacity 0.99, sticky enable"; - criteria = { - title = "^Emacs Popup Frame$"; - }; - } - { - command = "move container to scratchpad"; - criteria = { - title = "^Emacs Popup Anchor$"; - }; - } - { - command = "resize set width 60 ppt height 60 ppt, opacity 0.8, sticky enable, border normal, move container to scratchpad"; - criteria = { - title = "^kittyterm$"; - }; - } - { - command = "resize set width 60 ppt height 60 ppt, opacity 0.95, sticky enable, border normal, move container to scratchpad"; - criteria = { - title = "^spotifytui$"; - }; - } - { + # mode $exit { + # bindsym --to-code { + # s exec \"systemctl suspend\", mode \"default\" + # h exec \"systemctl hibernate\", mode \"default\" + # l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\ + # p exec \"systemctl poweroff\" + # r exec \"systemctl reboot\" + # u exec \"swaymsg exit\" - command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad"; - criteria = { - class = "Spotify"; - }; - } - { - command = "resize set width 60 ppt height 60 ppt, sticky enable"; - criteria = { - app_id = "vesktop"; - }; - } - { - command = "resize set width 60 ppt height 60 ppt, sticky enable"; - criteria = { - class = "Element"; - }; - } - # { - # command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad"; - # criteria = { - # app_id="^$"; - # class="^$"; - # }; + # Return mode \"default\" + # Escape mode \"default\" + # ${modifier}+Escape mode \"default\" + # } # } - ]; - }; - gaps = { - inner = 5; - }; - }; - extraSessionCommands = '' - export XDG_CURRENT_DESKTOP=sway; - export XDG_SESSION_DESKTOP=sway; - export _JAVA_AWT_WM_NONREPARENTING=1; - export GITHUB_NOTIFICATION_TOKEN_PATH=${confLib.getConfig.sops.secrets.github-notifications-token.path}; - '' + vars.waylandExports; - # extraConfigEarly = " - # exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK - # exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK - # "; - extraConfig = - let - inherit (config.wayland.windowManager.sway.config) modifier; - swayfxSettings = config.swarselsystems.swayfxConfig; - in - " - # exec_always autotiling - # set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\" - # mode $exit { - # bindsym --to-code { - # s exec \"systemctl suspend\", mode \"default\" - # h exec \"systemctl hibernate\", mode \"default\" - # l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\ - # p exec \"systemctl poweroff\" - # r exec \"systemctl reboot\" - # u exec \"swaymsg exit\" + exec systemctl --user import-environment + # exec swayidle -w - # Return mode \"default\" - # Escape mode \"default\" - # ${modifier}+Escape mode \"default\" - # } - # } + seat * hide_cursor 2000 - exec systemctl --user import-environment - # exec swayidle -w + exec_always kill -1 $(pidof kanshi) - seat * hide_cursor 2000 + bindswitch --locked lid:on exec kanshictl switch lidclosed + bindswitch --locked lid:off exec kanshictl switch lidopen - exec_always kill -1 $(pidof kanshi) - - bindswitch --locked lid:on exec kanshictl switch lidclosed - bindswitch --locked lid:off exec kanshictl switch lidopen - - ${swayfxSettings} - "; - }; - }; - } + ${swayfxSettings} + "; + }; + }; + } #+end_src **** Kanshi @@ -25101,7 +25126,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se # laptop screen output = { criteria = config.swarselsystems.sharescreen; - mode = config.swarselsystems.highResolution; + mode = "${config.swarselsystems.highResolution}@165.000"; scale = 1.0; }; } @@ -25135,7 +25160,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se name = "lidopen"; exec = [ "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/landscape/standwp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { @@ -25160,7 +25185,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se in { name = "lidclosed"; - exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" ]; + exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/landscape/standwp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { criteria = config.swarselsystems.sharescreen; @@ -25182,6 +25207,88 @@ Currently, I am too lazy to explain every option here, but most of it is very se } #+end_src +**** Shikane + +#+begin_src nix-ts :tangle modules/home/common/shikane.nix + { lib, config, confLib, ... }: + { + options.swarselmodules.shikane = lib.mkEnableOption "kanshi settings"; + config = lib.mkIf config.swarselmodules.shikane { + + systemd.user.services.shikane = confLib.overrideTarget "noctalia-shell.target"; + services.shikane = { + enable = true; + settings = + let + homeMonitor = [ + "m=PHL BDM3270" + "s=AU11806002320" + "v=Philips Consumer Electronics Company" + ]; + exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""]; + in + { + profile = [ + + { + name = "internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + mode = "${config.swarselsystems.highResolution}@165.000"; + scale = 1.0; + } + ]; + } + + { + name = "home-internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + scale = 1.7; + position = "2560,0"; + } + { + match = homeMonitor; + enable = true; + scale = 1.0; + mode = "2560x1440"; + position = "0,0"; + } + ]; + } + + { + name = "home-internal-off"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = false; + position = "2560,0"; + } + { + match = homeMonitor; + scale = 1.0; + enable = true; + mode = "2560x1440"; + position = "0,0"; + } + ]; + } + + ]; + }; + }; + }; + } +#+end_src + **** gpg-agent :PROPERTIES: :CUSTOM_ID: h:7d384e3b-1be7-4644-b304-ada4af0b692b @@ -25337,9 +25444,11 @@ This service changes the screen hue at night. I am not sure if that really does "${config.programs.obsidian.vaults.${name}.target}/.obsidian/core-plugins.json".force = true; }; - programs.obsidian = let - pluginSource = pkgs.nur.repos.swarsel; - in { + programs.obsidian = + let + pluginSource = pkgs.nur.repos.swarsel; + in + { enable = true; package = pkgs.obsidian; defaultSettings = { @@ -25608,11 +25717,11 @@ This service changes the screen hue at night. I am not sure if that really does enable = true; settings = { inherit irc_nick1; - }; }; }; + }; - } + } #+end_src **** obs-studio @@ -25631,10 +25740,10 @@ This service changes the screen hue at night. I am not sure if that really does config = lib.mkIf config.swarselmodules.${moduleName} { programs.${moduleName} = { enable = true; - }; }; + }; - } + } #+end_src **** spotify-player @@ -25652,10 +25761,10 @@ This service changes the screen hue at night. I am not sure if that really does config = lib.mkIf config.swarselmodules.${moduleName} { programs.${moduleName} = { enable = true; - }; }; + }; - } + } #+end_src **** vesktop @@ -25668,7 +25777,7 @@ This service changes the screen hue at night. I am not sure if that really does let moduleName = "vesktop"; in - { + { options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings"; config = lib.mkIf config.swarselmodules.${moduleName} { programs.${moduleName} = { @@ -25756,27 +25865,27 @@ This service changes the screen hue at night. I am not sure if that really does let moduleName = "batsignal"; in - { - options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings"; - config = lib.mkIf config.swarselmodules.${moduleName} { - services.${moduleName} = { - enable = true; - extraArgs = [ - "-W" - " Consider charging the battery" - "-C" - " Battery is low; plug in charger now" - "-D" - " Device will lose power in a few seconds" - "-c" - "10" - "-d" - "5" - ]; - }; + { + options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings"; + config = lib.mkIf config.swarselmodules.${moduleName} { + services.${moduleName} = { + enable = true; + extraArgs = [ + "-W" + " Consider charging the battery" + "-C" + " Battery is low; plug in charger now" + "-D" + " Device will lose power in a few seconds" + "-c" + "10" + "-d" + "5" + ]; }; + }; - } + } #+end_src **** autotiling @@ -25831,12 +25940,13 @@ This service changes the screen hue at night. I am not sure if that really does # { timeout = 300; command = "${swaylock} -f"; } { timeout = 300; command = "${noctalia} lockScreen lock || ${swaylock} -f"; } # { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on''; } - { timeout = 600; command = "${noctalia} sessionMenu lockAndSuspend || ${suspend}"; } + # { timeout = 600; command = "${noctalia} sessionMenu lockAndSuspend || ${suspend}"; } + { timeout = 600; command = "${suspend}"; } ]; events = { - # { event = "before-sleep"; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; } + # { event = "before-sleep"; command = "${noctalia} lockScreen lock || ${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; } # { event = "after-resume"; command = "${swaylock} -f "; } - # before-sleep = "${swaylock} -f "; + before-sleep = "${noctalia} lockScreen lock || ${swaylock} -f "; # lock = "${swaylock} -f "; }; }; @@ -26021,8 +26131,9 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. programs.niri = { package = pkgs.niri-stable; # which package to use for niri validation settings = { + gestures.hot-corners.enable = false; debug = { - honor-xdg-activation-with-invalid-serial = []; + honor-xdg-activation-with-invalid-serial = [ ]; }; xwayland-satellite = { enable = true; @@ -26030,7 +26141,7 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. }; prefer-no-csd = true; layer-rules = [ - { matches = [{ namespace = "^notifications$"; }]; block-out-from = "screen-capture"; } + { matches = [{ namespace = "^notificatioans$"; }]; block-out-from = "screen-capture"; } { matches = [{ namespace = "^wallpaper$"; }]; place-within-backdrop = true; } { matches = [{ namespace = "^noctalia-overview*"; }]; place-within-backdrop = true; } ]; @@ -26070,11 +26181,11 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. { matches = [{ app-id = "^spotifytui$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; } { matches = [{ app-id = "^kittyterm$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; } ]; - environment = { + environment = vars.waylandSessionVariables // { DISPLAY = ":0"; QT_QPA_PLATFORM = lib.mkForce "wayland"; EDITOR = "emacsclient -c"; - } // vars.waylandSessionVariables; + }; screenshot-path = "~/Pictures/Screenshots/screenshot_%Y-%m-%d-%H%M%S.png"; input = { mod-key = "Super"; @@ -26118,17 +26229,18 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. }; binds = with config.lib.niri.actions; let sh = spawn "sh" "-c"; - resizer = "niri-resize"; + resizer = "niri-resize & sleep 0.05"; in { "Mod+Shift+t".action = toggle-window-rule-opacity; "Mod+m".action = focus-workspace-previous; "Mod+Shift+Space".action = toggle-window-floating; "Mod+Shift+f".action = fullscreen-window; - "Mod+q".action = sh "niri msg action close-window & ${resizer}"; - "Mod+f".action = sh "${resizer} & firefox"; + "Mod+q".action = sh "${resizer} && niri msg action close-window"; + "Mod+f".action = sh "${resizer} && exec firefox"; # "Mod+Space".action = spawn "noctalia-shell" "ipc" "call" "launcher" "toggle"; - "Mod+Space".action = sh "${resizer} & fuzzel"; + "Mod+Space".action = sh "${resizer} && exec noctalia-shell ipc call launcher toggle"; + # "Mod+Space".action = sh "${resizer} & exec fuzzel"; "Mod+z".action = spawn "noctalia-shell" "ipc" "call" "bar" "toggle"; "Mod+Shift+c".action = spawn "qalculate-gtk"; "Mod+Ctrl+p".action = spawn "1password" "--quick-acces"; @@ -26142,11 +26254,11 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. "Mod+Shift+s".action.screenshot-window = { write-to-disk = true; }; # "Mod+Shift+v".action = spawn "wf-recorder" "-g" "'$(slurp -f %o -or)'" "-f" "~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv"; - "Mod+e".action = sh "${resizer} & emacsclient -nquc -a emacs -e '(dashboard-open)'"; - "Mod+c".action = sh "${resizer} & emacsclient -ce '(org-capture)'"; - "Mod+t".action = sh "${resizer} & emacsclient -ce '(org-agenda)'"; - "Mod+Shift+m".action = sh "${resizer} & emacsclient -ce '(mu4e)'"; - "Mod+Shift+a".action = sh "${resizer} & emacsclient -ce '(swarsel/open-calendar)'"; + "Mod+e".action = sh "${resizer} && exec emacsclient -nquc -a emacs -e '(dashboard-open)'"; + "Mod+c".action = sh "${resizer} && exec emacsclient -ce '(org-capture)'"; + "Mod+t".action = sh "${resizer} && exec emacsclient -ce '(org-agenda)'"; + "Mod+Shift+m".action = sh "${resizer} && exec emacsclient -ce '(mu4e)'"; + "Mod+Shift+a".action = sh "${resizer} && exec emacsclient -ce '(swarsel/open-calendar)'"; "Mod+a".action = spawn "swarselcheck-niri" "-s"; "Mod+x".action = spawn "swarselcheck-niri" "-k"; @@ -26162,8 +26274,8 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. "Mod+Right".action = focus-column-or-monitor-right; "Mod+Down".action = focus-window-or-workspace-down; "Mod+Up".action = focus-window-or-workspace-up; - "Mod+Shift+Left".action = move-column-left; - "Mod+Shift+Right".action = move-column-right; + "Mod+Shift+Left".action = move-column-left-or-to-monitor-left; + "Mod+Shift+Right".action = move-column-right-or-to-monitor-right; "Mod+Shift+Down".action = move-window-down-or-to-workspace-down; "Mod+Shift+Up".action = move-window-up-or-to-workspace-up; # "Mod+Ctrl+Shift+c".action = "reload"; @@ -26171,7 +26283,7 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. # "Mod+Shift+e".action = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; # "Mod+r".action = "mode resize"; # "Mod+Return".action = "exec kitty"; - "Mod+Return".action = sh "${resizer} & exec kitty -o confirm_os_window_close=0"; + "Mod+Return".action = sh "${resizer} && exec kitty -o confirm_os_window_close=0"; "XF86AudioRaiseVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "increase"; "XF86AudioLowerVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "decrease"; "XF86AudioMute".action = spawn "noctalia-shell" "ipc" "call" "volume" "muteOutput"; @@ -26216,13 +26328,13 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. # { command = [ "nm-applet" ]; } # { command = [ "niri" "msg" "action" "focus-workspace" "2" ]; } # { command = [ "noctalia-shell" ]; } - { command = [ "pkill mako" ]; } - { command = [ "systemctl" "--user" "start" "noctalia-shell.target" ]; } + # { argv = [ "pkill" "mako" ]; } + { argv = [ "systemctl" "--user" "restart" "noctalia-shell.target" "tray.target" ]; } ]; # workspaces = { - # "01-Main" = { - # name = "Scratchpad"; - # }; + # "01-Main" = { + # name = "Scratchpad"; + # }; # "99-Scratchpad" = { # name = "ο‹’"; # }; @@ -26235,8 +26347,11 @@ Akin to the [[#h:f9aa9af0-9b8d-43ff-901d-9ffccdd70589][Optional]] NixOS modules. #+end_src **** Noctalia +:PROPERTIES: +:CUSTOM_ID: h:385cc6c7-416c-4570-a5d3-bf8fb7c841e7 +:END: -Apart from configuring Noctalia, I here also add some systemd chains to make sure the Noctalia tray is actually ready to receive tray icons. For this I add another target =noctalia-tray-pre.target= that simply waits 5 seconds, which should be sufficient. +Apart from configuring Noctalia, I here also add some systemd chains to make sure the Noctalia tray is actually ready to receive tray icons. #+begin_src nix-ts :tangle modules/home/optional/noctalia.nix { self, inputs, config, pkgs, lib, confLib, ... }: @@ -26249,43 +26364,27 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur targets = { noctalia-shell.Unit = { After = [ "graphical-session.target" ]; - Wants = [ - "tray.target" - "noctalia-tray-pre.target" - ]; }; tray = { Unit = { - After = [ "noctalia-tray-pre.target" ]; + After = [ "noctalia-init.service" ]; PartOf = [ "noctalia-shell.service" ]; }; Install.WantedBy = [ "noctalia-shell.target" ]; }; - noctalia-tray-pre = { - Unit = { - After = [ - "noctalia-init.service" - ]; - }; - Install.WantedBy = [ "noctalia-shell.target" ]; - }; }; services = { noctalia-shell = confLib.overrideTarget "noctalia-shell.target"; noctalia-init = { - Unit = { - PartOf = [ "noctalia-tray-pre.target" ]; - }; Service = { Type = "oneshot"; - ExecStartPre = "${pkgs.coreutils}/bin/sleep 5"; - ExecStart = "-${pkgs.busybox}/bin/pkill mako"; + ExecStart = "${pkgs.coreutils}/bin/sleep 15"; RemainAfterExit = true; }; Install = { - WantedBy = [ "noctalia-tray-pre.target" ]; + WantedBy = [ "noctalia-shell.target" ]; }; }; }; @@ -26313,7 +26412,7 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur marginHorizontal = 0; frameThickness = 8; frameRadius = 12; - outerCorners = true; + outerCorners = false; hideOnOverview = false; displayMode = "auto_hide"; autoHideDelay = 100; @@ -26322,29 +26421,54 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur widgets = { left = [ { - characterCount = 2; + characterCount = 4; colorizeIcons = false; emptyColor = "primary"; enableScrollWheel = false; focusedColor = "secondary"; followFocusedScreen = false; groupedBorderOpacity = 1; - hideUnoccupied = true; + hideUnoccupied = false; iconScale = 0.5; id = "Workspace"; - labelMode = "none"; + labelMode = "name"; occupiedColor = "primary"; pillSize = 0.4; reverseScroll = false; showApplications = true; showBadge = true; - showLabelsOnlyWhenOccupied = true; + showLabelsOnlyWhenOccupied = false; unfocusedIconsOpacity = 0.25; } + + { + defaultSettings = { + completedCount = 0; + count = 0; + current_page_id = 0; + isExpanded = false; + pages = [ + { + id = 0; + name = "General"; + } + ]; + priorityColors = { + high = "#f44336"; + low = "#9e9e9e"; + medium = "#2196f3"; + }; + showBackground = true; + showCompleted = true; + todos = []; + useCustomColors = false; + }; + id = "plugin:todo"; + } ]; center = [ { - colorizeIcons = false; + colorizeIcons = true; hideMode = "hidden"; id = "ActiveWindow"; maxWidth = 145; @@ -26375,6 +26499,17 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur id = "Volume"; middleClickCommand = "pavucontrol"; } + { + id = "NotificationHistory"; + hideWhenZero = false; + showUnreadBadge = true; + } + { + id = "plugin:ba7043:github-feed"; + } + { + id = "plugin:clipper"; + } { displayMode = "onhover"; id = "Network"; @@ -26395,12 +26530,6 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur showNoctaliaPerformance = false; showPowerProfiles = true; } - { - id = "plugin:ba7043:github-feed"; - } - { - id = "plugin:clipper"; - } { colorName = "primary"; id = "SessionMenu"; @@ -26417,17 +26546,17 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur { colorizeDistroLogo = false; colorizeSystemIcon = "primary"; - customIconPath = ""; + customIconPath = "${self}/files/icons/swarsel.png"; enableColorization = true; icon = "noctalia"; id = "ControlCenter"; - useDistroLogo = true; + useDistroLogo = false; } ]; }; }; general = { - avatarImage = "${self}/files/wallpaper/swarsel.png"; + avatarImage = "${self}/files/icons/swarsel.png"; dimmerOpacity = 0.2; showScreenCorners = false; forceBlackScreenCorners = false; @@ -26436,16 +26565,16 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur iRadiusRatio = 1; boxRadiusRatio = 1; screenRadiusRatio = 1; - animationSpeed = 1; + animationSpeed = 1.5; animationDisabled = false; compactLockScreen = true; lockOnSuspend = true; showSessionButtonsOnLockScreen = true; showHibernateOnLockScreen = false; enableShadows = true; - shadowDirection = "bottom_right"; - shadowOffsetX = 2; - shadowOffsetY = 3; + shadowDirection = "center"; + shadowOffsetX = 0; + shadowOffsetY = 0; language = ""; allowPanelsOnScreenWithoutBar = true; showChangelogOnStartup = true; @@ -26501,17 +26630,17 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur wallpaper = { enabled = true; overviewEnabled = true; - directory = "${self}/files/wallpaper"; + directory = "${self}/files/wallpaper/landscape"; monitorDirectories = [ ]; enableMultiMonitorDirectories = true; showHiddenFiles = false; viewMode = "single"; - setWallpaperOnAllMonitors = true; + setWallpaperOnAllMonitors = false; fillMode = "crop"; fillColor = "#000000"; useSolidColor = false; solidColor = "#1a1a2e"; - automationEnabled = false; + automationEnabled = true; wallpaperChangeMode = "random"; randomIntervalSec = 300; transitionDuration = 500; @@ -26777,11 +26906,11 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur "unicode-picker" "screen-recorder" ]) // { - github-feed = { - enabled = true; - sourceUrl = "https://github.com/Swarsel/noctalia-plugins"; - }; - }; + github-feed = { + enabled = true; + sourceUrl = "https://github.com/Swarsel/noctalia-plugins"; + }; + }; }; pluginSettings = { clipper = { @@ -26827,7 +26956,7 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur colorizationEnabled = true; colorizationIcon = "Primary"; colorizationBadge = "Tertiary"; - colorizationBadgeText = "Primary"; + colorizationBadgeText = "None"; defaultTab = 1; enableSystemNotifications = true; notifyGitHubNotifications = true; @@ -26854,7 +26983,7 @@ Apart from configuring Noctalia, I here also add some systemd chains to make sur The rest of the settings is at [[#h:fb3f3e01-7df4-4b06-9e91-aa9cac61a431][gaming]]. #+begin_src nix-ts :tangle modules/home/optional/gaming.nix - { config, pkgs, confLib, ... }: + { config, pkgs, confLib, ... }: let inherit (config.swarselsystems) isNixos; in @@ -26931,694 +27060,772 @@ When setting up a new machine: #+begin_src nix-ts :tangle modules/home/optional/work.nix :noweb yes { self, config, pkgs, lib, vars, confLib, type, ... }: - let - inherit (config.swarselsystems) homeDir mainUser; - inherit (confLib.getConfig.repo.secrets.local.mail) allMailAddresses; - inherit (confLib.getConfig.repo.secrets.local.work) mailAddress; + let + inherit (config.swarselsystems) homeDir mainUser; + inherit (confLib.getConfig.repo.secrets.local.mail) allMailAddresses; + inherit (confLib.getConfig.repo.secrets.local.work) mailAddress; - certsSopsFile = self + /secrets/repo/certs.yaml; - in - { - options.swarselmodules.optional-work = lib.swarselsystems.mkTrueOption; - config = { - home = { - packages = with pkgs; [ - stable.teams-for-linux - shellcheck - dig - docker - postman - # rclone - libguestfs-with-appliance - prometheus.cli - tigervnc - # openstackclient + certsSopsFile = self + /secrets/repo/certs.yaml; + in + { + options.swarselmodules.optional-work = lib.swarselsystems.mkTrueOption; + config = { + home = { + packages = with pkgs; [ + stable.teams-for-linux + shellcheck + dig + docker + postman + # rclone + libguestfs-with-appliance + prometheus.cli + tigervnc + # openstackclient - vscode - dev.antigravity + vscode + dev.antigravity - rustdesk-vbc - ]; - sessionVariables = { - AWS_CA_BUNDLE = confLib.getConfig.sops.secrets.harica-root-ca.path; + rustdesk-vbc + ]; + sessionVariables = { + AWS_CA_BUNDLE = confLib.getConfig.sops.secrets.harica-root-ca.path; + }; + }; + systemd.user.sessionVariables = { + DOCUMENT_DIR_WORK = lib.mkForce "${homeDir}/Documents/Work"; + } // lib.optionalAttrs (!config.swarselsystems.isPublic) { + SWARSEL_MAIL_ALL = lib.mkForce allMailAddresses; + SWARSEL_MAIL_WORK = lib.mkForce mailAddress; + }; + + accounts.email.accounts.work = + let + inherit (confLib.getConfig.repo.secrets.local.work) mailName; + in + { + primary = false; + address = mailAddress; + userName = mailAddress; + realName = mailName; + passwordCommand = "pizauth show work"; + imap = { + host = "outlook.office365.com"; + port = 993; + tls.enable = true; # SSL/TLS + }; + smtp = { + host = "outlook.office365.com"; + port = 587; + tls = { + enable = true; # SSL/TLS + useStartTls = true; }; }; - systemd.user.sessionVariables = { - DOCUMENT_DIR_WORK = lib.mkForce "${homeDir}/Documents/Work"; - } // lib.optionalAttrs (!config.swarselsystems.isPublic) { - SWARSEL_MAIL_ALL = lib.mkForce allMailAddresses; - SWARSEL_MAIL_WORK = lib.mkForce mailAddress; + thunderbird = { + enable = true; + profiles = [ "default" ]; + settings = id: { + "mail.smtpserver.smtp_${id}.authMethod" = 10; # oauth + "mail.server.server_${id}.authMethod" = 10; # oauth + # "toolkit.telemetry.enabled" = false; + # "toolkit.telemetry.rejected" = true; + # "toolkit.telemetry.prompted" = 2; + }; }; - - accounts.email.accounts.work = - let - inherit (confLib.getConfig.repo.secrets.local.work) mailName; - in - { - primary = false; - address = mailAddress; - userName = mailAddress; - realName = mailName; - passwordCommand = "pizauth show work"; - imap = { - host = "outlook.office365.com"; - port = 993; - tls.enable = true; # SSL/TLS - }; - smtp = { - host = "outlook.office365.com"; - port = 587; - tls = { - enable = true; # SSL/TLS - useStartTls = true; - }; - }; - thunderbird = { - enable = true; - profiles = [ "default" ]; - settings = id: { - "mail.smtpserver.smtp_${id}.authMethod" = 10; # oauth - "mail.server.server_${id}.authMethod" = 10; # oauth - # "toolkit.telemetry.enabled" = false; - # "toolkit.telemetry.rejected" = true; - # "toolkit.telemetry.prompted" = 2; - }; - }; - msmtp = { - enable = true; - extraConfig = { - auth = "xoauth2"; - host = "outlook.office365.com"; - protocol = "smtp"; - port = "587"; - tls = "on"; - tls_starttls = "on"; - from = "${mailAddress}"; - user = "${mailAddress}"; - passwordeval = "pizauth show work"; - }; - }; - mu.enable = true; - mbsync = { - enable = true; - expunge = "both"; - patterns = [ "INBOX" ]; - extraConfig = { - account = { - AuthMechs = "XOAUTH2"; - }; - }; - }; + msmtp = { + enable = true; + extraConfig = { + auth = "xoauth2"; + host = "outlook.office365.com"; + protocol = "smtp"; + port = "587"; + tls = "on"; + tls_starttls = "on"; + from = "${mailAddress}"; + user = "${mailAddress}"; + passwordeval = "pizauth show work"; + }; + }; + mu.enable = true; + mbsync = { + enable = true; + expunge = "both"; + patterns = [ "INBOX" ]; + extraConfig = { + account = { + AuthMechs = "XOAUTH2"; }; + }; + }; + }; - # wayland.windowManager.sway.config = { - # output = { - # "Applied Creative Technology Transmitter QUATTRO201811" = { - # bg = "${self}/files/wallpaper/navidrome.png ${config.stylix.imageScalingMode}"; - # }; - # "Hewlett Packard HP Z24i CN44250RDT" = { - # bg = "${self}/files/wallpaper/op6wp.png ${config.stylix.imageScalingMode}"; - # }; - # "HP Inc. HP 732pk CNC4080YL5" = { - # bg = "${self}/files/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}"; - # }; - # }; - # }; + # wayland.windowManager.sway.config = { + # output = { + # "Applied Creative Technology Transmitter QUATTRO201811" = { + # bg = "${self}/files/wallpaper/navidrome.png ${config.stylix.imageScalingMode}"; + # }; + # "Hewlett Packard HP Z24i CN44250RDT" = { + # bg = "${self}/files/wallpaper/op6wp.png ${config.stylix.imageScalingMode}"; + # }; + # "HP Inc. HP 732pk CNC4080YL5" = { + # bg = "${self}/files/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}"; + # }; + # }; + # }; - wayland.windowManager.sway = - let - inherit (confLib.getConfig.repo.secrets.local.work) user1 user1Long domain1 mailAddress; - in - { - config = { - keybindings = - let - inherit (config.wayland.windowManager.sway.config) modifier; - in - { - "${modifier}+Shift+d" = "exec ${pkgs.quickpass}/bin/quickpass work/adm/${user1}/${user1Long}@${domain1}"; - "${modifier}+Shift+i" = "exec ${pkgs.quickpass}/bin/quickpass work/${mailAddress}"; - }; - }; - }; - - stylix = { - targets.firefox.profileNames = + wayland.windowManager.sway = + let + inherit (confLib.getConfig.repo.secrets.local.work) user1 user1Long domain1 mailAddress; + in + { + config = { + keybindings = let - inherit (confLib.getConfig.repo.secrets.local.work) user1 user2 user3; + inherit (config.wayland.windowManager.sway.config) modifier; in - [ - "${user1}" - "${user2}" - "${user3}" - "work" - ]; + { + "${modifier}+Shift+d" = "exec ${pkgs.quickpass}/bin/quickpass work/adm/${user1}/${user1Long}@${domain1}"; + "${modifier}+Shift+i" = "exec ${pkgs.quickpass}/bin/quickpass work/${mailAddress}"; + }; + }; + }; + + stylix = { + targets.firefox.profileNames = + let + inherit (confLib.getConfig.repo.secrets.local.work) user1 user2 user3; + in + [ + "${user1}" + "${user2}" + "${user3}" + "work" + ]; + }; + + programs = + let + inherit (confLib.getConfig.repo.secrets.local.work) user1 user1Long user2 user2Long user3 user3Long user4 path1 loc1 loc2 site1 site2 site3 site4 site5 site6 site7 lifecycle1 lifecycle2 domain1 domain2 gitMail clouds; + in + { + openstackclient = { + enable = true; + inherit clouds; + }; + awscli = { + enable = true; + package = pkgs.stable24_05.awscli2; + # settings = { + # "default" = { }; + # "profile s3-imagebuilder-prod" = { }; + # }; + # credentials = { + # "s3-imagebuilder-prod" = { + # aws_access_key_id = "5OYXY4879EJG9I91K1B6"; + # credential_process = "${pkgs.pass}/bin/pass show work/awscli/s3-imagebuilder-prod/secret-key"; + # }; + # }; + }; + git.settings.user.email = lib.mkForce gitMail; + + zsh = { + shellAliases = { + dssh = "ssh -l ${user1Long}"; + cssh = "ssh -l ${user2Long}"; + wssh = "ssh -l ${user3Long}"; + }; + cdpath = [ + "~/Documents/Work" + ]; + dirHashes = { + d = "$HOME/.dotfiles"; + w = "$HOME/Documents/Work"; + s = "$HOME/.dotfiles/secrets"; + pr = "$HOME/Documents/Private"; + ac = path1; + }; + + sessionVariables = { + VSPHERE_USER = "$(cat ${confLib.getConfig.sops.secrets.vcuser.path})"; + VSPHERE_PW = "$(cat ${confLib.getConfig.sops.secrets.vcpw.path})"; + GOVC_USERNAME = "$(cat ${confLib.getConfig.sops.secrets.govcuser.path})"; + GOVC_PASSWORD = "$(cat ${confLib.getConfig.sops.secrets.govcpw.path})"; + GOVC_URL = "$(cat ${confLib.getConfig.sops.secrets.govcurl.path})"; + GOVC_DATACENTER = "$(cat ${confLib.getConfig.sops.secrets.govcdc.path})"; + GOVC_DATASTORE = "$(cat ${confLib.getConfig.sops.secrets.govcds.path})"; + GOVC_HOST = "$(cat ${confLib.getConfig.sops.secrets.govchost.path})"; + GOVC_RESOURCE_POOL = "$(cat ${confLib.getConfig.sops.secrets.govcpool.path})"; + GOVC_NETWORK = "$(cat ${confLib.getConfig.sops.secrets.govcnetwork.path})"; + }; }; - programs = - let - inherit (confLib.getConfig.repo.secrets.local.work) user1 user1Long user2 user2Long user3 user3Long user4 path1 loc1 loc2 site1 site2 site3 site4 site5 site6 site7 lifecycle1 lifecycle2 domain1 domain2 gitMail clouds; - in - { - openstackclient = { - enable = true; - inherit clouds; - }; - awscli = { - enable = true; - package = pkgs.stable24_05.awscli2; - # settings = { - # "default" = { }; - # "profile s3-imagebuilder-prod" = { }; - # }; - # credentials = { - # "s3-imagebuilder-prod" = { - # aws_access_key_id = "5OYXY4879EJG9I91K1B6"; - # credential_process = "${pkgs.pass}/bin/pass show work/awscli/s3-imagebuilder-prod/secret-key"; - # }; - # }; - }; - git.settings.user.email = lib.mkForce gitMail; - - zsh = { - shellAliases = { - dssh = "ssh -l ${user1Long}"; - cssh = "ssh -l ${user2Long}"; - wssh = "ssh -l ${user3Long}"; - }; - cdpath = [ - "~/Documents/Work" - ]; - dirHashes = { - d = "$HOME/.dotfiles"; - w = "$HOME/Documents/Work"; - s = "$HOME/.dotfiles/secrets"; - pr = "$HOME/Documents/Private"; - ac = path1; - }; - - sessionVariables = { - VSPHERE_USER = "$(cat ${confLib.getConfig.sops.secrets.vcuser.path})"; - VSPHERE_PW = "$(cat ${confLib.getConfig.sops.secrets.vcpw.path})"; - GOVC_USERNAME = "$(cat ${confLib.getConfig.sops.secrets.govcuser.path})"; - GOVC_PASSWORD = "$(cat ${confLib.getConfig.sops.secrets.govcpw.path})"; - GOVC_URL = "$(cat ${confLib.getConfig.sops.secrets.govcurl.path})"; - GOVC_DATACENTER = "$(cat ${confLib.getConfig.sops.secrets.govcdc.path})"; - GOVC_DATASTORE = "$(cat ${confLib.getConfig.sops.secrets.govcds.path})"; - GOVC_HOST = "$(cat ${confLib.getConfig.sops.secrets.govchost.path})"; - GOVC_RESOURCE_POOL = "$(cat ${confLib.getConfig.sops.secrets.govcpool.path})"; - GOVC_NETWORK = "$(cat ${confLib.getConfig.sops.secrets.govcnetwork.path})"; - }; - }; - - ssh = { - matchBlocks = { - "${loc1}" = { - hostname = "${loc1}.${domain2}"; - user = user4; - }; - "${loc1}.stg" = { - hostname = "${loc1}.${lifecycle1}.${domain2}"; - user = user4; - }; - "${loc1}.staging" = { - hostname = "${loc1}.${lifecycle1}.${domain2}"; - user = user4; - }; - "${loc1}.dev" = { - hostname = "${loc1}.${lifecycle2}.${domain2}"; - user = user4; - }; - "${loc2}" = { - hostname = "${loc2}.${domain1}"; - user = user1Long; - }; - "${loc2}.stg" = { - hostname = "${loc2}.${lifecycle1}.${domain2}"; - user = user1Long; - }; - "${loc2}.staging" = { - hostname = "${loc2}.${lifecycle1}.${domain2}"; - user = user1Long; - }; - "*.${domain1}" = { - user = user1Long; - }; - }; - }; - - firefox = { - profiles = - let - isDefault = false; - in - { - "${user1}" = lib.recursiveUpdate - { - inherit isDefault; - id = 1; - settings = { - "browser.startup.homepage" = "${site1}|${site2}"; - }; - } - vars.firefox; - "${user2}" = lib.recursiveUpdate - { - inherit isDefault; - id = 2; - settings = { - "browser.startup.homepage" = "${site3}"; - }; - } - vars.firefox; - "${user3}" = lib.recursiveUpdate - { - inherit isDefault; - id = 3; - } - vars.firefox; - work = lib.recursiveUpdate - { - inherit isDefault; - id = 4; - settings = { - "browser.startup.homepage" = "${site4}|${site5}|${site6}|${site7}"; - }; - } - vars.firefox; - }; - }; - - chromium = { - enable = true; - package = pkgs.chromium; - - extensions = [ - # 1password - "gejiddohjgogedgjnonbofjigllpkmbf" - # dark reader - "eimadpbcbfnmbkopoojfekhnkhdbieeh" - # ublock origin - "cjpalhdlnbpafiamejdnhcphjbkeiagm" - # i still dont care about cookies - "edibdbjcniadpccecjdfdjjppcpchdlm" - # browserpass - "naepdomgkenhinolocfifgehidddafch" - ]; - }; + ssh = { + matchBlocks = { + "${loc1}" = { + hostname = "${loc1}.${domain2}"; + user = user4; }; + "${loc1}.stg" = { + hostname = "${loc1}.${lifecycle1}.${domain2}"; + user = user4; + }; + "${loc1}.staging" = { + hostname = "${loc1}.${lifecycle1}.${domain2}"; + user = user4; + }; + "${loc1}.dev" = { + hostname = "${loc1}.${lifecycle2}.${domain2}"; + user = user4; + }; + "${loc2}" = { + hostname = "${loc2}.${domain1}"; + user = user1Long; + }; + "${loc2}.stg" = { + hostname = "${loc2}.${lifecycle1}.${domain2}"; + user = user1Long; + }; + "${loc2}.staging" = { + hostname = "${loc2}.${lifecycle1}.${domain2}"; + user = user1Long; + }; + "*.${domain1}" = { + user = user1Long; + }; + }; + }; - services = { - kanshi = { - settings = [ - { - # seminary room - output = { - criteria = "Applied Creative Technology Transmitter QUATTRO201811"; + firefox = { + profiles = + let + isDefault = false; + in + { + "${user1}" = lib.recursiveUpdate + { + inherit isDefault; + id = 1; + settings = { + "browser.startup.homepage" = "${site1}|${site2}"; + }; + } + vars.firefox; + "${user2}" = lib.recursiveUpdate + { + inherit isDefault; + id = 2; + settings = { + "browser.startup.homepage" = "${site3}"; + }; + } + vars.firefox; + "${user3}" = lib.recursiveUpdate + { + inherit isDefault; + id = 3; + } + vars.firefox; + work = lib.recursiveUpdate + { + inherit isDefault; + id = 4; + settings = { + "browser.startup.homepage" = "${site4}|${site5}|${site6}|${site7}"; + }; + } + vars.firefox; + }; + }; + + chromium = { + enable = true; + package = pkgs.chromium; + + extensions = [ + # 1password + "gejiddohjgogedgjnonbofjigllpkmbf" + # dark reader + "eimadpbcbfnmbkopoojfekhnkhdbieeh" + # ublock origin + "cjpalhdlnbpafiamejdnhcphjbkeiagm" + # i still dont care about cookies + "edibdbjcniadpccecjdfdjjppcpchdlm" + # browserpass + "naepdomgkenhinolocfifgehidddafch" + ]; + }; + }; + + services = { + + shikane = { + settings = + let + workRight = [ + "m=HP Z32" + "s=CN41212T55" + "v=HP Inc." + ]; + workLeft = [ + "m=HP 732pk" + "s=CNC4080YL5" + "v=HP Inc." + ]; + exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""]; + in + { + profile = [ + + { + name = "work-internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + scale = 1.7; + position = "2560,0"; + } + { + match = workRight; + enable = true; scale = 1.0; - mode = "1280x720"; - }; - } - { - # work side screen - output = { + mode = "3840x2160@60Hz"; + position = "-1280,0"; + } + { + match = workLeft; + enable = true; + scale = 1.0; + transform = "270"; + mode = "3840x2160@60Hz"; + position = "-3440,-1050"; + } + ]; + } + { + name = "work-internal-off"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = false; + scale = 1.7; + position = "2560,0"; + } + { + match = workRight; + enable = true; + scale = 1.0; + mode = "3840x2160@60Hz"; + position = "-1280,0"; + } + { + match = workLeft; + enable = true; + scale = 1.0; + transform = "270"; + mode = "3840x2160@60Hz"; + position = "-3440,-1050"; + } + ]; + } + + + ]; + }; + }; + kanshi = { + settings = [ + { + # seminary room + output = { + criteria = "Applied Creative Technology Transmitter QUATTRO201811"; + scale = 1.0; + mode = "1280x720"; + }; + } + { + # work side screen + output = { + criteria = "HP Inc. HP 732pk CNC4080YL5"; + scale = 1.0; + mode = "3840x2160"; + transform = "270"; + }; + } + # { + # # work side screen + # output = { + # criteria = "Hewlett Packard HP Z24i CN44250RDT"; + # scale = 1.0; + # mode = "1920x1200"; + # transform = "270"; + # }; + # } + { + # work main screen + output = { + criteria = "HP Inc. HP Z32 CN41212T55"; + scale = 1.0; + mode = "3840x2160"; + }; + } + { + profile = { + name = "lidopen"; + exec = [ + "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/landscape/botanicswp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/portrait/op6wp.png --mode ${config.stylix.imageScalingMode}" + ]; + outputs = [ + { + criteria = config.swarselsystems.sharescreen; + status = "enable"; + scale = 1.5; + position = "2560,0"; + } + { criteria = "HP Inc. HP 732pk CNC4080YL5"; scale = 1.0; mode = "3840x2160"; + position = "-3440,-1050"; transform = "270"; - }; - } - # { - # # work side screen - # output = { - # criteria = "Hewlett Packard HP Z24i CN44250RDT"; - # scale = 1.0; - # mode = "1920x1200"; - # transform = "270"; - # }; - # } - { - # work main screen - output = { + } + { criteria = "HP Inc. HP Z32 CN41212T55"; scale = 1.0; mode = "3840x2160"; - }; - } + position = "-1280,0"; + } + ]; + }; + } + { + profile = + let + monitor = "Applied Creative Technology Transmitter QUATTRO201811"; + in { - profile = { - name = "lidopen"; - exec = [ - "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}" - ]; - outputs = [ - { - criteria = config.swarselsystems.sharescreen; - status = "enable"; - scale = 1.5; - position = "2560,0"; - } - { - criteria = "HP Inc. HP 732pk CNC4080YL5"; - scale = 1.0; - mode = "3840x2160"; - position = "-3440,-1050"; - transform = "270"; - } - { - criteria = "HP Inc. HP Z32 CN41212T55"; - scale = 1.0; - mode = "3840x2160"; - position = "-1280,0"; - } - ]; - }; - } - { - profile = - let - monitor = "Applied Creative Technology Transmitter QUATTRO201811"; - in - { - name = "lidopen"; - exec = [ - "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}" - "${pkgs.kanshare}/bin/kanshare ${config.swarselsystems.sharescreen} '${monitor}'" - ]; - outputs = [ - { - criteria = config.swarselsystems.sharescreen; - status = "enable"; - scale = 1.7; - position = "2560,0"; - } - { - criteria = "Applied Creative Technology Transmitter QUATTRO201811"; - scale = 1.0; - mode = "1280x720"; - position = "10000,10000"; - } - ]; - }; - } - { - profile = { - name = "lidclosed"; - exec = [ - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}" - ]; - outputs = [ - { - criteria = config.swarselsystems.sharescreen; - status = "disable"; - } - { - criteria = "HP Inc. HP 732pk CNC4080YL5"; - scale = 1.0; - mode = "3840x2160"; - position = "-3440,-1050"; - transform = "270"; - } - { - criteria = "HP Inc. HP Z32 CN41212T55"; - scale = 1.0; - mode = "3840x2160"; - position = "-1280,0"; - } - ]; - }; - } - { - profile = - let - monitor = "Applied Creative Technology Transmitter QUATTRO201811"; - in - { - name = "lidclosed"; - exec = [ - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}" - ]; - outputs = [ - { - criteria = config.swarselsystems.sharescreen; - status = "disable"; - } - { - criteria = "Applied Creative Technology Transmitter QUATTRO201811"; - scale = 1.0; - mode = "1280x720"; - position = "10000,10000"; - } - ]; - }; - } - ]; - }; - }; - - systemd.user.services = { - pizauth.Service = { - ExecStartPost = [ - "${pkgs.toybox}/bin/sleep 1" - "//bin/sh -c '${lib.getExe pkgs.pizauth} restore < ${homeDir}/.pizauth.state'" - ]; - }; - - teams-applet = { - Unit = { - Description = "teams applet"; - Requires = [ "graphical-session.target" ]; - After = [ - "graphical-session.target" - "tray.target" - ]; - PartOf = [ - "tray.target" - ]; - }; - - Install = { - WantedBy = [ "tray.target" ]; - }; - - Service = { - ExecStart = "${pkgs.stable.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; - }; - }; - - onepassword-applet = { - Unit = { - Description = "1password applet"; - Requires = [ "graphical-session.target" ]; - After = [ - "graphical-session.target" - "tray.target" - ]; - PartOf = [ - "tray.target" - ]; - }; - - Install = { - WantedBy = [ "tray.target" ]; - }; - - Service = { - ExecStart = "${pkgs._1password-gui-beta}/bin/1password"; - }; - }; - - }; - - services.pizauth = { - enable = true; - extraConfig = '' - auth_notify_cmd = "if [[ \"$(notify-send -A \"Open $PIZAUTH_ACCOUNT\" -t 30000 'pizauth authorisation')\" == \"0\" ]]; then open \"$PIZAUTH_URL\"; fi"; - error_notify_cmd = "notify-send -t 90000 \"pizauth error for $PIZAUTH_ACCOUNT\" \"$PIZAUTH_MSG\""; - token_event_cmd = "pizauth dump > ${homeDir}/.pizauth.state"; - ''; - accounts = { - work = { - authUri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"; - tokenUri = "https://login.microsoftonline.com/common/oauth2/v2.0/token"; - clientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584"; - clientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82"; - scopes = [ - "https://outlook.office365.com/IMAP.AccessAsUser.All" - "https://outlook.office365.com/SMTP.Send" - "offline_access" - ]; - loginHint = "${confLib.getConfig.repo.secrets.local.work.mailAddress}"; - }; - }; - - }; - - xdg = - let - inherit (confLib.getConfig.repo.secrets.local.work) user1 user2 user3; - in - { - mimeApps = { - defaultApplications = { - "x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ]; - }; - }; - desktopEntries = - let - terminal = false; - categories = [ "Application" ]; - icon = "firefox"; - in + name = "lidopen"; + exec = [ + "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/services/navidrome.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.kanshare}/bin/kanshare ${config.swarselsystems.sharescreen} '${monitor}'" + ]; + outputs = [ { - firefox_work = { - name = "Firefox (work)"; - genericName = "Firefox work"; - exec = "firefox -p work"; - inherit terminal categories icon; - }; - "firefox_${user1}" = { - name = "Firefox (${user1})"; - genericName = "Firefox ${user1}"; - exec = "firefox -p ${user1}"; - inherit terminal categories icon; - }; - - "firefox_${user2}" = { - name = "Firefox (${user2})"; - genericName = "Firefox ${user2}"; - exec = "firefox -p ${user2}"; - inherit terminal categories icon; - }; - - "firefox_${user3}" = { - name = "Firefox (${user3})"; - genericName = "Firefox ${user3}"; - exec = "firefox -p ${user3}"; - inherit terminal categories icon; - }; - - - }; - }; - swarselsystems = { - startup = [ - # { command = "nextcloud --background"; } - # { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } - # { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } - # { command = "anki"; } - # { command = "obsidian"; } - # { command = "nm-applet"; } - # { command = "feishin"; } - # { command = "teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; } - # { command = "1password"; } - ]; - monitors = { - work_back_middle = rec { - name = "LG Electronics LG Ultra HD 0x000305A6"; - mode = "2560x1440"; - scale = "1"; - position = "5120,0"; - workspace = "1:δΈ€"; - # output = "DP-10"; - output = name; - }; - work_front_left = rec { - name = "LG Electronics LG Ultra HD 0x0007AB45"; - mode = "3840x2160"; - scale = "1"; - position = "5120,0"; - workspace = "1:δΈ€"; - # output = "DP-7"; - output = name; - }; - work_middle_middle_main = rec { - name = "HP Inc. HP Z32 CN41212T55"; - mode = "3840x2160"; - scale = "1"; - position = "-1280,0"; - workspace = "1:δΈ€"; - # output = "DP-3"; - output = name; - }; - # work_middle_middle_main = rec { - # name = "HP Inc. HP 732pk CNC4080YL5"; - # mode = "3840x2160"; - # scale = "1"; - # position = "-1280,0"; - # workspace = "11:M"; - # # output = "DP-8"; - # output = name; - # }; - work_middle_middle_side = rec { - name = "HP Inc. HP 732pk CNC4080YL5"; - mode = "3840x2160"; - transform = "270"; - scale = "1"; - position = "-3440,-1050"; - workspace = "12:S"; - # output = "DP-8"; - output = name; - }; - work_middle_middle_old = rec { - name = "Hewlett Packard HP Z24i CN44250RDT"; - mode = "1920x1200"; - transform = "270"; - scale = "1"; - position = "-2480,0"; - workspace = "12:S"; - # output = "DP-9"; - output = name; - }; - work_seminary = rec { - name = "Applied Creative Technology Transmitter QUATTRO201811"; - mode = "1280x720"; - scale = "1"; - position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse - workspace = "14:T"; - # output = "DP-4"; - output = name; - }; - }; - inputs = { - "1133:45081:MX_Master_2S_Keyboard" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - # "2362:628:PIXA3854:00_093A:0274_Touchpad" = { - # dwt = "enabled"; - # tap = "enabled"; - # natural_scroll = "enabled"; - # middle_emulation = "enabled"; - # drag_lock = "disabled"; - # }; - "1133:50504:Logitech_USB_Receiver" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - "1133:45944:MX_KEYS_S" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - }; - - }; - } // lib.optionalAttrs (type != "nixos") { - sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) { - harica-root-ca = { - sopsFile = certsSopsFile; - path = "${homeDir}/.aws/certs/harica-root.pem"; - owner = mainUser; - }; - }; + criteria = config.swarselsystems.sharescreen; + status = "enable"; + scale = 1.7; + position = "2560,0"; + } + { + criteria = "Applied Creative Technology Transmitter QUATTRO201811"; + scale = 1.0; + mode = "1280x720"; + position = "10000,10000"; + } + ]; + }; + } + { + profile = { + name = "lidclosed"; + exec = [ + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/landscape/botanicswp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/portrait/op6wp.png --mode ${config.stylix.imageScalingMode}" + ]; + outputs = [ + { + criteria = config.swarselsystems.sharescreen; + status = "disable"; + } + { + criteria = "HP Inc. HP 732pk CNC4080YL5"; + scale = 1.0; + mode = "3840x2160"; + position = "-3440,-1050"; + transform = "270"; + } + { + criteria = "HP Inc. HP Z32 CN41212T55"; + scale = 1.0; + mode = "3840x2160"; + position = "-1280,0"; + } + ]; + }; + } + { + profile = + let + monitor = "Applied Creative Technology Transmitter QUATTRO201811"; + in + { + name = "lidclosed"; + exec = [ + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/services/navidrome.png --mode ${config.stylix.imageScalingMode}" + ]; + outputs = [ + { + criteria = config.swarselsystems.sharescreen; + status = "disable"; + } + { + criteria = "Applied Creative Technology Transmitter QUATTRO201811"; + scale = 1.0; + mode = "1280x720"; + position = "10000,10000"; + } + ]; + }; + } + ]; + }; + }; + systemd.user.services = { + pizauth.Service = { + ExecStartPost = [ + "${pkgs.toybox}/bin/sleep 1" + "//bin/sh -c '${lib.getExe pkgs.pizauth} restore < ${homeDir}/.pizauth.state'" + ]; }; - } + teams-applet = { + Unit = { + Description = "teams applet"; + Requires = [ "graphical-session.target" ]; + After = [ + "graphical-session.target" + "tray.target" + ]; + PartOf = [ + "tray.target" + ]; + }; + + Install = { + WantedBy = [ "tray.target" ]; + }; + + Service = { + ExecStart = "${pkgs.stable.teams-for-linux}/bin/teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; + }; + }; + + onepassword-applet = { + Unit = { + Description = "1password applet"; + Requires = [ "graphical-session.target" ]; + After = [ + "graphical-session.target" + "tray.target" + ]; + PartOf = [ + "tray.target" + ]; + }; + + Install = { + WantedBy = [ "tray.target" ]; + }; + + Service = { + ExecStart = "${pkgs._1password-gui-beta}/bin/1password"; + }; + }; + + }; + + services.pizauth = { + enable = true; + extraConfig = '' + auth_notify_cmd = "if [[ \"$(notify-send -A \"Open $PIZAUTH_ACCOUNT\" -t 30000 'pizauth authorisation')\" == \"0\" ]]; then open \"$PIZAUTH_URL\"; fi"; + error_notify_cmd = "notify-send -t 90000 \"pizauth error for $PIZAUTH_ACCOUNT\" \"$PIZAUTH_MSG\""; + token_event_cmd = "pizauth dump > ${homeDir}/.pizauth.state"; + ''; + accounts = { + work = { + authUri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"; + tokenUri = "https://login.microsoftonline.com/common/oauth2/v2.0/token"; + clientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584"; + clientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82"; + scopes = [ + "https://outlook.office365.com/IMAP.AccessAsUser.All" + "https://outlook.office365.com/SMTP.Send" + "offline_access" + ]; + loginHint = "${confLib.getConfig.repo.secrets.local.work.mailAddress}"; + }; + }; + + }; + + xdg = + let + inherit (confLib.getConfig.repo.secrets.local.work) user1 user2 user3; + in + { + mimeApps = { + defaultApplications = { + "x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ]; + }; + }; + desktopEntries = + let + terminal = false; + categories = [ "Application" ]; + icon = "firefox"; + in + { + firefox_work = { + name = "Firefox (work)"; + genericName = "Firefox work"; + exec = "firefox -p work"; + inherit terminal categories icon; + }; + "firefox_${user1}" = { + name = "Firefox (${user1})"; + genericName = "Firefox ${user1}"; + exec = "firefox -p ${user1}"; + inherit terminal categories icon; + }; + + "firefox_${user2}" = { + name = "Firefox (${user2})"; + genericName = "Firefox ${user2}"; + exec = "firefox -p ${user2}"; + inherit terminal categories icon; + }; + + "firefox_${user3}" = { + name = "Firefox (${user3})"; + genericName = "Firefox ${user3}"; + exec = "firefox -p ${user3}"; + inherit terminal categories icon; + }; + + + }; + }; + swarselsystems = { + startup = [ + # { command = "nextcloud --background"; } + # { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } + # { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } + # { command = "anki"; } + # { command = "obsidian"; } + # { command = "nm-applet"; } + # { command = "feishin"; } + # { command = "teams-for-linux --disableGpu=true --minimized=true --trayIconEnabled=true"; } + # { command = "1password"; } + ]; + monitors = { + work_back_middle = rec { + name = "LG Electronics LG Ultra HD 0x000305A6"; + mode = "2560x1440"; + scale = "1"; + position = "5120,0"; + workspace = "1:δΈ€"; + # output = "DP-10"; + output = name; + }; + work_front_left = rec { + name = "LG Electronics LG Ultra HD 0x0007AB45"; + mode = "3840x2160"; + scale = "1"; + position = "5120,0"; + workspace = "1:δΈ€"; + # output = "DP-7"; + output = name; + }; + work_middle_middle_main = rec { + name = "HP Inc. HP Z32 CN41212T55"; + mode = "3840x2160"; + scale = "1"; + position = "-1280,0"; + workspace = "1:δΈ€"; + # output = "DP-3"; + output = name; + }; + # work_middle_middle_main = rec { + # name = "HP Inc. HP 732pk CNC4080YL5"; + # mode = "3840x2160"; + # scale = "1"; + # position = "-1280,0"; + # workspace = "11:M"; + # # output = "DP-8"; + # output = name; + # }; + work_middle_middle_side = rec { + name = "HP Inc. HP 732pk CNC4080YL5"; + mode = "3840x2160"; + transform = "270"; + scale = "1"; + position = "-3440,-1050"; + workspace = "12:S"; + # output = "DP-8"; + output = name; + }; + work_middle_middle_old = rec { + name = "Hewlett Packard HP Z24i CN44250RDT"; + mode = "1920x1200"; + transform = "270"; + scale = "1"; + position = "-2480,0"; + workspace = "12:S"; + # output = "DP-9"; + output = name; + }; + work_seminary = rec { + name = "Applied Creative Technology Transmitter QUATTRO201811"; + mode = "1280x720"; + scale = "1"; + position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse + workspace = "14:T"; + # output = "DP-4"; + output = name; + }; + }; + inputs = { + "1133:45081:MX_Master_2S_Keyboard" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + # "2362:628:PIXA3854:00_093A:0274_Touchpad" = { + # dwt = "enabled"; + # tap = "enabled"; + # natural_scroll = "enabled"; + # middle_emulation = "enabled"; + # drag_lock = "disabled"; + # }; + "1133:50504:Logitech_USB_Receiver" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + "1133:45944:MX_KEYS_S" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; + + }; + } // lib.optionalAttrs (type != "nixos") { + sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) { + harica-root-ca = { + sopsFile = certsSopsFile; + path = "${homeDir}/.aws/certs/harica-root.pem"; + owner = mainUser; + }; + }; + + }; + + } #+end_src @@ -27663,7 +27870,7 @@ This holds configuration that is specific to framework laptops. #+begin_src nix-ts :tangle modules/home/optional/framework.nix _: { - config = { + config = { swarselsystems = { inputs = { "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = { @@ -27781,7 +27988,7 @@ TODO: check which of these can be replaced but builtin functions. }; wallpaper = lib.mkOption { type = lib.types.path; - default = "${self}/files/wallpaper/lenovowp.png"; + default = "${self}/files/wallpaper/landscape/lenovowp.png"; }; sharescreen = lib.mkOption { type = lib.types.str; @@ -28264,13 +28471,10 @@ In short, the options defined here are passed to the modules systems using =_mod _ = { }; }); - overrideTarget = target: let - inherit target; - in { + overrideTarget = target: { Unit = { PartOf = lib.mkForce [ target ]; After = lib.mkForce [ target ]; - Requires = lib.mkForce [ target ]; }; Install.WantedBy = lib.mkForce [ target ]; }; @@ -28720,7 +28924,7 @@ The normal =command-not-found.sh= uses the outdated =nix-shell= commands as sugg #+begin_src shell :tangle files/scripts/niri-resize.sh - WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select(.is_active == true) | .id') + WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select(.is_focused == true) | .id') COUNT=$(niri msg -j windows | jq --argjson ws "$WORKSPACE" -r '.[] | select(.workspace_id == $ws and .is_floating == false) | .app_id' | wc -l) @@ -30988,6 +31192,7 @@ This holds modules that are to be used on most hosts. These are also the most im tmux = lib.mkDefault true; vesktop = lib.mkDefault true; vesktop-tray = lib.mkDefault true; + shikane = lib.mkDefault true; syncthing-tray = lib.mkDefault true; waybar = lib.mkDefault true; yubikey = lib.mkDefault false; @@ -34477,7 +34682,7 @@ This sets up the =dashboard=, which is really quite useless. But, it looks cool dashboard-set-footer nil dashboard-banner-logo-title "Welcome to SwarsEmacs!" dashboard-image-banner-max-height 300 - dashboard-startup-banner "~/.dotfiles/files/wallpaper/swarsel.png" + dashboard-startup-banner "~/.dotfiles/files/icons/swarsel.png" dashboard-projects-backend 'projectile dashboard-projects-switch-function 'magit-status dashboard-set-navigator t diff --git a/files/emacs/init.el b/files/emacs/init.el index 14e5005..f613c31 100644 --- a/files/emacs/init.el +++ b/files/emacs/init.el @@ -1797,7 +1797,7 @@ create a new one." dashboard-set-footer nil dashboard-banner-logo-title "Welcome to SwarsEmacs!" dashboard-image-banner-max-height 300 - dashboard-startup-banner "~/.dotfiles/files/wallpaper/swarsel.png" + dashboard-startup-banner "~/.dotfiles/files/icons/swarsel.png" dashboard-projects-backend 'projectile dashboard-projects-switch-function 'magit-status dashboard-set-navigator t diff --git a/files/wallpaper/swarsel.png b/files/icons/swarsel.png similarity index 100% rename from files/wallpaper/swarsel.png rename to files/icons/swarsel.png diff --git a/files/wallpaper/user.png b/files/icons/user.png similarity index 100% rename from files/wallpaper/user.png rename to files/icons/user.png diff --git a/files/scripts/niri-resize.sh b/files/scripts/niri-resize.sh index e8dbdbc..cf6fab8 100644 --- a/files/scripts/niri-resize.sh +++ b/files/scripts/niri-resize.sh @@ -1,4 +1,4 @@ -WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select(.is_active == true) | .id') +WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select(.is_focused == true) | .id') COUNT=$(niri msg -j windows | jq --argjson ws "$WORKSPACE" -r '.[] | select(.workspace_id == $ws and .is_floating == false) | .app_id' | wc -l) diff --git a/files/templates/hosts/nixos/default.nix b/files/templates/hosts/nixos/default.nix index cc96eeb..240ebf3 100644 --- a/files/templates/hosts/nixos/default.nix +++ b/files/templates/hosts/nixos/default.nix @@ -39,7 +39,7 @@ in swarselsystems = lib.recursiveUpdate { - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = true; diff --git a/files/wallpaper/botanicswp.png b/files/wallpaper/landscape/botanicswp.png similarity index 100% rename from files/wallpaper/botanicswp.png rename to files/wallpaper/landscape/botanicswp.png diff --git a/files/wallpaper/lenovowp.png b/files/wallpaper/landscape/lenovowp.png similarity index 100% rename from files/wallpaper/lenovowp.png rename to files/wallpaper/landscape/lenovowp.png diff --git a/files/wallpaper/serverwp.png b/files/wallpaper/landscape/serverwp.png similarity index 100% rename from files/wallpaper/serverwp.png rename to files/wallpaper/landscape/serverwp.png diff --git a/files/wallpaper/standwp.png b/files/wallpaper/landscape/standwp.png similarity index 100% rename from files/wallpaper/standwp.png rename to files/wallpaper/landscape/standwp.png diff --git a/files/wallpaper/surfacewp.png b/files/wallpaper/landscape/surfacewp.png similarity index 100% rename from files/wallpaper/surfacewp.png rename to files/wallpaper/landscape/surfacewp.png diff --git a/files/wallpaper/op6wp.png b/files/wallpaper/portrait/op6wp.png similarity index 100% rename from files/wallpaper/op6wp.png rename to files/wallpaper/portrait/op6wp.png diff --git a/files/wallpaper/navidrome.png b/files/wallpaper/services/navidrome.png similarity index 100% rename from files/wallpaper/navidrome.png rename to files/wallpaper/services/navidrome.png diff --git a/hosts/home/aarch64-linux/treehouse/default.nix b/hosts/home/aarch64-linux/treehouse/default.nix index ef795c7..0ab2386 100644 --- a/hosts/home/aarch64-linux/treehouse/default.nix +++ b/hosts/home/aarch64-linux/treehouse/default.nix @@ -25,7 +25,7 @@ swarselsystems = { isLaptop = false; isNixos = false; - wallpaper = self + /files/wallpaper/surfacewp.png; + wallpaper = self + /files/wallpaper/landscape/surfacewp.png; }; swarselprofiles = { diff --git a/hosts/nixos/x86_64-linux/bakery/default.nix b/hosts/nixos/x86_64-linux/bakery/default.nix index f11512a..fc14391 100644 --- a/hosts/nixos/x86_64-linux/bakery/default.nix +++ b/hosts/nixos/x86_64-linux/bakery/default.nix @@ -31,7 +31,7 @@ in sharescreen = "eDP-1"; info = "Lenovo Ideapad 720S-13IKB"; firewall = lib.mkForce true; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = true; diff --git a/hosts/nixos/x86_64-linux/hotel/default.nix b/hosts/nixos/x86_64-linux/hotel/default.nix index 852af0e..02b9c48 100644 --- a/hosts/nixos/x86_64-linux/hotel/default.nix +++ b/hosts/nixos/x86_64-linux/hotel/default.nix @@ -40,7 +40,7 @@ in swarselsystems = { info = "~SwarselSystems~ demo host"; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; isImpermanence = true; isCrypted = true; isSecureBoot = false; diff --git a/hosts/nixos/x86_64-linux/pyramid/default.nix b/hosts/nixos/x86_64-linux/pyramid/default.nix index f1f3e1c..60d2522 100644 --- a/hosts/nixos/x86_64-linux/pyramid/default.nix +++ b/hosts/nixos/x86_64-linux/pyramid/default.nix @@ -40,7 +40,7 @@ in sharescreen = "eDP-2"; info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM"; firewall = lib.mkForce true; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; hasBluetooth = true; hasFingerprint = true; isImpermanence = false; diff --git a/hosts/nixos/x86_64-linux/summers/default.nix b/hosts/nixos/x86_64-linux/summers/default.nix index 8e08ce4..4342d2b 100644 --- a/hosts/nixos/x86_64-linux/summers/default.nix +++ b/hosts/nixos/x86_64-linux/summers/default.nix @@ -79,6 +79,7 @@ swarselmodules.server = { wireguard = true; restic = true; + podman = true; opkssh = true; }; diff --git a/hosts/nixos/x86_64-linux/toto/default.nix b/hosts/nixos/x86_64-linux/toto/default.nix index f90e54c..90955cc 100644 --- a/hosts/nixos/x86_64-linux/toto/default.nix +++ b/hosts/nixos/x86_64-linux/toto/default.nix @@ -26,7 +26,7 @@ swarselsystems = { info = "~SwarselSystems~ remote install helper"; - wallpaper = self + /files/wallpaper/lenovowp.png; + wallpaper = self + /files/wallpaper/landscape/lenovowp.png; isImpermanence = true; isCrypted = true; isSecureBoot = false; diff --git a/install/installer-config.nix b/install/installer-config.nix index bbeafb3..d89b749 100644 --- a/install/installer-config.nix +++ b/install/installer-config.nix @@ -84,6 +84,11 @@ in vim just sbctl + lsof + dig + + cryptsetup + btrfs-progs ]; programs = { diff --git a/modules/home/common/kanshi.nix b/modules/home/common/kanshi.nix index a81da51..463bc08 100644 --- a/modules/home/common/kanshi.nix +++ b/modules/home/common/kanshi.nix @@ -23,7 +23,7 @@ # laptop screen output = { criteria = config.swarselsystems.sharescreen; - mode = config.swarselsystems.highResolution; + mode = "${config.swarselsystems.highResolution}@165.000"; scale = 1.0; }; } @@ -57,7 +57,7 @@ name = "lidopen"; exec = [ "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/landscape/standwp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { @@ -82,7 +82,7 @@ in { name = "lidclosed"; - exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" ]; + exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/landscape/standwp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { criteria = config.swarselsystems.sharescreen; diff --git a/modules/home/common/packages.nix b/modules/home/common/packages.nix index 5442c14..bd1bed2 100644 --- a/modules/home/common/packages.nix +++ b/modules/home/common/packages.nix @@ -101,7 +101,7 @@ tridactyl-native # mako related - mako + # mako libnotify # general utilities diff --git a/modules/home/common/shikane.nix b/modules/home/common/shikane.nix new file mode 100644 index 0000000..59a4985 --- /dev/null +++ b/modules/home/common/shikane.nix @@ -0,0 +1,77 @@ +{ lib, config, confLib, ... }: +{ + options.swarselmodules.shikane = lib.mkEnableOption "kanshi settings"; + config = lib.mkIf config.swarselmodules.shikane { + + systemd.user.services.shikane = confLib.overrideTarget "noctalia-shell.target"; + services.shikane = { + enable = true; + settings = + let + homeMonitor = [ + "m=PHL BDM3270" + "s=AU11806002320" + "v=Philips Consumer Electronics Company" + ]; + exec = [ "notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\"" ]; + in + { + profile = [ + + { + name = "internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + mode = "${config.swarselsystems.highResolution}@165.000"; + scale = 1.0; + } + ]; + } + + { + name = "home-internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + scale = 1.7; + position = "2560,0"; + } + { + match = homeMonitor; + enable = true; + scale = 1.0; + mode = "2560x1440"; + position = "0,0"; + } + ]; + } + + { + name = "home-internal-off"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = false; + position = "2560,0"; + } + { + match = homeMonitor; + scale = 1.0; + enable = true; + mode = "2560x1440"; + position = "0,0"; + } + ]; + } + + ]; + }; + }; + }; +} diff --git a/modules/home/common/sway.nix b/modules/home/common/sway.nix index cfb6c73..54604eb 100644 --- a/modules/home/common/sway.nix +++ b/modules/home/common/sway.nix @@ -394,36 +394,36 @@ in swayfxSettings = config.swarselsystems.swayfxConfig; in " -# exec_always autotiling - # set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\" + # exec_always autotiling + # set $exit \"exit: [s]leep, [l]ock, [p]oweroff, [r]eboot, [u]ser logout\" - # mode $exit { - # bindsym --to-code { - # s exec \"systemctl suspend\", mode \"default\" - # h exec \"systemctl hibernate\", mode \"default\" - # l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\ - # p exec \"systemctl poweroff\" - # r exec \"systemctl reboot\" - # u exec \"swaymsg exit\" + # mode $exit { + # bindsym --to-code { + # s exec \"systemctl suspend\", mode \"default\" + # h exec \"systemctl hibernate\", mode \"default\" + # l exec \"swaylock --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize\", mode \"default\ + # p exec \"systemctl poweroff\" + # r exec \"systemctl reboot\" + # u exec \"swaymsg exit\" - # Return mode \"default\" - # Escape mode \"default\" - # ${modifier}+Escape mode \"default\" - # } - # } + # Return mode \"default\" + # Escape mode \"default\" + # ${modifier}+Escape mode \"default\" + # } + # } - exec systemctl --user import-environment - # exec swayidle -w + exec systemctl --user import-environment + # exec swayidle -w - seat * hide_cursor 2000 + seat * hide_cursor 2000 - exec_always kill -1 $(pidof kanshi) + exec_always kill -1 $(pidof kanshi) - bindswitch --locked lid:on exec kanshictl switch lidclosed - bindswitch --locked lid:off exec kanshictl switch lidopen + bindswitch --locked lid:on exec kanshictl switch lidclosed + bindswitch --locked lid:off exec kanshictl switch lidopen - ${swayfxSettings} - "; + ${swayfxSettings} + "; }; }; } diff --git a/modules/home/common/swayidle.nix b/modules/home/common/swayidle.nix index 9d4acae..50e5f73 100644 --- a/modules/home/common/swayidle.nix +++ b/modules/home/common/swayidle.nix @@ -22,12 +22,13 @@ in # { timeout = 300; command = "${swaylock} -f"; } { timeout = 300; command = "${noctalia} lockScreen lock || ${swaylock} -f"; } # { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on''; } - { timeout = 600; command = "${noctalia} sessionMenu lockAndSuspend || ${suspend}"; } + # { timeout = 600; command = "${noctalia} sessionMenu lockAndSuspend || ${suspend}"; } + { timeout = 600; command = "${suspend}"; } ]; events = { - # { event = "before-sleep"; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; } + # { event = "before-sleep"; command = "${noctalia} lockScreen lock || ${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; } # { event = "after-resume"; command = "${swaylock} -f "; } - # before-sleep = "${swaylock} -f "; + before-sleep = "${noctalia} lockScreen lock || ${swaylock} -f "; # lock = "${swaylock} -f "; }; }; diff --git a/modules/home/optional/niri.nix b/modules/home/optional/niri.nix index 0b0b51b..a144a3d 100644 --- a/modules/home/optional/niri.nix +++ b/modules/home/optional/niri.nix @@ -7,6 +7,7 @@ programs.niri = { package = pkgs.niri-stable; # which package to use for niri validation settings = { + gestures.hot-corners.enable = false; debug = { honor-xdg-activation-with-invalid-serial = [ ]; }; @@ -16,7 +17,7 @@ }; prefer-no-csd = true; layer-rules = [ - { matches = [{ namespace = "^notifications$"; }]; block-out-from = "screen-capture"; } + { matches = [{ namespace = "^notificatioans$"; }]; block-out-from = "screen-capture"; } { matches = [{ namespace = "^wallpaper$"; }]; place-within-backdrop = true; } { matches = [{ namespace = "^noctalia-overview*"; }]; place-within-backdrop = true; } ]; @@ -56,11 +57,11 @@ { matches = [{ app-id = "^spotifytui$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; } { matches = [{ app-id = "^kittyterm$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; } ]; - environment = { + environment = vars.waylandSessionVariables // { DISPLAY = ":0"; QT_QPA_PLATFORM = lib.mkForce "wayland"; EDITOR = "emacsclient -c"; - } // vars.waylandSessionVariables; + }; screenshot-path = "~/Pictures/Screenshots/screenshot_%Y-%m-%d-%H%M%S.png"; input = { mod-key = "Super"; @@ -104,17 +105,18 @@ }; binds = with config.lib.niri.actions; let sh = spawn "sh" "-c"; - resizer = "niri-resize"; + resizer = "niri-resize & sleep 0.05"; in { "Mod+Shift+t".action = toggle-window-rule-opacity; "Mod+m".action = focus-workspace-previous; "Mod+Shift+Space".action = toggle-window-floating; "Mod+Shift+f".action = fullscreen-window; - "Mod+q".action = sh "niri msg action close-window & ${resizer}"; - "Mod+f".action = sh "${resizer} & firefox"; + "Mod+q".action = sh "${resizer} && niri msg action close-window"; + "Mod+f".action = sh "${resizer} && exec firefox"; # "Mod+Space".action = spawn "noctalia-shell" "ipc" "call" "launcher" "toggle"; - "Mod+Space".action = sh "${resizer} & fuzzel"; + "Mod+Space".action = sh "${resizer} && exec noctalia-shell ipc call launcher toggle"; + # "Mod+Space".action = sh "${resizer} & exec fuzzel"; "Mod+z".action = spawn "noctalia-shell" "ipc" "call" "bar" "toggle"; "Mod+Shift+c".action = spawn "qalculate-gtk"; "Mod+Ctrl+p".action = spawn "1password" "--quick-acces"; @@ -128,11 +130,11 @@ "Mod+Shift+s".action.screenshot-window = { write-to-disk = true; }; # "Mod+Shift+v".action = spawn "wf-recorder" "-g" "'$(slurp -f %o -or)'" "-f" "~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv"; - "Mod+e".action = sh "${resizer} & emacsclient -nquc -a emacs -e '(dashboard-open)'"; - "Mod+c".action = sh "${resizer} & emacsclient -ce '(org-capture)'"; - "Mod+t".action = sh "${resizer} & emacsclient -ce '(org-agenda)'"; - "Mod+Shift+m".action = sh "${resizer} & emacsclient -ce '(mu4e)'"; - "Mod+Shift+a".action = sh "${resizer} & emacsclient -ce '(swarsel/open-calendar)'"; + "Mod+e".action = sh "${resizer} && exec emacsclient -nquc -a emacs -e '(dashboard-open)'"; + "Mod+c".action = sh "${resizer} && exec emacsclient -ce '(org-capture)'"; + "Mod+t".action = sh "${resizer} && exec emacsclient -ce '(org-agenda)'"; + "Mod+Shift+m".action = sh "${resizer} && exec emacsclient -ce '(mu4e)'"; + "Mod+Shift+a".action = sh "${resizer} && exec emacsclient -ce '(swarsel/open-calendar)'"; "Mod+a".action = spawn "swarselcheck-niri" "-s"; "Mod+x".action = spawn "swarselcheck-niri" "-k"; @@ -148,8 +150,8 @@ "Mod+Right".action = focus-column-or-monitor-right; "Mod+Down".action = focus-window-or-workspace-down; "Mod+Up".action = focus-window-or-workspace-up; - "Mod+Shift+Left".action = move-column-left; - "Mod+Shift+Right".action = move-column-right; + "Mod+Shift+Left".action = move-column-left-or-to-monitor-left; + "Mod+Shift+Right".action = move-column-right-or-to-monitor-right; "Mod+Shift+Down".action = move-window-down-or-to-workspace-down; "Mod+Shift+Up".action = move-window-up-or-to-workspace-up; # "Mod+Ctrl+Shift+c".action = "reload"; @@ -157,7 +159,7 @@ # "Mod+Shift+e".action = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; # "Mod+r".action = "mode resize"; # "Mod+Return".action = "exec kitty"; - "Mod+Return".action = sh "${resizer} & exec kitty -o confirm_os_window_close=0"; + "Mod+Return".action = sh "${resizer} && exec kitty -o confirm_os_window_close=0"; "XF86AudioRaiseVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "increase"; "XF86AudioLowerVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "decrease"; "XF86AudioMute".action = spawn "noctalia-shell" "ipc" "call" "volume" "muteOutput"; @@ -202,8 +204,8 @@ # { command = [ "nm-applet" ]; } # { command = [ "niri" "msg" "action" "focus-workspace" "2" ]; } # { command = [ "noctalia-shell" ]; } - { command = [ "pkill mako" ]; } - { command = [ "systemctl" "--user" "start" "noctalia-shell.target" ]; } + # { argv = [ "pkill" "mako" ]; } + { argv = [ "systemctl" "--user" "restart" "noctalia-shell.target" "tray.target" ]; } ]; # workspaces = { # "01-Main" = { diff --git a/modules/home/optional/noctalia.nix b/modules/home/optional/noctalia.nix index bd2831d..01d0f39 100644 --- a/modules/home/optional/noctalia.nix +++ b/modules/home/optional/noctalia.nix @@ -8,43 +8,27 @@ targets = { noctalia-shell.Unit = { After = [ "graphical-session.target" ]; - Wants = [ - "tray.target" - "noctalia-tray-pre.target" - ]; }; tray = { Unit = { - After = [ "noctalia-tray-pre.target" ]; + After = [ "noctalia-init.service" ]; PartOf = [ "noctalia-shell.service" ]; }; Install.WantedBy = [ "noctalia-shell.target" ]; }; - noctalia-tray-pre = { - Unit = { - After = [ - "noctalia-init.service" - ]; - }; - Install.WantedBy = [ "noctalia-shell.target" ]; - }; }; services = { noctalia-shell = confLib.overrideTarget "noctalia-shell.target"; noctalia-init = { - Unit = { - PartOf = [ "noctalia-tray-pre.target" ]; - }; Service = { Type = "oneshot"; - ExecStartPre = "${pkgs.coreutils}/bin/sleep 5"; - ExecStart = "-${pkgs.busybox}/bin/pkill mako"; + ExecStart = "${pkgs.coreutils}/bin/sleep 15"; RemainAfterExit = true; }; Install = { - WantedBy = [ "noctalia-tray-pre.target" ]; + WantedBy = [ "noctalia-shell.target" ]; }; }; }; @@ -72,7 +56,7 @@ marginHorizontal = 0; frameThickness = 8; frameRadius = 12; - outerCorners = true; + outerCorners = false; hideOnOverview = false; displayMode = "auto_hide"; autoHideDelay = 100; @@ -81,29 +65,54 @@ widgets = { left = [ { - characterCount = 2; + characterCount = 4; colorizeIcons = false; emptyColor = "primary"; enableScrollWheel = false; focusedColor = "secondary"; followFocusedScreen = false; groupedBorderOpacity = 1; - hideUnoccupied = true; + hideUnoccupied = false; iconScale = 0.5; id = "Workspace"; - labelMode = "none"; + labelMode = "name"; occupiedColor = "primary"; pillSize = 0.4; reverseScroll = false; showApplications = true; showBadge = true; - showLabelsOnlyWhenOccupied = true; + showLabelsOnlyWhenOccupied = false; unfocusedIconsOpacity = 0.25; } + + { + defaultSettings = { + completedCount = 0; + count = 0; + current_page_id = 0; + isExpanded = false; + pages = [ + { + id = 0; + name = "General"; + } + ]; + priorityColors = { + high = "#f44336"; + low = "#9e9e9e"; + medium = "#2196f3"; + }; + showBackground = true; + showCompleted = true; + todos = [ ]; + useCustomColors = false; + }; + id = "plugin:todo"; + } ]; center = [ { - colorizeIcons = false; + colorizeIcons = true; hideMode = "hidden"; id = "ActiveWindow"; maxWidth = 145; @@ -134,6 +143,17 @@ id = "Volume"; middleClickCommand = "pavucontrol"; } + { + id = "NotificationHistory"; + hideWhenZero = false; + showUnreadBadge = true; + } + { + id = "plugin:ba7043:github-feed"; + } + { + id = "plugin:clipper"; + } { displayMode = "onhover"; id = "Network"; @@ -154,12 +174,6 @@ showNoctaliaPerformance = false; showPowerProfiles = true; } - { - id = "plugin:ba7043:github-feed"; - } - { - id = "plugin:clipper"; - } { colorName = "primary"; id = "SessionMenu"; @@ -176,17 +190,17 @@ { colorizeDistroLogo = false; colorizeSystemIcon = "primary"; - customIconPath = ""; + customIconPath = "${self}/files/icons/swarsel.png"; enableColorization = true; icon = "noctalia"; id = "ControlCenter"; - useDistroLogo = true; + useDistroLogo = false; } ]; }; }; general = { - avatarImage = "${self}/files/wallpaper/swarsel.png"; + avatarImage = "${self}/files/icons/swarsel.png"; dimmerOpacity = 0.2; showScreenCorners = false; forceBlackScreenCorners = false; @@ -195,16 +209,16 @@ iRadiusRatio = 1; boxRadiusRatio = 1; screenRadiusRatio = 1; - animationSpeed = 1; + animationSpeed = 1.5; animationDisabled = false; compactLockScreen = true; lockOnSuspend = true; showSessionButtonsOnLockScreen = true; showHibernateOnLockScreen = false; enableShadows = true; - shadowDirection = "bottom_right"; - shadowOffsetX = 2; - shadowOffsetY = 3; + shadowDirection = "center"; + shadowOffsetX = 0; + shadowOffsetY = 0; language = ""; allowPanelsOnScreenWithoutBar = true; showChangelogOnStartup = true; @@ -260,17 +274,17 @@ wallpaper = { enabled = true; overviewEnabled = true; - directory = "${self}/files/wallpaper"; + directory = "${self}/files/wallpaper/landscape"; monitorDirectories = [ ]; enableMultiMonitorDirectories = true; showHiddenFiles = false; viewMode = "single"; - setWallpaperOnAllMonitors = true; + setWallpaperOnAllMonitors = false; fillMode = "crop"; fillColor = "#000000"; useSolidColor = false; solidColor = "#1a1a2e"; - automationEnabled = false; + automationEnabled = true; wallpaperChangeMode = "random"; randomIntervalSec = 300; transitionDuration = 500; @@ -586,7 +600,7 @@ colorizationEnabled = true; colorizationIcon = "Primary"; colorizationBadge = "Tertiary"; - colorizationBadgeText = "Primary"; + colorizationBadgeText = "None"; defaultTab = 1; enableSystemNotifications = true; notifyGitHubNotifications = true; diff --git a/modules/home/optional/work.nix b/modules/home/optional/work.nix index ce0a1e6..d59d082 100644 --- a/modules/home/optional/work.nix +++ b/modules/home/optional/work.nix @@ -297,6 +297,84 @@ in }; services = { + + shikane = { + settings = + let + workRight = [ + "m=HP Z32" + "s=CN41212T55" + "v=HP Inc." + ]; + workLeft = [ + "m=HP 732pk" + "s=CNC4080YL5" + "v=HP Inc." + ]; + exec = [ "notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\"" ]; + in + { + profile = [ + + { + name = "work-internal-on"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = true; + scale = 1.7; + position = "2560,0"; + } + { + match = workRight; + enable = true; + scale = 1.0; + mode = "3840x2160@60Hz"; + position = "-1280,0"; + } + { + match = workLeft; + enable = true; + scale = 1.0; + transform = "270"; + mode = "3840x2160@60Hz"; + position = "-3440,-1050"; + } + ]; + } + { + name = "work-internal-off"; + inherit exec; + output = [ + { + match = config.swarselsystems.sharescreen; + enable = false; + scale = 1.7; + position = "2560,0"; + } + { + match = workRight; + enable = true; + scale = 1.0; + mode = "3840x2160@60Hz"; + position = "-1280,0"; + } + { + match = workLeft; + enable = true; + scale = 1.0; + transform = "270"; + mode = "3840x2160@60Hz"; + position = "-3440,-1050"; + } + ]; + } + + + ]; + }; + }; kanshi = { settings = [ { @@ -338,8 +416,8 @@ in name = "lidopen"; exec = [ "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/landscape/botanicswp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/portrait/op6wp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { @@ -373,7 +451,7 @@ in name = "lidopen"; exec = [ "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/services/navidrome.png --mode ${config.stylix.imageScalingMode}" "${pkgs.kanshare}/bin/kanshare ${config.swarselsystems.sharescreen} '${monitor}'" ]; outputs = [ @@ -396,8 +474,8 @@ in profile = { name = "lidclosed"; exec = [ - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}" - "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP Z32 CN41212T55' --image ${self}/files/wallpaper/landscape/botanicswp.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/portrait/op6wp.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { @@ -428,7 +506,7 @@ in { name = "lidclosed"; exec = [ - "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}" + "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/services/navidrome.png --mode ${config.stylix.imageScalingMode}" ]; outputs = [ { diff --git a/modules/nixos/client/login.nix b/modules/nixos/client/login.nix index 667e959..7fbcf7c 100644 --- a/modules/nixos/client/login.nix +++ b/modules/nixos/client/login.nix @@ -6,14 +6,14 @@ enable = true; settings = { # initial_session.command = "sway"; - initial_session.command = "uwsm start -- sway-uwsm.desktop"; + initial_session.command = "uwsm start -- niri-uwsm.desktop"; # --cmd sway default_session.command = '' ${pkgs.tuigreet}/bin/tuigreet \ --time \ --asterisks \ --user-menu \ - --cmd "uwsm start -- sway-uwsm.desktop" + --cmd "uwsm start -- niri-uwsm.desktop" ''; }; }; diff --git a/modules/nixos/server/router.nix b/modules/nixos/server/router.nix index 5e9f40f..b0c64b3 100644 --- a/modules/nixos/server/router.nix +++ b/modules/nixos/server/router.nix @@ -11,7 +11,8 @@ let lan2VLANs = selectVLANs [ "home" "devices" "services" ]; lan3VLANs = selectVLANs [ "home" "devices" "services" ]; lan4VLANs = lan3VLANs; - lan5VLANs = selectVLANs [ "home" "devices" "guests" ]; + # TODO: remove services and reset ports 5+6 on swLR to guest when kitchen construction is finished + lan5VLANs = selectVLANs [ "home" "devices" "services" "guests" ]; inherit (globals.general) homeDnsServer; in { diff --git a/modules/shared/config-lib.nix b/modules/shared/config-lib.nix index 42a3f3f..1e9b323 100644 --- a/modules/shared/config-lib.nix +++ b/modules/shared/config-lib.nix @@ -165,18 +165,13 @@ in _ = { }; }); - overrideTarget = target: - let - inherit target; - in - { - Unit = { - PartOf = lib.mkForce [ target ]; - After = lib.mkForce [ target ]; - Requires = lib.mkForce [ target ]; - }; - Install.WantedBy = lib.mkForce [ target ]; + overrideTarget = target: { + Unit = { + PartOf = lib.mkForce [ target ]; + After = lib.mkForce [ target ]; }; + Install.WantedBy = lib.mkForce [ target ]; + }; genNginx = { serviceAddress diff --git a/modules/shared/options.nix b/modules/shared/options.nix index 8f56f94..baacc6e 100644 --- a/modules/shared/options.nix +++ b/modules/shared/options.nix @@ -87,7 +87,7 @@ }; wallpaper = lib.mkOption { type = lib.types.path; - default = "${self}/files/wallpaper/lenovowp.png"; + default = "${self}/files/wallpaper/landscape/lenovowp.png"; }; sharescreen = lib.mkOption { type = lib.types.str; diff --git a/profiles/home/personal/default.nix b/profiles/home/personal/default.nix index dba9980..5ba1104 100644 --- a/profiles/home/personal/default.nix +++ b/profiles/home/personal/default.nix @@ -57,6 +57,7 @@ tmux = lib.mkDefault true; vesktop = lib.mkDefault true; vesktop-tray = lib.mkDefault true; + shikane = lib.mkDefault true; syncthing-tray = lib.mkDefault true; waybar = lib.mkDefault true; yubikey = lib.mkDefault false;