Refactor flake patching/recursion
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
183
flake.nix
183
flake.nix
@@ -1,110 +1,64 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
# --- Official
|
||||
# type = "github";
|
||||
# owner = "NixOS";
|
||||
# repo = "nixpkgs";
|
||||
# ref = "master";
|
||||
# --- Fork
|
||||
type = "github";
|
||||
owner = "karaolidis";
|
||||
repo = "nixpkgs";
|
||||
ref = "integration";
|
||||
# --- Local
|
||||
# url = "git+file:./submodules/nixpkgs";
|
||||
};
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
# --- Official
|
||||
# type = "github";
|
||||
# owner = "nix-community"
|
||||
# repo = "home-manager";
|
||||
# --- Fork
|
||||
type = "github";
|
||||
owner = "karaolidis";
|
||||
repo = "home-manager";
|
||||
ref = "integration";
|
||||
# --- Local
|
||||
# url = "git+file:./submodules/home-manager";
|
||||
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
disko = {
|
||||
type = "github";
|
||||
owner = "nix-community";
|
||||
repo = "disko";
|
||||
ref = "master";
|
||||
|
||||
url = "github:nix-community/disko/latest";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
type = "github";
|
||||
owner = "Mic92";
|
||||
repo = "sops-nix";
|
||||
ref = "master";
|
||||
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
systems = {
|
||||
type = "github";
|
||||
owner = "nix-systems";
|
||||
repo = "default";
|
||||
ref = "main";
|
||||
};
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
||||
nur = {
|
||||
type = "github";
|
||||
owner = "nix-community";
|
||||
repo = "NUR";
|
||||
ref = "main";
|
||||
|
||||
url = "github:nix-community/NUR";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
flake-utils = {
|
||||
type = "github";
|
||||
owner = "numtide";
|
||||
repo = "flake-utils";
|
||||
ref = "main";
|
||||
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.systems.follows = "systems";
|
||||
};
|
||||
|
||||
treefmt-nix = {
|
||||
type = "github";
|
||||
owner = "numtide";
|
||||
repo = "treefmt-nix";
|
||||
ref = "main";
|
||||
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
quadlet-nix = {
|
||||
type = "github";
|
||||
owner = "SEIAROTg";
|
||||
repo = "quadlet-nix";
|
||||
ref = "main";
|
||||
flake-input-patcher = {
|
||||
url = "github:jfly/flake-input-patcher";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
systems.follows = "systems";
|
||||
};
|
||||
};
|
||||
|
||||
quadlet-nix.url = "github:SEIAROTg/quadlet-nix";
|
||||
|
||||
nvidia-patch = {
|
||||
url = "github:icewind1991/nvidia-patch-nixos";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
astal = {
|
||||
type = "github";
|
||||
owner = "aylur";
|
||||
repo = "astal";
|
||||
ref = "main";
|
||||
|
||||
url = "github:aylur/astal";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
ags = {
|
||||
type = "github";
|
||||
owner = "aylur";
|
||||
repo = "ags";
|
||||
ref = "main";
|
||||
|
||||
url = "github:aylur/ags";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
astal.follows = "astal";
|
||||
@@ -112,66 +66,37 @@
|
||||
};
|
||||
|
||||
spicetify-nix = {
|
||||
type = "github";
|
||||
owner = "Gerg-L";
|
||||
repo = "spicetify-nix";
|
||||
ref = "master";
|
||||
|
||||
url = "github:Gerg-L/spicetify-nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
systems.follows = "systems";
|
||||
};
|
||||
};
|
||||
|
||||
nvidia-patch = {
|
||||
type = "github";
|
||||
owner = "icewind1991";
|
||||
repo = "nvidia-patch-nixos";
|
||||
ref = "main";
|
||||
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }@inputs:
|
||||
{
|
||||
nixosConfigurations = {
|
||||
installer = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/installer ];
|
||||
specialArgs = { inherit inputs system; };
|
||||
};
|
||||
inputs:
|
||||
let
|
||||
mkInputs =
|
||||
system:
|
||||
let
|
||||
patcher = inputs.flake-input-patcher.lib.${system};
|
||||
in
|
||||
patcher.patch inputs (import ./patches.nix { inherit patcher; });
|
||||
|
||||
himalia = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/himalia ];
|
||||
mkNixosConfiguration =
|
||||
inputs: system: modules:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system modules;
|
||||
specialArgs = { inherit inputs system; };
|
||||
};
|
||||
|
||||
elara = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/elara ];
|
||||
specialArgs = { inherit inputs system; };
|
||||
};
|
||||
|
||||
jupiter = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/jupiter ];
|
||||
specialArgs = { inherit inputs system; };
|
||||
};
|
||||
|
||||
jupiter-vps = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/jupiter-vps ];
|
||||
specialArgs = { inherit inputs system; };
|
||||
};
|
||||
};
|
||||
}
|
||||
// inputs.flake-utils.lib.eachSystem [ "x86_64-linux" ] (
|
||||
system:
|
||||
in
|
||||
(
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
inputs = mkInputs system;
|
||||
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
@@ -179,12 +104,20 @@
|
||||
treefmt = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
||||
in
|
||||
{
|
||||
devShells = import ./hosts/common/shells { inherit pkgs; };
|
||||
lib = import ./lib { inherit pkgs; };
|
||||
packages = import ./packages { inherit pkgs inputs system; };
|
||||
nixosConfigurations = {
|
||||
installer = mkNixosConfiguration inputs system [ ./hosts/installer ];
|
||||
himalia = mkNixosConfiguration inputs system [ ./hosts/himalia ];
|
||||
elara = mkNixosConfiguration inputs system [ ./hosts/elara ];
|
||||
jupiter = mkNixosConfiguration inputs system [ ./hosts/jupiter ];
|
||||
jupiter-vps = mkNixosConfiguration inputs system [ ./hosts/jupiter-vps ];
|
||||
};
|
||||
|
||||
formatter = treefmt.config.build.wrapper;
|
||||
checks.formatting = treefmt.config.build.check self;
|
||||
devShells.${system} = import ./hosts/common/shells { inherit pkgs; };
|
||||
lib.${system} = import ./lib { inherit pkgs; };
|
||||
packages.${system} = import ./packages { inherit pkgs inputs system; };
|
||||
|
||||
formatter.${system} = treefmt.config.build.wrapper;
|
||||
checks.formatting.${system} = treefmt.config.build.check inputs.self;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user