# Modify fileSystem."/boot" in different file, not hardware-configuration.nix

**URL:** https://discourse.nixos.org/t/modify-filesystem-boot-in-different-file-not-hardware-configuration-nix/13377
**Category:** Help
**Created:** [June 1, 2021, 12:17am UTC](https://discourse.nixos.org/t/modify-filesystem-boot-in-different-file-not-hardware-configuration-nix/13377 "2021-06-01T00:17:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mackenzie](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mackenzie](https://discourse.nixos.org/u/mackenzie)
#### Post date: [June 1, 2021, 12:17am UTC](https://discourse.nixos.org/t/modify-filesystem-boot-in-different-file-not-hardware-configuration-nix/13377/1 "2021-06-01T00:17:59Z")

</div>

Is it possible to add below text to my default.nix. I’d like to keep hardware-configurations ‘generated-only’.

default.nix

```plaintext
...
  fileSystems."/boot1" = {
    # nofail: Makes it possible to boot with only 1 mirror present.
    options = ["nofail"];
  };
  fileSystems."/boot2" = {
    # nofail: Makes it possible to boot with only 1 mirror present.
    options = ["nofail"];
  };
...

```

hardware-configuration.nix

```plaintext
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
...
  fileSystems."/boot1" =
    { device = "/dev/disk/by-uuid/32C2-1234";
      fsType = "vfat";
    };
  fileSystems."/boot2" =
    { device = "/dev/disk/by-uuid/32C3-1234";
      fsType = "vfat";
    };
...

```

---

<div class="post-metadata">

### Author: ![fricklerhandwerk](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fricklerhandwerk/32/2029_2.png) [@fricklerhandwerk](https://discourse.nixos.org/u/fricklerhandwerk)
#### Post date: [June 1, 2021, 6:58am UTC](https://discourse.nixos.org/t/modify-filesystem-boot-in-different-file-not-hardware-configuration-nix/13377/2 "2021-06-01T06:58:38Z")

</div>

Yes. Attribute sets are usually\* merged recursively, and it does not matter where the fields are defined.

Just try it out.

\*It is possible to override merging mechanics for custom types, and so far for me it was always clear from context what to expect. Check the implementation when in doubt.

---

<div class="post-metadata">

### Author: ![mackenzie](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mackenzie](https://discourse.nixos.org/u/mackenzie)
#### Post date: [June 3, 2021, 11:05pm UTC](https://discourse.nixos.org/t/modify-filesystem-boot-in-different-file-not-hardware-configuration-nix/13377/3 "2021-06-03T23:05:00Z")

</div>

Tried it, it works.  
Thanks
