Migrate to snowfall lib

This commit is contained in:
soraefir
2023-11-04 02:28:27 +01:00
parent a7ef5cf996
commit 99d64c588e
175 changed files with 3870 additions and 4002 deletions

134
flake.nix
View File

@ -1,15 +1,16 @@
{
description = "SoraFlake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
hardware.url = "github:nixos/nixos-hardware";
nur.url = "github:nix-community/nur";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
@ -19,89 +20,62 @@
sops-nix.url = "github:Mic92/sops-nix";
nix-colors.url = "github:misterio77/nix-colors";
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, hardware, nur, home-manager, darwin, sops-nix, hyprland, nix-colors, ... }@inputs:
let
gen = import ./generator.nix { inherit inputs nixpkgs home-manager darwin sops-nix hyprland nix-colors; };
forEachSystem = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
outputs = inputs:
let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
};
in lib.mkFlake {
in {
package-namespace = "custom";
devShells = forEachSystem (system:
let
overlays = import ./pkgs/overlay.nix { inherit pkgs; };
overrides = {custom = import ./pkgs { inherit pkgs; }; };
pkgs = import nixpkgs {
inherit system overlays ;
} // overrides;
in {
default = import ./modules/devshell.nix { inherit pkgs; };
}
);
channels-config = {
allowUnfree = true;
permittedInsecurePackages = [ ];
};
nixosConfigurations = {
valinor = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "valinor";
systems = {
modules = {
darwin = with inputs; [ sops-nix.nixosModules.sops ];
home = with inputs; [
nix-colors.homeManagerModules
hyprland.homeManagerModules
];
nixos = with inputs; [ sops-nix.nixosModules.sops ];
};
};
iriy = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "iriy";
};
efir = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "efir";
};
avalon = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "avalon";
};
};
darwinConfigurations = {
asgard = gen.generate {
type = "macos";
system = "x86_64-darwin";
host = "asgard";
};
};
homeConfigurations = {
yomi = gen.generate {
type = "home";
system = "arm-64";
host = "example";
};
example = gen.generate {
type = "home";
system = "-"; #supports any
host = "example";
};
};
# ===== 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 - ?
};
# ===== 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 - ?
}