Import some dependencies where they are needed

This commit is contained in:
Geoffrey Preud'homme 2024-03-26 16:18:17 +01:00
parent 8d1d15a08e
commit 76a594ca9f
7 changed files with 131 additions and 112 deletions

View file

@ -1,5 +1,6 @@
{ lib, nixos-hardware, ... }: { pkgs, lib, config, nixos-hardware, ... }:
{ {
config = {
# UEFI works here, and variables can be touched # UEFI works here, and variables can be touched
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = lib.mkDefault true; efi.canTouchEfiVariables = lib.mkDefault true;
@ -27,4 +28,8 @@
}; };
# Needs prefetched binary blobs, see https://nixos.wiki/wiki/Displaylink # Needs prefetched binary blobs, see https://nixos.wiki/wiki/Displaylink
services.xserver.videoDrivers = [ "displaylink" "modesetting" ]; services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
};
imports = [
nixos-hardware.nixosModules.dell-g3-3779
];
} }

View file

@ -37,7 +37,7 @@
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
}; };
outputs = { self, nixpkgs, disko, nixos-hardware, nix-on-droid, home-manager, stylix, nixvim, nixgl, nur, ... }: outputs = { self, nixpkgs, disko, nix-on-droid, home-manager, stylix, nixgl, ... }@attrs:
let let
nixpkgsConfig = { nixpkgsConfig = {
overlays = [ overlays = [
@ -54,11 +54,15 @@
lib = { lib = {
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem { nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = attrs;
modules = modules ++ [ modules = modules ++ [
self.nixosModules.dotfiles self.nixosModules.dotfiles
{ {
nixpkgs = nixpkgsConfig; nixpkgs = nixpkgsConfig;
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ]; home-manager = {
sharedModules = [ self.homeManagerModules.dotfiles ];
extraSpecialArgs = attrs;
};
} }
]; ];
}; };
@ -74,6 +78,7 @@
]; ];
}; };
homeManagerConfiguration = { system, modules ? [ ] }: home-manager.lib.homeManagerConfiguration { homeManagerConfiguration = { system, modules ? [ ] }: home-manager.lib.homeManagerConfiguration {
specialArgs = attrs;
pkgs = import nixpkgs (nixpkgsConfig // { pkgs = import nixpkgs (nixpkgsConfig // {
inherit system; inherit system;
}); });
@ -107,8 +112,6 @@
imports = [ imports = [
./os ./os
disko.nixosModules.disko disko.nixosModules.disko
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
]; ];
}; };
nixOnDroidModules.dotfiles = { nixOnDroidModules.dotfiles = {
@ -121,8 +124,6 @@
imports = [ imports = [
./hm ./hm
stylix.homeManagerModules.stylix stylix.homeManagerModules.stylix
nixvim.homeManagerModules.nixvim
nur.hmModules.nur
]; ];
}; };
# Actual configurations # Actual configurations
@ -130,28 +131,24 @@
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./curacao ./curacao
nixos-hardware.nixosModules.dell-g3-3779
]; ];
}; };
nixosConfigurations.curacao-usb = lib.nixosSystem { nixosConfigurations.curacao-usb = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./curacao/usb.nix ./curacao/usb.nix
nixos-hardware.nixosModules.dell-g3-3779
]; ];
}; };
nixosConfigurations.pindakaas = lib.nixosSystem { nixosConfigurations.pindakaas = lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./pindakaas ./pindakaas
nixos-hardware.nixosModules.pine64-pinebook-pro
]; ];
}; };
nixosConfigurations.pindakaas-sd = lib.nixosSystem { nixosConfigurations.pindakaas-sd = lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./pindakaas/sd.nix ./pindakaas/sd.nix
nixos-hardware.nixosModules.pine64-pinebook-pro
]; ];
}; };
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { }; nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, nur, ... }:
{ {
config = lib.mkIf config.frogeye.desktop.xorg { config = lib.mkIf config.frogeye.desktop.xorg {
home.sessionVariables = { home.sessionVariables = {
@ -170,4 +170,7 @@
"${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore"; "${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore";
}; };
}; };
imports = [
nur.hmModules.nur
];
} }

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, nixvim, ... }:
{ {
# config = lib.mkIf config.programs.nixvim.enable { # Somehow this is infinite recursion? # config = lib.mkIf config.programs.nixvim.enable { # Somehow this is infinite recursion?
config = { config = {
@ -135,6 +135,7 @@
}; };
imports = [ imports = [
nixvim.homeManagerModules.nixvim
./code.nix ./code.nix
./completion.nix ./completion.nix
./decoration.nix ./decoration.nix

View file

@ -1,5 +1,6 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, home-manager, ... }:
{ {
config = {
users.users.root.initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password users.users.root.initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password
users.users.geoffrey = { users.users.geoffrey = {
@ -39,4 +40,8 @@
# Because everything is encrypted and I'm the only user, this is fine. # Because everything is encrypted and I'm the only user, this is fine.
services.xserver.displayManager.autoLogin.user = "geoffrey"; services.xserver.displayManager.autoLogin.user = "geoffrey";
};
imports = [
home-manager.nixosModules.home-manager
];
} }

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, stylix, ... }:
{ {
config = { config = {
boot = { boot = {
@ -16,4 +16,7 @@
# Maybe because people patch mono with nerdfonts and that isn't compatible? # Maybe because people patch mono with nerdfonts and that isn't compatible?
}; };
}; };
imports = [
stylix.nixosModules.stylix
];
} }

View file

@ -1,5 +1,6 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, nixos-hardware, ... }:
{ {
config = {
boot = { boot = {
# nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore?
kernelPackages = pkgs.linuxPackages; kernelPackages = pkgs.linuxPackages;
@ -41,4 +42,8 @@
# Fixes black font on Alacritty # Fixes black font on Alacritty
environment.variables.PAN_MESA_DEBUG = "gl3"; environment.variables.PAN_MESA_DEBUG = "gl3";
};
imports = [
nixos-hardware.nixosModules.pine64-pinebook-pro
];
} }