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
boot.loader = {
efi.canTouchEfiVariables = lib.mkDefault true;
@ -27,4 +28,8 @@
};
# Needs prefetched binary blobs, see https://nixos.wiki/wiki/Displaylink
services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
};
imports = [
nixos-hardware.nixosModules.dell-g3-3779
];
}

View file

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

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }:
{ pkgs, lib, config, nur, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
home.sessionVariables = {
@ -170,4 +170,7 @@
"${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 = {
@ -135,6 +135,7 @@
};
imports = [
nixvim.homeManagerModules.nixvim
./code.nix
./completion.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.geoffrey = {
@ -39,4 +40,8 @@
# Because everything is encrypted and I'm the only user, this is fine.
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 = {
boot = {
@ -16,4 +16,7 @@
# 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 = {
# nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore?
kernelPackages = pkgs.linuxPackages;
@ -41,4 +42,8 @@
# Fixes black font on Alacritty
environment.variables.PAN_MESA_DEBUG = "gl3";
};
imports = [
nixos-hardware.nixosModules.pine64-pinebook-pro
];
}