| 12 Dec 2023 |
matthewcroughan | I will continue the PR that went stale in march, are there any major differences between it and the current disko? | 23:32:53 |
| 13 Dec 2023 |
matthewcroughan | lassulus: working on https://github.com/nix-community/disko/pull/168
I see that the major difference is the lists vs attrsets of partitions. Is this the major difference between types now, or is there other differences I need to be aware of whilst refactoring this?
| 15:28:05 |
matthewcroughan | I.e lib/types/gpt.nix contains:
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }@partition: {
Whereas this outdated PR contains:
type = lib.types.listOf subTypes.hybrid_partition;
| 15:28:58 |
lassulus | yeah don't use lists | 15:29:50 |
matthewcroughan | But if I change the signature of this type, is this likely the only big thing to change? | 15:30:07 |
matthewcroughan | Or do you know of more changes that I'll run into and the context of them? | 15:30:18 |
lassulus | probably you need to get rid of the partitionnumbering in nix | 15:31:52 |
lassulus | and do it with partlabels, or something similiar | 15:32:00 |
lassulus | to make it portable between different formats | 15:32:10 |
lassulus | but maybe thats not soo important for your usecase | 15:32:20 |
matthewcroughan | lassulus: https://github.com/nix-community/disko/blob/master/lib/types/gpt.nix#L79 | 16:08:45 |
matthewcroughan | is this a bug/mistake? | 16:08:49 |
matthewcroughan | partitions defaults to [] rather than {} | 16:09:00 |
lassulus | probably dead code | 16:09:32 |
lassulus | but yeah, should be {} | 16:09:42 |
matthewcroughan | interesting that there are defaults that don't matter, and don't cause errors | 16:09:44 |
matthewcroughan | didn't know that could happen with tests + module system | 16:09:52 |
lassulus | well nobody defined an empty table yet | 16:09:56 |
matthewcroughan | so there should be a test with emptiness? | 16:10:06 |
lassulus | could, not sure if it's useful | 16:10:16 |
matthewcroughan | a language server like nil would use the default to present the default to the user, maybe | 16:10:41 |
matthewcroughan | tiny amount of usefulness | 16:10:46 |
lassulus | but yeah, you can PR the change | 16:10:57 |
lassulus | maybe add an emtoy table in the complext test | 16:11:16 |
matthewcroughan | Yeah just sifting through the gpt.nix to try to refactor the hybrid stuff | 16:11:17 |
matthewcroughan | Comparing the two | 16:11:34 |
lassulus | I think that maybe a new type gpt_hybrid.nix which is basically gpt.nix but extended would be best | 16:11:53 |
lassulus | or maybe add an hybrid flag on the partitions and just run the hybrid code then | 16:12:20 |
matthewcroughan | requires different formatting | 16:14:42 |
matthewcroughan | it's a mindfsck | 16:14:46 |