Commit graph

24 commits

Author SHA1 Message Date
midischwarz12
da6109c917 fix: flakes support on disko standalone cli 2025-07-04 05:43:36 +00:00
Torsten Curdt
d0c543d740 [fix] added missing single quote in script 2025-04-28 03:50:20 +00:00
DavHau
ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
Jörg Thalheim
60375cf096 cli: remove traceValSeq that shouldn't be there 2024-12-20 14:24:53 +01:00
Jörg Thalheim
aa006252c8 add unmount feature 2024-11-29 14:44:15 +01:00
Felix Uhl
cb64993826 cli: Fix "attribute missing" error when using flake
The final config's attributes have different names than those defined in
./default.nix, so this failed previously.
2024-11-16 08:40:38 +00:00
Felix Uhl
eaa51560df cli: Show error if flake's disko is incompatible
Fixes #871

Previously, if a user used v2.10.0 (currently unreleased master), an
error like this would be displayed:

    error: attribute '_cliDestroyFormatMount' missing
       at /nix/store/fbqgaij9d3b373rq1iav5glzr4dy77qf-disko/share/disko/cli.nix:73:7:
           72|     else if (lib.traceValSeq hasDiskoModuleFlake) then
           73|       (builtins.getFlake flake).nixosConfigurations.${flakeAttr}.config.system.build.${diskoAttr}
             |       ^
           74|     else

This situation now produces a more helpful error:

    Error: Attribute `nixosConfigurations.testmachine.config.system.build._cliDestroyFormatMount`
           not found in flake `/home/felix/repos-new/disko`!
           This is probably caused by the locked version of disko in the flake
           being different from the version of disko you executed.
    EITHER set the `disko` input of your flake to `github:nix-community/disko/latest`,
           run `nix flake update disko` in the flake directory and then try again,
    OR run `nix run github:nix-community/disko/v1.9.0 -- --help` and use one of its modes.
2024-11-16 08:40:38 +00: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
Felix Uhl
3b2e19fe7c disko cli: fix misleading error message
Found this while trying to repro #523
2024-10-14 10:36:55 +00:00
lassulus
f6649d69d9 cli/default: refactor to use more code from lib 2023-07-19 19:07:40 +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
Sandro
8f218e98c1
Minor cleanup 2023-05-19 02:00:43 +02: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
9f58230409 also inherit lib for disko scripts 2023-02-02 14:42:09 +01:00
lassulus
e88e00752d cli: fix zap_create_mount mode 2023-02-02 12:44:57 +01:00
lassulus
af2da574be add support for another mountpoint than /mnt 2023-01-28 18:08:31 +01:00
zimbatm
8c0fa72ab4 pass lib along
Avoid impurities
2022-12-23 17:43:12 +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
5fd29dfeb3 disko: support nixos-install style flake syntax 2022-11-09 23:36:46 +01:00
David Arnold
0af2a7c206 feat: allow to declare disko-config relative to flake 2022-11-09 12:30:06 +01:00
David Arnold
15b62fd7a1 fix: expect normal disko-config module files 2022-11-09 12:21:45 +01:00
lassulus
f1531fb4f3 add disko cli 2022-11-01 20:05:10 +01:00