mirror of
				https://github.com/Jokiller230/puzzlevision.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "7d16e19c8b91ab77774f10ea59f7f60db761cf59" and "e54b87a835d6d64ae03b0dd338804b4fe2f9e3c6" have entirely different histories.
		
	
	
		
			7d16e19c8b
			...
			e54b87a835
		
	
		
					 4 changed files with 2 additions and 55 deletions
				
			
		| 
						 | 
					@ -16,7 +16,7 @@
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  outputs = { flake-parts, ... }@inputs:
 | 
					  outputs = inputs@{ flake-parts, ... }:
 | 
				
			||||||
    flake-parts.lib.mkFlake { inherit inputs; } {
 | 
					    flake-parts.lib.mkFlake { inherit inputs; } {
 | 
				
			||||||
      debug = true;
 | 
					      debug = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,16 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  lib,
 | 
					 | 
				
			||||||
  ...
 | 
					 | 
				
			||||||
}:
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  ## Create a NixOS module option as a one-liner.
 | 
					 | 
				
			||||||
  ##
 | 
					 | 
				
			||||||
  ## ```nix
 | 
					 | 
				
			||||||
  ## lib.mkOpt nixpkgs.lib.types.str "My default" "Option description"
 | 
					 | 
				
			||||||
  ## ```
 | 
					 | 
				
			||||||
  ##
 | 
					 | 
				
			||||||
  #@ Type -> Any -> String
 | 
					 | 
				
			||||||
  mkOpt =
 | 
					 | 
				
			||||||
    type: default: description:
 | 
					 | 
				
			||||||
    lib.mkOption { inherit type default description; };
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,43 +1,13 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  lib,
 | 
					 | 
				
			||||||
  inputs,
 | 
					  inputs,
 | 
				
			||||||
  config,
 | 
					  config,
 | 
				
			||||||
  ...
 | 
					  ...
 | 
				
			||||||
}:
 | 
					}:
 | 
				
			||||||
let
 | 
					 | 
				
			||||||
  ## Recursive loading of libraries, similar to snowfall lib.
 | 
					 | 
				
			||||||
  ## Logical flow: read files => merge all file outputs to single attr. set
 | 
					 | 
				
			||||||
  ## The directory in question is flake-root => lib
 | 
					 | 
				
			||||||
  ## The directory structure is:
 | 
					 | 
				
			||||||
  ## lib/
 | 
					 | 
				
			||||||
  ##   => libname
 | 
					 | 
				
			||||||
  ##     => default.nix
 | 
					 | 
				
			||||||
  ##   => libname2
 | 
					 | 
				
			||||||
  ##     => default.nix
 | 
					 | 
				
			||||||
  ##
 | 
					 | 
				
			||||||
  ## The structure of multiple libs is simply for organization and the attrs. of all default.nix files should still be merged
 | 
					 | 
				
			||||||
  ## into a single set.
 | 
					 | 
				
			||||||
  loadLibs = directory:
 | 
					 | 
				
			||||||
    builtins.foldl' (acc: name:
 | 
					 | 
				
			||||||
      let
 | 
					 | 
				
			||||||
        path = "${directory}/${name}";
 | 
					 | 
				
			||||||
        isDir = (builtins.getAttr name (builtins.readDir directory)) == "directory";
 | 
					 | 
				
			||||||
      in
 | 
					 | 
				
			||||||
        if isDir then
 | 
					 | 
				
			||||||
          lib.mergeAttrs acc (loadLibs path)
 | 
					 | 
				
			||||||
        else if name == "default.nix" then
 | 
					 | 
				
			||||||
          lib.mergeAttrs acc (import path { inherit lib; })
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
          acc
 | 
					 | 
				
			||||||
    ) {} (builtins.attrNames (builtins.readDir directory));
 | 
					 | 
				
			||||||
in
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  # Overwrite and add new arguments to all flake modules.
 | 
					  # Overwrite and add new arguments to all flake modules.
 | 
				
			||||||
  _module.args = {
 | 
					  _module.args = {
 | 
				
			||||||
    namespace = config.flake.namespace;
 | 
					    namespace = config.flake.namespace;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    puzzlelib = loadLibs ../../lib;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Initialize nixpkgs instance with custom overlays.
 | 
					    # Initialize nixpkgs instance with custom overlays.
 | 
				
			||||||
    pkgs = import inputs.nixpkgs {
 | 
					    pkgs = import inputs.nixpkgs {
 | 
				
			||||||
      overlays = [
 | 
					      overlays = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,13 +7,6 @@
 | 
				
			||||||
    ./hardware.nix
 | 
					    ./hardware.nix
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  virtualisation.vmVariant = {
 | 
					 | 
				
			||||||
    virtualisation = {
 | 
					 | 
				
			||||||
      cores = 6;
 | 
					 | 
				
			||||||
      memorySize = 2048;
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Todo: pass a set of users to enable from within easy-hosts and automatically map the corresponding home-manager configurations
 | 
					  # Todo: pass a set of users to enable from within easy-hosts and automatically map the corresponding home-manager configurations
 | 
				
			||||||
  # ${namespace} = {
 | 
					  # ${namespace} = {
 | 
				
			||||||
  #   mainUser = "jo";
 | 
					  #   mainUser = "jo";
 | 
				
			||||||
| 
						 | 
					@ -25,7 +18,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Enable Plasma6
 | 
					  # Enable Plasma6
 | 
				
			||||||
  services.xserver.enable = true;
 | 
					  services.xserver.enable = true;
 | 
				
			||||||
  services.displayManager.sddm.enable = true;
 | 
					  services.displayManager.sddm.wayland.enable = true;
 | 
				
			||||||
  services.desktopManager.plasma6.enable = true;
 | 
					  services.desktopManager.plasma6.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  environment.systemPackages = with pkgs; [
 | 
					  environment.systemPackages = with pkgs; [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue