summaryrefslogtreecommitdiff
path: root/archetypes
diff options
context:
space:
mode:
Diffstat (limited to 'archetypes')
-rw-r--r--archetypes/collections/development/docker.nix11
-rw-r--r--archetypes/default.nix1
-rw-r--r--archetypes/profiles/btrfs/default.nix17
-rw-r--r--archetypes/profiles/zfs/default.nix4
4 files changed, 22 insertions, 11 deletions
diff --git a/archetypes/collections/development/docker.nix b/archetypes/collections/development/docker.nix
index 0e09744..0c9fce4 100644
--- a/archetypes/collections/development/docker.nix
+++ b/archetypes/collections/development/docker.nix
@@ -3,19 +3,10 @@
in {
options._archetypes.collections.development.docker = {
enable = lib.mkEnableOption "enables docker";
- # TODO move to btrfs profile
- btrfsSupport = lib.mkOption {
- type = lib.types.bool;
- default = true;
- description = "Changes docker storageDriver to btrfs.";
- };
};
config = lib.mkIf cfg.enable {
- virtualisation.docker = {
- enable = true;
- storageDriver = lib.mkIf cfg.btrfsSupport "btrfs";
- };
+ virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
docker-compose
diff --git a/archetypes/default.nix b/archetypes/default.nix
index 5e47bc9..3884a49 100644
--- a/archetypes/default.nix
+++ b/archetypes/default.nix
@@ -8,6 +8,7 @@
./collections/utilities.nix
./collections/virtualization.nix
+ ./profiles/btrfs
./profiles/desktop
./profiles/headless
./profiles/pi
diff --git a/archetypes/profiles/btrfs/default.nix b/archetypes/profiles/btrfs/default.nix
new file mode 100644
index 0000000..88fad38
--- /dev/null
+++ b/archetypes/profiles/btrfs/default.nix
@@ -0,0 +1,17 @@
+{ lib, pkgs, ... }: let
+ mkBtrfs = lib.mkOverride 820;
+
+ # https://wiki.nixos.org/wiki/Btrfs
+ nixosConfig = {
+ services.btrfs = {
+ autoScrub.enable = mkBtrfs true;
+ };
+
+ # Make docker work with btrfs
+ virtualisation.docker.storageDriver = mkBtrfs "btrfs";
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "btrfs" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/zfs/default.nix b/archetypes/profiles/zfs/default.nix
index 5fe63fe..a3ca2e1 100644
--- a/archetypes/profiles/zfs/default.nix
+++ b/archetypes/profiles/zfs/default.nix
@@ -13,10 +13,12 @@
autoSnapshot.enable = mkZfs true;
autoScrub.enable = mkZfs true;
};
+
+ # Make docker work with zfs
+ virtualisation.docker.storageDriver = mkZfs "zfs";
};
homeConfig = {};
in {
imports = [ (lib._mkProfileArchetype "zfs" nixosConfig homeConfig) ];
}
-