summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix56
1 files changed, 42 insertions, 14 deletions
diff --git a/flake.nix b/flake.nix
index 4edd899..69987c2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,27 +3,55 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
- nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+ nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
-
- nurpkgs.url = "github:nix-community/NUR";
- nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
- outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, nurpkgs, home-manager, ... }@inputs:
- let
- inherit (self) outputs;
- stateVersion = "23.11";
+ outputs = inputs @ {
+ self,
+ nixpkgs,
+ ...
+ }: let
+ system = "x86_64-linux";
+
+ lib = nixpkgs.lib.extend (
+ final: prev: {
+ custom = import ./lib.nix nixpkgs.lib;
+ }
+ );
+
+ pkgs = import nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ overlays = [ self.overlays.default ];
+ };
+
in {
- nixosConfigurations = (
- import ./hosts {
- inherit (nixpkgs) lib;
- inherit inputs nixpkgs nixpkgs-unstable nixos-hardware nurpkgs home-manager stateVersion;
- }
- );
+ overlays.default = import ./overlay.nix {inherit inputs system;};
+
+ nixosModules =
+ { nixosConfig = import ./.;}
+ // lib.custom.mapModulesRec ./modules import;
+
+ nixosConfigurations = let
+ mkHost = system: path:
+ lib.nixosSystem {
+ inherit system;
+ specialArgs = {inherit lib inputs system;};
+ modules = [
+ {
+ nixpkgs.pkgs = pkgs;
+ modules.device.name = lib.mkDefault (builtins.baseNameOf path);
+ }
+ ./.
+ (import path)
+ ];
+ };
+ in
+ lib.custom.mapModules ./hosts (mkHost system);
};
}