mirror of
				https://github.com/ItsDrike/nixdots
				synced 2025-11-04 02:46:36 +00:00 
			
		
		
		
	Originally, I was including all role configurations for all hosts, and controlling which get applied in the role configs with a check in each file. This is a very repetetive and annoying approach. Instead, now the role directory is included manually from the hosts config for devices which meet that role, removing the role options.
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{inputs, ...}: let
 | 
						|
  inherit (inputs) self;
 | 
						|
  inherit (inputs.nixpkgs) lib;
 | 
						|
 | 
						|
  # A list of shared modules that ALL systems need
 | 
						|
  shared = [
 | 
						|
    ../system/shared
 | 
						|
    ../home
 | 
						|
    ../options
 | 
						|
  ];
 | 
						|
 | 
						|
  workstationRole = ../system/roles/workstation;
 | 
						|
  laptopRole = ../system/roles/laptop;
 | 
						|
  uniRole = ../system/roles/uni;
 | 
						|
in {
 | 
						|
  herugrim = lib.nixosSystem {
 | 
						|
    system = "x86_64-linux";
 | 
						|
    specialArgs = {inherit lib inputs self;};
 | 
						|
    modules =
 | 
						|
      [
 | 
						|
        ./herugrim
 | 
						|
        inputs.home-manager.nixosModules.home-manager
 | 
						|
        inputs.impermanence.nixosModules.impermanence
 | 
						|
        inputs.lanzaboote.nixosModules.lanzaboote
 | 
						|
        workstationRole
 | 
						|
        laptopRole
 | 
						|
      ]
 | 
						|
      ++ shared;
 | 
						|
  };
 | 
						|
 | 
						|
  voyager = lib.nixosSystem {
 | 
						|
    system = "x86_64-linux";
 | 
						|
    specialArgs = {inherit lib inputs self;};
 | 
						|
    modules =
 | 
						|
      [
 | 
						|
        ./voyager
 | 
						|
        inputs.home-manager.nixosModules.home-manager
 | 
						|
        inputs.impermanence.nixosModules.impermanence
 | 
						|
        inputs.lanzaboote.nixosModules.lanzaboote
 | 
						|
        workstationRole
 | 
						|
        laptopRole
 | 
						|
        uniRole
 | 
						|
      ]
 | 
						|
      ++ shared;
 | 
						|
  };
 | 
						|
}
 |