Test workflow (v12)

This commit is contained in:
Tom Hubrecht 2023-06-29 23:38:13 +02:00
parent 5b8de53749
commit 6694f9cf8a
6 changed files with 48 additions and 12 deletions

View file

@ -17,11 +17,7 @@ jobs:
- name: Build website
run: |
printenv HOME
export HOME=$(pwd)
nix --extra-experimental-features nix-command \
--extra-experimental-features flakes \
build dgnum.eu
nix-build dgnum.eu
- name: Clone dgnum.eu
uses: actions/checkout@v3

10
default.nix Normal file
View file

@ -0,0 +1,10 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix

View file

@ -1,5 +1,21 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -35,6 +51,7 @@
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}

View file

@ -4,15 +4,20 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ssg = pkgs.callPackage ./ssg { };
defaultInputs = with pkgs; [ nixfmt shellcheck ];
in {
in
{
formatter = pkgs.nixfmt;
devShells = {

View file

@ -1,6 +1,10 @@
{ glibcLocales, nix-gitignore, ssg, stdenv }:
{ glibcLocales
, nix-gitignore
, ssg
, mkDerivation
}:
stdenv.mkDerivation {
mkDerivation {
name = "dgnum.eu";
version = "0.1.0";
srcs = nix-gitignore.gitignoreSourcePure ../.gitignore ./.;

View file

@ -1,4 +1,8 @@
{ haskellPackages, locale, nix-gitignore }:
{ haskellPackages
, nix-gitignore
}:
let srcs = nix-gitignore.gitignoreSourcePure ../.gitignore ./.;
in haskellPackages.callCabal2nix "ssg" srcs { }
haskellPackages.callCabal2nix
"ssg"
(nix-gitignore.gitignoreSourcePure ../.gitignore ./.)
{ }