Browse Source

i can't get this test working

Signed-off-by: Xe <[email protected]>
main
Cadey Ratio 4 weeks ago
parent
commit
d3b4c730a0
  1. 42
      flake.lock
  2. 22
      flake.nix

42
flake.lock

@ -61,6 +61,22 @@
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1640319671,
"narHash": "sha256-ZkKmakwaOaLiZOpIZWbeJZwap5CzJ30s4UJTfydYIYc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "eac07edbd20ed4908b98790ba299250b5527ecdf",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
@ -69,14 +85,32 @@
"xess": "xess"
}
},
"utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"xess": {
"flake": false,
"inputs": {
"nixpkgs": "nixpkgs_3",
"utils": "utils"
},
"locked": {
"lastModified": 1637634344,
"narHash": "sha256-63zWhmRpppLzh+H70gHSViHfZ4JvtnOFDRrrjkXtzJE=",
"lastModified": 1640540322,
"narHash": "sha256-II4raADUWKTLDAALyJSToAgL8FB1ADbRHqEr/b3JeIc=",
"owner": "Xe",
"repo": "Xess",
"rev": "f9ffc529fca9751afdce2408089c51e73d56fce8",
"rev": "5fabc96de6487a721235c4bdf18214519d9e6201",
"type": "github"
},
"original": {

22
flake.nix

@ -6,7 +6,7 @@
};
outputs = { self, nixpkgs, flake-utils, naersk, xess }:
flake-utils.lib.eachDefaultSystem (system:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
@ -31,7 +31,9 @@
cp -rf $src/templates $out/templates
cp -rf ${printerfacts-bin}/bin $out/bin
cp -rf ${xess}/xess.css $out/static/gruvbox.css
cp -rf ${
xess.defaultPackage."${system}"
}/static/css/xess.css $out/static/gruvbox.css
'';
};
};
@ -83,12 +85,11 @@
within.services.printerfacts.enable = true;
};
testScript =
''
start_all()
client.wait_for_unit("within.printerfacts.service")
client.succeed("curl -f http://printerfacts.akua --resolve printerfacts.akua:80:127.0.0.1")
'';
testScript = ''
start_all()
server.wait_for_unit("within.printerfacts.service")
server.succeed("sleep 2 && curl -m 2 -v -f http://printerfacts.akua/metrics --unix-socket /srv/within/run/printerfacts.sock")
'';
};
nixosModules.printerfacts = { config, lib, pkgs, ... }:
@ -124,11 +125,12 @@
DynamicUser = "yes";
Restart = "on-failure";
WorkingDirectory = "/srv/within/printerfacts";
RestartSec = "30s";
RestartSec = "5s";
};
script = let site = self.packages."${system}".printerfacts;
in ''
set -x
export SOCKPATH=${cfg.sockPath}
export DOMAIN=${toString cfg.domain}
export RUST_LOG=info
@ -146,7 +148,7 @@
proxyWebsockets = true;
};
forceSSL = cfg.useACME;
useACMEHost = "cetacean.club";
useACMEHost = mkIf cfg.useACME "cetacean.club";
extraConfig = ''
access_log /var/log/nginx/printerfacts.access.log;
'';

Loading…
Cancel
Save