diff --git a/flake.nix b/flake.nix index af69b35..93e51ab 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,10 @@ inherit (util) user; inherit (util) host; + inherit (import ./pkgs { + inherit pkgs; + }) myPkgs; + pkgs = import nixpkgs { inherit system; config.allowUnfree = true; diff --git a/modules/users/applications/default.nix b/modules/users/applications/default.nix index 3979498..3c75d8d 100644 --- a/modules/users/applications/default.nix +++ b/modules/users/applications/default.nix @@ -6,8 +6,12 @@ let in { options.erwin.applications = { - enable = mkOption { + enable = mkEnableOption { description = "Enable a set of common applications"; + }; + + work = mkOption { + description = "Is this a work config?"; type = types.bool; default = false; }; @@ -31,6 +35,7 @@ in programs = { alacritty = import ./alacritty.nix; + firefox = import ./firefox.nix { work = cfg.work; }; }; }; } diff --git a/modules/users/applications/firefox.nix b/modules/users/applications/firefox.nix new file mode 100644 index 0000000..4113cb9 --- /dev/null +++ b/modules/users/applications/firefox.nix @@ -0,0 +1,15 @@ +{ work }: { + enable = true; + + profiles = { + private = { + id = 0; + isDefault = !work; + }; + + horus = { + id = 1; + isDefault = work; + }; + }; +} diff --git a/modules/users/applications/rofi.nix b/modules/users/applications/rofi.nix new file mode 100644 index 0000000..c607d0d --- /dev/null +++ b/modules/users/applications/rofi.nix @@ -0,0 +1,19 @@ +{ pkgs, config, lib, ... }: +with lib; + +let cfg = config.erwin.rofi; +in +{ + options.erwin.rofi = { + enable = mkEnableOption { + description = "Enable rofi"; + }; + }; + + config = mkIf (cfg.enable) { + programs.rofi = { + enable = true; + package = myPkgs.rofi-wayland; + }; + }; +} diff --git a/modules/users/sway/default.nix b/modules/users/sway/default.nix index 89a8d9c..ad8d303 100644 --- a/modules/users/sway/default.nix +++ b/modules/users/sway/default.nix @@ -40,5 +40,12 @@ in programs.waybar = import ./waybar.nix { inherit pkgs config lib; }; home.file.".wallpapers".source = ./wallpapers; + + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session-pre.target" ]; + }; + }; }; } diff --git a/modules/users/sway/sway.nix b/modules/users/sway/sway.nix index 7097910..dc72c21 100644 --- a/modules/users/sway/sway.nix +++ b/modules/users/sway/sway.nix @@ -54,6 +54,11 @@ in bg = "~/.wallpapers/river-1920.png fill"; mode = "1920x1080@60Hz"; }; + "DP-2" = { + bg = "~/.wallpapers/river-2560.png fill"; + mode = "2560x1440@144Hz"; + adaptive_sync = "on"; + }; }; menu = "${pkgs.wofi}/bin/wofi --show drun -i | ${pkgs.findutils}/bin/xargs swaymsg exec --"; diff --git a/modules/users/sway/wallpapers/river-2560.png b/modules/users/sway/wallpapers/river-2560.png new file mode 100644 index 0000000..cf295cc Binary files /dev/null and b/modules/users/sway/wallpapers/river-2560.png differ diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..998217b --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +with pkgs; +{ + myPkgs = { + rofi-wayland = callPackage ./rofi-wayland.nix { }; + }; +} diff --git a/pkgs/rofi-wayland.nix b/pkgs/rofi-wayland.nix new file mode 100644 index 0000000..267549d --- /dev/null +++ b/pkgs/rofi-wayland.nix @@ -0,0 +1,50 @@ +{ pkgs, ... }: +with pkgs; +stdenv.mkDerivation rec { + pname = "rofi-wayland-unwrapped"; + version = "1.7.0"; + + src = fetchFromGitHub { + owner = "lbonn"; + repo = "rofi"; + rev = "${version}+wayland1"; + fetchSubmodules = true; + sha256 = "1h6lh4lrkxzs6iy2rzn5g71dnz6qck4j8cxpgy1ja179vrnj1sf7"; + }; + + preConfigure = '' + patchShebangs "script" + # root not present in build /etc/passwd + sed -i 's/~root/~nobody/g' test/helper-expand.c + ''; + + nativeBuildInputs = [ meson ninja pkgconfig ]; + buildInputs = [ + libxkbcommon + pango + cairo + git + bison + flex + librsvg + check + libstartup_notification + libxcb + xcbutil + xcbutilwm + xcbutilxrm + which + wayland-protocols + wayland + ]; + + doCheck = false; + + meta = with lib; { + description = "Window switcher, run dialog and dmenu replacement"; + homepage = "https://github.com/davatorium/rofi"; + license = licenses.mit; + maintainers = with maintainers; [ c0deaddict ]; + platforms = with platforms; linux; + }; +}