Adapted hyprland configurations for new breaking changes, and some misc adjustments

adjusted hyprland config for new breaking changes

capitalized 'Description' keys in userservices

altered shell aliases and added missing autosuggest option in zsh/options.nix

rebuild now has dry run flags

added hyprpaper to packages.nix

updated check_updates service to check the upstream nixpkgs channel instead of my local flake pkgs
This commit is contained in:
2024-11-15 12:10:21 -05:00
parent 6d9e054a7a
commit 2431e4361b
8 changed files with 156 additions and 135 deletions

143
flake.lock generated
View File

@@ -20,11 +20,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729527199, "lastModified": 1731496216,
"narHash": "sha256-D5/YksfRga8Akd04ZtIkuYSIOjXVrAzQIQBSeplokzU=", "narHash": "sha256-nlQrNN+tmJ+iP6Ck/czwZI0Hxz3oNvUyGkVruxJwgwA=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "8d732fa8aff8b12ef2b1e2f00fc8153e41312b72", "rev": "3b00e96f90cb0040de6d88ad99bf5f4d443f0c59",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -190,11 +190,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727826117, "lastModified": 1730504689,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -275,11 +275,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730302582, "lastModified": 1731363552,
"narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -356,11 +356,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730490306, "lastModified": 1731604581,
"narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=", "narHash": "sha256-Qq2YZZaDTB3FZLWU/Hgh1uuWlUBl3cMLGB99bm7rFUM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1743615b61c7285976f85b303a36cdf88a556503", "rev": "1d0862ee2d7c6f6cd720d6f32213fa425004be10",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -377,11 +377,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730016908, "lastModified": 1731535640,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", "narHash": "sha256-2EckCJn4wxran/TsRiCOFcmVpep2m9EBKl99NBh2GnM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e83414058edd339148dc142a8437edb9450574c8", "rev": "35b055009afd0107b69c286fca34d2ad98940d57",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -416,11 +416,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1729224425, "lastModified": 1730743354,
"narHash": "sha256-w9dNUedNe2qnhHuhcRf7A1l29+/6DxdMfwN6g4U3c/w=", "narHash": "sha256-gU4NySYyXeAzVaF5bI6BKmj2CdgiwGFnuPjXUId3Dx0=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "contrib", "repo": "contrib",
"rev": "d72bc8b1cd30d448bd438e8328f8eeb4c0f2ddb6", "rev": "792f6b83dc719214e0e2a0b380c34f147b28ece2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -472,11 +472,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1730499652, "lastModified": 1731631654,
"narHash": "sha256-De3YRKpowtm15xN7hK0PdBpu96wwSyQE+qFoq9Gi6lM=", "narHash": "sha256-a6gy39yki4mX/Oj83aG08nNntXxXhM1wjksNXGZ8x5c=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "32b18179dd789cde948c97eb3c2ebbdd6af36bf7", "rev": "098e491a43e8b26f4382b48651a4131464bf6a2f",
"revCount": 5402, "revCount": 5456,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@@ -549,11 +549,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1729810282, "lastModified": 1731193353,
"narHash": "sha256-ARBFaV1LtNfdvosdMuhVKX+q11JTx59Ed7/QK+BFmMc=", "narHash": "sha256-oiNuCxbwtfLOPGEoXjsojdVOXNEL5aFPtdELdaz65hw=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprpicker", "repo": "hyprpicker",
"rev": "89b9352d26cc0fd13cd6dc0a77ac18c795a44e59", "rev": "4e8837ddabf669600c9571189e8a6a7937ba336a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -574,11 +574,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728941256, "lastModified": 1731518387,
"narHash": "sha256-WRypmcZ2Bw94lLmcmxYokVOHPJSZ7T06V49QZ4tkZeQ=", "narHash": "sha256-aZZw1ZvTMLkcA6udlvkA3hrCkuipoWLy8s/JNnIclxY=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "fd4be8b9ca932f7384e454bcd923c5451ef2aa85", "rev": "315fba5d21d87ddb756d4bebdb49f99d86b0ffe8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -676,16 +676,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729544999, "lastModified": 1729958008,
"narHash": "sha256-YcyJLvTmN6uLEBGCvYoMLwsinblXMkoYkNLEO4WnKus=", "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "ixx", "repo": "ixx",
"rev": "65c207c92befec93e22086da9456d3906a4e999c", "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NuschtOS", "owner": "NuschtOS",
"ref": "v0.0.5", "ref": "v0.0.6",
"repo": "ixx", "repo": "ixx",
"type": "github" "type": "github"
} }
@@ -698,11 +698,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730184279, "lastModified": 1731454423,
"narHash": "sha256-6OB+WWR6gnaWiqSS28aMJypKeK7Pjc2Wm6L0MtOrTuA=", "narHash": "sha256-TtwvgFxUa0wyptLhQbKaixgNW1UXf3+TDqfX3Kp63oM=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "b379bd4d872d159e5189053ce9a4adf86d56db4b", "rev": "6c71c49e2448e51ad830ed211024e6d0edc50116",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -729,11 +729,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1720386169, "lastModified": 1730741070,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7", "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -745,11 +745,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1729413321, "lastModified": 1731139594,
"narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=", "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26", "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -777,11 +777,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1730200266, "lastModified": 1731319897,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", "rev": "dc460ec76cbff0e66e269457d7b728432263166c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -793,11 +793,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1725194671, "lastModified": 1731531548,
"narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", "rev": "24f0d4acd634792badd6470134c387a3b039dace",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -822,11 +822,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1730499477, "lastModified": 1731675303,
"narHash": "sha256-olt0Sx4alDxv3ko9BgbV3SsE2KQ/Tf0/Az1Fr9s2Y6U=", "narHash": "sha256-Pd0ZZICCwwDIE+ruHTDg8Oaizna5bJrdw5BSTht+Pdc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "356896f58dde22ee16481b7c954e340dceec340d", "rev": "46e574d4ea1642dd87a6bfb162053c52b2e4878b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -837,11 +837,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1730540878, "lastModified": 1731682507,
"narHash": "sha256-JYfoVW5lsfv4bo87U6mqbC3Jh+EBImU5iUsHJlOkyAI=", "narHash": "sha256-1gZCrmPQ3mWwXl3b3KM53DuS0SVpvZB+qwJcMT1qDB8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "57df81c2bcabc503171defb232a0e11710ddaaf9", "rev": "dd830ca21979e6566596d7acaa5d761d4421c278",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -860,11 +860,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730337772, "lastModified": 1731347683,
"narHash": "sha256-uTxvqDohfG85+zldO5Tf1B+fuAF8ZhMouNwG5S6OAnA=", "narHash": "sha256-BcSWCEUBShuB32LPif+EG0XGXyUi2jyjCSpGE1rbOws=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "search", "repo": "search",
"rev": "4e0a7a95a3df3333771abc4df6a656e7baf67106", "rev": "135d202e032be70c93b6d7d53592ef4799d6efde",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -884,11 +884,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1729104314, "lastModified": 1731363552,
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -918,11 +918,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730521028, "lastModified": 1731644206,
"narHash": "sha256-vZtg4J+jOADDKgS+s821PeJiTXfawan8mzX3JM3xjqc=", "narHash": "sha256-J4HjGCDIJTBjlzhHDjQpbci/fMIE8eNcgOAKbDJUlBs=",
"owner": "gerg-l", "owner": "gerg-l",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "191323d81e19efa0be5071e17263851e62f35685", "rev": "f8f8cac5aabb30009610e7ee4b56f04291577a12",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -948,11 +948,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1729963473, "lastModified": 1731657386,
"narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=", "narHash": "sha256-Mm/JL8tFUS1SOmmZDPcswExUxzw0VpHcEyZI1h58CGA=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "04afcfc0684d9bbb24bb1dc77afda7c1843ec93b", "rev": "5ab1207b2fdeb5a022f2dd7cccf6be760f1b150f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1024,16 +1024,17 @@
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696725948, "lastModified": 1726913040,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "tinted-foot", "repo": "tinted-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "tinted-foot", "repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github" "type": "github"
} }
}, },
@@ -1119,11 +1120,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728166987, "lastModified": 1730743262,
"narHash": "sha256-w6dVTguAn9zJ+7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI=", "narHash": "sha256-iTLqj3lU8kFehPm5tXpctzkD274t/k1nwSSq3qCWXeg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "fb9c8d665af0588bb087f97d0f673ddf0d501787", "rev": "09b23cef06fe248e61cec8862c04b9bcb62f4b6d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -125,7 +125,6 @@ in {
}; };
dwindle = { dwindle = {
no_gaps_when_only = false;
force_split = 0; force_split = 0;
special_scale_factor = 1.0; special_scale_factor = 1.0;
split_width_multiplier = 1.0; split_width_multiplier = 1.0;
@@ -137,7 +136,6 @@ in {
master = { master = {
new_status = "master"; new_status = "master";
special_scale_factor = 1; special_scale_factor = 1;
no_gaps_when_only = false;
}; };
decoration = { decoration = {
@@ -158,12 +156,6 @@ in {
xray = true; xray = true;
}; };
drop_shadow = true;
shadow_ignore_window = true;
shadow_offset = "0 2";
shadow_range = 20;
shadow_render_power = 3;
}; };
animations = { animations = {

View File

@@ -15,7 +15,7 @@
services = { services = {
loginSound = { loginSound = {
Unit= { Unit= {
description = "Plays a sound on login"; Description = "Plays a sound on login";
After = [ "graphical-session.target" ]; After = [ "graphical-session.target" ];
WantedBy = [ "graphical-session.target" ]; WantedBy = [ "graphical-session.target" ];
}; };
@@ -27,7 +27,7 @@
}; };
maintenanceCheck = { maintenanceCheck = {
Unit = { Unit = {
description = "Check for updates in my maintained packages"; Description = "Check for updates in my maintained packages";
}; };
Service = { Service = {

View File

@@ -23,7 +23,6 @@
iv = "invoke"; iv = "invoke";
cfgfilecount = cfgfilecount =
''find $FLAKEPATH -name "*.nix" | wc -l | toilet -f 3d | lolcat''; ''find $FLAKEPATH -name "*.nix" | wc -l | toilet -f 3d | lolcat'';
#git #git
ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add"; ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
gcomm = "gitcommit_sfx"; gcomm = "gitcommit_sfx";

View File

@@ -25,6 +25,11 @@
size = 10000; size = 10000;
share = true; share = true;
}; };
autosuggestion = {
enable = true;
highlight = "fg=#4C566A,underline";
};
}; };
}; };
} }

View File

@@ -4,13 +4,16 @@ pkgs.writeShellApplication {
text = '' text = ''
hooray() { scheck && runbg aplay ${self}/assets/sound/update.wav; } hooray() { scheck && runbg aplay ${self}/assets/sound/update.wav; }
damn() { scheck && runbg aplay ${self}/assets/sound/error.wav; } damn() { scheck && runbg aplay ${self}/assets/sound/error.wav; }
[ $# -eq 0 ] && echo -e "\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config, rebuild -a for both" && damn && exit 1 [ $# -eq 0 ] && echo -e "\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config, rebuild -a for both. Adding 'n' before the flag does a dry run, i.e. rebuild -nh" && damn && exit 1
scheck && runbg aplay ${self}/assets/sound/nixswitch-start.wav scheck && runbg aplay ${self}/assets/sound/nixswitch-start.wav
case $1 in case $1 in
"-h" ) if nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;; "-h" ) if nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;;
"-s" ) if nh os switch -H ${host} "$FLAKEPATH"; then hooray; else damn; fi;; "-s" ) if nh os switch -H ${host} "$FLAKEPATH"; then hooray; else damn; fi;;
"-a" ) if sudo sleep 0.1 && nh os switch -H ${host} "$FLAKEPATH" && nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;; "-a" ) if sudo sleep 0.1 && nh os switch -H ${host} "$FLAKEPATH" && nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;;
* ) echo -e "\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config";; "-nh" ) if nh home switch -n -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;;
"-ns" ) if nh os switch -n -H ${host} "$FLAKEPATH"; then hooray; else damn; fi;;
"-na" ) if sudo sleep 0.1 && nh os switch -n -H ${host} "$FLAKEPATH" && nh home switch -n -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;;
* ) echo -e "\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config. Adding 'n' before the flag does a dry run, i.e. rebuild -nh" && damn && exit 1;;
esac esac
''; '';
} }

View File

@@ -13,6 +13,7 @@
fail2ban fail2ban
git git
hyprland-workspaces hyprland-workspaces
hyprpaper
hyprpicker hyprpicker
inetutils inetutils
kitty kitty

View File

@@ -7,65 +7,85 @@ pkgs.stdenv.mkDerivation {
buildPhase = '' buildPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cat > $out/bin/checkupdates.py <<- EOF cat > $out/bin/checkupdates.py <<- EOF
import os, re, json, requests, subprocess import json
flakePath = os.getenv('FLAKEPATH') import subprocess
def nix_eval(expr): import requests
def get_packages_by_maintainer(target_maintainer):
try: try:
nix_env_command = [
"nix-env", "--meta", "--json", "-qaP"
]
jq_query = (
'to_entries[] | select(.value.meta.maintainers? // [] | '
f'any(.github == "{target_maintainer}")) | .value'
)
result = subprocess.run( result = subprocess.run(
["nix", "eval", "--json", expr], nix_env_command,
capture_output=True, capture_output=True,
text=True, text=True,
check=True) check=True
return json.loads(result.stdout) )
filtered_packages = subprocess.run(
["jq", "-r", "-c", jq_query],
input=result.stdout,
capture_output=True,
text=True,
check=True
)
return [json.loads(pkg) for pkg in filtered_packages.stdout.strip().split('\n') if pkg]
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"Error running 'nix eval' for {expr}: {e}") print(f"Error running nix-env or jq: {e}")
return {} return []
packages = nix_eval(f"{flakePath}#pkgs.myPkgs")
target_maintainer = 'pagedMov' def check_github_releases(maintained_packages):
maintained_packages = [] github_api_template = "https://api.github.com/repos/{owner}/{repo}/releases/latest"
for pname in packages.keys(): updates = []
maintainers_info = nix_eval(f"{flakePath}#pkgs.myPkgs.{pname}.meta.maintainers")
for maintainer in maintainers_info: for package in maintained_packages:
if maintainer.get('github') == target_maintainer: pname = package.get("pname", "unknown")
# Collect relevant package details repo_url = package.get("meta", {}).get("homepage", "")
version = nix_eval(f"{flakePath}#pkgs.myPkgs.{pname}.version") or "unknown" current_version = package.get("version", "unknown")
repo_url = nix_eval(f"{flakePath}#pkgs.myPkgs.{pname}.meta.homepage") or ""
maintained_packages.append({ if "github.com" in repo_url:
'pname': pname, owner_repo = repo_url.split("github.com/")[1].rstrip('/')
'version': version, owner, repo = owner_repo.split('/')
'repo': repo_url, api_url = github_api_template.format(owner=owner, repo=repo)
'maintainers': maintainers_info
}) response = requests.get(api_url)
break if response.status_code == 200:
print(json.dumps(maintained_packages, indent=2)) latest_release = response.json()
github_api_template = "https://api.github.com/repos/{owner}/{repo}/releases/latest" latest_version = latest_release.get("tag_name", "").lstrip('v')
updates = [] if latest_version and latest_version != current_version:
for package in maintained_packages: updates.append({"pkg": pname, "version": latest_version})
repo_url = package["repo"] else:
current_version = package["version"] print(f"{pname} is up to date.\n")
if "github.com" in repo_url:
owner_repo = repo_url.split("github.com/")[1].rstrip('/')
owner, repo = owner_repo.split('/')
api_url = github_api_template.format(owner=owner, repo=repo)
response = requests.get(api_url)
if response.status_code == 200:
latest_release = response.json()
latest_version = latest_release.get("tag_name", "").lstrip('v')
if latest_version and latest_version != current_version:
updates.append({"pkg": package["pname"], "version": latest_version})
else: else:
print(f"{package['pname']} is up to date.\n") print(f"Failed to check version for {pname} (HTTP {response.status_code}).\n")
else: else:
print(f"Failed to check version for {package['pname']} (HTTP {response.status_code}).\n") print(f"Skipping non-GitHub repository for {pname}.\n")
else: return updates
print(f"Skipping non-GitHub repository for {package['pname']}.\n")
if updates: def notify_updates(updates):
update_string = '\n'.join([f" {update['pkg']} -> {update['version']}" for update in updates]) if updates:
subprocess.run(["notify-send", "--icon=/home/pagedmov/.sysflake/assets/images/nixos-icon-generic.png", update_string = '\n'.join([f" {update['pkg']} -> {update['version']}" for update in updates])
"Maintenance Update", f"Package updates found:\n{update_string}"]) subprocess.run([
subprocess.run(["aplay", "-q", "-N", "/home/pagedmov/.sysflake/assets/sound/login.wav"]) "notify-send",
"--icon=/home/pagedmov/.sysflake/assets/images/nixos-icon-generic.png",
"Maintenance Update",
f"Package updates found:\n{update_string}"
])
subprocess.run(["aplay", "-q", "-N", "/home/pagedmov/.sysflake/assets/sound/login.wav"])
target_maintainer = "pagedMov"
maintained_packages = get_packages_by_maintainer(target_maintainer)
if maintained_packages:
updates = check_github_releases(maintained_packages)
notify_updates(updates)
else:
print(f"No packages maintained by {target_maintainer} were found.")
EOF EOF
''; '';
buildInputs = with pkgs; [ python3Packages.requests ]; buildInputs = with pkgs; [ python3Packages.requests jq ];
installPhase = ":"; installPhase = ":";
} }