mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
Working Config With Libs!
This commit is contained in:
47
flake.nix
47
flake.nix
@@ -49,18 +49,37 @@
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager,library, ignore, filter,... }@inputs:
|
||||
outputs = { self, nixpkgs, home-manager,nixpkgs-unstable,... }@inputs:
|
||||
let
|
||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||
inherit (self) outputs;
|
||||
forEachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
||||
platforms = ["x86_64-linux"];
|
||||
|
||||
forEachPkgs = f: forEachSystem (sys: f nixpkgs.legacyPackages.${sys});
|
||||
system = "x86_64-linux";
|
||||
|
||||
mkPkgs = pkgs: extraOverlays: import pkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # forgive me Stallman senpai
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
};
|
||||
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
||||
pkgs' = mkPkgs nixpkgs-unstable [];
|
||||
|
||||
lib = nixpkgs.lib.extend
|
||||
(self: super: { my = import ./lib { inherit pkgs inputs outputs; lib = self; }; });
|
||||
in {
|
||||
lib = lib.my;
|
||||
packages."${system}" =
|
||||
mapModules ./pkgs (p: pkgs.callPackage p {});
|
||||
|
||||
devShell."${system}" =
|
||||
import ./shell.nix { inherit pkgs; };
|
||||
|
||||
overlay =
|
||||
final: prev: {
|
||||
unstable = pkgs';
|
||||
my = self.packages."${system}";
|
||||
};
|
||||
|
||||
in
|
||||
rec {
|
||||
packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; });
|
||||
devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; });
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
|
||||
|
||||
@@ -71,7 +90,7 @@
|
||||
name = x;
|
||||
value = import (./modules/nixos + "/${x}");
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ../modules/nixos)));
|
||||
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
||||
|
||||
|
||||
##import our HM modules
|
||||
@@ -83,21 +102,23 @@
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
||||
|
||||
|
||||
# nixosConfigurations =
|
||||
# mapHosts ./hosts {};
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
Go3 = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./hosts/WSL/Go3
|
||||
{ imports = builtins.attrValues self.nixosModules; }
|
||||
./hosts/Go3
|
||||
];
|
||||
};
|
||||
StuPC = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./hosts/WSL/StuPC
|
||||
{ imports = builtins.attrValues self.nixosModules; }
|
||||
./hosts/StuPC
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user