diff --git a/flake.lock b/flake.lock index c4de84b..fce3159 100644 --- a/flake.lock +++ b/flake.lock @@ -117,11 +117,11 @@ ] }, "locked": { - "lastModified": 1712462372, - "narHash": "sha256-WA3bbBWhd3o1wAgyHZNypjb/LG4oq+IWxFq8ey8yNPU=", + "lastModified": 1717931644, + "narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=", "owner": "nix-community", "repo": "home-manager", - "rev": "a561ad6ab38578c812cc9af3b04f2cc60ebf48c9", + "rev": "3d65009effd77cb0d6e7520b68b039836a7606cf", "type": "github" }, "original": { @@ -132,11 +132,11 @@ }, "impermanence": { "locked": { - "lastModified": 1708968331, - "narHash": "sha256-VUXLaPusCBvwM3zhGbRIJVeYluh2uWuqtj4WirQ1L9Y=", + "lastModified": 1717932370, + "narHash": "sha256-7C5lCpiWiyPoIACOcu2mukn/1JRtz6HC/1aEMhUdcw0=", "owner": "nix-community", "repo": "impermanence", - "rev": "a33ef102a02ce77d3e39c25197664b7a636f9c30", + "rev": "27979f1c3a0d3b9617a3563e2839114ba7d48d3f", "type": "github" }, "original": { @@ -174,11 +174,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712439257, - "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "lastModified": 1717786204, + "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "rev": "051f920625ab5aabe37c920346e3e69d7d34400e", "type": "github" }, "original": { diff --git a/home/programs/graphical/default.nix b/home/programs/graphical/default.nix index 47e6869..e5fd07c 100644 --- a/home/programs/graphical/default.nix +++ b/home/programs/graphical/default.nix @@ -1,5 +1,6 @@ _: { imports = [ ./wms + ./launchers ]; } diff --git a/home/programs/graphical/launchers/default.nix b/home/programs/graphical/launchers/default.nix new file mode 100644 index 0000000..f536ed5 --- /dev/null +++ b/home/programs/graphical/launchers/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + #./anyrun + #./rofi + #./tofi + ./walker + ./wofi + ]; +} diff --git a/home/programs/graphical/launchers/walker/config.json b/home/programs/graphical/launchers/walker/config.json new file mode 100644 index 0000000..e2f5ad1 --- /dev/null +++ b/home/programs/graphical/launchers/walker/config.json @@ -0,0 +1,97 @@ +{ + "placeholder": "Search...", + "keep_open": false, + "ignore_mouse": false, + "ssh_host_file": "", + "enable_typeahead": false, + "show_initial_entries": true, + "fullscreen": false, + "scrollbar_policy": "automatic", + "hyprland": { + "context_aware_history": false + }, + "activation_mode": { + "disabled": false, + "use_f_keys": false, + "use_alt": false + }, + "search": { + "delay": 0, + "hide_icons": false, + "margin_spinner": 10, + "hide_spinner": false + }, + "runner": { + "excludes": [ + "rm" + ] + }, + "clipboard": { + "max_entries": 10, + "image_height": 300 + }, + "align": { + "ignore_exlusive": true, + "width": 400, + "horizontal": "center", + "vertical": "start", + "anchors": { + "top": false, + "left": false, + "bottom": false, + "right": false + }, + "margins": { + "top": 20, + "bottom": 0, + "end": 0, + "start": 0 + } + }, + "list": { + "height": 300, + "margin_top": 10, + "always_show": true, + "hide_sub": false + }, + "orientation": "vertical", + "icons": { + "theme": "", + "hide": false, + "size": 28, + "image_height": 200 + }, + "modules": [ + { + "name": "runner", + "prefix": "" + }, + { + "name": "applications", + "prefix": "" + }, + { + "name": "ssh", + "prefix": "", + "switcher_exclusive": true + }, + { + "name": "finder", + "prefix": "", + "switcher_exclusive": true + }, + { + "name": "commands", + "prefix": "", + "switcher_exclusive": true + }, + { + "name": "websearch", + "prefix": "?" + }, + { + "name": "switcher", + "prefix": "/" + } + ] +} diff --git a/home/programs/graphical/launchers/walker/default.nix b/home/programs/graphical/launchers/walker/default.nix new file mode 100644 index 0000000..ed21743 --- /dev/null +++ b/home/programs/graphical/launchers/walker/default.nix @@ -0,0 +1,20 @@ +{ + osConfig, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = osConfig.myOptions.home-manager.programs.launchers.walker; +in { + config = mkIf cfg.enable { + home.packages = with pkgs; [ + walker + ]; + + xdg.configFile = { + "walker/config.json".source = ./config.json; + "walker/style.css".source = ./style.css; + }; + }; +} diff --git a/home/programs/graphical/launchers/walker/style.css b/home/programs/graphical/launchers/walker/style.css new file mode 100644 index 0000000..d726a1a --- /dev/null +++ b/home/programs/graphical/launchers/walker/style.css @@ -0,0 +1,90 @@ +* { + color: #dcd7ba; +} + +#window { + background: #1c1c23; + opacity: 0.9; + border: 4px solid #26262d; +} + +#box { + background: #16161d; + padding: 10px; + border-radius: 2px; +} + +#searchwrapper {} + +#search, +#typeahead { + border-radius: 0; + outline: none; + outline-width: 0px; + box-shadow: none; + border-bottom: none; + border: none; + background: #1f1f28; + padding-left: 10px; + padding-right: 10px; + padding-top: 0px; + padding-bottom: 0px; + border-radius: 2px; +} + +#spinner { + opacity: 0; +} + +#spinner.visible { + opacity: 1; +} + +#typeahead { + background: none; + opacity: 0.5; +} + +#search placeholder { + opacity: 0.5; +} + +#list { + background: #1c1c23; +} + +row:selected { + background: rgba(100, 100, 100, 0.3); +} + +.item { + padding: 5px; + border-radius: 2px; +} + +.icon { + padding-right: 5px; +} + +.textwrapper {} + +.label {} + +.sub { + opacity: 0.5; +} + +.activationlabel { + opacity: 0.25; +} + +.activation .activationlabel { + opacity: 1; + color: #76946a; +} + +.activation .textwrapper, +.activation .icon, +.activation .search { + opacity: 0.5; +} diff --git a/home/programs/graphical/launchers/wofi/default.nix b/home/programs/graphical/launchers/wofi/default.nix new file mode 100644 index 0000000..37f945d --- /dev/null +++ b/home/programs/graphical/launchers/wofi/default.nix @@ -0,0 +1,26 @@ +{ + osConfig, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = osConfig.myOptions.home-manager.programs.launchers.wofi; +in { + config = mkIf cfg.enable { + programs.wofi = { + enable = true; + settings = { + width = "40%"; + height = "30%"; + show = "drun"; + prompt = "Search"; + allow_images = true; + allow_markup = true; + insensitive = true; + }; + style = '' + ${builtins.readFile ./style.css} + ''; + }; + }; +} diff --git a/home/programs/graphical/launchers/wofi/style.css b/home/programs/graphical/launchers/wofi/style.css new file mode 100644 index 0000000..0ef36a6 --- /dev/null +++ b/home/programs/graphical/launchers/wofi/style.css @@ -0,0 +1,51 @@ +window { + font-family: "DejaVu Sans", "Font Awesome 5 Free"; + margin: 0px; + border: 1px solid rgba(0, 0, 0, 0.9); + background-color: rgba(29, 31, 33, 0.95); + border-radius: 10px; +} + +#input { + margin: 5px; + border: none; + color: #f8f8f2; + background-color: rgba(55, 59, 65, 0.95); +} + +#inner-box { + margin: 5px; + border: none; + background-color: transparent; +} + +#outer-box { + margin: 5px; + border: none; + background-color: transparent; +} + +#scroll { + margin: 0px; + border: none; +} + +#text { + margin: 5px; + border: none; + color: #c5c8c6; +} + +#entry { + border: none; +} + +#entry:focus { + border: none; +} + +#entry:selected { + background-color: rgba(55, 59, 65, 0.95); + border-radius: 5px; + border: none; +} diff --git a/home/programs/graphical/wms/hyprland/config/keybinds.nix b/home/programs/graphical/wms/hyprland/config/keybinds.nix index 9aab3e6..5252473 100644 --- a/home/programs/graphical/wms/hyprland/config/keybinds.nix +++ b/home/programs/graphical/wms/hyprland/config/keybinds.nix @@ -23,6 +23,7 @@ # Programs # "SUPER, Return, exec, kitty" + "SUPER, R, exec, walker" # TODO: requires programs # diff --git a/hosts/herugrim/default.nix b/hosts/herugrim/default.nix index 6b6beb7..01046e6 100644 --- a/hosts/herugrim/default.nix +++ b/hosts/herugrim/default.nix @@ -77,6 +77,7 @@ home-manager = { enable = true; stateVersion = "23.11"; + git = { userName = "ItsDrike"; userEmail = "itsdrike@protonmail.com"; @@ -85,6 +86,7 @@ key = "FA2745890B7048C0"; }; }; + wms.hyprland = { enable = true; monitor = [ diff --git a/options/home/default.nix b/options/home/default.nix index 506671b..9f3f0c2 100644 --- a/options/home/default.nix +++ b/options/home/default.nix @@ -3,6 +3,7 @@ in { imports = [ + ./programs ./git.nix ./wms.nix ]; diff --git a/options/home/programs/default.nix b/options/home/programs/default.nix new file mode 100644 index 0000000..cd18b5f --- /dev/null +++ b/options/home/programs/default.nix @@ -0,0 +1,15 @@ +{ lib, ... }: with lib; let + inherit (lib) mkEnableOption mkOption types; +in +{ + options.myOptions.home-manager.programs = { + launchers = { + wofi.enable = mkEnableOption "Wofi launcher"; + walker.enable = mkOption { + type = types.bool; + default = true; + description = "Enable Walker launcher."; + }; + }; + }; +} diff --git a/system/roles/laptop/touchpad.nix b/system/roles/laptop/touchpad.nix index 685d724..aa05640 100644 --- a/system/roles/laptop/touchpad.nix +++ b/system/roles/laptop/touchpad.nix @@ -4,7 +4,7 @@ acceptedTypes = ["laptop"]; in { config = mkIf (builtins.elem deviceType acceptedTypes) { - services.xserver.libinput = { + services.libinput = { # enable libinput enable = true; @@ -17,7 +17,7 @@ in { # touchpad settings touchpad = { - naturalScrolling = false; # I'm weird like that + naturalScrolling = false; # I'm not natural tapping = true; clickMethod = "clickfinger"; horizontalScrolling = true; diff --git a/system/roles/workstation/default.nix b/system/roles/workstation/default.nix index 54b31e5..1c83f82 100644 --- a/system/roles/workstation/default.nix +++ b/system/roles/workstation/default.nix @@ -3,5 +3,6 @@ ./services ./programs ./fonts.nix + ./runners.nix ]; } diff --git a/system/roles/workstation/programs/default.nix b/system/roles/workstation/programs/default.nix index 661d81a..10f2500 100644 --- a/system/roles/workstation/programs/default.nix +++ b/system/roles/workstation/programs/default.nix @@ -2,5 +2,6 @@ imports = [ ./misc.nix ./physlock.nix + ./thunar.nix ]; } diff --git a/system/roles/workstation/programs/physlock.nix b/system/roles/workstation/programs/physlock.nix index b692160..ef08482 100644 --- a/system/roles/workstation/programs/physlock.nix +++ b/system/roles/workstation/programs/physlock.nix @@ -1,8 +1,14 @@ -{ - # Screen locker which works across all virtual terminals - # Use `systemctl start physlock` to securely lock the screen - services.physlock = { - enable = true; - lockMessage = "System is locked..."; +{ lib, config, ...}: let + inherit (lib) mkIf; + deviceType = config.myOptions.device.roles.type; + acceptedTypes = ["laptop" "desktop"]; +in { + config = mkIf (builtins.elem deviceType acceptedTypes) { + # Screen locker which works across all virtual terminals + # Use `systemctl start physlock` to securely lock the screen + services.physlock = { + enable = true; + lockMessage = "System is locked..."; + }; }; } diff --git a/system/roles/workstation/programs/thunar.nix b/system/roles/workstation/programs/thunar.nix new file mode 100644 index 0000000..513b2ec --- /dev/null +++ b/system/roles/workstation/programs/thunar.nix @@ -0,0 +1,37 @@ +{ + lib, + pkgs, + config, + ... +}: let + inherit (lib) mkIf; + deviceType = config.myOptions.device.roles.type; + acceptedTypes = ["laptop" "desktop"]; +in { + config = mkIf (builtins.elem deviceType acceptedTypes) { + # Unconditionally enable thunar file manager here as a relatively + # lightweight fallback option for my default file manager. + programs.thunar = { + enable = true; + + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-media-tags-plugin + ]; + }; + + environment = { + systemPackages = with pkgs; [ + # packages necessery for thunar thumbnails + xfce.tumbler + libgsf # odf files + ffmpegthumbnailer + ark # GUI archiver for thunar archive plugin + ]; + }; + + # thumbnail support on thunar + services.tumbler.enable = true; + }; +} + diff --git a/system/roles/workstation/runners.nix b/system/roles/workstation/runners.nix new file mode 100644 index 0000000..6b6fae4 --- /dev/null +++ b/system/roles/workstation/runners.nix @@ -0,0 +1,52 @@ +{ + config, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf; + + deviceType = config.myOptions.device.roles.type; + acceptedTypes = ["laptop" "desktop"]; +in { + config = mkIf (builtins.elem deviceType acceptedTypes) { + environment.systemPackages = [pkgs.appimage-run]; + + # run appimages with appimage-run + boot.binfmt.registrations = lib.genAttrs ["appimage" "AppImage"] (_: { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff"; + magicOrExtension = "\\x7fELF....AI\\x02"; + }); + + # run unpatched linux binaries with nix-ld + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc + openssl + curl + glib + util-linux + glibc + icu + libunwind + libuuid + zlib + libsecret + # graphical + freetype + libglvnd + libnotify + SDL2 + vulkan-loader + gdk-pixbuf + xorg.libX11 + ]; + }; + }; +} + diff --git a/system/roles/workstation/services/default.nix b/system/roles/workstation/services/default.nix index a68d854..3f856bc 100644 --- a/system/roles/workstation/services/default.nix +++ b/system/roles/workstation/services/default.nix @@ -3,6 +3,7 @@ ./earlyoom.nix ./mount.nix ./printing.nix + ./misc.nix ]; } diff --git a/system/roles/workstation/services/misc.nix b/system/roles/workstation/services/misc.nix new file mode 100644 index 0000000..99d263e --- /dev/null +++ b/system/roles/workstation/services/misc.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + + deviceType = config.myOptions.device.roles.type; + acceptedTypes = ["laptop" "desktop"]; +in { + config = mkIf (builtins.elem deviceType acceptedTypes) { + services = { + # enable GVfs - a userspace virtual filesystem + gvfs.enable = true; + + # storage daemon required for udiskie auto-mount + udisks2.enable = true; + }; + }; +} diff --git a/system/shared/default.nix b/system/shared/default.nix index 37a7b12..b94792b 100644 --- a/system/shared/default.nix +++ b/system/shared/default.nix @@ -13,5 +13,6 @@ _: { ./network.nix ./bluetooth.nix ./localisation.nix + ./packages.nix ]; } diff --git a/system/shared/packages.nix b/system/shared/packages.nix new file mode 100644 index 0000000..d5d1ad5 --- /dev/null +++ b/system/shared/packages.nix @@ -0,0 +1,8 @@ +{ + pkgs, + ... +}: { + environment.systemPackages = with pkgs; [ + killall + ]; +}