Add Nix flake configuration
This commit is contained in:
46
flake.nix
Normal file
46
flake.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
description = "NixOS/Darwin system configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-22.11";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-22.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ { nixpkgs, home-manager, ... }:
|
||||
let
|
||||
inherit (lib) attrValues;
|
||||
inherit (lib.my) mapModules mapModulesRec;
|
||||
|
||||
mkPkgs = pkgs:
|
||||
import pkgs {
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
pkgs = mkPkgs nixpkgs;
|
||||
|
||||
lib = nixpkgs.lib.extend (self: super: {
|
||||
my = import ./lib {
|
||||
inherit pkgs inputs;
|
||||
lib = self;
|
||||
};
|
||||
});
|
||||
in {
|
||||
lib = lib.my;
|
||||
|
||||
nixosModules = mapModulesRec ./modules import;
|
||||
|
||||
nixosConfigurations = {
|
||||
atlas = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
(import ./modules)
|
||||
./hosts/atlas
|
||||
];
|
||||
specialArgs = { inherit lib inputs; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user