unify versioning (minus around nixops, for now) #311

Merged
fricklerhandwerk merged 1 commit from kiara/fediversity:unify-versioning into main 2025-05-05 09:22:17 +02:00
Owner

closes #279

not sure how to port the nixops4 bits, so that bit i put off to #309.

closes #279 not sure how to port the nixops4 bits, so that bit i put off to #309.
kiara changed title from WIP: unify versioning - not sure how to port nixops4 bits so wait until #309? to WIP: unify versioning 2025-04-18 19:14:32 +02:00
flake.nix Outdated
@ -17,0 +2,4 @@
outputs = { self, ... }: let
inherit sources = import ./npins;
inherit (sources) nixpkgs flake-parts nixops4 nixops4-nixos git-hooks;
pkgs = import nixpkgs;

This can't work, you're missing the argument to nixpkgs.

Also to make it unambiguous that you're just taking the pure library, do

lib = import "${nixpkgs}/lib";
This can't work, you're missing the argument to `nixpkgs`. Also to make it unambiguous that you're just taking the pure library, do ```nix lib = import "${nixpkgs}/lib"; ```
kiara marked this conversation as resolved
@ -9,6 +8,9 @@ let
inherit (lib) attrValues elem mkDefault;
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
inherit (lib.strings) removeSuffix;
# TODO: use thru nix path after #309

Why would we use nix path anywhere?

Why would we use nix path anywhere?
Author
Owner

(fwiw i removed this comment here now)

(fwiw i removed this comment here now)
kiara marked this conversation as resolved
@ -10,2 +9,4 @@
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
inherit (lib.strings) removeSuffix;
# TODO: use thru nix path after #309
sources = import ../../npins;

At this point we may set up our own little module system class to pass around sources. But I see this is trying to work around flake-parts, so either we rip out flake-parts or embrace it.

At this point we may set up our own little module system class to pass around `sources`. But I see this is trying to work around flake-parts, so either we rip out flake-parts or embrace it.
Author
Owner

i see little point ripping out flake-parts while nixops4 needs flakes as our external interface. it creates a diff moving infra/flake-part.nix into flake.nix, without meaningfully helping address unifying how we manage dependencies.

i see little point ripping out flake-parts while nixops4 needs flakes as our external interface. it creates a diff moving `infra/flake-part.nix` into `flake.nix`, without meaningfully helping address unifying how we manage dependencies.
fricklerhandwerk marked this conversation as resolved
Author
Owner

@fricklerhandwerk thanks for your feedback - i'll close in favor of #309, but yeah let's further discuss the dependency management still (as per matrix).

@fricklerhandwerk thanks for your feedback - i'll close in favor of #309, but yeah let's further discuss the dependency management still (as per matrix).
kiara closed this pull request 2025-04-21 16:54:01 +02:00
kiara reopened this pull request 2025-04-23 15:56:02 +02:00
kiara changed title from WIP: unify versioning to unify versioning (minus around nixops, for now) 2025-04-23 15:56:43 +02:00

Looks good generally (we can keep trimming it down later), but I don't understand why we would need multiple shell.nix or .envrc

Looks good generally (we can keep trimming it down later), but I don't understand why we would need multiple `shell.nix` or `.envrc`
Author
Owner

@fricklerhandwerk thanks for reviewing!

.envrc i guess prob seems like it should match our number of shells, as any would only help enter 'their' shell i guess.

on the multiple shells, the intent was to reflect decoupling components (and already segregating the proxmox bits to nuke after #116), but fair enough, i deduplicated them again now.

@fricklerhandwerk thanks for reviewing! `.envrc` i guess prob seems like it should match our number of shells, as any would only help enter 'their' shell i guess. on the multiple shells, the intent was to reflect decoupling components (and already segregating the proxmox bits to nuke after #116), but fair enough, i deduplicated them again now.

We currently have no need to emphasize composition, and if we need to we can still follow through with the module system idea. Right now it's just a monorepo with stuff in it.

We currently have no need to emphasize composition, and if we need to we can still follow through with the module system idea. Right now it's just a monorepo with stuff in it.
default.nix Outdated
@ -0,0 +24,4 @@
## Add a directory here if pre-commit hooks shouldn't apply to it.
optout = [
"npins"
".terraform"

Not using that yet

Not using that yet
kiara marked this conversation as resolved
default.nix Outdated
@ -0,0 +41,4 @@
# shell for testing TF directly
shell = pkgs.mkShellNoCC {
inherit (pre-commit-check) shellHook;
buildInputs = pre-commit-check.enabledPackages;

++ [ pkgs.npins ] (we had a schema divergence multiple times now, please always ship npins with the project)

`++ [ pkgs.npins ]` (we had a schema divergence multiple times now, please always ship npins with the project)
kiara marked this conversation as resolved
flake.nix Outdated
@ -54,4 +38,1 @@
shellcheck.enable = true;
};
devShells.default = pkgs.mkShell {

We can just re-export that from default.nix no? Why keep the split?

We can just re-export that from `default.nix` no? Why keep the split?
Author
Owner

i didn't know how to get non-flake nixops. i thought we imported flake inputs into default.nix before, yet now i don't even see it anymore.

i didn't know how to get non-flake nixops. i thought we imported flake inputs into `default.nix` before, yet now i don't even see it anymore.

We may have talked about it in a side channel, but this is how one can do it: https://github.com/fricklerhandwerk/flake-inputs (real-world example: bbf2cdaa6b/default.nix (L2-L3))

But in this case I would have thought we wanted it the other way round, and just not use the flake inputs?

We may have talked about it in a side channel, but this is how one can do it: https://github.com/fricklerhandwerk/flake-inputs (real-world example: https://github.com/ngi-nix/ngipkgs/blob/bbf2cdaa6ba3d6c6f576d188df34cc8c508292ab/default.nix#L2-L3) But in this case I would have thought we wanted it the other way round, and just not use the flake inputs?
Author
Owner

npins seems harder to use in flakes, in the sense they disallow builtins.currentSystem.
even with flake-inputs, i'm not sure how to proceed given that's aimed at getting inputs, while with nixops4 i don't know how to manually translate these config bits from the flake since they seemingly point nowhere.

npins seems harder to use in flakes, in the sense they disallow `builtins.currentSystem`. even with `flake-inputs`, i'm not sure how to proceed given that's aimed at getting `inputs`, while with nixops4 i don't know how to manually translate [these `config` bits](https://github.com/nixops4/nixops4/blob/main/flake.nix#L32-L35) from the flake since they seemingly point nowhere.

That's the config of the packages submodule from flake-parts. And we don't need builtins.currentSystem -- just pass system from the forAllSystems into that call, such as here: 02ce465c91/flake.nix (L90-L96)

That's the `config` of the `packages` submodule from `flake-parts`. And we don't need `builtins.currentSystem` -- just pass `system` from the `forAllSystems` into that call, such as here: https://github.com/ngi-nix/ngipkgs/blob/02ce465c911a3c61791a6f15be2f6001c33317d9/flake.nix#L90-L96
Author
Owner

thanks for the hint about system!

nixops4 tho feels like a pain to decouple from flakes, given the self-referential nature of flakes followed by flake-parts 😭

thanks for the hint about `system`! nixops4 tho feels like a pain to decouple from flakes, given the self-referential nature of flakes followed by `flake-parts` 😭

Yeah but that's fine, nixops can keep living in its flake world.

Yeah but that's fine, nixops can keep living in its flake world.
Author
Owner

i squashed a version with just nixops flakes-based now

i squashed a version with just nixops flakes-based now
services/.envrc Outdated
@ -0,0 +1,10 @@
#!/usr/bin/env bash

Don't think that file is needed

Don't think that file is needed
kiara marked this conversation as resolved
@ -0,0 +1,14 @@
{

Is that imported from anywhere else except the top level? Because if not, we could just leave it with { pkgs }: for now.

Is that imported from anywhere else except the top level? Because if not, we could just leave it with `{ pkgs }:` for now.
kiara marked this conversation as resolved
kiara force-pushed unify-versioning from ad0ee3cff5 to edd35361a1 2025-04-23 20:34:31 +02:00 Compare
kiara force-pushed unify-versioning from b378cc5292 to aec599821f 2025-05-01 11:17:52 +02:00 Compare
requested review from fricklerhandwerk 2025-05-01 11:21:58 +02:00
kiara force-pushed unify-versioning from aec599821f to 56522e6125 2025-05-01 11:45:38 +02:00 Compare
kiara force-pushed unify-versioning from 56522e6125 to f4ebf55a15 2025-05-01 13:24:56 +02:00 Compare
fricklerhandwerk left a comment
Owner

Let's keep fixing it up piecemeal

Let's keep fixing it up piecemeal
fricklerhandwerk deleted branch unify-versioning 2025-05-05 09:22:18 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#65 Automated dependency updates
fediversity/fediversity
Reference: fediversity/fediversity#311
No description provided.