summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--hosts/laptop/cfg.nix5
-rw-r--r--hosts/pc/cfg.nix1
-rw-r--r--hosts/vm/cfg.nix6
-rw-r--r--mixins/cli.nix2
-rw-r--r--mixins/emacs/default.nix59
-rw-r--r--mixins/greet.nix6
-rw-r--r--mixins/sway.nix32
-rw-r--r--profiles/user.nix2
8 files changed, 57 insertions, 56 deletions
diff --git a/hosts/laptop/cfg.nix b/hosts/laptop/cfg.nix
index 01d2f26..3fb53d0 100644
--- a/hosts/laptop/cfg.nix
+++ b/hosts/laptop/cfg.nix
@@ -19,6 +19,7 @@
     ../../mixins/sway.nix
     ../../mixins/pipewire.nix
     ../../mixins/multimedia.nix
+    ../../mixins/emacs
   ];
 
   config = {
@@ -59,7 +60,7 @@
       };
     };
 
-    hardware.firmware = [ pkgs.rtw88-firmware ];
+    hardware.firmware = [pkgs.rtw88-firmware];
 
     time.timeZone = lib.mkDefault "Israel";
 
@@ -97,7 +98,7 @@
 
     hardware.opengl = {
       enable = true;
-      extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ];
+      extraPackages = with pkgs; [rocm-opencl-icd rocm-opencl-runtime];
       driSupport = true;
       driSupport32Bit = true;
     };
diff --git a/hosts/pc/cfg.nix b/hosts/pc/cfg.nix
index aaf624c..38fb8c6 100644
--- a/hosts/pc/cfg.nix
+++ b/hosts/pc/cfg.nix
@@ -91,7 +91,6 @@
     };
 
     hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-    hardware.video.hidpi.enable = lib.mkDefault true;
     # greeter.initialSession = "sh -c hyprland";
   };
 }
diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix
index 5c47612..79f00c4 100644
--- a/hosts/vm/cfg.nix
+++ b/hosts/vm/cfg.nix
@@ -84,15 +84,15 @@
 
     hardware.opengl = {
       enable = true;
-      extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ];
+      extraPackages = with pkgs; [rocm-opencl-icd rocm-opencl-runtime];
       driSupport = true;
       driSupport32Bit = true;
     };
 
     greeter.initialSession = "env WLR_RENDERER=pixman ${pkgs.sway.out}/bin/sway";
     # home-manager.users.tzlil.wayland.windowManager.sway.config.input."type:keyboard".xkb_variant = lib.mkForce "";
- 
+
     # nice to work with
-    security.sudo.wheelNeedsPassword = false; 
+    security.sudo.wheelNeedsPassword = false;
   };
 }
diff --git a/mixins/cli.nix b/mixins/cli.nix
index abf40e0..dbed8fd 100644
--- a/mixins/cli.nix
+++ b/mixins/cli.nix
@@ -23,7 +23,7 @@
           bat
           croc
         ];
-        sessionVariables.EDITOR = "nvim";
+        # sessionVariables.EDITOR = "nvim";
       };
       programs = {
         git = {
diff --git a/mixins/emacs/default.nix b/mixins/emacs/default.nix
index 0290d20..7303ebb 100644
--- a/mixins/emacs/default.nix
+++ b/mixins/emacs/default.nix
@@ -5,29 +5,38 @@
   inputs,
   ...
 }: {
-  #   imports = [
-  #     inputs.home-manager.nixosModules."home-manager"
-  #   ];
-  #   config = {
-  #     home-manager.users.tzlil = {
-  #       pkgs,
-  #       config,
-  #       nixosConfig,
-  #       ...
-  #     } @ hm: {
-  #       home = {
-  #         packages = with pkgs; [
-
-  #         ];
-  #       };
-  #       services.emacs = {
-  #         enable = true;
-  #         defaultEditor = true;
-  #       };
-  #       programs.emacs = {
-  #         enable = true;
-  #         extraConfig = builtins.readFile ./init.el
-  #       };
-  #     };
-  #   }
+  imports = [
+    inputs.home-manager.nixosModules."home-manager"
+  ];
+  config = {
+    home-manager.users.tzlil = {
+      pkgs,
+      config,
+      nixosConfig,
+      ...
+    } @ hm: {
+      home = {
+        packages = with pkgs; [
+        ];
+      };
+      services.emacs = {
+        enable = true;
+        defaultEditor = true;
+        startWithUserSession = true;
+        client.enable = true;
+        package = with pkgs; (emacsWithPackages (with emacsPackagesNg; [
+          evil
+          nix-mode
+          org
+          python-mode
+        ]));
+      };
+      # xdg.configFile."emacs/init.el".text = builtins.readFile ./init.el;
+      # non client
+      programs.emacs = {
+        enable = true;
+        extraConfig = builtins.readFile ./init.el;
+      };
+    };
+  };
 }
diff --git a/mixins/greet.nix b/mixins/greet.nix
index 794d322..27a8a75 100644
--- a/mixins/greet.nix
+++ b/mixins/greet.nix
@@ -10,9 +10,9 @@
   greet = "${pkgs.greetd.gtkgreet.out}/bin/gtkgreet -l -s ${pkgs.writeText "gtkgreet.css" "
 window {
   background-image: url(\"${pkgs.fetchurl {
-    url = "https://i.imgur.com/D6qCaQG.png";
-    sha256 = "sha256-Yt5JxmqN6++76cWu8EI/gsmelsJT/3jvLxyeRASQUhI=";
-  }}\");
+      url = "https://i.imgur.com/D6qCaQG.png";
+      sha256 = "sha256-Yt5JxmqN6++76cWu8EI/gsmelsJT/3jvLxyeRASQUhI=";
+    }}\");
   background-size: cover;
   background-position: center;
   color: white;
