refactor: flake dir -> outputs/sys -> nixos
This commit is contained in:
		
							parent
							
								
									3615bb010f
								
							
						
					
					
						commit
						a6d5e892a1
					
				
					 73 changed files with 9 additions and 2 deletions
				
			
		
							
								
								
									
										49
									
								
								nixos/modules/base/nix/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								nixos/modules/base/nix/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,49 @@
 | 
			
		|||
{ lib, config, pkgs, inputs, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  inherit (lib) mkIf mapAttrs mapAttrsToList;
 | 
			
		||||
  host = config.ooknet.host;
 | 
			
		||||
in
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./nh.nix
 | 
			
		||||
    ./nixpkgs.nix
 | 
			
		||||
    ./subs.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  config = mkIf (host.type != "phone") {
 | 
			
		||||
    environment = {
 | 
			
		||||
      systemPackages = with pkgs; [
 | 
			
		||||
        git
 | 
			
		||||
        deadnix
 | 
			
		||||
        statix
 | 
			
		||||
      ];
 | 
			
		||||
      defaultPackages = [];
 | 
			
		||||
      etc = {
 | 
			
		||||
        "nix/flake-channels/nixpkgs".source = inputs.nixpkgs;
 | 
			
		||||
        "nix/flake-channels/home-manager".source = inputs.nixpkgs;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    nix = {
 | 
			
		||||
      registry = mapAttrs (_: v: {flake = v;}) inputs;
 | 
			
		||||
      nixPath = mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
 | 
			
		||||
      optimise = {
 | 
			
		||||
        automatic = true;
 | 
			
		||||
        dates = [ "18:00" ];
 | 
			
		||||
      };
 | 
			
		||||
      gc = {
 | 
			
		||||
        automatic = true;
 | 
			
		||||
        dates = "Sun *-*-* 17:00";
 | 
			
		||||
        options = "--delete-older-than 30d";
 | 
			
		||||
      };
 | 
			
		||||
      settings = {
 | 
			
		||||
        flake-registry = "/etc/nix/registry.json";
 | 
			
		||||
        allowed-users = [ "root" "@wheel" ];
 | 
			
		||||
        trusted-users = [ "root" "@wheel" ];
 | 
			
		||||
        experimental-features = [ "nix-command" "flakes" ];
 | 
			
		||||
        builders-use-substitutes = true;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue