Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline let-ins comments #124

Merged
merged 1 commit into from
Feb 17, 2022
Merged

feat: inline let-ins comments #124

merged 1 commit into from
Feb 17, 2022

Conversation

kamadorueda
Copy link
Owner

@kamadorueda kamadorueda commented Feb 17, 2022

diff --git a/doc/doc-support/lib-function-locations.nix b/doc/doc-support/lib-function-locations.nix
index 5528d1ef9..d28ddac98 100644
--- a/doc/doc-support/lib-function-locations.nix
+++ b/doc/doc-support/lib-function-locations.nix
@@ -47,8 +47,7 @@ let
 
   locatedlibsets = libs: builtins.map flattenedLibSubset (libset libs);
   removeFilenamePrefix = prefix: filename: let
-    prefixLen = (builtins.stringLength prefix) + 1;
-    # +1 to remove the leading /
+    prefixLen = (builtins.stringLength prefix) + 1; # +1 to remove the leading /
     filenameLen = builtins.stringLength filename;
     substr = builtins.substring prefixLen filenameLen filename;
   in
diff --git a/lib/lists.nix b/lib/lists.nix
index edd149ccc..16d3c3036 100644
--- a/lib/lists.nix
+++ b/lib/lists.nix
@@ -666,8 +666,7 @@ in rec {
           then toInt (head x)
           else x
       ) (builtins.split "(0|[1-9][0-9]*)" s);
-    prepared = map (x: [(vectorise x) x]) lst;
-    # remember vectorised version for O(n) regex splits
+    prepared = map (x: [(vectorise x) x]) lst; # remember vectorised version for O(n) regex splits
     less = a: b: (compareLists compare (head a) (head b)) < 0;
   in
     map (x: elemAt x 1) (sort less prepared);
diff --git a/lib/zip-int-bits.nix b/lib/zip-int-bits.nix
index 3ec288730..922b29840 100644
--- a/lib/zip-int-bits.nix
+++ b/lib/zip-int-bits.nix
@@ -13,13 +13,11 @@ f: x: y: let
         headbit =
           if (x / 2) * 2 != x
           then 1
-          else 0;
-        # x & 1
+          else 0; # x & 1
         tailbits =
           if x < 0
           then ((x + 1) / 2) - 1
-          else x / 2;
-        # x >> 1
+          else x / 2; # x >> 1
       in
         [headbit] ++ (intToBits tailbits);
 
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix
index 4b6925d52..7349d1c35 100644
--- a/nixos/lib/make-disk-image.nix
+++ b/nixos/lib/make-disk-image.nix
@@ -197,8 +197,7 @@ in let
     rootPaths = basePaths ++ additionalPaths';
   };
 
-  blockSize = toString (4 * 1024);
-  # ext4fs block size (not block device sector size)
+  blockSize = toString (4 * 1024); # ext4fs block size (not block device sector size)
 
   prepareImage = ''
     export PATH=${binPath}
diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix
index 30033dbba..044b8d199 100644
--- a/nixos/modules/config/networking.nix
+++ b/nixos/modules/config/networking.nix
@@ -162,8 +162,7 @@ in {
       hostnames =
         # Note: The FQDN (canonical hostname) has to come first:
         optional (cfg.hostName != "" && cfg.domain != null) "${cfg.hostName}.${cfg.domain}"
-        ++ optional (cfg.hostName != "") cfg.hostName;
-      # Then the hostname (without the domain)
+        ++ optional (cfg.hostName != "") cfg.hostName; # Then the hostname (without the domain)
     in
       {
         "127.0.0.2" = hostnames;
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index 746dfb058..faf5e1006 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -489,8 +489,7 @@ with lib; let
 
     # Verify the FAT partition.
     fsck.vfat -vn "$out"
-  '';
-  # */
+  ''; # */
 
   # Name used by UEFI for architectures.
   targetArch =
diff --git a/nixos/modules/services/backup/borgbackup.nix b/nixos/modules/services/backup/borgbackup.nix
index 666a884e0..c62151061 100644
--- a/nixos/modules/services/backup/borgbackup.nix
+++ b/nixos/modules/services/backup/borgbackup.nix
@@ -11,8 +11,7 @@ with lib; let
     # absolute path
     || builtins.substring 0 1 x == "."
     # relative path
-    || builtins.match "[.*:.*]" == null;
-  # not machine:path
+    || builtins.match "[.*:.*]" == null; # not machine:path
 
   mkExcludeFile = cfg:
   # Write each exclude pattern to a new line
diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix
index 4a4735b4b..bf4c89ff9 100644
--- a/nixos/modules/services/hardware/udev.nix
+++ b/nixos/modules/services/hardware/udev.nix
@@ -130,8 +130,7 @@ with lib; let
       ln -s /dev/null $out/80-drivers.rules
     ''
   }
-  '';
-  # */
+  ''; # */
 
   hwdbBin = pkgs.runCommand "hwdb.bin"
   {
diff --git a/nixos/modules/services/mail/clamsmtp.nix b/nixos/modules/services/mail/clamsmtp.nix
index 1c56eb5bf..6fe10e1f7 100644
--- a/nixos/modules/services/mail/clamsmtp.nix
+++ b/nixos/modules/services/mail/clamsmtp.nix
@@ -6,8 +6,7 @@
 }:
 with lib; let
   cfg = config.services.clamsmtp;
-  clamdSocket = "/run/clamav/clamd.ctl";
-  # See services/security/clamav.nix
+  clamdSocket = "/run/clamav/clamd.ctl"; # See services/security/clamav.nix
 in {
   ##### interface
   options = {
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix
index a15243396..6a545f88b 100644
--- a/nixos/modules/services/misc/gitea.nix
+++ b/nixos/modules/services/misc/gitea.nix
@@ -529,10 +529,8 @@ in {
         runConfig = "${cfg.stateDir}/custom/conf/app.ini";
         secretKey = "${cfg.stateDir}/custom/conf/secret_key";
         oauth2JwtSecret = "${cfg.stateDir}/custom/conf/oauth2_jwt_secret";
-        oldLfsJwtSecret = "${cfg.stateDir}/custom/conf/jwt_secret";
-        # old file for LFS_JWT_SECRET
-        lfsJwtSecret = "${cfg.stateDir}/custom/conf/lfs_jwt_secret";
-        # new file for LFS_JWT_SECRET
+        oldLfsJwtSecret = "${cfg.stateDir}/custom/conf/jwt_secret"; # old file for LFS_JWT_SECRET
+        lfsJwtSecret = "${cfg.stateDir}/custom/conf/lfs_jwt_secret"; # new file for LFS_JWT_SECRET
         internalToken = "${cfg.stateDir}/custom/conf/internal_token";
       in ''
         # copy custom configuration and generate a random secret key if needed
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index bb6e2a66c..4034fc2d2 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/ipfs.nix
@@ -37,8 +37,7 @@ with lib; let
     then "[${s 1}]:${s 3}"
     else if s 0 == "unix"
     then "/${lib.concatStringsSep "/" (lib.tail addr)}"
-    else null;
-  # not valid for listen stream, skip
+    else null; # not valid for listen stream, skip
 
   multiaddrToListenDatagram = addrRaw: let
     addr = splitMulitaddr addrRaw;
@@ -48,8 +47,7 @@ with lib; let
     then "${s 1}:${s 3}"
     else if s 0 == "ip6" && s 2 == "udp"
     then "[${s 1}]:${s 3}"
-    else null;
-  # not valid for listen datagram, skip
+    else null; # not valid for listen datagram, skip
 in {
   ###### interface

@kamadorueda kamadorueda merged commit 042bf5f into main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant