Add deployment workflow #7

Merged
hubrecht merged 32 commits from refs/pull/7/head into master 2023-06-30 11:56:52 +02:00
6 changed files with 48 additions and 12 deletions
Showing only changes of commit 6694f9cf8a - Show all commits

View file

@ -17,11 +17,7 @@ jobs:
- name: Build website - name: Build website
run: | run: |
printenv HOME nix-build dgnum.eu
export HOME=$(pwd)
nix --extra-experimental-features nix-command \
--extra-experimental-features flakes \
build dgnum.eu
- name: Clone dgnum.eu - name: Clone dgnum.eu
uses: actions/checkout@v3 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": { "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": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -35,6 +51,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View file

@ -4,15 +4,20 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; 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: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
ssg = pkgs.callPackage ./ssg { }; ssg = pkgs.callPackage ./ssg { };
defaultInputs = with pkgs; [ nixfmt shellcheck ]; defaultInputs = with pkgs; [ nixfmt shellcheck ];
in { in
{
formatter = pkgs.nixfmt; formatter = pkgs.nixfmt;
devShells = { devShells = {

View file

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

View file

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