]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
flake.nix: add nixosModules
authorKayla Firestack <dev@kaylafire.me>
Tue, 19 Oct 2021 19:26:41 +0000 (15:26 -0400)
committerKayla Firestack <dev@kaylafire.me>
Wed, 20 Oct 2021 18:47:28 +0000 (14:47 -0400)
Signed-off-by: Kayla Firestack <dev@kaylafire.me>
flake.nix

index 146da4683ae50d4cc77efe08530138ecb0339cec..4c73fd1414c049c6d2317f4366efb5e79b31c264 100644 (file)
--- a/flake.nix
+++ b/flake.nix
                        version = "${builtins.substring 0 8 self.lastModifiedDate}-${self.shortRev or "dirty"}";
 
                        overlay = import ./nix/overlay.nix inputs;
+                       nixosModule = self.nixosModules.bcachefs;
+                       nixosModules.bcachefs = import ./rust-src/mount/module.nix;
+                       nixosModules.bcachefs-enable-boot = ({config, pkgs, lib, ... }:{
+                               # Disable Upstream NixOS Module when this is in use
+                               disabledModules = [ "tasks/filesystems/bcachefs.nix" ];
+                               # Import needed packages
+                               nixpkgs.overlays = [ self.overlay ];
+
+                               # Add bcachefs to boot and kernel
+                               boot.initrd.supportedFilesystems = [ "bcachefs" ];
+                               boot.supportedFilesystems = [ "bcachefs" ];
+                       });
                }
                // utils.lib.eachSystem supportedSystems (system: 
                let pkgs = import nixpkgs {