| 
									
										
										
										
											2024-07-27 02:04:12 +02:00
										 |  |  | # WIP SMC fonts flake
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-13 19:38:43 +02:00
										 |  |  | This is a nix flake that installs all SMC fonts. | 
					
						
							| 
									
										
										
										
											2024-10-12 23:43:53 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-13 01:21:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-12 23:43:53 +02:00
										 |  |  | ## Using with a flakes+home-manager based nixOS setup
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In the inputs section | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  |   inputs = { | 
					
						
							|  |  |  |     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | 	# Other flakes/modules/inputs | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |     smcFonts.url = "gitlab:smc/smc-fonts-flake/trunk"; | 
					
						
							|  |  |  |     smcFonts.inputs.nixpkgs.follows = "nixpkgs"; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In the outputs section of the flake: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | # Note the smcFonts being passed as an argument
 | 
					
						
							|  |  |  |  outputs = { self, nixpkgs, smcFonts, <other inputs>  }@inputs: | 
					
						
							|  |  |  |     let platforms = [ "x86_64-linux" ]; | 
					
						
							|  |  |  |     in { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       nixosConfigurations = { | 
					
						
							|  |  |  |         hex = nixpkgs.lib.nixosSystem { | 
					
						
							|  |  |  |           system = "x86_64-linux"; | 
					
						
							|  |  |  |           specialArgs = { inherit inputs; }; # <-- The inputs are being passed down to the modules | 
					
						
							|  |  |  |           modules = [ | 
					
						
							|  |  |  |             (import ./hosts/default.nix) | 
					
						
							|  |  |  |           ]; | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Lastly, in `default.nix` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | { config, lib, pkgs, modulesPath, inputs, ... }: # <-- "inputs" is an argument | 
					
						
							|  |  |  | let | 
					
						
							|  |  |  |   smc-fonts = inputs.smcFonts.packages."${pkgs.system}".default; # <-- by default, it will install all fonts | 
					
						
							|  |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |   home-manager.users.<username> = { pkgs, ...}: { | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |     home.packages = with pkgs; [ | 
					
						
							|  |  |  |     	# list of home manager packages  | 
					
						
							|  |  |  | 		smc-fonts # what we defined above. | 
					
						
							|  |  |  | ``` |