Compare commits
7 Commits
6a16f9cc49
...
b8fac75c93
Author | SHA1 | Date |
---|---|---|
emily | b8fac75c93 | 4 months ago |
emily | ff503e0978 | 4 months ago |
emily | 8961278acb | 4 months ago |
emily | dd2eec1797 | 4 months ago |
emily | 34a674872f | 4 months ago |
emily | 1bab1ada37 | 4 months ago |
emily | db4f08ccd7 | 4 months ago |
@ -1 +1,2 @@
|
||||
other/**
|
||||
result
|
||||
|
@ -1,131 +0,0 @@
|
||||
@font-face{
|
||||
font-family:brandon light;
|
||||
src:url(../font.woff2)
|
||||
}
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
position:relative;
|
||||
box-sizing:border-box;
|
||||
overflow:hidden
|
||||
}
|
||||
html,body{
|
||||
height:100%
|
||||
}
|
||||
body{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
align-items:center;
|
||||
background:#000
|
||||
}
|
||||
.content,.bg{
|
||||
position:absolute
|
||||
}
|
||||
.bg {
|
||||
/* margin: auto;
|
||||
min-height: 100%;
|
||||
min-width: 100%*/
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.bg video {
|
||||
filter: brightness(75%);
|
||||
}
|
||||
|
||||
.content{
|
||||
z-index:1;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
align-items:center;
|
||||
mix-blend-mode:overlay;
|
||||
filter:invert(100%)
|
||||
}
|
||||
img{
|
||||
width:100vmin;
|
||||
height:0vmin
|
||||
}
|
||||
canvas{
|
||||
width:91vmin;
|
||||
height:13vmin
|
||||
}
|
||||
h1{
|
||||
font-size:5.25vmin;
|
||||
}
|
||||
h2{
|
||||
font-size:2vmin;
|
||||
}
|
||||
.social, .social button {
|
||||
margin-top:.5vmin;
|
||||
font-family:brandon light;
|
||||
font-size:4.25vmin;
|
||||
letter-spacing:.3vmin
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer
|
||||
}
|
||||
.social a{
|
||||
text-decoration:none;
|
||||
color:#000
|
||||
}
|
||||
.hint{
|
||||
z-index:1;
|
||||
color:#000;
|
||||
mix-blend-mode:overlay;
|
||||
filter:invert(100%);
|
||||
position:fixed;
|
||||
bottom:6vmin;
|
||||
font-family:brandon light;
|
||||
font-size:2.75vmin;
|
||||
letter-spacing:.2vmin;
|
||||
font-weight:700;
|
||||
cursor:pointer
|
||||
}
|
||||
|
||||
/*.center{
|
||||
text-align: -webkit-center;
|
||||
}*/
|
||||
|
||||
.img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.content2 {
|
||||
font-family: Calibri, monospace;
|
||||
text-shadow: 0.06vw 0.06vw 0px rgba(8,230,255,100), -0.06vw -0.06vw 0px rgba(255,0,0,100);
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
}
|
||||
.content2 button {
|
||||
font-family: Calibri, monospace;
|
||||
text-shadow: 0.06vw 0.06vw 0px rgba(8,230,255,100), -0.06vw -0.06vw 0px rgba(255,0,0,100);
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container pre {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.container h1, .container button {
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
font-size: 1.39vmin;
|
||||
}
|
||||
.container a , .container button {
|
||||
color: #ffffff
|
||||
}
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705133751,
|
||||
"narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
{
|
||||
description = "kyouma.net website";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }: {
|
||||
overlays.default = final: prev: rec {
|
||||
vid = prev.stdenv.mkDerivation {
|
||||
name = "kyouma-www-vid";
|
||||
src = ./.;
|
||||
buildInputs = [ prev.yt-dlp ];
|
||||
buildPhase = ''
|
||||
yt-dlp -f 136+251 C4oApBlw7Gc --merge-output-format mp4 -o "media/sunnyday-avc.mp4"
|
||||
yt-dlp -f 398+251 C4oApBlw7Gc --merge-output-format mp4 -o "media/sunnyday-av1.mp4"
|
||||
'';
|
||||
installPhase = ''cp -r media $out'';
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "abrls86wyBJaZN3QM/p8fRoGQ7jVseao3F4oiMPh+84=";
|
||||
};
|
||||
kyouma-www = prev.stdenv.mkDerivation {
|
||||
pname = "kyouma-www";
|
||||
version = self.shortRev or (toString self.lastModifiedDate);
|
||||
src = ./.;
|
||||
buildPhase = '''';
|
||||
installPhase = ''cp -r src $out'';
|
||||
};
|
||||
};
|
||||
nixosModules.default =
|
||||
{ config, options, pkgs, lib, ... }: with lib;
|
||||
let
|
||||
cfg = config.services.vyosBld;
|
||||
bldFlags = (attrsets.mapAttrsToList (flag: opt: "--" + flag + " " + opt) cfg.buildFlags);
|
||||
vyosBuildScript = pkgs.writeShellScript "build-vyos" ''
|
||||
cleanup() {
|
||||
rmdir "$root"
|
||||
}
|
||||
root="$(mktemp -d)"
|
||||
trap cleanup EXIT
|
||||
iso_name="vyos-${cfg.buildFlags.version}-${cfg.buildFlags.architecture}.iso"
|
||||
bld_dir="$root/vyos-build"
|
||||
docker_cmd="${pkgs.docker}/bin/docker run --rm -it --privileged -v $bld_dir:/vyos -w /vyos vyos/vyos-build:current"
|
||||
|
||||
git clone -b current --single-branch https://github.com/vyos/vyos-build $root
|
||||
$docker_cmd sudo ./build-vyos-image ${cfg.flavor} ${builtins.concatStringsSep " " bldFlags}
|
||||
$docker_cmd sudo chown -R ${builtins.toString config.users.users.vyos-bld.uid}:${builtins.toString config.users.groups.vyos-bld.gid} /vyos
|
||||
|
||||
cp $bld_dir/build/$iso_name ${cfg.output}
|
||||
mapfile -t old_isos < <(ls ${cfg.output} | head -n -${builtins.toString cfg.keep})
|
||||
for i in ''${old_isos[@]}; do
|
||||
rm -r ${cfg.output}/''${old_iso[$i]}
|
||||
done
|
||||
'';
|
||||
in {
|
||||
options.services.vyosBld = {
|
||||
enable = mkEnableOption "VyOS automatic build";
|
||||
|
||||
output = mkOption {
|
||||
type = types.str;
|
||||
default = "/nix/var/vyos-build";
|
||||
description = "Where the iso should be copied";
|
||||
};
|
||||
|
||||
keep = mkOption {
|
||||
type = types.number;
|
||||
default = 5;
|
||||
description = "Amount of versions to keep";
|
||||
};
|
||||
|
||||
buildFreq = mkOption {
|
||||
type = types.str;
|
||||
default = "*-*-* 4:20:00";
|
||||
description = "How often a new Image should be build. See {manpage}`systemd.timer(5)`";
|
||||
};
|
||||
|
||||
flavor = mkOption {
|
||||
type = types.str;
|
||||
default = "iso";
|
||||
description = "See VyOS build docs";
|
||||
};
|
||||
|
||||
buildFlags = mkOption {
|
||||
type = types.attrs;
|
||||
default = "";
|
||||
description = "Build Flags see https://docs.vyos.io/en/latest/contributing/build-vyos.html
|
||||
example:
|
||||
{ build-by = 'mail@server.tld' }";
|
||||
};
|
||||
};
|
||||
config = with lib; mkIf cfg.enable {
|
||||
users = {
|
||||
users.vyos-bld = {
|
||||
isSystemUser = true;
|
||||
group = "vyos-bld";
|
||||
};
|
||||
groups.vyos-bld = {};
|
||||
};
|
||||
virtualisation.docker = {
|
||||
daemon.settings = {
|
||||
ipv6 = true;
|
||||
fixed-cidr-v6 = "fd00::/80";
|
||||
};
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
flags = [ "--all" "--filter until=24h" ];
|
||||
};
|
||||
rootless = {
|
||||
enable = true;
|
||||
setSocketVariable = true;
|
||||
};
|
||||
};
|
||||
networking.firewall.extraCommands = ''ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE'';
|
||||
|
||||
systemd = {
|
||||
services.docker.after = [ "firewall.service" ];
|
||||
services.vyosBld = {
|
||||
serviceConfig = {
|
||||
User = "vyos-bld";
|
||||
Group = "vyos-bld";
|
||||
ExecStart = vyosBuildScript;
|
||||
|
||||
PrivateTmp = true;
|
||||
ProtectHome = true;
|
||||
};
|
||||
};
|
||||
timers.vyosBld = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = cfg.buildFreq;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
;
|
||||
} // flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in rec {
|
||||
packages = {
|
||||
inherit (pkgs) vid kyouma-www;
|
||||
default = packages.kyouma-www;
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue