41 Commits
Author SHA1 Message Date
lassulus f15bcc27b4 luks: don't define boot.initrd.systemd.enable where the option was removed
NixOS 26.11 dropped scripted stage 1 (NixOS/nixpkgs#573038) and replaced
boot.initrd.systemd.enable with mkRemovedOptionModule, whose assertion
fails as soon as the option is defined. The luks type set it for
enrollFido2, so FIDO2 configs stopped evaluating (#1303). The old
mkIf would also break once the removal shim is dropped, because mkIf
cannot define an option that is not declared at all.

Emit the definition via lib.optional only when
diskoLib.systemdInitrdToggleable says the option still has its bool
type. The removed-option stub is untyped; renamed or hidden
declarations keep bool, so unlike checking `visible` this does not
misfire on aliases. Where the option is gone, stage 1 is always
systemd, so nothing needs to be set.

The flag reaches the types through globals.canToggleSystemdInitrd:
- module.nix derives it from the system's options;
- default.nix accepts canToggleSystemdInitrd (default true, the
  pre-26.11 behaviour) for direct callers of the legacy outputs;
- the test harness probes the nixpkgs under test for direct mode.

The test harness itself read config.boot.initrd.systemd.enable, which
throws on 26.11; guard it as done in lib/tests.nix of
https://github.com/nix-community/disko/pull/1304/changes#diff-605c7b66854ad3072529f715252655bb5b4e5e5b53a99edec9dc929fd85162cd
2026-11-10 13:14:11 +01:00
DavHau ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
Jörg Thalheim aa006252c8 add unmount feature 2024-11-29 14:44:15 +01:00
Felix Uhl 3fc91a7576 outputs: Deprecate all unused outputs
I believe that people are either using disko through the flake or via
nixpkgs. In both cases, the `default.nix` file contains a lot of outputs
that are not needed.

Adding scary error messages with a call to action like this should help
confirm or deny this theory.
2024-11-06 21:16:18 +01:00
Felix Uhl daca7be309 outputs: make compatible with nix run and package lists
This adds new outpus like `format` and `formatNoDeps` which
are compatible with `nix run` so you can do something like

    nix run .#nixosConfigurations.myhostname.config.system.build.formatNoDeps

as originally intended in #78, or add disko to your configuration like

    environment.systemPackages = [
        config.system.build.format
        config.system.build.mount
        config.system.build.destroyFormatMount
    ];

as mentioned in #454.

Fixes part of #454
Supersedes #78

It also deprecates mode `disko` in favor of the clearer
`destroy,format,mount` and adds `format,mount` to allow easier in-place
updates.
2024-11-06 21:16:18 +01:00
lassulus 2bf4fc166b flake: deprecate .lib.lib 2023-09-26 14:00:14 +00:00
lassulus f6649d69d9 cli/default: refactor to use more code from lib 2023-07-19 19:07:40 +00:00
lassulus cdaff66b57 lib: refactor outputs into toplevel 2023-07-19 19:07:40 +00:00
lassulus 1e7098ee04 diskoScript: add bash to PATH 2023-06-24 09:19:17 +00:00
lassulus 8e50c6da0d diskoNoDeps -> diskoScriptNoDeps 2023-06-24 09:19:17 +00:00
lassulus 28d4e71950 cli: consume diskoConfigurations or nixosConfigurations disko configs 2023-05-21 14:04:34 +02:00
lassulus 22b33a4fd6 types: refactor into diskoLib 2023-05-20 13:56:42 +02:00
lassulus 769bde0834 turn disk configs into valid nixos configuration 2023-04-06 08:56:55 +02:00
Lily Foster 0accdf4e20 types,module,tests: run shellcheck on scripts before running them in NixOS tests 2023-02-14 09:07:13 +01:00
Chris Scutcher 4ba8181319 style: Disable inherit pattern check in statix
As discussed in [this
comment](https://github.com/nix-community/disko/pull/143#discussion_r1097912402),
as a blanket rule converting everything possible to `inherit` like
statements can hurt readability.

Add config file for statix to disable these checks and fixes, then rerun
the autofix with these options.
2023-02-07 15:37:12 +00:00
Chris Scutcher 08435eec4b style: Apply nixpkgs-fmt and fix
Apply standard formatting and some statix conventions using;

```sh
nixpkgs-fmt **.nix && statix fix .
```

With the intent of making contribution a bit easier and reducing mental
load in hand formatting (in the same vein as [black]).

[black]: https://github.com/psf/black#the-uncompromising-code-formatter
2023-02-06 14:24:34 +00:00
Jörg Thalheim 48e4c06004 split disko type into multiple files 2023-01-29 08:10:33 +01:00
lassulus af2da574be add support for another mountpoint than /mnt 2023-01-28 18:08:31 +01:00
lassulus 192f9cc416 scripts: append old $PATH for destroying 2022-12-24 12:13:04 +01:00
lassulus 25cc022282 disko cli: add --no-deps mode 2022-12-01 20:33:03 +01:00
lassulus 9cf4f170ae add zapCreateMount script for idempodents install from iso/kexec 2022-11-25 17:36:40 +01:00
lassulus f1531fb4f3 add disko cli 2022-11-01 20:05:10 +01:00
lassulus 324a8d5347 disko: add scripts with pkgs 2022-10-29 13:23:31 +02:00
lassulus 3c4cc93007 export config list in types 2022-10-23 11:36:56 +02:00
lassulus 5aa3ebcb99 types: refactor topLevel into devices, move output generators to lib 2022-10-23 11:36:56 +02:00
lassulus 271b00593f types: add packages output 2022-10-23 11:34:39 +02:00
Jörg Thalheim 46177f0b30 disko: drop dependency on pkgs
This creates less headaches when importing nixos configuration and also
fix some flake use cases.
2022-09-13 13:29:18 +02:00
Jörg Thalheim 68f950bf20 add test for standalone nixos config 2022-09-04 13:09:10 +02:00
lassulus dcb0c42857 reimplement disko using the nixos type system
This should make the code cleaner, more robust and errors should be
clearer. we also changed the configuration format a bit.
2022-09-02 11:14:58 +02:00
lassulus 9bb4aec964 support zfs over legacy fs 2022-08-26 12:55:50 +02:00
Jörg Thalheim 722dde361c zfs: support for root dataset mountpoint and mountpoint=none 2022-08-26 10:29:49 +02:00
Jörg Thalheim 69f1337980 fix inconsistent indentation with nixpkgs-fmt 2022-08-26 08:41:58 +02:00
lassulus e4836108d5 create.filesystem: support extraArgs 2022-08-25 23:31:05 +02:00
lassulus 81e704b638 add btrfs subvolumes 2022-08-25 23:31:05 +02:00
lassulus dadc491330 add lvm raid 2022-08-25 23:31:05 +02:00
lassulus 83fb8f661e add zfs support/test/example 2022-08-25 23:31:05 +02:00
lassulus dd99e29edc fix cryptsetup luksOpen idempotency, add luks-lvm test 2022-08-25 15:32:09 +02:00
lassulus 1237ac36db fix mdadm mounting, move test to mdadm test 2022-08-25 15:32:09 +02:00
lassulus 6b0b20da18 /lib -> / 2022-08-24 22:24:33 +02:00
Jörg Thalheim 20bfa32750 disko: get rid of impure imports
This is a backwards-incompatible change but it allows to pin nixpkgs,
which is desirable especially in professional environments where
reproduciblity is important.
2022-08-17 14:53:43 +02:00
makefu a252f8a57a add default.nix 2018-09-11 20:52:12 +02:00