Files
nixconfig/flake.nix
T
2026-06-20 12:50:42 +02:00

99 lines
2.7 KiB
Nix
Executable File

{
description = "SoraFlake";
inputs = {
# Trick renovate into working: "github:NixOS/nixpkgs/nixpkgs-unstable"
nixUnstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
hardware.url = "github:nixos/nixos-hardware";
nur = {
url = "github:nix-community/nur";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors.url = "github:misterio77/nix-colors";
nixos-wsl = {
url = "github:nix-community/nixos-wsl";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
let
lib = inputs.nixpkgs.lib;
linuxSystems = [ "x86_64-linux" "aarch64-linux" ];
supportedSystems = linuxSystems ++ [ "x86_64-darwin" "aarch64-darwin" ];
overlays = import ./overlays { inherit inputs; };
mkPkgs = system:
import inputs.nixpkgs {
inherit system;
inherit overlays;
config.allowUnfree = true;
};
gen = import ./generator.nix { inherit inputs mkPkgs supportedSystems; };
systemsDir = ./systems;
isIgnoredSystemDir = name: lib.hasPrefix "_" name || lib.hasPrefix "." name;
systemNames = lib.attrNames (
lib.filterAttrs (
name: type:
type == "directory"
&& !isIgnoredSystemDir name
&& builtins.pathExists (systemsDir + "/${name}/cfg.nix")
) (builtins.readDir systemsDir)
);
hostsByType = systemType:
lib.filter (host: ((import (systemsDir + "/${host}/cfg.nix")).syscfg.type or "nixos") == systemType) systemNames;
generateHosts = systemType:
lib.genAttrs (hostsByType systemType) (host: gen.generate { inherit host; });
in {
devShells = import ./shells {
inherit inputs mkPkgs;
supportedSystems = linuxSystems;
};
nixosConfigurations = generateHosts "nixos";
darwinConfigurations = generateHosts "macos";
homeConfigurations = generateHosts "home";
};
# ===== Unsupported/NotImplemented ======
# menel - PI/ARM64
# ilduma - PI/ARM64
# daimoth - PI/ARM64
# gimle - ....
# ===== Unused ======
#
# naraka - ?
# diyu - ?
# tirnanog - ?
# valhalla - ?
# arcadia - ?
# elysium - ?
# empyrean - ?
# duat - ?
# sheol - ?
# adlivun - ?
# araf - ?
# aman/araman - ?
}