Remove custom lib usage
This commit is contained in:
99
flake.nix
99
flake.nix
@ -20,66 +20,47 @@
|
||||
|
||||
outputs = inputs @ { self, nixpkgs, agenix, home-manager, ... }:
|
||||
let
|
||||
inherit (lib) attrValues;
|
||||
inherit (lib.my) mapModules mapModulesRec;
|
||||
|
||||
system = "x86_64-linux";
|
||||
|
||||
mkPkgs = pkgs: extraOverlays:
|
||||
import pkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
nixpkgsForSystem = system: inputs.nixpkgs;
|
||||
overlays = [
|
||||
agenix.overlays.default
|
||||
(import ./overlays/gnome.nix)
|
||||
];
|
||||
commonModules = [
|
||||
agenix.nixosModules.age
|
||||
home-manager.nixosModule
|
||||
./modules
|
||||
];
|
||||
nixosSystem = system: name:
|
||||
let
|
||||
nixpkgs = nixpkgsForSystem system;
|
||||
lib = (import nixpkgs { inherit overlays system; }).lib;
|
||||
in
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit lib system;
|
||||
specialArgs = { modulesPath = toString (nixpkgs + "/nixos/modules"); inherit inputs; };
|
||||
baseModules = import (nixpkgs + "/nixos/modules/module-list.nix");
|
||||
modules = commonModules ++ [
|
||||
({ config, ... }:
|
||||
{
|
||||
nixpkgs.pkgs = import nixpkgs {
|
||||
inherit overlays system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
networking.hostName = name;
|
||||
nix = {
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
};
|
||||
})
|
||||
./hosts/${name}
|
||||
];
|
||||
};
|
||||
pkgs = mkPkgs nixpkgs [];
|
||||
|
||||
lib = nixpkgs.lib.extend (self: super: {
|
||||
my = import ./lib {
|
||||
inherit pkgs inputs;
|
||||
lib = self;
|
||||
};
|
||||
});
|
||||
in {
|
||||
lib = lib.my;
|
||||
|
||||
nixosConfigurations = {
|
||||
atlas = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
{ nixpkgs.overlays = [ (import ./overlays/gnome.nix) ]; }
|
||||
(import ./modules)
|
||||
./hosts/atlas
|
||||
];
|
||||
specialArgs = { inherit lib inputs; };
|
||||
};
|
||||
eos = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
{ nixpkgs.overlays = [ (import ./overlays/gnome.nix) ]; }
|
||||
(import ./modules)
|
||||
./hosts/eos
|
||||
];
|
||||
specialArgs = { inherit lib inputs; };
|
||||
};
|
||||
helios = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
{ nixpkgs.overlays = [ (import ./overlays/gnome.nix) ]; }
|
||||
(import ./modules)
|
||||
./hosts/helios
|
||||
];
|
||||
specialArgs = { inherit lib inputs; };
|
||||
};
|
||||
odyssey = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
agenix.nixosModules.default
|
||||
{ nixpkgs.overlays = [ (import ./overlays/gnome.nix) ]; }
|
||||
(import ./modules)
|
||||
./hosts/odyssey
|
||||
];
|
||||
specialArgs = { inherit lib inputs; };
|
||||
};
|
||||
atlas = nixosSystem "x86_64-linux" "atlas";
|
||||
eos = nixosSystem "x86_64-linux" "eos";
|
||||
helios = nixosSystem "x86_64-linux" "helios";
|
||||
odyssey = nixosSystem "x86_64-linux" "odyssey";
|
||||
};
|
||||
};
|
||||
in
|
||||
{ inherit nixosConfigurations; };
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user