forked from fediversity/fediversity
		
	Compare commits
	
		
			2 commits
		
	
	
		
			0eaca3e228
			...
			1101c4fbc3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1101c4fbc3 | |||
| 9490612630 | 
					 3 changed files with 13 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,6 @@
 | 
			
		|||
  ...
 | 
			
		||||
}@args:
 | 
			
		||||
let
 | 
			
		||||
  self = "deployment/check/data-model-ssh/data-model.nix";
 | 
			
		||||
  inherit (sources) nixpkgs;
 | 
			
		||||
  pkgs = import nixpkgs { inherit system; };
 | 
			
		||||
  inherit (pkgs) lib;
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +39,7 @@ in
 | 
			
		|||
                key-file = null;
 | 
			
		||||
                inherit sshOpts;
 | 
			
		||||
              };
 | 
			
		||||
              module = self;
 | 
			
		||||
              caller = "deployment/check/data-model-ssh/data-model.nix";
 | 
			
		||||
              inherit args deployment-name;
 | 
			
		||||
              root-path = pathToRoot;
 | 
			
		||||
            };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,6 @@
 | 
			
		|||
  ...
 | 
			
		||||
}@args:
 | 
			
		||||
let
 | 
			
		||||
  self = "deployment/check/data-model-tf/data-model.nix";
 | 
			
		||||
  inherit (sources) nixpkgs;
 | 
			
		||||
  pkgs = import nixpkgs { inherit system; };
 | 
			
		||||
  inherit (pkgs) lib;
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +39,7 @@ in
 | 
			
		|||
                key-file = null;
 | 
			
		||||
                inherit sshOpts;
 | 
			
		||||
              };
 | 
			
		||||
              module = self;
 | 
			
		||||
              caller = "deployment/check/data-model-tf/data-model.nix";
 | 
			
		||||
              inherit args deployment-name httpBackend;
 | 
			
		||||
              root-path = pathToRoot;
 | 
			
		||||
            };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,13 +30,13 @@ let
 | 
			
		|||
  writeConfig =
 | 
			
		||||
    {
 | 
			
		||||
      system,
 | 
			
		||||
      module,
 | 
			
		||||
      caller,
 | 
			
		||||
      root-path,
 | 
			
		||||
      deployment-type,
 | 
			
		||||
      deployment-name,
 | 
			
		||||
      args,
 | 
			
		||||
    }:
 | 
			
		||||
    # having a `module` location and (serializable) `args`, we know
 | 
			
		||||
    # having a `caller` location and (serializable) `args`, we know
 | 
			
		||||
    # enough to call it again to extract different info elsewhere later.
 | 
			
		||||
    # we use this to make a deployment script using the desired nixos config,
 | 
			
		||||
    # which would otherwise not be serializable, while nix also makes it hard to
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ let
 | 
			
		|||
      pkgs.writers.writeText "configuration.nix" ''
 | 
			
		||||
        import ${root-path}/deployment/nixos.nix {
 | 
			
		||||
          system = "${system}";
 | 
			
		||||
          configuration = (import "${root-path}/${module}" (builtins.fromJSON "${
 | 
			
		||||
          configuration = (import "${root-path}/${caller}" (builtins.fromJSON "${
 | 
			
		||||
            lib.replaceStrings [ "\"" ] [ "\\\"" ] (lib.strings.toJSON args)
 | 
			
		||||
          }")).${deployment-name}.${deployment-type}.nixos-configuration;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -121,8 +121,8 @@ let
 | 
			
		|||
          };
 | 
			
		||||
          inherit nixos-configuration;
 | 
			
		||||
          ssh = host-ssh;
 | 
			
		||||
          module = mkOption {
 | 
			
		||||
            description = "The module to call to obtain the NixOS configuration from.";
 | 
			
		||||
          caller = mkOption {
 | 
			
		||||
            description = "The calling module to obtain the NixOS configuration from.";
 | 
			
		||||
            type = types.str;
 | 
			
		||||
          };
 | 
			
		||||
          args = mkOption {
 | 
			
		||||
| 
						 | 
				
			
			@ -147,7 +147,7 @@ let
 | 
			
		|||
                inherit (ssh-host.config)
 | 
			
		||||
                  system
 | 
			
		||||
                  ssh
 | 
			
		||||
                  module
 | 
			
		||||
                  caller
 | 
			
		||||
                  args
 | 
			
		||||
                  deployment-name
 | 
			
		||||
                  root-path
 | 
			
		||||
| 
						 | 
				
			
			@ -168,7 +168,7 @@ let
 | 
			
		|||
                  nixos_conf = writeConfig {
 | 
			
		||||
                    inherit
 | 
			
		||||
                      system
 | 
			
		||||
                      module
 | 
			
		||||
                      caller
 | 
			
		||||
                      args
 | 
			
		||||
                      deployment-name
 | 
			
		||||
                      root-path
 | 
			
		||||
| 
						 | 
				
			
			@ -204,8 +204,8 @@ let
 | 
			
		|||
          };
 | 
			
		||||
          inherit nixos-configuration;
 | 
			
		||||
          ssh = host-ssh;
 | 
			
		||||
          module = mkOption {
 | 
			
		||||
            description = "The module to call to obtain the NixOS configuration from.";
 | 
			
		||||
          caller = mkOption {
 | 
			
		||||
            description = "The calling module to obtain the NixOS configuration from.";
 | 
			
		||||
            type = types.str;
 | 
			
		||||
          };
 | 
			
		||||
          args = mkOption {
 | 
			
		||||
| 
						 | 
				
			
			@ -233,7 +233,7 @@ let
 | 
			
		|||
                inherit (tf-host.config)
 | 
			
		||||
                  system
 | 
			
		||||
                  ssh
 | 
			
		||||
                  module
 | 
			
		||||
                  caller
 | 
			
		||||
                  args
 | 
			
		||||
                  deployment-name
 | 
			
		||||
                  root-path
 | 
			
		||||
| 
						 | 
				
			
			@ -255,7 +255,7 @@ let
 | 
			
		|||
                  nixos_conf = writeConfig {
 | 
			
		||||
                    inherit
 | 
			
		||||
                      system
 | 
			
		||||
                      module
 | 
			
		||||
                      caller
 | 
			
		||||
                      args
 | 
			
		||||
                      deployment-name
 | 
			
		||||
                      root-path
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue