ctucx.git: travelynx2fedi

Automaticly post travelynx checkins on the fediverse

commit 606c2cdd3ce141e3c6d1c1bec0463df67a4c810b
parent a93608c90c17c02ce08d9ded804de162df0e2372
Author: Katja (ctucx) <git@ctu.cx>
Date: Wed, 5 Mar 2025 21:58:13 +0100

flake: refactor, remove `flake-utils` dependency
2 files changed, 29 insertions(+), 64 deletions(-)
M
flake.lock
|
34
----------------------------------
M
flake.nix
|
59
+++++++++++++++++++++++++++++------------------------------
diff --git a/flake.lock b/flake.lock
@@ -1,23 +1,5 @@
 {
   "nodes": {
-    "flake-utils": {
-      "inputs": {
-        "systems": "systems"
-      },
-      "locked": {
-        "lastModified": 1710146030,
-        "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
     "nixpkgs": {
       "locked": {
         "lastModified": 1719426051,

@@ -36,24 +18,8 @@
     },
     "root": {
       "inputs": {
-        "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,45 +1,45 @@
 {
+
   description = "Automaticly post travelynx checkins on the fediverse";
 
-  inputs = {
-    flake-utils.url = "github:numtide/flake-utils";
-    nixpkgs.url     = "github:NixOS/nixpkgs/nixos-24.05";
-  };
+  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
+
+  outputs = inputs: let
+    forAllSystems = function:
+      inputs.nixpkgs.lib.genAttrs [
+        "x86_64-linux"
+        "aarch64-linux"
+        "aarch64-darwin"
+      ] (system: function (import inputs.nixpkgs {
+        system   = system;
+        overlays = [ inputs.self.overlays.default ];
+      }));
 
-  outputs = { self, nixpkgs, flake-utils }: {
+  in {
 
-    nixosModule = import ./nixosModule.nix;
+    packages = forAllSystems (pkgs: {
+      default        = pkgs.travelynx2fedi;
+      travelynx2fedi = pkgs.travelynx2fedi;
+    });
 
-    overlay     = final: prev: {
+    apps = forAllSystems (pkgs: {
+      default.type    = "app";
+      default.program = "${pkgs.travelynx2fedi}/bin/travelynx2fedi";
+    });
 
+    nixosModules.default = import ./nixosModule.nix;
+
+    overlays.default = final: prev: {
       travelynx2fedi = final.buildNimPackage {
-        name        = "travelynx2fedi";
-        src         = self;
+        name = "travelynx2fedi";
+        src  = inputs.self;
 
         buildInputs = [ final.openssl ];
 
         nimRelease  = true;
       };
-
     };
 
-  } // (flake-utils.lib.eachDefaultSystem (system:
-    let
-      pkgs = import nixpkgs {
-        inherit system;
-        overlays = [ self.overlay ];
-      };
-
-    in rec {
-
-      packages.default        = pkgs.travelynx2fedi;
-      packages.travelynx2fedi = pkgs.travelynx2fedi;
-
-      apps.default = {
-        type = "app";
-        program = "${pkgs.travelynx2fedi}/bin/travelynx2fedi";
-      };
+  };
 
-    }
-  ));
-}-
\ No newline at end of file
+}