refactored leyla packages into several folders
This commit is contained in:
		
							parent
							
								
									1a4c2b2f95
								
							
						
					
					
						commit
						dd53735354
					
				
					 13 changed files with 275 additions and 233 deletions
				
			
		|  | @ -1,7 +1,7 @@ | ||||||
| {osConfig, ...}: { | {osConfig, ...}: { | ||||||
|   imports = [ |   imports = [ | ||||||
|  |     ./packages | ||||||
|     ./i18n.nix |     ./i18n.nix | ||||||
|     ./packages.nix |  | ||||||
|     ./impermanence.nix |     ./impermanence.nix | ||||||
|     ./dconf.nix |     ./dconf.nix | ||||||
|   ]; |   ]; | ||||||
|  |  | ||||||
|  | @ -1,136 +0,0 @@ | ||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   osConfig, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: let |  | ||||||
|   userConfig = osConfig.host.users.leyla; |  | ||||||
|   hardware = osConfig.host.hardware; |  | ||||||
| in { |  | ||||||
|   imports = [ |  | ||||||
|     ./vscode/default.nix |  | ||||||
|     ./firefox.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   config = lib.mkMerge [ |  | ||||||
|     (lib.mkIf userConfig.isTerminalUser { |  | ||||||
|       home.packages = with pkgs; [ |  | ||||||
|         # command line tools |  | ||||||
|         sox |  | ||||||
|         yt-dlp |  | ||||||
|         ffmpeg |  | ||||||
|         imagemagick |  | ||||||
|       ]; |  | ||||||
|     }) |  | ||||||
|     (lib.mkIf userConfig.isDesktopUser { |  | ||||||
|       nixpkgs.config = { |  | ||||||
|         allowUnfree = true; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       home.packages = ( |  | ||||||
|         lib.lists.optionals userConfig.isDesktopUser ( |  | ||||||
|           (with pkgs; [ |  | ||||||
|             # helvetica font |  | ||||||
|             aileron |  | ||||||
| 
 |  | ||||||
|             gnomeExtensions.dash-to-dock |  | ||||||
| 
 |  | ||||||
|             # development tools |  | ||||||
|             dbeaver-bin |  | ||||||
|             bruno |  | ||||||
|             proxmark3 |  | ||||||
|           ]) |  | ||||||
|           ++ ( |  | ||||||
|             lib.lists.optionals hardware.directAccess.enable (with pkgs; [ |  | ||||||
|               #foss platforms |  | ||||||
|               signal-desktop-bin |  | ||||||
|               bitwarden |  | ||||||
|               ungoogled-chromium |  | ||||||
|               libreoffice |  | ||||||
|               inkscape |  | ||||||
|               gimp |  | ||||||
|               krita |  | ||||||
|               freecad |  | ||||||
|               # cura |  | ||||||
|               # kicad-small |  | ||||||
|               makemkv |  | ||||||
|               onionshare |  | ||||||
|               # rhythmbox |  | ||||||
|               (lib.mkIf hardware.graphicsAcceleration.enable obs-studio) |  | ||||||
|               # wireshark |  | ||||||
|               # rpi-imager |  | ||||||
|               # fritzing |  | ||||||
|               mfoc |  | ||||||
|               tor-browser |  | ||||||
|               anki |  | ||||||
|               pdfarranger |  | ||||||
|               calibre |  | ||||||
|               qbittorrent |  | ||||||
|               picard |  | ||||||
| 
 |  | ||||||
|               # proprietary platforms |  | ||||||
|               discord |  | ||||||
|               obsidian |  | ||||||
|               prostudiomasters |  | ||||||
|               (lib.mkIf hardware.graphicsAcceleration.enable davinci-resolve) |  | ||||||
| 
 |  | ||||||
|               # development tools |  | ||||||
|               # androidStudioPackages.canary |  | ||||||
|               jetbrains.idea-community |  | ||||||
|               qFlipper |  | ||||||
| 
 |  | ||||||
|               # system tools |  | ||||||
|               protonvpn-gui |  | ||||||
|               openvpn |  | ||||||
|               noisetorch |  | ||||||
| 
 |  | ||||||
|               # hardware management tools |  | ||||||
|               (lib.mkIf hardware.piperMouse.enable piper) |  | ||||||
|               (lib.mkIf hardware.openRGB.enable openrgb) |  | ||||||
|               (lib.mkIf hardware.viaKeyboard.enable via) |  | ||||||
|             ]) |  | ||||||
|           ) |  | ||||||
|         ) |  | ||||||
|       ); |  | ||||||
|       programs = lib.mkIf userConfig.isDesktopUser { |  | ||||||
|         # Let Home Manager install and manage itself. |  | ||||||
|         home-manager.enable = true; |  | ||||||
| 
 |  | ||||||
|         # set up git defaults |  | ||||||
|         git = { |  | ||||||
|           enable = true; |  | ||||||
|           userName = "Leyla Becker"; |  | ||||||
|           userEmail = "git@jan-leila.com"; |  | ||||||
|           extraConfig.init.defaultBranch = "main"; |  | ||||||
|         }; |  | ||||||
| 
 |  | ||||||
|         # add direnv to auto load flakes for development |  | ||||||
|         direnv = { |  | ||||||
|           enable = true; |  | ||||||
|           enableBashIntegration = true; |  | ||||||
|           nix-direnv.enable = true; |  | ||||||
|           config = { |  | ||||||
|             global.hide_env_diff = true; |  | ||||||
|             whitelist.exact = ["/home/leyla/documents/code/nix-config"]; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|         bash.enable = true; |  | ||||||
| 
 |  | ||||||
|         openssh = { |  | ||||||
|           authorizedKeys = [ |  | ||||||
|             "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHeItmt8TRW43uNcOC+eIurYC7Eunc0V3LGocQqLaYj leyla@horizon" |  | ||||||
|             "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIILimFIW2exEH/Xo7LtXkqgE04qusvnPNpPWSCeNrFkP leyla@defiant" |  | ||||||
|             "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKBiZkg1c2aaNHiieBX4cEziqvJVj9pcDfzUrKU/mO0I leyla@twilight" |  | ||||||
|           ]; |  | ||||||
|           hostKeys = [ |  | ||||||
|             { |  | ||||||
|               type = "ed25519"; |  | ||||||
|               path = "${config.home.username}_${osConfig.networking.hostName}_ed25519"; |  | ||||||
|             } |  | ||||||
|           ]; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }) |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
							
								
								
									
										104
									
								
								configurations/home-manager/leyla/packages/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								configurations/home-manager/leyla/packages/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,104 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   pkgs, | ||||||
|  |   config, | ||||||
|  |   osConfig, | ||||||
|  |   ... | ||||||
|  | }: let | ||||||
|  |   hardware = osConfig.host.hardware; | ||||||
|  | in { | ||||||
|  |   imports = [ | ||||||
|  |     ./vscode | ||||||
|  |     ./firefox.nix | ||||||
|  |     ./direnv.nix | ||||||
|  |     ./openssh.nix | ||||||
|  |     ./git.nix | ||||||
|  |   ]; | ||||||
|  | 
 | ||||||
|  |   config = lib.mkMerge [ | ||||||
|  |     (lib.mkIf config.user.isTerminalUser { | ||||||
|  |       home.packages = with pkgs; [ | ||||||
|  |         # command line tools | ||||||
|  |         sox | ||||||
|  |         yt-dlp | ||||||
|  |         ffmpeg | ||||||
|  |         imagemagick | ||||||
|  |       ]; | ||||||
|  |     }) | ||||||
|  |     (lib.mkIf config.user.isDesktopUser { | ||||||
|  |       nixpkgs.config = { | ||||||
|  |         allowUnfree = true; | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       home.packages = ( | ||||||
|  |         (with pkgs; [ | ||||||
|  |           # helvetica font | ||||||
|  |           aileron | ||||||
|  | 
 | ||||||
|  |           gnomeExtensions.dash-to-dock | ||||||
|  | 
 | ||||||
|  |           # development tools | ||||||
|  |           dbeaver-bin | ||||||
|  |           bruno | ||||||
|  |           proxmark3 | ||||||
|  |         ]) | ||||||
|  |         ++ ( | ||||||
|  |           lib.lists.optionals hardware.directAccess.enable (with pkgs; [ | ||||||
|  |             #foss platforms | ||||||
|  |             signal-desktop-bin | ||||||
|  |             bitwarden | ||||||
|  |             ungoogled-chromium | ||||||
|  |             libreoffice | ||||||
|  |             inkscape | ||||||
|  |             gimp | ||||||
|  |             krita | ||||||
|  |             freecad | ||||||
|  |             # cura | ||||||
|  |             # kicad-small | ||||||
|  |             makemkv | ||||||
|  |             onionshare | ||||||
|  |             # rhythmbox | ||||||
|  |             (lib.mkIf hardware.graphicsAcceleration.enable obs-studio) | ||||||
|  |             # wireshark | ||||||
|  |             # rpi-imager | ||||||
|  |             # fritzing | ||||||
|  |             mfoc | ||||||
|  |             tor-browser | ||||||
|  |             anki | ||||||
|  |             pdfarranger | ||||||
|  |             calibre | ||||||
|  |             qbittorrent | ||||||
|  |             picard | ||||||
|  | 
 | ||||||
|  |             # proprietary platforms | ||||||
|  |             discord | ||||||
|  |             obsidian | ||||||
|  |             prostudiomasters | ||||||
|  |             (lib.mkIf hardware.graphicsAcceleration.enable davinci-resolve) | ||||||
|  | 
 | ||||||
|  |             # development tools | ||||||
|  |             # androidStudioPackages.canary | ||||||
|  |             jetbrains.idea-community | ||||||
|  |             qFlipper | ||||||
|  | 
 | ||||||
|  |             # system tools | ||||||
|  |             protonvpn-gui | ||||||
|  |             openvpn | ||||||
|  |             noisetorch | ||||||
|  | 
 | ||||||
|  |             # hardware management tools | ||||||
|  |             (lib.mkIf hardware.piperMouse.enable piper) | ||||||
|  |             (lib.mkIf hardware.openRGB.enable openrgb) | ||||||
|  |             (lib.mkIf hardware.viaKeyboard.enable via) | ||||||
|  |           ]) | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  |       programs = { | ||||||
|  |         # Let Home Manager install and manage itself. | ||||||
|  |         home-manager.enable = true; | ||||||
|  | 
 | ||||||
|  |         bash.enable = true; | ||||||
|  |       }; | ||||||
|  |     }) | ||||||
|  |   ]; | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								configurations/home-manager/leyla/packages/direnv.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								configurations/home-manager/leyla/packages/direnv.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | ||||||
|  | {config, ...}: { | ||||||
|  |   config = { | ||||||
|  |     programs = { | ||||||
|  |       git = { | ||||||
|  |         enable = config.user.isDesktopUser || config.user.isTerminalUser; | ||||||
|  |         userName = "Leyla Becker"; | ||||||
|  |         userEmail = "git@jan-leila.com"; | ||||||
|  |         extraConfig.init.defaultBranch = "main"; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -2,14 +2,12 @@ | ||||||
|   lib, |   lib, | ||||||
|   pkgs, |   pkgs, | ||||||
|   inputs, |   inputs, | ||||||
|   osConfig, |   config, | ||||||
|   ... |   ... | ||||||
| }: let | }: { | ||||||
|   is-desktop-user = osConfig.host.users.leyla.isDesktopUser; |   config = { | ||||||
| in { |  | ||||||
|   config = lib.mkIf is-desktop-user { |  | ||||||
|     programs.firefox = { |     programs.firefox = { | ||||||
|       enable = true; |       enable = config.user.isDesktopUser; | ||||||
|       profiles.leyla = { |       profiles.leyla = { | ||||||
|         settings = { |         settings = { | ||||||
|           "browser.search.defaultenginename" = "Searx"; |           "browser.search.defaultenginename" = "Searx"; | ||||||
							
								
								
									
										22
									
								
								configurations/home-manager/leyla/packages/git.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								configurations/home-manager/leyla/packages/git.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   config, | ||||||
|  |   osConfig, | ||||||
|  |   ... | ||||||
|  | }: let | ||||||
|  |   userConfig = osConfig.host.users.leyla; | ||||||
|  | in { | ||||||
|  |   config = lib.mkIf userConfig.isDesktopUser { | ||||||
|  |     programs = { | ||||||
|  |       direnv = { | ||||||
|  |         enable = true; | ||||||
|  |         enableBashIntegration = true; | ||||||
|  |         nix-direnv.enable = true; | ||||||
|  |         config = { | ||||||
|  |           global.hide_env_diff = true; | ||||||
|  |           whitelist.exact = ["${config.home.homeDirectory}/documents/code/nix-config"]; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										24
									
								
								configurations/home-manager/leyla/packages/openssh.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								configurations/home-manager/leyla/packages/openssh.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | ||||||
|  | { | ||||||
|  |   config, | ||||||
|  |   osConfig, | ||||||
|  |   ... | ||||||
|  | }: { | ||||||
|  |   config = { | ||||||
|  |     programs = { | ||||||
|  |       openssh = { | ||||||
|  |         enable = config.user.isDesktopUser; | ||||||
|  |         authorizedKeys = [ | ||||||
|  |           "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHeItmt8TRW43uNcOC+eIurYC7Eunc0V3LGocQqLaYj leyla@horizon" | ||||||
|  |           "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIILimFIW2exEH/Xo7LtXkqgE04qusvnPNpPWSCeNrFkP leyla@defiant" | ||||||
|  |           "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKBiZkg1c2aaNHiieBX4cEziqvJVj9pcDfzUrKU/mO0I leyla@twilight" | ||||||
|  |         ]; | ||||||
|  |         hostKeys = [ | ||||||
|  |           { | ||||||
|  |             type = "ed25519"; | ||||||
|  |             path = "${config.home.username}_${osConfig.networking.hostName}_ed25519"; | ||||||
|  |           } | ||||||
|  |         ]; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -8,9 +8,8 @@ | ||||||
| }: let | }: let | ||||||
|   nix-development-enabled = osConfig.host.nix-development.enable; |   nix-development-enabled = osConfig.host.nix-development.enable; | ||||||
|   ai-tooling-enabled = config.user.continue.enable && osConfig.host.ai.enable; |   ai-tooling-enabled = config.user.continue.enable && osConfig.host.ai.enable; | ||||||
|   is-desktop-user = osConfig.host.users.leyla.isDesktopUser; |  | ||||||
| in { | in { | ||||||
|   config = lib.mkIf is-desktop-user { |   config = lib.mkIf config.user.isDesktopUser { | ||||||
|     nixpkgs = { |     nixpkgs = { | ||||||
|       overlays = [ |       overlays = [ | ||||||
|         inputs.nix-vscode-extensions.overlays.default |         inputs.nix-vscode-extensions.overlays.default | ||||||
|  | @ -7,8 +7,7 @@ | ||||||
| }: let | }: let | ||||||
|   ai-tooling-enabled = config.user.continue.enable && osConfig.host.ai.enable; |   ai-tooling-enabled = config.user.continue.enable && osConfig.host.ai.enable; | ||||||
| in { | in { | ||||||
|   options = { |   options.user.continue = { | ||||||
|     user.continue = { |  | ||||||
|     enable = lib.mkEnableOption "should continue be enabled on this machine"; |     enable = lib.mkEnableOption "should continue be enabled on this machine"; | ||||||
|     docs = lib.mkOption { |     docs = lib.mkOption { | ||||||
|       type = lib.types.attrsOf (lib.types.submodule ({name, ...}: { |       type = lib.types.attrsOf (lib.types.submodule ({name, ...}: { | ||||||
|  | @ -43,7 +42,6 @@ in { | ||||||
|       }; |       }; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
|   config = |   config = | ||||||
|     lib.mkIf ai-tooling-enabled |     lib.mkIf ai-tooling-enabled | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| # this folder container modules that are for home manager only | # this folder container modules that are for home manager only | ||||||
| {...}: { | {...}: { | ||||||
|   imports = [ |   imports = [ | ||||||
|  |     ./user.nix | ||||||
|     ./flipperzero.nix |     ./flipperzero.nix | ||||||
|     ./i18n.nix |     ./i18n.nix | ||||||
|     ./openssh.nix |     ./openssh.nix | ||||||
|  |  | ||||||
|  | @ -6,6 +6,7 @@ | ||||||
|   ... |   ... | ||||||
| }: { | }: { | ||||||
|   options.programs.openssh = { |   options.programs.openssh = { | ||||||
|  |     enable = lib.mkEnableOption "should we enable openssh"; | ||||||
|     authorizedKeys = lib.mkOption { |     authorizedKeys = lib.mkOption { | ||||||
|       type = lib.types.listOf lib.types.str; |       type = lib.types.listOf lib.types.str; | ||||||
|       default = []; |       default = []; | ||||||
|  | @ -37,7 +38,8 @@ | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   config = lib.mkMerge [ |   config = lib.mkIf config.programs.openssh.enable ( | ||||||
|  |     lib.mkMerge [ | ||||||
|       ( |       ( | ||||||
|         lib.mkIf ((builtins.length config.programs.openssh.hostKeys) != 0) { |         lib.mkIf ((builtins.length config.programs.openssh.hostKeys) != 0) { | ||||||
|           services.ssh-agent.enable = true; |           services.ssh-agent.enable = true; | ||||||
|  | @ -95,5 +97,6 @@ | ||||||
|           ); |           ); | ||||||
|         }; |         }; | ||||||
|       }) |       }) | ||||||
|   ]; |     ] | ||||||
|  |   ); | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								modules/home-manager-modules/user.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								modules/home-manager-modules/user.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   config, | ||||||
|  |   osConfig, | ||||||
|  |   ... | ||||||
|  | }: { | ||||||
|  |   options.user = { | ||||||
|  |     isDesktopUser = lib.mkOption { | ||||||
|  |       type = lib.types.bool; | ||||||
|  |       default = osConfig.host.users.${config.home.username}.isDesktopUser; | ||||||
|  |     }; | ||||||
|  |     isTerminalUser = lib.mkOption { | ||||||
|  |       type = lib.types.bool; | ||||||
|  |       default = osConfig.host.users.${config.home.username}.isTerminalUser; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue