Skip to content

Commit cb9db7b

Browse files
committed
flake/apps: add input groups and enhanced flake management
1 parent 8c09f6f commit cb9db7b

1 file changed

Lines changed: 77 additions & 2 deletions

File tree

flake/apps.nix

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,89 @@
11
_: {
22
perSystem =
33
{ pkgs, lib, ... }:
4+
let
5+
# Input groups based on our flake.nix organization
6+
inputGroups = {
7+
core = {
8+
description = "Core Nix ecosystem";
9+
inputs = [
10+
"nixpkgs"
11+
"nixpkgs-unstable"
12+
"nixpkgs-master"
13+
"flake-compat"
14+
"flake-parts"
15+
];
16+
};
17+
18+
system = {
19+
description = "System management";
20+
inputs = [
21+
"disko"
22+
"home-manager"
23+
"lanzaboote"
24+
"nix-darwin"
25+
"nix-rosetta-builder"
26+
"nixos-wsl"
27+
"sops-nix"
28+
];
29+
};
30+
31+
apps = {
32+
description = "Applications & packages";
33+
inputs = [
34+
"anyrun-nixos-options"
35+
"catppuccin"
36+
"firefox-addons"
37+
"hypr-socket-watch"
38+
"hyprland"
39+
"khanelivim"
40+
"nh"
41+
"nix-flatpak"
42+
"nix-index-database"
43+
"stylix"
44+
"waybar"
45+
"yazi-flavors"
46+
];
47+
};
48+
};
49+
50+
mkUpdateApp =
51+
name:
52+
{ description, inputs }:
53+
{
54+
type = "app";
55+
program = lib.getExe (
56+
pkgs.writeShellApplication {
57+
name = "update-${name}";
58+
meta = {
59+
mainProgram = "update-${name}";
60+
description = "Update ${description} inputs";
61+
};
62+
text = ''
63+
set -euo pipefail
64+
65+
echo "🔄 Updating ${description} inputs..."
66+
nix flake update ${lib.concatStringsSep " " inputs}
67+
68+
echo "✅ ${description} inputs updated successfully!"
69+
'';
70+
}
71+
);
72+
};
73+
74+
groupApps = lib.mapAttrs mkUpdateApp inputGroups;
75+
in
476
{
5-
apps = {
77+
apps = groupApps // {
678
update-all = {
779
type = "app";
880
program = lib.getExe (
981
pkgs.writeShellApplication {
1082
name = "update-all";
11-
meta.mainProgram = "update-all";
83+
meta = {
84+
mainProgram = "update-all";
85+
description = "Update all flake inputs";
86+
};
1287
text = ''
1388
set -euo pipefail
1489

0 commit comments

Comments
 (0)