From 8f5c2ff8f63c0a8b6b55ffa6b5bf3eb43d39d6fc Mon Sep 17 00:00:00 2001 From: Astreaprtcl Date: Sun, 21 Dec 2025 00:44:47 +0100 Subject: [PATCH] restructure and further configure sway --- all.nix | 10 +- flake.nix | 24 +- programs/all.nix | 16 -- programs/boot.nix | 2 +- programs/git.nix | 8 +- programs/home-manager.nix | 2 +- programs/lix.nix | 17 +- programs/locale.nix | 28 +++ programs/nix.nix | 24 +- programs/programs.nix | 12 + programs/security.nix | 3 +- programs/system.nix | 5 + systems/galen/configuration.nix | 2 - systems/galen/hardware-configuration.nix | 49 ++-- users/all.nix | 7 - users/{home-default.nix => default.nix} | 5 +- users/default/swww.nix | 42 ++++ users/mara/config.nix | 34 +-- users/mara/config/all.nix | 13 -- users/mara/config/fish.nix | 10 +- users/mara/config/kitty.nix | 3 +- users/mara/config/nix.nix | 11 +- users/mara/config/sway.nix | 276 ++++++++++++++--------- users/mara/config/swaylock.nix | 92 ++++++++ users/mara/config/swww.nix | 37 --- 25 files changed, 476 insertions(+), 256 deletions(-) delete mode 100644 programs/all.nix create mode 100644 programs/locale.nix create mode 100644 programs/programs.nix create mode 100644 programs/system.nix delete mode 100644 users/all.nix rename users/{home-default.nix => default.nix} (57%) create mode 100644 users/default/swww.nix delete mode 100644 users/mara/config/all.nix create mode 100644 users/mara/config/swaylock.nix delete mode 100644 users/mara/config/swww.nix diff --git a/all.nix b/all.nix index 253db5f..6fdf250 100644 --- a/all.nix +++ b/all.nix @@ -1,8 +1,8 @@ -{ ... }: +{ lib, ... }: { - imports = [ - ./users/all.nix - ./programs/all.nix - ]; + imports = ( + lib.fileset.toList (lib.fileset.fileFilter (f: f.name == "config.nix") ./users) + ++ lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./programs) + ); } diff --git a/flake.nix b/flake.nix index d2d4dc2..ab520bb 100644 --- a/flake.nix +++ b/flake.nix @@ -4,15 +4,21 @@ home-manager.url = "github:nix-community/home-manager"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; }; - outputs = inputs@{ self, nixpkgs, home-manager, ... }: { - nixosConfigurations = { - galen = nixpkgs.lib.nixosSystem { - modules = [ - home-manager.nixosModules.home-manager - ./systems/galen/configuration.nix - ]; + outputs = + inputs@{ + self, + nixpkgs, + home-manager, + ... + }: + { + nixosConfigurations = { + galen = nixpkgs.lib.nixosSystem { + modules = [ + home-manager.nixosModules.home-manager + ./systems/galen/configuration.nix + ]; + }; }; }; - }; } - diff --git a/programs/all.nix b/programs/all.nix deleted file mode 100644 index 07c8490..0000000 --- a/programs/all.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ ... }: - -{ - imports = [ - ./boot.nix - ./default.nix - ./git.nix - ./greetd.nix - ./home-manager.nix - ./lix.nix - ./nix.nix - ./polkit.nix - ./qemuGuest.nix - ./security.nix - ]; -} diff --git a/programs/boot.nix b/programs/boot.nix index 21df790..40f9bf2 100644 --- a/programs/boot.nix +++ b/programs/boot.nix @@ -8,7 +8,7 @@ efi.canTouchEfiVariables = true; limine = { enable = true; - style.wallpapers = []; + style.wallpapers = [ ]; }; }; }; diff --git a/programs/git.nix b/programs/git.nix index 23a9cad..8a3626e 100644 --- a/programs/git.nix +++ b/programs/git.nix @@ -3,8 +3,10 @@ { programs.git = { enable = true; - config = [{ - init.defaultBranch = "main"; - }]; + config = [ + { + init.defaultBranch = "main"; + } + ]; }; } diff --git a/programs/home-manager.nix b/programs/home-manager.nix index 68237f0..19ce9ad 100644 --- a/programs/home-manager.nix +++ b/programs/home-manager.nix @@ -1,4 +1,4 @@ -{ home-manager, ... }: +{ ... }: { home-manager = { diff --git a/programs/lix.nix b/programs/lix.nix index 8a675cb..be420c5 100644 --- a/programs/lix.nix +++ b/programs/lix.nix @@ -1,13 +1,16 @@ { pkgs, ... }: { - nixpkgs.overlays = [ (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena; - }) ]; + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; nix.package = pkgs.lixPackageSets.stable.lix; } diff --git a/programs/locale.nix b/programs/locale.nix new file mode 100644 index 0000000..9d8f25e --- /dev/null +++ b/programs/locale.nix @@ -0,0 +1,28 @@ +{ ... }: + +{ + time.timeZone = "Europe/Berlin"; + i18n = { + defaultLocale = "en_IE.UTF-8"; + supportedLocales = [ + "C.UTF-8/UTF-8" + "en_GB.UTF-8/UTF-8" + "en_IE.UTF-8/UTF-8" + "en_US.UTF-8/UTF-8" + "de_DE.UTF-8/UTF-8" + ]; + extraLocaleSettings = { + LANGUAGE = "en_IE.UTF-8"; + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + LANG = "en_IE.UTF-8"; + }; + }; +} diff --git a/programs/nix.nix b/programs/nix.nix index c4d2c12..801ab90 100644 --- a/programs/nix.nix +++ b/programs/nix.nix @@ -1,8 +1,24 @@ { ... }: { - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; + nix = { + optimise.automatic = true; + settings = { + auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + ]; + }; + }; + programs = { + nix-index.enable = true; + command-not-found.enable = true; + nix-ld.enable = true; + nh = { + enable = true; + clean.enable = true; + flake = "/etc/nixos"; + }; + }; } diff --git a/programs/programs.nix b/programs/programs.nix new file mode 100644 index 0000000..ee4b4fe --- /dev/null +++ b/programs/programs.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + programs = { + fish.enable = true; + }; + environment.systemPackages = with pkgs; [ + brightnessctl + nixfmt-rfc-style + nixfmt-tree + ]; +} diff --git a/programs/security.nix b/programs/security.nix index fb72f00..05aca47 100644 --- a/programs/security.nix +++ b/programs/security.nix @@ -1,8 +1,9 @@ -{ pkgs, ... }: +{ ... }: { security = { sudo.enable = false; sudo-rs.enable = true; + pam.services.swaylock = { }; }; } diff --git a/programs/system.nix b/programs/system.nix new file mode 100644 index 0000000..01aaceb --- /dev/null +++ b/programs/system.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + system.stateVersion = "25.11"; +} diff --git a/systems/galen/configuration.nix b/systems/galen/configuration.nix index 1816e62..63b3c30 100644 --- a/systems/galen/configuration.nix +++ b/systems/galen/configuration.nix @@ -23,6 +23,4 @@ console = { keyMap = "de"; }; - - system.stateVersion = "25.11"; } diff --git a/systems/galen/hardware-configuration.nix b/systems/galen/hardware-configuration.nix index 37b2e35..efb57e5 100644 --- a/systems/galen/hardware-configuration.nix +++ b/systems/galen/hardware-configuration.nix @@ -1,32 +1,47 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/637c5040-7824-4308-bb4b-32b486cb326d"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/637c5040-7824-4308-bb4b-32b486cb326d"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1A25-9FA7"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/b89cb4bb-b75e-4479-9023-cc338835bb74"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1A25-9FA7"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/b89cb4bb-b75e-4479-9023-cc338835bb74"; } + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/users/all.nix b/users/all.nix deleted file mode 100644 index aa5e08e..0000000 --- a/users/all.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./mara/config.nix - ]; -} diff --git a/users/home-default.nix b/users/default.nix similarity index 57% rename from users/home-default.nix rename to users/default.nix index 650ee65..d1db2c3 100644 --- a/users/home-default.nix +++ b/users/default.nix @@ -1,8 +1,9 @@ -{ osConfig, ... }: +{ osConfig, lib, ... }: { + imports = lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./default); + programs.home-manager.enable = true; - nixpkgs.config.allowUnfree = true; home = { stateVersion = osConfig.system.stateVersion; diff --git a/users/default/swww.nix b/users/default/swww.nix new file mode 100644 index 0000000..8ba4a1e --- /dev/null +++ b/users/default/swww.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + options.services.swww-randomize = { + enable = lib.mkEnableOption "enable the randomization swww service"; + backgroundDir = lib.mkOption { + default = config.home.homeDirectory + "/Pictures/Backgrounds"; + description = "directory with images to use for the background"; + type = with lib.types; uniq str; + }; + }; + + config = { + services.swww.enable = true; + systemd.user = { + services.swww-randomize = { + Unit = { + Description = "randomly change the swww background image"; + Requires = "swww.service"; + }; + Service = { + Type = "oneshot"; + ExecStart = "${lib.getExe pkgs.bash} -c '${lib.getExe pkgs.findutils} ${config.services.swww-randomize.backgroundDir} -type f | ${lib.getExe' pkgs.coreutils "shuf"} -n 1 | ${lib.getExe' pkgs.findutils "xargs"} ${lib.getExe pkgs.swww} img --transition-step 16'"; + }; + Install.WantedBy = [ "default.target" ]; + }; + timers.swww-randomize = { + Unit.Description = "randomly changes the swww background image"; + Timer = { + Unit = "swww-randomize"; + OnCalendar = "*-*-* *:00,30:00"; + }; + Install.WantedBy = [ "timers.target" ]; + }; + }; + }; +} diff --git a/users/mara/config.nix b/users/mara/config.nix index a70ed32..4edb030 100644 --- a/users/mara/config.nix +++ b/users/mara/config.nix @@ -1,28 +1,32 @@ -{ config, lib, pkgs, home-manager, ... }: +{ + config, + lib, + pkgs, + home-manager, + ... +}: let - inherit (lib) mkEnableOption mkIf; cfg = config.users.mara; in { - options.users.mara.enable = mkEnableOption "Enable the user Mara"; + options.users.mara.enable = lib.mkEnableOption "Enable the user Mara"; - config = mkIf cfg.enable { - home-manager.users.mara = { config, pkgs, ... }: + config = lib.mkIf cfg.enable { + home-manager.users.mara = + { config, pkgs, ... }: - { - imports = [ - ../home-default.nix - ./config/all.nix - ]; + { + imports = ( + [ ../default.nix ] ++ lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./config) + ); - home = { - username = "mara"; - homeDirectory = "/home/mara"; + home = { + username = "mara"; + homeDirectory = "/home/mara"; + }; }; - custom.backgroundDir = config.home.homeDirectory + "/Pictures/Archive/Wallpaper/Landscape"; - }; programs.fish.enable = true; diff --git a/users/mara/config/all.nix b/users/mara/config/all.nix deleted file mode 100644 index 1e6563c..0000000 --- a/users/mara/config/all.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: - -{ - imports = [ - ./fish.nix - ./fuzzel.nix - ./helix.nix - ./kitty.nix - ./nix.nix - ./sway.nix - ./swww.nix - ]; -} diff --git a/users/mara/config/fish.nix b/users/mara/config/fish.nix index 2d04535..55e6456 100644 --- a/users/mara/config/fish.nix +++ b/users/mara/config/fish.nix @@ -7,17 +7,17 @@ interactiveShellInit = '' set fish_greeting ''; - + functions = { fish_prompt.body = '' printf '%s %s > ' (set_color purple)(whoami)@(prompt_hostname) (set_color blue)(prompt_pwd)(set_color normal) ''; fish_right_prompt.body = '' - set stat $status - set -g __fish_git_prompt_showupstream verbose - set -g __fish_git_prompt_showcolorhints 1 - printf '%s %s' (fish_vcs_prompt) [(set_color red)$stat(set_color normal)] + set stat $status + set -g __fish_git_prompt_showupstream verbose + set -g __fish_git_prompt_showcolorhints 1 + printf '%s %s' (fish_vcs_prompt) [(set_color red)$stat(set_color normal)] ''; }; }; diff --git a/users/mara/config/kitty.nix b/users/mara/config/kitty.nix index eb385a8..ccb52f0 100644 --- a/users/mara/config/kitty.nix +++ b/users/mara/config/kitty.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { programs.kitty = { @@ -8,6 +8,7 @@ font = { name = "Maple Mono NF"; size = 11; + package = pkgs.maple-mono.NF; }; shellIntegration.enableFishIntegration = true; diff --git a/users/mara/config/nix.nix b/users/mara/config/nix.nix index 831f14c..579e5ed 100644 --- a/users/mara/config/nix.nix +++ b/users/mara/config/nix.nix @@ -1,8 +1,11 @@ -{ ... }: +{ pkgs, ... }: { - programs.nix-index = { - enable = true; - enableFishIntegration = true; + programs = { + nix-index = { + enable = true; + enableFishIntegration = true; + }; + nix-search-tv.enable = true; }; } diff --git a/users/mara/config/sway.nix b/users/mara/config/sway.nix index cd40024..fa6f9e6 100644 --- a/users/mara/config/sway.nix +++ b/users/mara/config/sway.nix @@ -1,55 +1,86 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - inherit (lib) concatMapStringsSep getExe getExe'; + inherit (lib) + concatMapStringsSep + getExe + getExe' + mkOption + types + ; in { - wayland.windowManager.sway = { - enable = true; - package = pkgs.swayfx; - wrapperFeatures.gtk = true; - checkConfig = false; - extraConfigEarly = '' - blur enable - blur_passes 2 - blur_radius 4 + options.custom.screenShotDir = mkOption { + default = config.home.homeDirectory + "/Pictures/Screenshots"; + type = with types; uniq str; + description = "Folder for all screenshots"; + }; - shadows enable - shadow_blur_radius 16 + config = { + services.swww-randomize = { + enable = true; + backgroundDir = config.home.homeDirectory + "/Pictures/Archive/Wallpaper/Landscape"; + }; + wayland.windowManager.sway = { + enable = true; + package = pkgs.swayfx; + wrapperFeatures.gtk = true; + checkConfig = false; + extraConfigEarly = '' + blur enable + blur_passes 2 + blur_radius 4 - layer_effects "waybar" blur enable - layer_effects "launcher" blur enable - layer_effects "notifications" blur enable - ''; - config = rec { - modifier = "Mod1"; + shadows enable + shadow_blur_radius 16 - input."*" = { - xkb_layout = "de,gb"; - xkb_variant = ",colemak_dh"; - xkb_numlock = "enabled"; - }; + layer_effects "waybar" blur enable + layer_effects "launcher" blur enable + layer_effects "notifications" blur enable - output."BOE 0x0BCA Unknown".scale = "1.5"; + bindgesture swipe:right workspace prev + bindgesture swipe:left workspace next + ''; + config = rec { + modifier = "Mod1"; + terminal = getExe pkgs.kitty; + menu = getExe pkgs.fuzzel; - seat = { - "*".hide_cursor = "when-typing enable"; - seat0.fallback = "true"; - seat1."\r" = concatMapStringsSep "\n " (s: " attach ${s}") [ - "9390:4610:Rapoo_Rapoo_Gaming_Device" - "9390:4610:Rapoo_Rapoo_Gaming_Device_Keyboard" - ]; - }; - - keybindings = - let - mod = config.wayland.windowManager.sway.config.modifier; - in - { + input = { + "type:touchpad" = { + tap = "on"; + }; + "*" = { + accel_profile = "flat"; + pointer_accel = "-0.1"; + xkb_layout = "de,gb"; + xkb_variant = ",colemak_dh"; + xkb_numlock = "enabled"; + }; + }; + + output."BOE 0x0BCA Unknown".scale = "1.5"; + + seat = { + "*".hide_cursor = "when-typing enable"; + seat0.fallback = "true"; + seat1."\r" = concatMapStringsSep "\n " (s: " attach ${s}") [ + "9390:4610:Rapoo_Rapoo_Gaming_Device" + "9390:4610:Rapoo_Rapoo_Gaming_Device_Keyboard" + ]; + }; + + keybindings = { # Computer Control "${modifier}+Escape" = "exit"; - "${modifier}+Shift+Escape" = "exec ${getExe' pkgs.coreutils "printf"} 'poweroff\\nreboot\\nhibernate\\n' | ${getExe pkgs.fuzzel} -d'"; + "${modifier}+Shift+Escape" = + "exec ${getExe' pkgs.coreutils "printf"} 'poweroff\\nreboot\\nhibernate\\n' | ${menu} -d | ${getExe' pkgs.findutils "xargs"} ${getExe' pkgs.systemd "systemctl"}"; # Focus "${modifier}+Down" = "focus down"; @@ -90,7 +121,6 @@ in "${modifier}+0" = "workspace number 0"; "${modifier}+Shift+0" = "move window to workspace number 0"; - # Sway Control "${modifier}+Shift+q" = "kill"; "${modifier}+Shift+c" = "reload"; @@ -102,77 +132,111 @@ in # Programs "${modifier}+a" = "exec ${getExe pkgs.nemo}"; - "${modifier}+Return" = "exec ${getExe pkgs.kitty}"; + "${modifier}+Return" = "exec ${terminal}"; # dmenu - "${modifier}+d" = "exec ${getExe pkgs.fuzzel}"; + "${modifier}+d" = "exec ${menu}"; + "${modifier}+s" = + "exec ${getExe pkgs.bash} -c \"${terminal} ssh $(grep -P '^Host (?!\\*)' ${config.home.homeDirectory}/.ssh/config | ${getExe' pkgs.coreutils "cut"} -d ' ' -f2 | ${menu} -d)\""; + "${modifier}+e" = + "exec ${getExe pkgs.bash} -c \"${getExe pkgs.uni} emoji all -f '%(emoji h) %(cldr_full h Q:[:])' | ${getExe pkgs.gnused} '/^$/d' | ${menu} -d | ${getExe' pkgs.coreutils "cut"} -d ' ' -f1 | ${getExe' pkgs.coreutils "tr"} -d '\\n' | ${getExe' pkgs.wl-clipboard-rs "wl-copy"}\""; + + # Wallpaper + "${modifier}+b" = "exec ${getExe' pkgs.systemd "systemctl"} --user start swww-randomize"; + # Notifications + "${modifier}+n" = "exec ${getExe' pkgs.dunst "dunstctl"} history-pop"; + + # Screenshot + "${modifier}+Shift+s" = + "exec ${getExe pkgs.bash} -c \"${getExe' pkgs.coreutils "mkdir"} -p ${config.custom.screenShotDir}; ${getExe pkgs.wayfreeze} --hide-cursor --after-freeze-cmd '${getExe pkgs.sway-contrib.grimshot} savecopy area ${config.custom.screenShotDir}/$(${getExe' pkgs.coreutils "date"} -Iseconds).png; ${getExe pkgs.killall} wayfreeze'\""; + + # Screenlock + "${modifier}+l" = "exec --no-startup-id ${getExe pkgs.swaylock}"; + + # Audio + "--locked XF86AudioLowerVolume" = + "exec ${getExe pkgs.pulsemixer} --change-volume -5 --max-volume 100"; + "--locked XF86AudioRaiseVolume" = + "exec ${getExe pkgs.pulsemixer} --change-volume +5 --max-volume 100"; + "--locked XF86AudioNext" = "exec ${getExe pkgs.playerctl} next"; + "--locked XF86AudioPrev" = "exec ${getExe pkgs.playerctl} previous"; + "--locked XF86AudioPause" = "exec ${getExe pkgs.playerctl} play-pause"; + "--locked XF86AudioPlay" = "exec ${getExe pkgs.playerctl} play-pause"; + "--locked XF86AudioMute" = "exec ${getExe pkgs.pulsemixer} --toggle-mute"; + "--locked XF86AudioMicMute" = + "exec ${getExe pkgs.pulsemixer} --toggle-mute --id $(${getExe pkgs.pulsemixer} --list-sources | grep -Po 'source-\\d{2}(?=.*Default$)')"; + + # Brightness + "--locked XF86MonBrightnessDown" = "exec ${getExe pkgs.brightnessctl} set 5%-"; + "--locked XF86MonBrightnessUp" = "exec ${getExe pkgs.brightnessctl} set 5%+"; }; - colors = { - background = "#856cf9"; - focused = { - background = "#182030"; - border = "#5c4a94"; - childBorder = "#856cd9"; - indicator = "#856cd9"; - text = "#856cd9"; + colors = { + background = "#856cf9"; + focused = { + background = "#182030"; + border = "#5c4a94"; + childBorder = "#856cd9"; + indicator = "#856cd9"; + text = "#856cd9"; + }; + focusedInactive = { + background = "#5c4a94"; + border = "#5c4a94"; + childBorder = "#5c4a94"; + indicator = "#5c4a94"; + text = "#5c4a94"; + }; + unfocused = { + background = "#5c4a94"; + border = "#5c4a94"; + childBorder = "#5c4a94"; + indicator = "#5c4a94"; + text = "#5c4a94"; + }; + urgent = { + background = "#2f343a"; + border = "#900000"; + childBorder = "#ffffff"; + indicator = "#900000"; + text = "#900000"; + }; + placeholder = { + background = "#000000"; + border = "#0c0c0c"; + childBorder = "#ffffff"; + indicator = "#000000"; + text = "#0c0c0c"; + }; }; - focusedInactive = { - background = "#5c4a94"; - border = "#5c4a94"; - childBorder = "#5c4a94"; - indicator = "#5c4a94"; - text = "#5c4a94"; - }; - unfocused = { - background = "#5c4a94"; - border = "#5c4a94"; - childBorder = "#5c4a94"; - indicator = "#5c4a94"; - text = "#5c4a94"; - }; - urgent = { - background = "#2f343a"; - border = "#900000"; - childBorder = "#ffffff"; - indicator = "#900000"; - text = "#900000"; - }; - placeholder = { - background = "#000000"; - border = "#0c0c0c"; - childBorder = "#ffffff"; - indicator = "#000000"; - text = "#0c0c0c"; - }; - }; - gaps = { - inner = 5; - outer = 0; - }; - - floating = { - border = 2; - titlebar = false; - }; - window = { - border = 2; - titlebar = false; - commands = [ - { - criteria.app_id = ".*"; - command = "inhibit_idle fullscreen"; - } - { - criteria.app_id = "org\.keepassxc\.KeePassXC"; - command = "floating enable"; - } - { - criteria.app_id = "xfce-polkit"; - command = "floating enable"; - } - ]; + gaps = { + inner = 5; + outer = 0; + }; + + floating = { + border = 2; + titlebar = false; + }; + window = { + border = 2; + titlebar = false; + commands = [ + { + criteria.app_id = ".*"; + command = "inhibit_idle fullscreen"; + } + { + criteria.app_id = "org\.keepassxc\.KeePassXC"; + command = "floating enable"; + } + { + criteria.app_id = "xfce-polkit"; + command = "floating enable"; + } + ]; + }; }; }; }; diff --git a/users/mara/config/swaylock.nix b/users/mara/config/swaylock.nix new file mode 100644 index 0000000..d57b269 --- /dev/null +++ b/users/mara/config/swaylock.nix @@ -0,0 +1,92 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + inherit (lib) getExe; +in + +{ + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + # Background + color = "#232136"; + image = config.services.swww-randomize.backgroundDir + "/Alena_Aenami-Clouds.jpg"; + + # Swaylock-effects + screenshot = true; + effect-blur = "5x5"; + fade-in = "1"; + clock = true; + indicator = true; + datestr = ""; + + # Layout text colors + layout-bg-color = "#00000000"; + layout-border-color = "#00000000"; + layout-text-color = "#e0def4"; + + # Text color + text-color = "#3e8fb0"; + text-clear-color = "#9ccdf8"; + text-caps-lock-color = "#f6c177"; + text-ver-color = "#c4a7e7"; + text-wrong-color = "#eb6f92"; + + # Highlight segments + bs-hl-color = "#23213666"; + key-hl-color = "#3e8fb0"; + caps-lock-bs-hl-color = "#23213666"; + caps-lock-key-hl-color = "#f6c177"; + + # Inside of the indicator + inside-color = "#22222add"; + inside-clear-color = "#22222add"; + inside-caps-lock-color = "#22222add"; + inside-ver-color = "#22222add"; + inside-wrong-color = "#22222add"; + + # Line between inside and ring + line-color = "#3e8fb011"; + line-clear-color = "#9ccfd811"; + line-caps-lock-color = "#f6c17711"; + line-ver-color = "#c4a7e711"; + line-wrong-color = "#eb6f9211"; + + # Indicator ring + ring-color = "#3e8fb0aa"; + ring-clear-color = "#9ccfd8aa"; + ring-caps-lock-color = "#f6c177aa"; + ring-ver-color = "#c4a7e7aa"; + ring-wrong-color = "#eb6f92aa"; + + # Indicator + font = "Maple Mono NF"; + indicator-radius = 80; + indicator-thickness = 8; + }; + }; + services.swayidle = { + enable = true; + timeouts = [ + { + timeout = 300; + command = "${getExe pkgs.brightnessctl} -s s $(($(${getExe pkgs.brightnessctl} g) / 2))"; + resumeCommand = "${getExe pkgs.brightnessctl} -r"; + } + { + timeout = 360; + command = "${getExe pkgs.swaylock-effects} -f"; + } + ]; + events = { + before-sleep = "${getExe pkgs.swaylock-effects} -f"; + lock = "${getExe pkgs.swaylock-effects} -f"; + }; + }; +} diff --git a/users/mara/config/swww.nix b/users/mara/config/swww.nix deleted file mode 100644 index a03fa95..0000000 --- a/users/mara/config/swww.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - inherit (lib) getExe getExe' mkOption types; -in - -{ - options.custom.backgroundDir = mkOption { - default = config.home.homeDirectory + "/Pictures/Backgrounds"; - type = with types; uniq str; - }; - - config = { - services.swww.enable = true; - systemd.user = { - services.swww-randomize = { - Unit = { - Description = "randomly change the swww background image"; - Requires = "swww.service"; - }; - Service = { - Type = "oneshot"; - ExecStart = "${getExe pkgs.bash} -c '${getExe pkgs.findutils} ${config.custom.backgroundDir} -type f | ${getExe' pkgs.coreutils "shuf"} -n 1 | ${getExe' pkgs.findutils "xargs"} ${getExe pkgs.swww} img --transition-step 16'"; - }; - Install.WantedBy = [ "default.target" ]; - }; - timers.swww-randomize = { - Unit.Description = "randomly changes the swww background image"; - Timer = { - Unit = "swww-random"; - OnCalendar = "*-*-* *:00,30:00"; - }; - Install.WantedBy = [ "timers.target" ]; - }; - }; - }; -}