diff --git a/flake.lock b/flake.lock index 0a20f08..7b241b5 100644 --- a/flake.lock +++ b/flake.lock @@ -117,11 +117,11 @@ ] }, "locked": { - "lastModified": 1736711425, - "narHash": "sha256-8hKhPQuMtXfJi+4lPvw3FBk/zSJVHeb726Zo0uF1PP8=", + "lastModified": 1736199437, + "narHash": "sha256-TdU0a/x8048rbbJmkKWzSY1CtsbbGKNkIJcMdr8Zf4Q=", "owner": "nix-community", "repo": "disko", - "rev": "f720e64ec37fa16ebba6354eadf310f81555cc07", + "rev": "49f8aa791f81ff2402039b3efe0c35b9386c4bcf", "type": "github" }, "original": { @@ -156,11 +156,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1736759802, - "narHash": "sha256-XCaIRTC+YlL5nRi9WJHeftyfw2Z0YXwwzEmHThGuR3Q=", + "lastModified": 1736327656, + "narHash": "sha256-vDli473KKyf13uexB4Ja9Jt7KmeUSbHbeuwIDP0M2yM=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "244a2ab1459c72bac32a2db088549f8bc6d7a836", + "rev": "42b7368d193ad1939c32e87b48e970423f22f242", "type": "github" }, "original": { @@ -267,11 +267,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1735774679, + "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", "type": "github" }, "original": { @@ -582,11 +582,11 @@ ] }, "locked": { - "lastModified": 1736781604, - "narHash": "sha256-nIjcN89nxaI5ZnwU/1gzc3rBVQ/te5sHraYeG4cyJX4=", + "lastModified": 1736349537, + "narHash": "sha256-jE6CXoJLBmvuq9bWjv+EQusiEtSxPiNasWbD+N4575U=", "owner": "nix-community", "repo": "home-manager", - "rev": "9616d81f98032d1ee9bec68ab4b6a8c833add88c", + "rev": "456e599f9101ed153dde268b4401c5d294ba6c8c", "type": "github" }, "original": { @@ -618,11 +618,11 @@ }, "impermanence": { "locked": { - "lastModified": 1736688610, - "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=", + "lastModified": 1734945620, + "narHash": "sha256-olIfsfJK4/GFmPH8mXMmBDAkzVQ1TWJmeGT3wBGfQPY=", "owner": "nix-community", "repo": "impermanence", - "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7", + "rev": "d000479f4f41390ff7cf9204979660ad5dd16176", "type": "github" }, "original": { @@ -687,11 +687,11 @@ "lix": { "flake": false, "locked": { - "lastModified": 1736680332, - "narHash": "sha256-gwidOezQ6FT5q4GHcpD6y2EwKcrtzjAoxaN/9bTGqQw=", + "lastModified": 1736275188, + "narHash": "sha256-IWu1aN1MeRCtx0PYIKTvG5iDSOx/JVegm4Y+0lAZGTE=", "ref": "refs/heads/main", - "rev": "38dd196b03f4163ae3bbb2a1910b8f0f141ca0e2", - "revCount": 16610, + "rev": "3413ab56292f12ac03ee49270bcaf16038020cb3", + "revCount": 16605, "type": "git", "url": "https://git@git.lix.systems/lix-project/lix" }, @@ -754,11 +754,11 @@ "mobile-nixos": { "flake": false, "locked": { - "lastModified": 1736638789, - "narHash": "sha256-pkpOkSUNrSf5DePUtYYFt4wGODhY28RlQ4SIJ1e+15M=", + "lastModified": 1735176114, + "narHash": "sha256-PxPYz/EFJDtSVrtca14l7crlASkJG2jVrQNpbMzmAcY=", "owner": "NixOS", "repo": "mobile-nixos", - "rev": "72a0601f36a1b424e8b72f17ff53509b990ee060", + "rev": "595d359518864a13483fd3f4f4ad740cb3bae825", "type": "github" }, "original": { @@ -776,11 +776,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1736592044, - "narHash": "sha256-HkaJeIFgxncLm8MC1BaWRTkge9b1/+mjPcbzXTRshoM=", + "lastModified": 1736168988, + "narHash": "sha256-jqH3cfg98+mRSB59WmJuWnvsSyOUNIOVZxf16Mh9/8s=", "owner": "Mic92", "repo": "nix-fast-build", - "rev": "906af17fcd50c84615a4660d9c08cf89c01cef7d", + "rev": "a06a8b2c079f7b6dab491a12555387bdb737cc44", "type": "github" }, "original": { @@ -864,11 +864,11 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1736631212, - "narHash": "sha256-mG9lRZBcPiAGiVJ9B97BJoIGQcSBWIVlBiN30QYCtG0=", + "lastModified": 1736085891, + "narHash": "sha256-bTl9fcUo767VaSx4Q5kFhwiDpFQhBKna7lNbGsqCQiA=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "6ace2f2d12bdf74235d5cbf9fbd34a71c9716685", + "rev": "ba9b3173b0f642ada42b78fb9dfc37ca82266f6c", "type": "github" }, "original": { @@ -900,11 +900,11 @@ }, "nixosHardware": { "locked": { - "lastModified": 1736441705, - "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=", + "lastModified": 1736283893, + "narHash": "sha256-BG1FfTexFwNty5VhYjaQLMR6CMPfI3QRcaZrFQYu2EM=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337", + "rev": "4f339f6be2b61662f957c2ee9eda0fa597d8a6d6", "type": "github" }, "original": { @@ -1009,11 +1009,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1736549401, - "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=", + "lastModified": 1736200483, + "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899", + "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", "type": "github" }, "original": { @@ -1087,11 +1087,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1736523798, - "narHash": "sha256-Xb8mke6UCYjge9kPR9o4P1nVrhk7QBbKv3xQ9cj7h2s=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "130595eba61081acde9001f43de3248d8888ac4a", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -1164,11 +1164,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1736701207, - "narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -1497,11 +1497,11 @@ ] }, "locked": { - "lastModified": 1736154270, - "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", + "lastModified": 1735905407, + "narHash": "sha256-1hKMRIT+QZNWX46e4gIovoQ7H8QRb7803ZH4qSKI45o=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", + "rev": "29806abab803e498df96d82dd6f34b32eb8dd2c8", "type": "github" }, "original": { diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 19ac094..047e4d3 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -1016,41 +1016,26 @@ This is meant to be an helper to be called from the window manager." ;;; Experiments, remove from here -(defun ccr/test (niri-socket) - "Select a window and focus it based on `niri msg` output." + +(defun ccr/test () + "test" (interactive) - (let* ((niri-output (ccr/niri-get-windows niri-socket)) - (display-list (mapcar (lambda (entry) - (let ((title (cdr (assoc 'title entry))) - (app-id (cdr (assoc 'app_id entry))) - (id (cdr (assoc 'id entry)))) - (cons (format "%s - %s" title app-id) id))) - niri-output))) - (with-selected-frame - (make-frame '((name . "Emacs Selector") - (minibuffer . only) - (fullscreen . 0) - (undecorated . t) - (internal-border-width . 10) - (width . 120) - (height . 20))) - (unwind-protect - (let* ((entry (completing-read "Select window: " (mapcar #'car display-list) nil t "")) - (entry-id (cdr (assoc entry display-list))) ;; Get the ID associated with the selected entry - (command (format "NIRI_SOCKET=\"%s\" niri msg action focus-window --id %s" niri-socket entry-id))) - (message command) - (shell-command command)) - (delete-frame))))) + (with-selected-frame + (make-frame '((name . "Emacs Selector") + (minibuffer . only) + (fullscreen . 0) ; no fullscreen + (undecorated . t) ; remove title bar + ;;(auto-raise . t) ; focus on this frame + ;;(tool-bar-lines . 0) + ;;(menu-bar-lines . 0) + (internal-border-width . 10) + (width . 50) + (height . 10))) + (unwind-protect + (completing-read "ciao " '("foo" "bar" "pippo") nil t "") + (delete-frame)))) -(defun ccr/niri-get-windows (niri-socket) - "Esegue `niri msg --json windows` e parse l'output JSON in una alist." - (let* ((command (format "NIRI_SOCKET=\"%s\" niri msg --json windows" niri-socket)) - (output (shell-command-to-string command)) - (json-object-type 'alist) ; Usa alist per rappresentare gli oggetti JSON - (parsed-json (json-read-from-string output))) - parsed-json)) - (provide 'init) ;;; init.el ends here diff --git a/hmModules/gpg/default.nix b/hmModules/gpg/default.nix index f245f26..a894c90 100644 --- a/hmModules/gpg/default.nix +++ b/hmModules/gpg/default.nix @@ -2,13 +2,25 @@ { services.gpg-agent = { enable = true; - pinentryPackage = pkgs.pinentry-rofi.override { - rofi = pkgs.rofi-wayland; - }; - extraConfig = '' - allow-emacs-pinentry - allow-loopback-pinentry - ''; + enableSshSupport = true; + extraConfig = + let + pinentryRofi = pkgs.writeShellApplication { + name = "pinentry-rofi-with-env"; + runtimeInputs = with pkgs; [ + coreutils + rofi-wayland + ]; + text = '' + "${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@" + ''; + }; + in + '' + allow-emacs-pinentry + allow-loopback-pinentry + pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env + ''; }; programs.gpg = { diff --git a/hmModules/niri/config.kdl b/hmModules/niri/config.kdl index 7fbe4bf..7d25a06 100644 --- a/hmModules/niri/config.kdl +++ b/hmModules/niri/config.kdl @@ -301,9 +301,7 @@ window-rule { } window-rule { - match title=r#"^Emacs Selector$"# - opacity 0.95 - open-floating true + match app-id=r#"^Emacs Selector$"# } diff --git a/hmModules/swayidle/default.nix b/hmModules/swayidle/default.nix index 4db2310..ccd150b 100644 --- a/hmModules/swayidle/default.nix +++ b/hmModules/swayidle/default.nix @@ -48,4 +48,10 @@ } ]; }; + + # Otherwise it will start only after Sway and will not work with Hyprland + systemd.user.services.swayidle = { + Unit.PartOf = lib.mkForce [ ]; + Install.WantedBy = lib.mkForce [ "graphical-session-pre.target" ]; + }; } diff --git a/hosts/default.nix b/hosts/default.nix index b76a20d..9b4c7c9 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -14,22 +14,20 @@ deltaflyer = { nixpkgs = let - # keep in sync with https://github.com/mobile-nixos/mobile-nixos/blob/development/npins/sources.json - rev = "d3c42f187194c26d9f0309a8ecc469d6c878ce33"; + # keep in sync with https://github.com/NixOS/mobile-nixos/blob/development/pkgs.nix + rev = "44d0940ea560dee511026a53f0e2e2cde489b4d4"; in builtins.getFlake "github:NixOS/nixpkgs/${rev}"; extraHmModules = [ - inputs.catppuccin.homeManagerModules.catppuccin + # inputs.ccrEmacs.hmModules.default ]; vpn = { ip = "10.100.0.5"; publicKey = "6bzmBx2b5yzMdW0aK0KapoBesNcxTv5+qdo+pGmG+jc="; }; - # homeManager = builtins.getFlake "github:nix-community/home-manager/670d9ecc3e46a6e3265c203c2d136031a3d3548e"; + homeManager = builtins.getFlake "github:nix-community/home-manager/670d9ecc3e46a6e3265c203c2d136031a3d3548e"; extraModules = [ (import "${inputs.mobile-nixos}/lib/configuration.nix" { device = "oneplus-fajita"; }) - inputs.catppuccin.nixosModules.catppuccin - inputs.lix-module.nixosModules.default ]; secrets = { "deltaflyer-wireguard-private-key" = { }; diff --git a/hosts/deltaflyer/default.nix b/hosts/deltaflyer/default.nix index 7e68982..70f479f 100644 --- a/hosts/deltaflyer/default.nix +++ b/hosts/deltaflyer/default.nix @@ -30,13 +30,6 @@ # INSECURE STUFF FIRST # Users and hardcoded passwords. { - nixpkgs.overlays = [ - (prev: final: { - gcc7 = final.gcc; - gcc8 = final.gcc; - }) - ]; - users.users.root.password = "nixos"; # users.users.ccr.password = "1234"; @@ -73,13 +66,11 @@ "git" "shell" "helix" - # "hyprland" - "niri" + "hyprland" "emacs" "firefox" "mpv" "xdg" - "catppuccin" ]; extraGroups = [ "dialout" @@ -108,18 +99,18 @@ ccr.extraModules = [ { programs.fish.loginShellInit = '' - pgrep niri >/dev/null || exec niri-session + pgrep Hypr >/dev/null || exec dbus-run-session Hyprland + ''; + wayland.windowManager.hyprland.extraConfig = lib.mkAfter '' + monitor = DSI-1, 1080x2340, 0x0, 2, transform, 1 + input { + touchdevice { + transform = 1 + } + } + bind = $mod, r, exec, rotate-screen hor + bind = $mod SHIFT, r, exec, rotate-screen ver ''; - # wayland.windowManager.hyprland.extraConfig = lib.mkAfter '' - # monitor = DSI-1, 1080x2340, 0x0, 2, transform, 1 - # input { - # touchdevice { - # transform = 1 - # } - # } - # bind = $mod, r, exec, rotate-screen hor - # bind = $mod SHIFT, r, exec, rotate-screen ver - # ''; home.packages = let rotateScript = pkgs.writeShellApplication { diff --git a/hosts/deltaflyer/plasma-mobile.nix b/hosts/deltaflyer/plasma-mobile.nix index 11eb446..35c6f86 100644 --- a/hosts/deltaflyer/plasma-mobile.nix +++ b/hosts/deltaflyer/plasma-mobile.nix @@ -3,7 +3,6 @@ # { lib, - pkgs, ... }: { @@ -17,38 +16,35 @@ # # desktopManager.plasma5.mobile.enable = true; - displayManager.autoLogin = { - enable = true; - user = "ccr"; - }; + # displayManager.autoLogin = { + # enable = true; + # }; - displayManager.session = [ - { - manage = "desktop"; - name = "niri"; - start = '' - ${pkgs.niri}/bin/niri-session & - waitPID=$! - ''; - } - ]; + # displayManager.session = [{ + # manage = "desktop"; + # name = "hyprland"; + # start = '' + # ${pkgs.hyprland}/bin/Hyprland & + # waitPID=$! + # ''; + # }]; - displayManager.defaultSession = "niri"; + # displayManager.defaultSession = "hyprland"; - displayManager.lightdm = { - enable = true; - # Workaround for autologin only working at first launch. - # A logout or session crashing will show the login screen otherwise. - extraSeatDefaults = '' - session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm - ''; - }; + # displayManager.lightdm = { + # enable = true; + # # Workaround for autologin only working at first launch. + # # A logout or session crashing will show the login screen otherwise. + # extraSeatDefaults = '' + # session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm + # ''; + # }; libinput.enable = true; }; hardware.bluetooth.enable = true; - hardware.pulseaudio.enable = lib.mkDefault false; # mkDefault to help out users wanting pipewire + hardware.pulseaudio.enable = lib.mkDefault true; # mkDefault to help out users wanting pipewire networking.networkmanager.enable = true; networking.wireless.enable = false; powerManagement.enable = true;