meta: Move nixosConfiguration logic to separate file

Makes it easier to reason about the flake-specific stuff inside
the flake.
This commit is contained in:
Donovan Glover 2024-04-05 19:20:27 -04:00
parent 7a8fdd7259
commit 51273df2c8
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 42 additions and 36 deletions

39
default.nix Normal file
View File

@ -0,0 +1,39 @@
{ self, pkgs, ... }:
let
inherit (builtins) attrValues;
in
{
imports = attrValues self.nixosModules ++ [
./hardware/laptop.nix
];
nixpkgs.overlays = attrValues self.overlays;
home-manager.sharedModules = attrValues self.homeManagerModules;
environment.systemPackages = attrValues self.packages.${pkgs.system};
environment.pathsToLink = [
"/share/backgrounds"
"/share/eww"
"/share/thumbnailers"
"/share/fonts"
];
modules = {
hardware = {
disableLaptopKeyboard = true;
lidIgnore = true;
powerIgnore = true;
};
networking = {
mullvad = true;
};
desktop = {
japanese = true;
bloat = true;
wine = true;
};
};
}

View File

@ -21,11 +21,11 @@
};
};
outputs = { self, nixpkgs, home-manager, stylix, ... } @ attrs:
outputs = { self, nixpkgs, ... } @ attrs:
let
inherit (nixpkgs.lib) nixosSystem;
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
inherit (builtins) attrValues attrNames listToAttrs map replaceStrings readDir;
inherit (builtins) attrNames listToAttrs map replaceStrings readDir;
checkArgs = {
inherit self;
@ -44,40 +44,7 @@
nixos = nixosSystem {
system = "x86_64-linux";
specialArgs = attrs // { nix-config = self; };
modules = [
./hardware/laptop.nix
{
environment.pathsToLink = [
"/share/backgrounds"
"/share/eww"
"/share/thumbnailers"
"/share/fonts"
];
nixpkgs.overlays = attrValues self.overlays;
imports = attrValues self.nixosModules;
home-manager.sharedModules = attrValues self.homeManagerModules;
environment.systemPackages = attrValues self.packages.x86_64-linux;
modules = {
hardware = {
disableLaptopKeyboard = true;
lidIgnore = true;
powerIgnore = true;
};
networking = {
mullvad = true;
};
desktop = {
japanese = true;
bloat = true;
wine = true;
};
};
}
];
modules = [ ./. ];
};
};