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

Convert to flake #1

Merged
merged 11 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

use devenv
use flake . --impure
16 changes: 11 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ concurrency:

on:
push:
branches:
branches:
- main
- flake

jobs:
update:
Expand All @@ -15,13 +16,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23

- name: Install nix
uses: cachix/install-nix-action@v24
with:
extra_nix_config: |
accept-flake-config = true

- uses: cachix/cachix-action@v12
with:
name: lco-public
extraPullNames: devenv
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Install devenv.sh
run: nix profile install tarball+https://install.devenv.sh/latest

- name: Build
run: devenv ci
run: nix develop --impure
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml

.devenv
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ A reusable [devenv](https://devenv.sh/) w/ common tools needed for Kubernetes

## Usage

```shell
nix develop --impure
```

### Import

To import this devenv into another, add the following to your `devenv.yaml`:

```diff
Expand All @@ -17,13 +23,16 @@ index c7cb5ce..75410d4 100644
url: github:NixOS/nixpkgs/nixpkgs-unstable
+ k8s:
+ url: git+https://github.com/LCOGT/devenv-k8s
+ flake: false
+ flake: true
+imports:
+ - k8s
```

Next time you do `devenv shell`, it will install all packages listed in [devenv.nix](devenv.nix)
in addition to any project specific ones.
Or if using a flake-parts, add this repo to inputs and follow
https://devenv.sh/guides/using-with-flake-parts/#import-a-devenv-module

Next time you do `devenv shell` or `nix develop --impure`, it will install all
packages listed in [devenv.nix](devenv.nix) in addition to any project specific ones.

## Cache

Expand All @@ -43,3 +52,9 @@ devenv update
```

Or you can declaritively lock it to a specific ref. See https://devenv.sh/reference/yaml-options/.

For flakes,

```shell
nix flake update devenv-k8s
```
156 changes: 0 additions & 156 deletions devenv.lock

This file was deleted.

38 changes: 0 additions & 38 deletions devenv.nix

This file was deleted.

3 changes: 0 additions & 3 deletions devenv.yaml

This file was deleted.

Loading