From 0698120b11595f70972c30891fd6f0bd95d52aad Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sun, 4 Feb 2024 17:12:13 +0100 Subject: add factorio to ettves --- flake.lock | 17 +++++++++++++++++ flake.nix | 24 +++++++++++++++++++++--- modules/default.nix | 1 + modules/games/default.nix | 14 ++++++++++++++ 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 modules/games/default.nix diff --git a/flake.lock b/flake.lock index 4d25d13..d0a3b5f 100644 --- a/flake.lock +++ b/flake.lock @@ -107,6 +107,22 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1706732774, + "narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1706826059, @@ -128,6 +144,7 @@ "flake-parts": "flake-parts", "nixinate": "nixinate", "nixpkgs": "nixpkgs_2", + "nixpkgs-unstable": "nixpkgs-unstable", "secrets": "secrets" } }, diff --git a/flake.nix b/flake.nix index 0f5721b..9a8388d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; nixinate.url = "github:maxaudron/nixinate"; @@ -10,7 +11,7 @@ }; }; - outputs = inputs@{ self, nixpkgs, flake-parts, nixinate, ... }: + outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, flake-parts, nixinate, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ nixinate.flakeModule ./lib ]; flake = @@ -19,11 +20,28 @@ specialArgs = inputs // { nodes = self.nixosConfigurations; }; + + overlay-unstable = final: prev: { + unstable = import nixpkgs-unstable { + system = prev.system; + config.allowUnfree = true; + }; + }; + + overlays = { config, pkgs, ... }: { + nixpkgs.overlays = [ overlay-unstable ]; + }; + mkSystem = modules: nixpkgs.lib.nixosSystem { inherit specialArgs system; modules = modules ++ (with self.nixosModules; [ nixinate.nixosModules.default - common users wireguard crypto + overlays + + common + users + wireguard + crypto ]); }; in @@ -32,7 +50,7 @@ nixosConfigurations = with self.nixosModules; { # vultr-image = mkSystem [ common users image vultr ]; - ettves = mkSystem [ (import ./machines/ettves) kubernetes zfs teamspeak postgresql quassel powerdns acme authentik hydra homeassistant palworld ]; + ettves = mkSystem [ (import ./machines/ettves) kubernetes zfs teamspeak postgresql quassel powerdns acme authentik hydra homeassistant palworld games ]; phaenn = mkSystem [ (import ./machines/phaenn) kubernetes zfs acme tlmp ]; fra01 = mkSystem [ (import ./machines/fra01) vultr bgp powerdns acme garage ]; nyc01 = mkSystem [ (import ./machines/nyc01) vultr bgp powerdns acme garage ]; diff --git a/modules/default.nix b/modules/default.nix index baa7cd2..be1f57e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -24,4 +24,5 @@ garage = import ./garage; palworld = import ./palworld; + games = import ./games; } diff --git a/modules/games/default.nix b/modules/games/default.nix new file mode 100644 index 0000000..61250cb --- /dev/null +++ b/modules/games/default.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +{ + services.factorio = { + enable = true; + package = pkgs.unstable.factorio-headless; + + public = false; + nonBlockingSaving = true; + loadLatestSave = true; + game-name = "cocaine.farm"; + bind = "178.63.224.10"; + }; +} -- cgit v1.2.3