Skip to content

Commit d686bc0

Browse files
authored
Merge pull request #30 from vst/28-switch-to-nix-flakes
Switch to Nix Flakes, Chores
2 parents 7d8106a + 33e5db1 commit d686bc0

File tree

15 files changed

+214
-485
lines changed

15 files changed

+214
-485
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
use nix
1+
use flake

.github/workflows/check.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Check Codebase"
1+
name: "Check, Test and Build Codebase"
22

33
on:
44
pull_request:
@@ -12,14 +12,17 @@ jobs:
1212
- name: "Checkout Codebase"
1313
uses: "actions/checkout@v4"
1414

15-
- name: "Install nix"
16-
uses: "cachix/install-nix-action@v25"
17-
with:
18-
nix_path: "nixpkgs=channel:nixos-24.05"
15+
- name: "Install Nix"
16+
uses: "DeterminateSystems/nix-installer-action@v17"
1917

20-
- name: "Use magic Nix cache"
21-
uses: "DeterminateSystems/magic-nix-cache-action@v4"
18+
- name: "Check, Test and Build"
19+
run: |
20+
nix develop --command bash -c "cabal update --ignore-project && cabal dev-test-build"
21+
22+
- name: "Build Docker Image"
23+
run: |
24+
nix build .#docker
2225
23-
- name: "Check Application"
26+
- name: "Load Docker Image"
2427
run: |
25-
nix-shell --run "dev-test-build"
28+
docker load <./result

.github/workflows/release.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,20 @@ jobs:
1616
steps:
1717
- id: "release"
1818
name: "Release"
19-
uses: "google-github-actions/release-please-action@v4"
19+
uses: "googleapis/release-please-action@v4"
2020

2121
- name: "Checkout Codebase"
2222
if: "${{ steps.release.outputs.release_created }}"
2323
uses: "actions/checkout@v4"
24-
with:
25-
fetch-depth: 0
2624

27-
- name: "Install nix"
25+
- name: "Install Nix"
2826
if: "${{ steps.release.outputs.release_created }}"
29-
uses: "cachix/install-nix-action@v25"
30-
with:
31-
nix_path: "nixpkgs=channel:nixos-24.05"
32-
extra_nix_config: "system-features = benchmark, big-parallel, nixos-test, uid-range, kvm"
33-
34-
- name: "Use magic Nix cache"
35-
if: "${{ steps.release.outputs.release_created }}"
36-
uses: "DeterminateSystems/magic-nix-cache-action@v4"
27+
uses: "DeterminateSystems/nix-installer-action@v17"
3728

3829
- name: "Build Statically Compiled Executable"
3930
if: "${{ steps.release.outputs.release_created }}"
4031
run: |
41-
nix-shell --run "bash build-static.sh"
32+
nix develop --command bash build-static.sh
4233
4334
- name: "Upload Release Artifact"
4435
if: "${{ steps.release.outputs.release_created }}"

README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,10 @@ secrets:
8080
> If 1Password is used, 1Password CLI application (`op`) must be on
8181
> `PATH` when running `opsops`.
8282

83-
### Using `nix-env`
84-
85-
```sh
86-
nix-env --install --file https://github.com/vst/opsops/archive/main.tar.gz --attr app
87-
```
88-
89-
### Using `nix-profile`
90-
91-
```sh
92-
nix profile install --file https://github.com/vst/opsops/archive/main.tar.gz app
93-
```
94-
95-
### Using `niv`
96-
9783
```sh
98-
niv add vst/opsops -n opsops
84+
nix profile install --file https://github.com/vst/opsops/archive/main.tar.gz
9985
```
10086

101-
... and then:
102-
103-
```sh
104-
sources = import ./nix/sources.nix;
105-
opsops = (import sources.opsops { }).app;
106-
```
107-
108-
... and finally add `opsops` to your system packages, home packages or
109-
Nix shell build inputs.
110-
11187
## Usage
11288

11389
### Specification
@@ -333,7 +309,7 @@ hpack &&
333309
To check and build:
334310

335311
```sh
336-
dev-test-build
312+
cabal dev-test-build [-c]
337313
```
338314

339315
## License

build-static.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## `--enable-executable-stripping`, hence the `strip` command usage.
1010

1111
## GHC version:
12-
GHC_VERSION="9.4.8"
12+
GHC_VERSION="9.6.6"
1313

1414
## Docker image:
1515
DOCKER_IMAGE="quay.io/benz0li/ghc-musl:${GHC_VERSION}"

default.nix

Lines changed: 0 additions & 133 deletions
This file was deleted.

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)