From c5414fa008ffcbef2e648e61e7760333da55d31f Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Mon, 14 Oct 2024 00:11:06 -0700 Subject: [PATCH] bcachefs iso --- flake.lock | 16 ++++++++++++++++ flake.nix | 16 ++++++++++++++++ systems/disk-config.nix | 14 +++++++------- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index bab198b..1ed9c51 100644 --- a/flake.lock +++ b/flake.lock @@ -316,6 +316,21 @@ "url": "https://flakehub.com/f/NixOS/nix/%3D2.24.9" } }, + "nixos": { + "locked": { + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, "nixos-cosmic": { "inputs": { "flake-compat": "flake-compat_2", @@ -519,6 +534,7 @@ "determinate": "determinate", "disko": "disko", "home-manager": "home-manager_2", + "nixos": "nixos", "nixos-cosmic": "nixos-cosmic", "nixos-facter-modules": "nixos-facter-modules", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index dafb148..9e289bb 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1"; + nixos.url = "nixpkgs/nixos-24.05"; }; nixConfig = { @@ -62,6 +63,7 @@ nixos-cosmic, zen-browser, determinate, + nixos, ... } @ inputs: { nixosConfigurations = { @@ -141,6 +143,20 @@ ./extras/minecraft-server.nix ]; }; + bcachefs-iso = nixos.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + "${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix" + ({ + lib, + pkgs, + ... + }: { + boot.supportedFilesystems = ["bcachefs"]; + boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest; + }) + ]; + }; }; }; } diff --git a/systems/disk-config.nix b/systems/disk-config.nix index 6abd97f..6624b2b 100644 --- a/systems/disk-config.nix +++ b/systems/disk-config.nix @@ -1,7 +1,7 @@ {lib, ...}: { disko.devices = { disk.disk1 = { - device = lib.mkDefault "/dev/disk/by-diskseq/1"; + device = lib.mkDefault "/dev/nvme0n1"; type = "disk"; content = { type = "gpt"; @@ -30,13 +30,13 @@ content = { type = "filesystem"; format = "bcachefs"; - mountOptions = ["noatime"]; - mountpoint = "/"; - extraArgs = [ - "--compression zstd" - "--background_compression zstd" - "--discard" + mountOptions = [ + "noatime" + "compression=zstd" + "background_compression=zstd" + "discard" ]; + mountpoint = "/"; # subvolumes = { # "/home" = {}; # "/nix" = {};