-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9064284
commit cab6e63
Showing
5 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use flake | ||
dotenv_if_exists .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: nix build | ||
|
||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
check_nix: | ||
name: Check nix build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
with: | ||
extra-conf: system-features = nixos-test benchmark big-parallel kvm | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- name: Check Nix flake inputs | ||
uses: DeterminateSystems/flake-checker-action@v4 | ||
- name: Build lib | ||
run: nix build -L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ tags | |
tags.mtime | ||
.DS_Store | ||
TAGS | ||
|
||
.env | ||
.direnv | ||
result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
description = "one-time-password"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
libsodium-bindings.url = "github:haskell-cryptography/libsodium-bindings"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }@inputs: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs{inherit system;}; | ||
|
||
haskellPackages = pkgs.haskellPackages.override { | ||
overrides = hself: hsuper: { | ||
libsodium-bindings = inputs.libsodium-bindings.packages.${system}.libsodium-bindings; | ||
sel = inputs.libsodium-bindings.packages.${system}.sel; | ||
}; | ||
}; | ||
in | ||
rec | ||
{ | ||
packages.one-time-password = | ||
haskellPackages.callCabal2nix "one-time-password" ./. | ||
{ | ||
base32 = haskellPackages.base32_0_4; | ||
sel = inputs.libsodium-bindings.packages.${system}.sel; | ||
}; | ||
|
||
defaultPackage = packages.one-time-password; | ||
|
||
devShell = | ||
let | ||
scripts = pkgs.symlinkJoin { | ||
name = "scripts"; | ||
paths = pkgs.lib.mapAttrsToList pkgs.writeShellScriptBin { | ||
}; | ||
}; | ||
in | ||
pkgs.mkShell { | ||
buildInputs = with haskellPackages; [ | ||
pkgs.libsodium | ||
haskell-language-server | ||
ghcid | ||
cabal-install | ||
scripts | ||
]; | ||
inputsFrom = [ | ||
self.defaultPackage.${system}.env | ||
]; | ||
}; | ||
}); | ||
} |