From 3efe26c5bff5d8bfc2543eafc25ff980ee900952 Mon Sep 17 00:00:00 2001 From: noe Date: Tue, 1 Apr 2025 22:41:48 -0700 Subject: [PATCH] ps2live: update --- Justfile | 2 +- flake.lock | 308 +++---------------------- flake.nix | 42 +--- nixos/stacks/ps2.live/agg_metagame.nix | 24 +- shell.nix | 1 - 5 files changed, 60 insertions(+), 317 deletions(-) diff --git a/Justfile b/Justfile index dde2b71..f986a66 100644 --- a/Justfile +++ b/Justfile @@ -80,7 +80,7 @@ deploy target_host extra_flags="": deploy2 target_host extra_flags="": @test -f nixos/hosts/{{target_host}}/.target || { echo "Host cannot be deployed, add a .target file with SSH destination"; exit 1; } - nixos-rebuild switch {{extra_flags}} --target-host root@`cat nixos/hosts/{{target_host}}/.target` `cat nixos/hosts/{{target_host}}/.flags 2>/dev/null || echo ''` --accept-flake-config --flake .#{{target_host}} + nixos-rebuild switch {{extra_flags}} --target-host root@`cat nixos/hosts/{{target_host}}/.target` `cat nixos/hosts/{{target_host}}/.flags 2>/dev/null || echo ''` --accept-flake-config --verbose --flake .#{{target_host}} # ssh target_host *args='': diff --git a/flake.lock b/flake.lock index e4b4e22..53972f6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,5 @@ { "nodes": { - "apple-silicon": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1742098834, - "narHash": "sha256-l98XVpNXW6hr0AsxCeQZbdf6EGT8OpHdkWBi7sdel4s=", - "owner": "tpwrules", - "repo": "nixos-apple-silicon", - "rev": "8457960249bcfd34c22838e20eaa7d8261428688", - "type": "github" - }, - "original": { - "owner": "tpwrules", - "repo": "nixos-apple-silicon", - "type": "github" - } - }, "crane": { "locked": { "lastModified": 1737689766, @@ -78,7 +58,7 @@ }, "fedi-emotes_2": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1714013418, @@ -94,21 +74,6 @@ "url": "https://git.sapphic.engineer/noe/emotes" } }, - "flake-compat": { - "locked": { - "lastModified": 1688025799, - "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", - "owner": "nix-community", - "repo": "flake-compat", - "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -128,27 +93,6 @@ } }, "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_3": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, @@ -166,7 +110,7 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_3": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_3" }, @@ -184,7 +128,7 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_4" }, @@ -256,24 +200,6 @@ "type": "github" } }, - "flake-utils_4": { - "inputs": { - "systems": "systems_4" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flakey-profile": { "locked": { "lastModified": 1712898590, @@ -354,40 +280,12 @@ "url": "https://iceshrimp.dev/noe/withdrawal" } }, - "ixx": { - "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], - "nixpkgs": [ - "nixvim", - "nuschtosSearch", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", - "owner": "NuschtOS", - "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "ref": "v0.0.6", - "repo": "ixx", - "type": "github" - } - }, "lenovo-rgb": { "inputs": { "crane": "crane", "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2", - "rust-overlay": "rust-overlay_2" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" }, "locked": { "lastModified": 1740256865, @@ -424,26 +322,6 @@ "url": "https://git.sapphic.engineer/noe/lightrunner-emotes" } }, - "linger": { - "inputs": { - "flake-utils": [ - "flake-utils" - ] - }, - "locked": { - "lastModified": 1670283645, - "narHash": "sha256-SuC/SuQ8RUaM6RthNAkNTSnlpRXJxEmuym2OyPLLpWk=", - "owner": "mindsbackyard", - "repo": "linger-flake", - "rev": "9f8632c0621dc562dd42e9eacfdb6dae82aebf8b", - "type": "github" - }, - "original": { - "owner": "mindsbackyard", - "repo": "linger-flake", - "type": "github" - } - }, "lix": { "flake": false, "locked": { @@ -468,15 +346,15 @@ ] }, "locked": { - "lastModified": 1742919621, - "narHash": "sha256-+Wy+bMNZXDTfMuCFKRWbd2Rcpj6UZcrQ8tlT5vhtgm4=", - "rev": "c40fe6e5c69fed5f5df4af92479046d86e2368ac", + "lastModified": 1742943028, + "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", + "rev": "868d97695bab9d21f6070b03957bcace249fbe3c", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/c40fe6e5c69fed5f5df4af92479046d86e2368ac.tar.gz?rev=c40fe6e5c69fed5f5df4af92479046d86e2368ac" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/868d97695bab9d21f6070b03957bcace249fbe3c.tar.gz?rev=868d97695bab9d21f6070b03957bcace249fbe3c" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-2.tar.gz" + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz" } }, "nixlib": { @@ -497,7 +375,7 @@ "nixos-generators": { "inputs": { "nixlib": "nixlib", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1742568034, @@ -531,16 +409,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741851582, - "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", - "owner": "nixos", + "lastModified": 1737717945, + "narHash": "sha256-ET91TMkab3PmOZnqiJQYOtSGvSTvGeHoegAv4zcTefM=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", + "rev": "ecd26a469ac56357fd333946a99086e992452b6a", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -607,11 +485,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1743559538, - "narHash": "sha256-RUyl8Wqp+MpQnRblzZE0qedTlrA4Grd6fxa0ysEAsIw=", + "lastModified": 1743564986, + "narHash": "sha256-1Iw5F3/WF8Cai6nqzJyuQChppKG0bJoTUTow7c4Cyak=", "owner": "nixos", "repo": "nixpkgs", - "rev": "99bb443ae33b5e0c0d6e2468797a58a398e175cf", + "rev": "73568195d9be8a300a9ca17b6bfb7d1d65aed1ae", "type": "github" }, "original": { @@ -654,22 +532,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1737717945, - "narHash": "sha256-ET91TMkab3PmOZnqiJQYOtSGvSTvGeHoegAv4zcTefM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ecd26a469ac56357fd333946a99086e992452b6a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1713596654, "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", @@ -685,7 +547,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1736657626, "narHash": "sha256-FWlPMUzp0lkQBdhKlPqtQdqmp+/C+1MBiEytaYfrCTY=", @@ -701,7 +563,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1743448293, "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", @@ -717,7 +579,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1743441817, "narHash": "sha256-+OE03P3u0FRwhS+Ah6EYiwxdS1rcIYlXheuXGM3wP3Q=", @@ -733,31 +595,9 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": [ - "nixpkgs-unstable" - ], - "nuschtosSearch": "nuschtosSearch" - }, - "locked": { - "lastModified": 1743536158, - "narHash": "sha256-/jlBU7EGIfaa5VKwvVyrSspuuNmgKYOjAuTd2ywyevg=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "754b8df7e37be04b7438decee5a5aa18af72cbe1", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, "noe-sh": { "inputs": { - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" ] @@ -776,58 +616,9 @@ "url": "https://git.sapphic.engineer/noe/noe.sh" } }, - "nuschtosSearch": { - "inputs": { - "flake-utils": "flake-utils_4", - "ixx": "ixx", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1743201766, - "narHash": "sha256-bb/dqoIjtIWtJRzASOe8g4m8W2jUIWtuoGPXdNjM/Tk=", - "owner": "NuschtOS", - "repo": "search", - "rev": "2651dbfad93d6ef66c440cbbf23238938b187bde", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "repo": "search", - "type": "github" - } - }, - "pihole": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "linger": [ - "linger" - ], - "nixpkgs": [ - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1717134985, - "narHash": "sha256-jnkBhTI27wYI6ISwszzGfDRmyR6xXNvt1IHAnpvmAOA=", - "ref": "refs/heads/main", - "rev": "913f75bd0d1e8c8f10aad666b112a25e9e0ad686", - "revCount": 39, - "type": "git", - "url": "https://git.sapphic.engineer/noe/pihole-flake" - }, - "original": { - "type": "git", - "url": "https://git.sapphic.engineer/noe/pihole-flake" - } - }, "plapkit": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_3", "nixpkgs": [ "nixpkgs" ] @@ -871,7 +662,6 @@ }, "root": { "inputs": { - "apple-silicon": "apple-silicon", "doll-repair": "doll-repair", "fedi-emotes": "fedi-emotes", "flake-utils": "flake-utils", @@ -880,17 +670,14 @@ "iceshrimp-withdrawal": "iceshrimp-withdrawal", "lenovo-rgb": "lenovo-rgb", "lightrunner-emotes": "lightrunner-emotes", - "linger": "linger", "lix-module": "lix-module", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-master": "nixpkgs-master", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", - "nixvim": "nixvim", "noe-sh": "noe-sh", - "pihole": "pihole", "plapkit": "plapkit", "plasma-manager": "plasma-manager", "saerro": "saerro", @@ -899,22 +686,6 @@ } }, "rust-overlay": { - "flake": false, - "locked": { - "lastModified": 1686795910, - "narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { "inputs": { "nixpkgs": [ "lenovo-rgb", @@ -937,17 +708,17 @@ }, "saerro": { "inputs": { - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_4", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1743562865, - "narHash": "sha256-caJfyD08ZWZFXkwxeEpFBaYO7McBgTekakTH6W8P9NU=", + "lastModified": 1743566083, + "narHash": "sha256-yCmrP/FPIDYp8GMk2T0KiZ5LXcW8paLaJZoqhR93Io8=", "ref": "refs/heads/main", - "rev": "2bfd19339c8d3b204a6aa510772e3c84b9cf4500", - "revCount": 12, + "rev": "630c958642cac6c843d0a3ac418a5234ef0c220c", + "revCount": 13, "type": "git", "url": "https://git.sapphic.engineer/ps2.live/saerro-go" }, @@ -958,7 +729,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1743502316, @@ -1019,21 +790,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tachikoma": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 5a9a01c..29760bf 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-2.tar.gz"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz"; inputs.nixpkgs.follows = "nixpkgs-master"; }; @@ -23,20 +23,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; - - # Darwin & Apple Silicon tools - apple-silicon.url = "github:tpwrules/nixos-apple-silicon"; - + # Secrets sops-nix.url = "github:Mic92/sops-nix"; - #sops-nix-darwin.url = "github:Kloenk/sops-nix?ref=darwin"; - - # Fancy stuff - nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; - }; - + # Pro gamer move nixos-generators.url = "github:nix-community/nixos-generators"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; @@ -54,18 +44,6 @@ inputs.iceshrimp.follows = "iceshrimp"; }; - # PiHole - pihole = { - url = "git+https://git.sapphic.engineer/noe/pihole-flake"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; - inputs.linger.follows = "linger"; - inputs.flake-utils.follows = "flake-utils"; - }; - linger = { - url = "github:mindsbackyard/linger-flake"; - inputs.flake-utils.follows = "flake-utils"; - }; - # Self noe-sh = { url = "git+https://git.sapphic.engineer/noe/noe.sh"; @@ -95,6 +73,10 @@ url = "git+https://git.sapphic.engineer/ps2.live/saerro-go"; inputs.nixpkgs.follows = "nixpkgs"; }; + ps2live = { + url = "git+https://git.sapphic.engineer/ps2.live/ps2.live"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; nixConfig = { @@ -141,14 +123,6 @@ ]; format = "proxmox-lxc"; }; - - rpi-streambox = inputs.nixos-generators.nixosGenerate { - inherit system pkgs; - modules = [ - ./nixos/hosts/streambox - ]; - format = "sd-aarch64"; - }; } ); @@ -174,7 +148,7 @@ # Available through 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = { aerial = mkNixos [ ./nixos/hosts/aerial ]; # desktop - cider = mkNixos [ ./nixos/hosts/cider ]; # asahi m2 mba + # cider = mkNixos [ ./nixos/hosts/cider ]; # asahi m2 mba dis-sociat-ing = mkNixos [ ./nixos/hosts/dis-sociat-ing ]; # Iceshrimp+Withdrawl, dis.sociat.ing exit-node = mkNixos [ ./nixos/hosts/exit-node ]; # lab jump git = mkNixos [ ./nixos/hosts/git ]; # Forgejo Host diff --git a/nixos/stacks/ps2.live/agg_metagame.nix b/nixos/stacks/ps2.live/agg_metagame.nix index 0ca2c72..751b27c 100644 --- a/nixos/stacks/ps2.live/agg_metagame.nix +++ b/nixos/stacks/ps2.live/agg_metagame.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: let +{ config, pkgs, inputs, ... }: let image = name: "ghcr.io/genudine/${name}/${name}:latest"; port = n: builtins.toString ( 8201 + (n * 100) ); in { @@ -19,9 +19,10 @@ in { }; aggpop = { - image = image "agg-population"; + image = "ps2.live/agg.ps2.live:latest"; + imageFile = inputs.ps2live.packages.${pkgs.system}.aggpop; environment = { - PORT = port 0; + ADDR = ":${port 0}"; }; ports = [ "${port 0}:${port 0}" ]; }; @@ -31,9 +32,7 @@ in { serviceConfig.Type = "oneshot"; script = '' ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.metagame.image} - ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.aggpop.image} - systemctl restart podman-aggpop systemctl restart podman-metagame ''; }; @@ -45,4 +44,19 @@ in { OnUnitActiveSec = "360m"; }; }; + + systemd.services.start-aggpop-if-stopped = { + serviceConfig.Type = "oneshot"; + script = '' + systemctl start podman-aggpop + ''; + }; + + systemd.timers.start-aggpop-if-stopped = { + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "start-aggpop-if-stopped.service"; + OnUnitActiveSec = "15m"; + }; + }; } diff --git a/shell.nix b/shell.nix index 3745b90..41c0e0b 100644 --- a/shell.nix +++ b/shell.nix @@ -6,7 +6,6 @@ # Enable experimental features without having to specify the argument NIX_CONFIG = "experimental-features = nix-command flakes"; nativeBuildInputs = with pkgs; [ - lix home-manager git just