Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix flake enablement for gardenlogin #73

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vasu1124
Copy link
Member

What this PR does / why we need it:

We want to enable gardenlogin for the nix community.

# with Nix (macOS, Linux, and Windows)

# development version
nix profile install github:gardener/gardenlogin

gardenlogin --help
kubectl gardenlogin --help

@vasu1124 vasu1124 requested a review from a team as a code owner January 10, 2024 12:51
@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Jan 10, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 10, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 10, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 10, 2024
Copy link
Member

@petersutter petersutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.
I've added some feedback, but I'm not familiar with Nix. Generally, I'm wondering what problem we're trying to solve with yet another installer (to put it simply). Or are we just adding to the maintenance burden (hardcoded vendor hash that has to be updated on every dependency update, go version, nixos version)?

README.md Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated
Comment on lines 37 to 42
version = lib.fileContents ./VERSION;
splitVersion = lib.versions.splitVersion version;
major = if ((lib.elemAt splitVersion 0) == "v") then lib.elemAt splitVersion 1 else lib.elemAt splitVersion 0;
minor = if ((lib.elemAt splitVersion 0) == "v") then lib.elemAt splitVersion 2 else lib.elemAt splitVersion 1;
gitCommit = if (self ? rev) then self.rev else self.dirtyRev;
state = if (self ? rev) then "clean" else "dirty";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitVersion, major, minor can be repalced with lib.versions.major/minor.

As you can see in the syntax highlighting that no longer works, this is not really how nix does things but I think it would work. The idomatic nix way would be something like:

            gitCommit = if (self ? rev) then
              self.rev 
            else
              self.dirtyRev;

flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link

I'm wondering what problem we're trying to solve with yet another installer (to put it simply).

Nix also allows things like nix run github:vasu1124/gardenlogin which most other package managers can only dream off.
Also now other flakes or nixos configuration can just reference this repo to install gardenlogin and don't need to manually install it or use tools like brew which lack reproducibility and a generall way of defining things declaratively which makes building devops tooling in a central place not easier.

@vasu1124
Copy link
Member Author

Generally, I'm wondering what problem we're trying to solve with yet another installer (to put it simply).

The nix ecosystem allows for a simplified developer onboarding and enhanced team productivity. There are already teams that use nix for this purpose and have created nix functions/packages for all our gardentools. Let's be frontrunners and not laggards.

Or are we just adding to the maintenance burden (hardcoded vendor hash that has to be updated on every dependency update, go version, nixos version)?

Let's tackle that issue in a next step.

@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 12, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 12, 2024
@gardener-robot gardener-robot added the lifecycle/stale Nobody worked on this for 6 months (will further age) label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Nobody worked on this for 6 months (will further age) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants