about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--flake.nix2
-rw-r--r--nix/modules/default.nix8
-rw-r--r--nix/package.nix4
3 files changed, 7 insertions, 7 deletions
diff --git a/flake.nix b/flake.nix
index eb9c560..c3b99bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -24,7 +24,7 @@
   outputs = { self, nixpkgs, flake-utils, gomod2nix, pre-commit-hooks, simple-css }:
     {
       nixosModules = {
-        web = import ./nix/modules self;
+        web = import ./nix/modules;
       };
     } // (flake-utils.lib.eachDefaultSystem
       (system:
diff --git a/nix/modules/default.nix b/nix/modules/default.nix
index acfa7aa..690116b 100644
--- a/nix/modules/default.nix
+++ b/nix/modules/default.nix
@@ -1,4 +1,3 @@
-flake:
 { config
 , lib
 , pkgs
@@ -9,7 +8,7 @@ let
   inherit (builtins) fromTOML readFile;
   cfg = config.services.searchix;
 
-  package = flake.packages.${pkgs.system}.default;
+  package = pkgs.callPackage ../.. { };
 
   defaults = fromTOML (readFile ../../defaults.toml);
 
@@ -91,6 +90,7 @@ in
           };
 
           web = mkOption {
+            default = { };
             type = types.submodule {
               freeformType = settingsFormat.type;
               options = {
@@ -113,7 +113,7 @@ in
                   mkOption {
                     type = types.str;
                     description = "The base URL that searchix will be served on.";
-                    default = "http://${web.listenAddress}:${web.port}";
+                    default = "http://${web.listenAddress}:${toString web.port}";
                   };
 
                 environment = mkOption {
@@ -146,6 +146,7 @@ in
           };
 
           importer = mkOption {
+            default = { };
             type = types.submodule {
               freeformType = settingsFormat.type;
 
@@ -179,7 +180,6 @@ in
           };
         };
       };
-      default = { };
       description = ''
         Configuration for searchix.
 
diff --git a/nix/package.nix b/nix/package.nix
index 3426235..99eeb88 100644
--- a/nix/package.nix
+++ b/nix/package.nix
@@ -47,9 +47,9 @@ buildGoApplication {
     "-s"
     "-w"
     "-X"
-    "searchix/internal/config.CommitSHA=${self.rev or self.dirtyRev}"
+    "searchix/internal/config.CommitSHA=${self.rev or self.dirtyRev or "unknown"}"
     "-X"
-    "searchix/internal/config.ShortSHA=${self.shortRev or self.dirtyShortRev}"
+    "searchix/internal/config.ShortSHA=${self.shortRev or self.dirtyShortRev or "unknown"}"
     "-X"
     "main.buildVersion=${version}"
   ];