Compare commits

...

5 commits

Author SHA1 Message Date
3788823072
Simplify pinentry-rofi usage
Some checks failed
BUILD x86_64-linux.picard
UPLOAD x86_64-linux.picard
DOWNLOAD x86_64-linux.picard
CACHIX x86_64-linux.picard
ATTIC x86_64-linux.picard
EVAL x86_64-linux.picard
/ test (push) Successful in 48s
2025-01-14 17:39:03 +01:00
bfa2f177d3
Niri floating rule for the experimental Emacs selector 2025-01-14 17:38:55 +01:00
e21a61c360
Bump all inputs 2025-01-14 17:38:27 +01:00
a98b467d26
Fix swayidle
My workaround is not needed anymore and it was preventing it to work
2025-01-13 16:43:47 +01:00
6849194702
Update deltaflyer config
Still not working
2025-01-13 16:43:32 +01:00
8 changed files with 137 additions and 123 deletions

86
flake.lock generated
View file

@ -117,11 +117,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736199437, "lastModified": 1736711425,
"narHash": "sha256-TdU0a/x8048rbbJmkKWzSY1CtsbbGKNkIJcMdr8Zf4Q=", "narHash": "sha256-8hKhPQuMtXfJi+4lPvw3FBk/zSJVHeb726Zo0uF1PP8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "49f8aa791f81ff2402039b3efe0c35b9386c4bcf", "rev": "f720e64ec37fa16ebba6354eadf310f81555cc07",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -156,11 +156,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1736327656, "lastModified": 1736759802,
"narHash": "sha256-vDli473KKyf13uexB4Ja9Jt7KmeUSbHbeuwIDP0M2yM=", "narHash": "sha256-XCaIRTC+YlL5nRi9WJHeftyfw2Z0YXwwzEmHThGuR3Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "42b7368d193ad1939c32e87b48e970423f22f242", "rev": "244a2ab1459c72bac32a2db088549f8bc6d7a836",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -267,11 +267,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735774679, "lastModified": 1736143030,
"narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -582,11 +582,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736349537, "lastModified": 1736781604,
"narHash": "sha256-jE6CXoJLBmvuq9bWjv+EQusiEtSxPiNasWbD+N4575U=", "narHash": "sha256-nIjcN89nxaI5ZnwU/1gzc3rBVQ/te5sHraYeG4cyJX4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "456e599f9101ed153dde268b4401c5d294ba6c8c", "rev": "9616d81f98032d1ee9bec68ab4b6a8c833add88c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -618,11 +618,11 @@
}, },
"impermanence": { "impermanence": {
"locked": { "locked": {
"lastModified": 1734945620, "lastModified": 1736688610,
"narHash": "sha256-olIfsfJK4/GFmPH8mXMmBDAkzVQ1TWJmeGT3wBGfQPY=", "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "d000479f4f41390ff7cf9204979660ad5dd16176", "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -687,11 +687,11 @@
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1736275188, "lastModified": 1736680332,
"narHash": "sha256-IWu1aN1MeRCtx0PYIKTvG5iDSOx/JVegm4Y+0lAZGTE=", "narHash": "sha256-gwidOezQ6FT5q4GHcpD6y2EwKcrtzjAoxaN/9bTGqQw=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "3413ab56292f12ac03ee49270bcaf16038020cb3", "rev": "38dd196b03f4163ae3bbb2a1910b8f0f141ca0e2",
"revCount": 16605, "revCount": 16610,
"type": "git", "type": "git",
"url": "https://git@git.lix.systems/lix-project/lix" "url": "https://git@git.lix.systems/lix-project/lix"
}, },
@ -754,11 +754,11 @@
"mobile-nixos": { "mobile-nixos": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1735176114, "lastModified": 1736638789,
"narHash": "sha256-PxPYz/EFJDtSVrtca14l7crlASkJG2jVrQNpbMzmAcY=", "narHash": "sha256-pkpOkSUNrSf5DePUtYYFt4wGODhY28RlQ4SIJ1e+15M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "mobile-nixos", "repo": "mobile-nixos",
"rev": "595d359518864a13483fd3f4f4ad740cb3bae825", "rev": "72a0601f36a1b424e8b72f17ff53509b990ee060",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -776,11 +776,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1736168988, "lastModified": 1736592044,
"narHash": "sha256-jqH3cfg98+mRSB59WmJuWnvsSyOUNIOVZxf16Mh9/8s=", "narHash": "sha256-HkaJeIFgxncLm8MC1BaWRTkge9b1/+mjPcbzXTRshoM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-fast-build", "repo": "nix-fast-build",
"rev": "a06a8b2c079f7b6dab491a12555387bdb737cc44", "rev": "906af17fcd50c84615a4660d9c08cf89c01cef7d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -864,11 +864,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1736085891, "lastModified": 1736631212,
"narHash": "sha256-bTl9fcUo767VaSx4Q5kFhwiDpFQhBKna7lNbGsqCQiA=", "narHash": "sha256-mG9lRZBcPiAGiVJ9B97BJoIGQcSBWIVlBiN30QYCtG0=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "ba9b3173b0f642ada42b78fb9dfc37ca82266f6c", "rev": "6ace2f2d12bdf74235d5cbf9fbd34a71c9716685",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -900,11 +900,11 @@
}, },
"nixosHardware": { "nixosHardware": {
"locked": { "locked": {
"lastModified": 1736283893, "lastModified": 1736441705,
"narHash": "sha256-BG1FfTexFwNty5VhYjaQLMR6CMPfI3QRcaZrFQYu2EM=", "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "4f339f6be2b61662f957c2ee9eda0fa597d8a6d6", "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1009,11 +1009,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1736200483, "lastModified": 1736549401,
"narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1087,11 +1087,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1736012469, "lastModified": 1736523798,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "narHash": "sha256-Xb8mke6UCYjge9kPR9o4P1nVrhk7QBbKv3xQ9cj7h2s=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "rev": "130595eba61081acde9001f43de3248d8888ac4a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1164,11 +1164,11 @@
}, },
"nixpkgs_9": { "nixpkgs_9": {
"locked": { "locked": {
"lastModified": 1736012469, "lastModified": 1736701207,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1497,11 +1497,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735905407, "lastModified": 1736154270,
"narHash": "sha256-1hKMRIT+QZNWX46e4gIovoQ7H8QRb7803ZH4qSKI45o=", "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "29806abab803e498df96d82dd6f34b32eb8dd2c8", "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1016,26 +1016,41 @@ This is meant to be an helper to be called from the window manager."
;;; Experiments, remove from here ;;; Experiments, remove from here
(defun ccr/test (niri-socket)
(defun ccr/test () "Select a window and focus it based on `niri msg` output."
"test"
(interactive) (interactive)
(with-selected-frame (let* ((niri-output (ccr/niri-get-windows niri-socket))
(make-frame '((name . "Emacs Selector") (display-list (mapcar (lambda (entry)
(minibuffer . only) (let ((title (cdr (assoc 'title entry)))
(fullscreen . 0) ; no fullscreen (app-id (cdr (assoc 'app_id entry)))
(undecorated . t) ; remove title bar (id (cdr (assoc 'id entry))))
;;(auto-raise . t) ; focus on this frame (cons (format "%s - %s" title app-id) id)))
;;(tool-bar-lines . 0) niri-output)))
;;(menu-bar-lines . 0) (with-selected-frame
(internal-border-width . 10) (make-frame '((name . "Emacs Selector")
(width . 50) (minibuffer . only)
(height . 10))) (fullscreen . 0)
(unwind-protect (undecorated . t)
(completing-read "ciao " '("foo" "bar" "pippo") nil t "") (internal-border-width . 10)
(delete-frame)))) (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)))))
(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) (provide 'init)
;;; init.el ends here ;;; init.el ends here

View file

@ -2,25 +2,13 @@
{ {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; pinentryPackage = pkgs.pinentry-rofi.override {
extraConfig = rofi = pkgs.rofi-wayland;
let };
pinentryRofi = pkgs.writeShellApplication { extraConfig = ''
name = "pinentry-rofi-with-env"; allow-emacs-pinentry
runtimeInputs = with pkgs; [ allow-loopback-pinentry
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 = { programs.gpg = {

View file

@ -301,7 +301,9 @@ window-rule {
} }
window-rule { window-rule {
match app-id=r#"^Emacs Selector$"# match title=r#"^Emacs Selector$"#
opacity 0.95
open-floating true
} }

View file

@ -48,10 +48,4 @@
} }
]; ];
}; };
# 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" ];
};
} }

View file

@ -14,20 +14,22 @@
deltaflyer = { deltaflyer = {
nixpkgs = nixpkgs =
let let
# keep in sync with https://github.com/NixOS/mobile-nixos/blob/development/pkgs.nix # keep in sync with https://github.com/mobile-nixos/mobile-nixos/blob/development/npins/sources.json
rev = "44d0940ea560dee511026a53f0e2e2cde489b4d4"; rev = "d3c42f187194c26d9f0309a8ecc469d6c878ce33";
in in
builtins.getFlake "github:NixOS/nixpkgs/${rev}"; builtins.getFlake "github:NixOS/nixpkgs/${rev}";
extraHmModules = [ extraHmModules = [
# inputs.ccrEmacs.hmModules.default inputs.catppuccin.homeManagerModules.catppuccin
]; ];
vpn = { vpn = {
ip = "10.100.0.5"; ip = "10.100.0.5";
publicKey = "6bzmBx2b5yzMdW0aK0KapoBesNcxTv5+qdo+pGmG+jc="; publicKey = "6bzmBx2b5yzMdW0aK0KapoBesNcxTv5+qdo+pGmG+jc=";
}; };
homeManager = builtins.getFlake "github:nix-community/home-manager/670d9ecc3e46a6e3265c203c2d136031a3d3548e"; # homeManager = builtins.getFlake "github:nix-community/home-manager/670d9ecc3e46a6e3265c203c2d136031a3d3548e";
extraModules = [ extraModules = [
(import "${inputs.mobile-nixos}/lib/configuration.nix" { device = "oneplus-fajita"; }) (import "${inputs.mobile-nixos}/lib/configuration.nix" { device = "oneplus-fajita"; })
inputs.catppuccin.nixosModules.catppuccin
inputs.lix-module.nixosModules.default
]; ];
secrets = { secrets = {
"deltaflyer-wireguard-private-key" = { }; "deltaflyer-wireguard-private-key" = { };

View file

@ -30,6 +30,13 @@
# INSECURE STUFF FIRST # INSECURE STUFF FIRST
# Users and hardcoded passwords. # Users and hardcoded passwords.
{ {
nixpkgs.overlays = [
(prev: final: {
gcc7 = final.gcc;
gcc8 = final.gcc;
})
];
users.users.root.password = "nixos"; users.users.root.password = "nixos";
# users.users.ccr.password = "1234"; # users.users.ccr.password = "1234";
@ -66,11 +73,13 @@
"git" "git"
"shell" "shell"
"helix" "helix"
"hyprland" # "hyprland"
"niri"
"emacs" "emacs"
"firefox" "firefox"
"mpv" "mpv"
"xdg" "xdg"
"catppuccin"
]; ];
extraGroups = [ extraGroups = [
"dialout" "dialout"
@ -99,18 +108,18 @@
ccr.extraModules = [ ccr.extraModules = [
{ {
programs.fish.loginShellInit = '' programs.fish.loginShellInit = ''
pgrep Hypr >/dev/null || exec dbus-run-session Hyprland pgrep niri >/dev/null || exec niri-session
'';
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 = home.packages =
let let
rotateScript = pkgs.writeShellApplication { rotateScript = pkgs.writeShellApplication {

View file

@ -3,6 +3,7 @@
# #
{ {
lib, lib,
pkgs,
... ...
}: }:
{ {
@ -16,35 +17,38 @@
# # desktopManager.plasma5.mobile.enable = true; # # desktopManager.plasma5.mobile.enable = true;
# displayManager.autoLogin = { displayManager.autoLogin = {
# enable = true; enable = true;
# }; user = "ccr";
};
# displayManager.session = [{ displayManager.session = [
# manage = "desktop"; {
# name = "hyprland"; manage = "desktop";
# start = '' name = "niri";
# ${pkgs.hyprland}/bin/Hyprland & start = ''
# waitPID=$! ${pkgs.niri}/bin/niri-session &
# ''; waitPID=$!
# }]; '';
}
];
# displayManager.defaultSession = "hyprland"; displayManager.defaultSession = "niri";
# displayManager.lightdm = { displayManager.lightdm = {
# enable = true; enable = true;
# # Workaround for autologin only working at first launch. # Workaround for autologin only working at first launch.
# # A logout or session crashing will show the login screen otherwise. # A logout or session crashing will show the login screen otherwise.
# extraSeatDefaults = '' extraSeatDefaults = ''
# session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm
# ''; '';
# }; };
libinput.enable = true; libinput.enable = true;
}; };
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.pulseaudio.enable = lib.mkDefault true; # mkDefault to help out users wanting pipewire hardware.pulseaudio.enable = lib.mkDefault false; # mkDefault to help out users wanting pipewire
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.wireless.enable = false; networking.wireless.enable = false;
powerManagement.enable = true; powerManagement.enable = true;