phantom: load vpsfreecz configuration from upstream instead of duplicating
This commit is contained in:
		
							parent
							
								
									8d85dd15d7
								
							
						
					
					
						commit
						f0af06970c
					
				
					 4 changed files with 19 additions and 77 deletions
				
			
		
							
								
								
									
										16
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										16
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							| 
						 | 
					@ -531,6 +531,7 @@
 | 
				
			||||||
        "plymouth-themes": "plymouth-themes",
 | 
					        "plymouth-themes": "plymouth-themes",
 | 
				
			||||||
        "ranger-icons": "ranger-icons",
 | 
					        "ranger-icons": "ranger-icons",
 | 
				
			||||||
        "tlauncher": "tlauncher",
 | 
					        "tlauncher": "tlauncher",
 | 
				
			||||||
 | 
					        "vpsadminos": "vpsadminos",
 | 
				
			||||||
        "warthunder-leak-counter": "warthunder-leak-counter",
 | 
					        "warthunder-leak-counter": "warthunder-leak-counter",
 | 
				
			||||||
        "wl-crosshair": "wl-crosshair"
 | 
					        "wl-crosshair": "wl-crosshair"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -723,6 +724,21 @@
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    "vpsadminos": {
 | 
				
			||||||
 | 
					      "locked": {
 | 
				
			||||||
 | 
					        "lastModified": 1727306253,
 | 
				
			||||||
 | 
					        "narHash": "sha256-PdVXdZvhAqQFALZiACXIjwFRSo0EhEKMm94uxvyFyPk=",
 | 
				
			||||||
 | 
					        "owner": "vpsfreecz",
 | 
				
			||||||
 | 
					        "repo": "vpsadminos",
 | 
				
			||||||
 | 
					        "rev": "bd2b87cbcb75a9e9aa25f76fb7e1f0f625963277",
 | 
				
			||||||
 | 
					        "type": "github"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      "original": {
 | 
				
			||||||
 | 
					        "owner": "vpsfreecz",
 | 
				
			||||||
 | 
					        "repo": "vpsadminos",
 | 
				
			||||||
 | 
					        "type": "github"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    "warthunder-leak-counter": {
 | 
					    "warthunder-leak-counter": {
 | 
				
			||||||
      "inputs": {
 | 
					      "inputs": {
 | 
				
			||||||
        "crane": "crane_2",
 | 
					        "crane": "crane_2",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,6 +7,8 @@
 | 
				
			||||||
    home-manager.url = "github:nix-community/home-manager/release-24.05";
 | 
					    home-manager.url = "github:nix-community/home-manager/release-24.05";
 | 
				
			||||||
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
 | 
					    home-manager.inputs.nixpkgs.follows = "nixpkgs";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vpsadminos.url = "github:vpsfreecz/vpsadminos";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    nix-index-database = {
 | 
					    nix-index-database = {
 | 
				
			||||||
      url = "github:Mic92/nix-index-database";
 | 
					      url = "github:Mic92/nix-index-database";
 | 
				
			||||||
      inputs.nixpkgs.follows = "nixpkgs";
 | 
					      inputs.nixpkgs.follows = "nixpkgs";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,7 @@
 | 
				
			||||||
}:
 | 
					}:
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  imports = [
 | 
					  imports = [
 | 
				
			||||||
    ./vpsadminos.nix
 | 
					    inputs.vpsadminos.nixosConfigurations.container
 | 
				
			||||||
    inputs.agenix.nixosModules.default
 | 
					    inputs.agenix.nixosModules.default
 | 
				
			||||||
    ../../system/nix.nix
 | 
					    ../../system/nix.nix
 | 
				
			||||||
    ./hardware-config.nix
 | 
					    ./hardware-config.nix
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,76 +0,0 @@
 | 
				
			||||||
# This file provides compatibility for NixOS to run in a container on vpsAdminOS
 | 
					 | 
				
			||||||
# hosts.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# If you're experiencing issues, try updating this file to the latest version
 | 
					 | 
				
			||||||
# from vpsAdminOS repository:
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#   https://github.com/vpsfreecz/vpsadminos/blob/staging/os/lib/nixos-container/vpsadminos.nix
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  config,
 | 
					 | 
				
			||||||
  pkgs,
 | 
					 | 
				
			||||||
  lib,
 | 
					 | 
				
			||||||
  ...
 | 
					 | 
				
			||||||
}:
 | 
					 | 
				
			||||||
with lib;
 | 
					 | 
				
			||||||
let
 | 
					 | 
				
			||||||
  nameservers = [
 | 
					 | 
				
			||||||
    "1.1.1.1"
 | 
					 | 
				
			||||||
    "2606:4700:4700::1111"
 | 
					 | 
				
			||||||
  ];
 | 
					 | 
				
			||||||
in
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  networking.nameservers = mkDefault nameservers;
 | 
					 | 
				
			||||||
  services.resolved = mkDefault { fallbackDns = nameservers; };
 | 
					 | 
				
			||||||
  networking.dhcpcd.extraConfig = "noipv4ll";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  systemd.services.systemd-sysctl.enable = false;
 | 
					 | 
				
			||||||
  systemd.services.systemd-oomd.enable = false;
 | 
					 | 
				
			||||||
  systemd.sockets."systemd-journald-audit".enable = false;
 | 
					 | 
				
			||||||
  systemd.mounts = [
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      where = "/sys/kernel/debug";
 | 
					 | 
				
			||||||
      enable = false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  ];
 | 
					 | 
				
			||||||
  systemd.services.rpc-gssd.enable = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Due to our restrictions in /sys, the default systemd-udev-trigger fails
 | 
					 | 
				
			||||||
  # on accessing PCI devices, etc. Override it to match only network devices.
 | 
					 | 
				
			||||||
  # In addition, boot.isContainer prevents systemd-udev-trigger.service from
 | 
					 | 
				
			||||||
  # being enabled at all, so add it explicitly.
 | 
					 | 
				
			||||||
  systemd.additionalUpstreamSystemUnits = [ "systemd-udev-trigger.service" ];
 | 
					 | 
				
			||||||
  systemd.services.systemd-udev-trigger.serviceConfig.ExecStart = [
 | 
					 | 
				
			||||||
    ""
 | 
					 | 
				
			||||||
    "-udevadm trigger --subsystem-match=net --action=add"
 | 
					 | 
				
			||||||
  ];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  boot.isContainer = true;
 | 
					 | 
				
			||||||
  boot.enableContainers = mkDefault true;
 | 
					 | 
				
			||||||
  boot.loader.initScript.enable = true;
 | 
					 | 
				
			||||||
  boot.specialFileSystems."/run/keys".fsType = mkForce "tmpfs";
 | 
					 | 
				
			||||||
  boot.systemdExecutable = mkDefault "/run/current-system/systemd/lib/systemd/systemd systemd.unified_cgroup_hierarchy=0";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Overrides for <nixpkgs/nixos/modules/virtualisation/container-config.nix>
 | 
					 | 
				
			||||||
  documentation.enable = mkOverride 500 true;
 | 
					 | 
				
			||||||
  documentation.nixos.enable = mkOverride 500 true;
 | 
					 | 
				
			||||||
  networking.useHostResolvConf = mkOverride 500 false;
 | 
					 | 
				
			||||||
  services.openssh.startWhenNeeded = mkOverride 500 false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Bring up the network, /ifcfg.{add,del} are supplied by the vpsAdminOS host
 | 
					 | 
				
			||||||
  systemd.services.networking-setup = {
 | 
					 | 
				
			||||||
    description = "Load network configuration provided by the vpsAdminOS host";
 | 
					 | 
				
			||||||
    before = [ "network.target" ];
 | 
					 | 
				
			||||||
    wantedBy = [ "network.target" ];
 | 
					 | 
				
			||||||
    after = [ "network-pre.target" ];
 | 
					 | 
				
			||||||
    path = [ pkgs.iproute2 ];
 | 
					 | 
				
			||||||
    serviceConfig = {
 | 
					 | 
				
			||||||
      Type = "oneshot";
 | 
					 | 
				
			||||||
      RemainAfterExit = true;
 | 
					 | 
				
			||||||
      ExecStart = "${pkgs.bash}/bin/bash /ifcfg.add";
 | 
					 | 
				
			||||||
      ExecStop = "${pkgs.bash}/bin/bash /ifcfg.del";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    unitConfig.ConditionPathExists = "/ifcfg.add";
 | 
					 | 
				
			||||||
    restartIfChanged = false;
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue