73 lines
2 KiB
Nix
73 lines
2 KiB
Nix
{
|
|
description = "Nixos config flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
disko.url = "github:nix-community/disko";
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
nix-index-database.url = "github:nix-community/nix-index-database";
|
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs =
|
|
inputs@{ nixpkgs, self, ... }:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
lib = import ./lib.nix {
|
|
inherit (nixpkgs) lib;
|
|
inherit pkgs;
|
|
inherit (inputs) home-manager;
|
|
};
|
|
createCommonArgs = system: {
|
|
inherit
|
|
self
|
|
inputs
|
|
nixpkgs
|
|
lib
|
|
pkgs
|
|
system
|
|
;
|
|
specialArgs = {
|
|
inherit self inputs;
|
|
};
|
|
};
|
|
commonArgs = createCommonArgs system;
|
|
# call with forAllSystems (commonArgs: function body)
|
|
forAllSystems =
|
|
fn:
|
|
lib.genAttrs [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
] (system: fn (createCommonArgs system));
|
|
in
|
|
{
|
|
inherit lib self;
|
|
nixosConfigurations = (import ./src/hosts/nixos.nix commonArgs);
|
|
};
|
|
|
|
# outputs = {nixpkgs, ...} @ inputs:
|
|
# {
|
|
# nixosConfigurations.pickwick = nixpkgs.lib.nixosSystem {
|
|
# specialArgs = { inherit inputs; };
|
|
# modules = [
|
|
# inputs.disko.nixosModules.default
|
|
# (import ./disko.nix { device = "/dev/nvme0n1"; })
|
|
|
|
# ./configuration.nix
|
|
#
|
|
# inputs.home-manager.nixosModules.default
|
|
# inputs.impermanence.nixosModules.impermanence
|
|
# ];
|
|
# };
|
|
# };
|
|
}
|