diff --git a/mixins/sway.nix b/mixins/sway.nix
index dd8a44c..fe9e217 100644
--- a/mixins/sway.nix
+++ b/mixins/sway.nix
@@ -17,18 +17,10 @@
 
       app_id=menu
       chooser="${pkgs.fzf}/bin/fzf <$in_pipe >$out_pipe"
-      foot -W40x40 --app-id "$app_id" -- sh -c "$chooser" &
+      ${pkgs.foot}/bin/foot -W40x40 --app-id "$app_id" -- sh -c "$chooser" &
       cat >"$in_pipe"
       cat <"$out_pipe"
     '';
-  sel =
-    pkgs.writeShellScript "sel"
-    ''
-      #!/bin/sh
-      swaymsg -t get_tree | \
-      ${pkgs.jq}/bin/jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | \
-      ${pkgs.slurp}/bin/slurp
-    '';
 in {
   config = {
     security.pam.services.swaylock = {};
@@ -51,7 +43,7 @@ in {
 
         [[block]]
         block = "sound"
-        on_click = "pavucontrol"
+        on_click = "${pkgs.pavucontrol}/bin/pavucontrol"
 
         [[block]]
         block = "time"
@@ -60,8 +52,6 @@ in {
       '';
       services.mako.enable = true;
       home.packages = with pkgs; [
-        grim
-        slurp
         wf-recorder
         font-awesome_6
         waypipe
@@ -149,7 +139,7 @@ in {
           keybindings = {
             "${modifier}+Return" = "exec $term";
             "${modifier}+q" = "kill";
-            "${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${menuscript} | xargs swaymsg exec --";
+            "${modifier}+d" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${menuscript} | xargs swaymsg exec --";
             "${modifier}+Shift+c" = "reload";
             "${modifier}+Shift+q" = "exit";
             "${modifier}+Shift+p" = "exec systemctl poweroff";
@@ -204,6 +194,11 @@ in {
             "${modifier}+Shift+minus" = "move scratchpad";
             "${modifier}+minus" = "scratchpad show";
             "${modifier}+m" = "mode notifications";
+
+            "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 070D0D";
+            "Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
+            "Shift+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy active";
+            "Ctrl+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output";
           };
           input = {
             "type:keyboard" = {
@@ -275,16 +270,13 @@ in {
           bindsym XF86MonBrightnessUp exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%
           bindsym XF86MonBrightnessDown exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-
 
-          bindsym Print exec ${pkgs.grim}/bin/grim - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy
-          bindsym Shift+Print exec ${pkgs.grim}/bin/grim -g "$(${sel})" - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy
-          bindsym Ctrl+Print exec ${pkgs.grim}/bin/grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" - |tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy
-
-          bindsym $mod+l exec ${pkgs.swaylock}/bin/swaylock -c 070D0D
-
           exec ${pkgs.mako}/bin/mako >/tmp/mako.log 2>&1
           exec_always ${pkgs.kanshi}/bin/kanshi >/tmp/kanshi.log 2>&1
 
-          exec foot
+
+          default_border pixel 2
+          gaps outer 5
+          gaps inner 5
           include /etc/sway/config.d/*
         '';
       };
diff --git a/profiles/user.nix b/profiles/user.nix
index 18e6a35..0a3bebe 100644
--- a/profiles/user.nix
+++ b/profiles/user.nix
@@ -31,7 +31,7 @@
         "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMDyzrs9sbstv3KFK5FV8qYlSknnEy8Cn+qch4dJLmHA"
       ];
     };
-  
+
     nix.settings.allowed-users = ["root" "tzlil"];
     nix.settings.trusted-users = ["root" "tzlil"];