i can't get this test working
Signed-off-by: Xe <me@christine.website>
This commit is contained in:
parent
f83a28dcea
commit
d3b4c730a0
44
flake.lock
44
flake.lock
|
@ -61,6 +61,22 @@
|
||||||
"type": "indirect"
|
"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": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
@ -69,14 +85,32 @@
|
||||||
"xess": "xess"
|
"xess": "xess"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"xess": {
|
"utils": {
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1637634344,
|
"lastModified": 1638122382,
|
||||||
"narHash": "sha256-63zWhmRpppLzh+H70gHSViHfZ4JvtnOFDRrrjkXtzJE=",
|
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xess": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1640540322,
|
||||||
|
"narHash": "sha256-II4raADUWKTLDAALyJSToAgL8FB1ADbRHqEr/b3JeIc=",
|
||||||
"owner": "Xe",
|
"owner": "Xe",
|
||||||
"repo": "Xess",
|
"repo": "Xess",
|
||||||
"rev": "f9ffc529fca9751afdce2408089c51e73d56fce8",
|
"rev": "5fabc96de6487a721235c4bdf18214519d9e6201",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
22
flake.nix
22
flake.nix
|
@ -6,7 +6,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, naersk, xess }:
|
outputs = { self, nixpkgs, flake-utils, naersk, xess }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
pkgs = nixpkgs.legacyPackages."${system}";
|
||||||
naersk-lib = naersk.lib."${system}";
|
naersk-lib = naersk.lib."${system}";
|
||||||
|
@ -31,7 +31,9 @@
|
||||||
|
|
||||||
cp -rf $src/templates $out/templates
|
cp -rf $src/templates $out/templates
|
||||||
cp -rf ${printerfacts-bin}/bin $out/bin
|
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;
|
within.services.printerfacts.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript =
|
testScript = ''
|
||||||
''
|
start_all()
|
||||||
start_all()
|
server.wait_for_unit("within.printerfacts.service")
|
||||||
client.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")
|
||||||
client.succeed("curl -f http://printerfacts.akua --resolve printerfacts.akua:80:127.0.0.1")
|
'';
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.printerfacts = { config, lib, pkgs, ... }:
|
nixosModules.printerfacts = { config, lib, pkgs, ... }:
|
||||||
|
@ -124,11 +125,12 @@
|
||||||
DynamicUser = "yes";
|
DynamicUser = "yes";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
WorkingDirectory = "/srv/within/printerfacts";
|
WorkingDirectory = "/srv/within/printerfacts";
|
||||||
RestartSec = "30s";
|
RestartSec = "5s";
|
||||||
};
|
};
|
||||||
|
|
||||||
script = let site = self.packages."${system}".printerfacts;
|
script = let site = self.packages."${system}".printerfacts;
|
||||||
in ''
|
in ''
|
||||||
|
set -x
|
||||||
export SOCKPATH=${cfg.sockPath}
|
export SOCKPATH=${cfg.sockPath}
|
||||||
export DOMAIN=${toString cfg.domain}
|
export DOMAIN=${toString cfg.domain}
|
||||||
export RUST_LOG=info
|
export RUST_LOG=info
|
||||||
|
@ -146,7 +148,7 @@
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
forceSSL = cfg.useACME;
|
forceSSL = cfg.useACME;
|
||||||
useACMEHost = "cetacean.club";
|
useACMEHost = mkIf cfg.useACME "cetacean.club";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
access_log /var/log/nginx/printerfacts.access.log;
|
access_log /var/log/nginx/printerfacts.access.log;
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue