Add nixfmt to nix devShell, reformat flake.nix, Ignore flake.lock
authorBobbe <redacted>
Fri, 20 Feb 2026 16:34:26 +0000 (17:34 +0100)
committerBobbe <redacted>
Tue, 28 Apr 2026 14:04:13 +0000 (16:04 +0200)
.gitignore
flake.nix

index 72dde8933ffd94565845668c9ab9216358289405..8cf7b5353e895e9a53e3c513fbb251153e7715dd 100644 (file)
@@ -9,3 +9,4 @@ hosts-*
 /node_modules/
 /package-lock.json
 /yarn.lock
+/flake.lock
index 342068f6bfcd4f2e1c7253e8efb9f3d8cf30b4af..c557795080c954149331e815781ed6b46fb5f6bd 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -1,15 +1,18 @@
 {
   description = "Unified hosts file with base extensions.";
-  outputs = { self, nixpkgs, ... }@inputs:
+  outputs =
+    {
+      self,
+      nixpkgs,
+      ...
+    }:
     let
       forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix;
-
-      nixpkgsFor = forAllSystems (system: import nixpkgs {
-        inherit system;
-      });
+      nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
     in
     {
-      nixosModule = { config, ... }:
+      nixosModule =
+        { config, ... }:
         let
           inherit (nixpkgs) lib;
           cfg = config.networking.stevenBlackHosts;
           config = lib.mkIf cfg.enable {
             networking.extraHosts =
               let
-                orig = builtins.readFile ("${self}/" + (lib.optionalString (alternatesList != []) alternatesPath) + "hosts");
+                orig = builtins.readFile (
+                  "${self}/" + (lib.optionalString (alternatesList != [ ]) alternatesPath) + "hosts"
+                );
                 ipv6 = builtins.replaceStrings [ "0.0.0.0" ] [ "::" ] orig;
               in
               lib.mkAfter (orig + (lib.optionalString cfg.enableIPv6 ("\n" + ipv6)));
           };
         };
 
-      devShells = forAllSystems (system:
-        let pkgs = nixpkgsFor.${system}; in
+      devShells = forAllSystems (
+        system:
+        let
+          pkgs = nixpkgsFor.${system};
+        in
         {
           default = pkgs.mkShell {
-            buildInputs = with pkgs; [
-              python3
-              python3Packages.flake8
-              python3Packages.requests
+            packages = with pkgs; [
+              nixfmt
+              (python3.withPackages (
+                pythonPackages: with pythonPackages; [
+                  flake8
+                  requests
+                ]
+              ))
             ];
           };
         }
git clone https://git.99rst.org/PROJECT