zaphyra's git: tgcNUR

fork of https://git.transgirl.cafe/zaphoid/tgc-nix-user-repository

commit 6b407af0aa35dccf75615a43ff1a7a6a87100f68
parent c7c9ca443eb13ae6ecc24582b205f96c3d2c6b0d
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Tue, 19 Aug 2025 12:42:36 +0200

flake: refactor
2 files changed, 44 insertions(+), 65 deletions(-)
M
flake.lock
|
34
----------------------------------
M
flake.nix
|
75
++++++++++++++++++++++++++++++++++++++++++++-------------------------------
diff --git a/flake.lock b/flake.lock
@@ -21,24 +21,6 @@
         "type": "github"
       }
     },
-    "flake-utils": {
-      "inputs": {
-        "systems": "systems"
-      },
-      "locked": {
-        "lastModified": 1731533236,
-        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
     "nixpkgs": {
       "locked": {
         "lastModified": 1754292888,

@@ -74,24 +56,8 @@
     "root": {
       "inputs": {
         "emacs-overlay": "emacs-overlay",
-        "flake-utils": "flake-utils",
         "nixpkgs": "nixpkgs"
       }
-    },
-    "systems": {
-      "locked": {
-        "lastModified": 1681028828,
-        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
-        "owner": "nix-systems",
-        "repo": "default",
-        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nix-systems",
-        "repo": "default",
-        "type": "github"
-      }
     }
   },
   "root": "root",
diff --git a/flake.nix b/flake.nix
@@ -1,9 +1,9 @@
 {
-  description = "A set of packages maintained by emily and void";
+
+  description = "This flake contains packages and modules for home-manager and nixos - maintained by the tgc-users";
 
   inputs = {
     nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
-    flake-utils.url = "github:numtide/flake-utils";
     emacs-overlay = {
       url = "github:nix-community/emacs-overlay";
       inputs.nixpkgs.follows = "nixpkgs";

@@ -11,40 +11,53 @@
   };
 
   outputs =
-    {
-      self,
-      nixpkgs,
-      flake-utils,
-      emacs-overlay
-    }:
-    (flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (
-      system:
+    inputs:
+    (
       let
-        pkgs = import nixpkgs {
-          inherit system;
-          overlays = [ emacs-overlay.overlays.package ];
-        };
-      in {
-        packages = nixpkgs.lib.mapAttrs (name: _: pkgs.callPackage ./pkgs/${name}/package.nix { }) (
-          builtins.readDir ./pkgs
+        nixpkgsLib = inputs.nixpkgs.lib;
+        forAllSystems =
+          function:
+          nixpkgsLib.genAttrs
+            [
+              "x86_64-linux"
+              "aarch64-linux"
+            ]
+            (
+              system:
+              function (
+                import inputs.nixpkgs {
+                  system = system;
+                  overlays = builtins.attrValues inputs.self.overlays;
+                }
+              )
+            );
+
+      in
+      {
+
+        formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
+
+        packages = forAllSystems (
+          pkgs: nixpkgsLib.packagesFromDirectoryRecursive {
+            directory = ./pkgs;
+            callPackage = pkgs.callPackage;
+          }
         );
 
-        formatter = pkgs.nixfmt-rfc-style;
-      }) // (
-        let
-          overlay = final: prev: {
-            emivoid = self.packages.${prev.system};
-          };
-        in {
-          overlays = {
-            default = overlay;
+        overlays = {
+          emacs-overlay = inputs.emacs-overlay.overlays.package;
+          default = final: prev: {
+            tgc = inputs.self.packages.${prev.system};
           };
+        };
 
-          nixosModules = {
-            default = {
-              nixpkgs.overlays = [ overlay ];
-            };
+        nixosModules = {
+          default = {
+            nixpkgs.overlays = [ inputs.self.overlays.default ];
           };
-        })
+        };
+
+      }
     );
+
 }