about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-03 00:38:33 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-03 00:38:33 +0300
commited775a06b6fee8788330fa07f1b9d26d5d2c4fcd (patch)
treeefaba6e97da77a2668c366544f76dbd6ae0a9ac6
parent2023-02-02 (diff)
2023-02-03
-rw-r--r--modules/nixfiles/common/nix/default.nix30
-rw-r--r--modules/nixos/podman.nix34
-rw-r--r--nixosConfigurations/eonwe/default.nix16
3 files changed, 60 insertions, 20 deletions
diff --git a/modules/nixfiles/common/nix/default.nix b/modules/nixfiles/common/nix/default.nix
index 2cbb86a..2f7904a 100644
--- a/modules/nixfiles/common/nix/default.nix
+++ b/modules/nixfiles/common/nix/default.nix
@@ -27,25 +27,25 @@ with lib; {
   nix = let
     filteredInputs = filterAttrs (n: _: n != "self") inputs;
   in {
-    # https://github.com/NixOS/nix/blob/master/src/libutil/experimental-features.cc
-    extraOptions = ''
-      warn-dirty = false
-      flake-registry = ${inputs.flake-registry}/flake-registry.json
-      extra-experimental-features = ca-derivations
-      extra-experimental-features = flakes
-      extra-experimental-features = nix-command
-      extra-experimental-features = recursive-nix
-      keep-derivations = ${
+    settings = {
+      # https://github.com/NixOS/nix/blob/master/src/libutil/experimental-features.cc
+      experimental-features = concatStringsSep " " [
+        "ca-derivations"
+        "flakes"
+        "nix-command"
+        "recursive-nix"
+      ];
+      keep-derivations =
         if this.isHeadful
         then "true"
-        else "false"
-      }
-      keep-outputs = ${
+        else "false";
+      keep-outputs =
         if this.isHeadful
         then "true"
-        else "false"
-      }
-    '';
+        else "false";
+      flake-registry = "${inputs.flake-registry}/flake-registry.json";
+      warn-dirty = false;
+    };
 
     nixPath =
       mapAttrsToList (n: v: "${n}=${v}") filteredInputs
diff --git a/modules/nixos/podman.nix b/modules/nixos/podman.nix
index 1c5378b..cda8a4b 100644
--- a/modules/nixos/podman.nix
+++ b/modules/nixos/podman.nix
@@ -31,11 +31,35 @@ in {
 
     my.extraGroups = ["podman"];
 
-    hm.programs.bash = {
-      shellAliases.p = "${pkgs.podman}/bin/podman";
-      initExtra = mkAfter ''
-        _complete_alias p __start_podman podman
-      '';
+    hm = {
+      xdg.configFile = {
+        # This removes a really annoying registry search. 100% of the time I
+        # would need to look up stuff from the Docker and not Quay!
+        "containers/registries.conf".text = ''
+          [registries.search]
+          registries = ["docker.io"]
+        '';
+
+        # As for plain OverlayFS in Podman over ZFS[1]... I guess we are waiting
+        # for Podman to catch up now.
+        #
+        # [1]: https://github.com/openzfs/zfs/pull/14070#issuecomment-1309116666
+        "containers/storage.conf".text = optionalString config.boot.zfs.enabled ''
+          [storage]
+          driver = "overlay"
+
+          [storage.options]
+          mount_program = "${pkgs.fuse-overlayfs}/bin/fuse-overlayfs"
+          mountopt = "noatime,nodev,nosuid"
+        '';
+      };
+
+      programs.bash = {
+        shellAliases.p = "${pkgs.podman}/bin/podman";
+        initExtra = mkAfter ''
+          _complete_alias p __start_podman podman
+        '';
+      };
     };
   };
 }
diff --git a/nixosConfigurations/eonwe/default.nix b/nixosConfigurations/eonwe/default.nix
index 3bd7230..97dd1d1 100644
--- a/nixosConfigurations/eonwe/default.nix
+++ b/nixosConfigurations/eonwe/default.nix
@@ -101,6 +101,10 @@ with lib; {
   # -o mountpoint=legacy
   # nixos/root/nix
   # ```
+  #
+  # As for Podman support over ZFS[1]. We wait.
+  #
+  # [1]: https://github.com/openzfs/zfs/pull/14070#issuecomment-1309116666
   fileSystems = {
     "/" = {
       device = "none";
@@ -135,6 +139,18 @@ with lib; {
       depends = [config.ark.path];
       neededForBoot = true;
     };
+
+    # "/home/${my.username}/.local/share/containers/storage" = {
+    #   device = "nixos/containers/${my.username}/storage";
+    #   fsType = "zfs";
+    #   options = ["noatime"];
+    # };
+
+    # "/var/lib/containers/storage" = {
+    #   device = "nixos/containers/root/storage";
+    #   fsType = "zfs";
+    #   options = ["noatime"];
+    # };
   };
 
   # No swap space is declared here because the system already has 128Gb of RAM. :^)

Consider giving Nix/NixOS a try! <3