mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 01:53:15 -06:00
rework overlays handling
This commit is contained in:
parent
b66236553f
commit
a559ac1c79
7 changed files with 37 additions and 71 deletions
|
@ -3,23 +3,21 @@ let
|
|||
lib = nixpkgs.lib.extend (import ./extended.nix inputs);
|
||||
|
||||
inherit (builtins) mapAttrs readDir listToAttrs;
|
||||
inherit (lib) genAttrs pkgFromSystem pkgsFromSystem;
|
||||
inherit (lib) genAttrs pkgFromSystem pkgsFromSystem loadOverlays;
|
||||
|
||||
inherit (import ./find-modules.nix { inherit lib; }) findModulesList;
|
||||
inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem;
|
||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
|
||||
forAllSystems =
|
||||
f:
|
||||
fn:
|
||||
genAttrs supportedSystems (
|
||||
system:
|
||||
f (
|
||||
fn (
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.nim2nix.overlays.default
|
||||
(import ../overlays/nimble { inherit inputs; })
|
||||
];
|
||||
overlays = (import ../overlays { inherit inputs loadOverlays; });
|
||||
}
|
||||
)
|
||||
);
|
||||
|
@ -62,13 +60,13 @@ let
|
|||
];
|
||||
};
|
||||
});
|
||||
checks = forAllSystems (
|
||||
pkgs:
|
||||
import ./checks.nix {
|
||||
inherit inputs lib self;
|
||||
system = pkgs.system;
|
||||
}
|
||||
);
|
||||
# checks = forAllSystems (
|
||||
# pkgs:
|
||||
# import ./checks.nix {
|
||||
# inherit inputs lib self;
|
||||
# system = pkgs.system;
|
||||
# }
|
||||
# );
|
||||
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
||||
};
|
||||
in
|
||||
|
|
|
@ -3,8 +3,11 @@ let
|
|||
inherit (builtins)
|
||||
listToAttrs
|
||||
substring
|
||||
filter
|
||||
replaceStrings
|
||||
map
|
||||
filter
|
||||
attrNames
|
||||
readDir
|
||||
;
|
||||
inherit (final)
|
||||
concatStringsSep
|
||||
|
@ -106,6 +109,12 @@ let
|
|||
pkg = pkgFromSystem system;
|
||||
};
|
||||
|
||||
loadOverlays =
|
||||
inputs: dir: readDir dir
|
||||
|> attrNames
|
||||
|> filter (f: f != "default.nix")
|
||||
|> map (f: import (../overlays + "/${f}") { inherit inputs; });
|
||||
|
||||
in
|
||||
{
|
||||
inherit
|
||||
|
@ -125,5 +134,6 @@ in
|
|||
overlayFrom
|
||||
flakeFromSystem
|
||||
listify
|
||||
loadOverlays
|
||||
;
|
||||
}
|
||||
|
|
|
@ -49,14 +49,6 @@ let
|
|||
nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
# TODO: clean this up
|
||||
(
|
||||
{ ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ inputs.nim2nix.overlays.default ];
|
||||
}
|
||||
)
|
||||
../overlays
|
||||
../modules/oizys.nix
|
||||
inputs.lix-module.nixosModules.default
|
||||
inputs.hyprland.nixosModules.default
|
||||
|
|
|
@ -15,8 +15,6 @@ in
|
|||
with pkgs;
|
||||
[
|
||||
nim
|
||||
|
||||
nim-atlas
|
||||
nimble
|
||||
]
|
||||
++ [ nimlangserver ];
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
self,
|
||||
hostName,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption;
|
||||
inherit (lib) mkEnableOption mkOption loadOverlays;
|
||||
in
|
||||
{
|
||||
imports = with self.nixosModules; [
|
||||
|
@ -54,5 +55,6 @@ in
|
|||
config = {
|
||||
networking.hostName = hostName;
|
||||
time.timeZone = "US/Central";
|
||||
nixpkgs.overlays = import ../overlays { inherit inputs loadOverlays; };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,33 +1,11 @@
|
|||
{ inputs, ... }:
|
||||
let
|
||||
inherit (builtins)
|
||||
map
|
||||
filter
|
||||
attrNames
|
||||
readDir
|
||||
elem
|
||||
;
|
||||
# execute and import all overlay files in the current
|
||||
# directory with the given args
|
||||
# overlays =
|
||||
# map
|
||||
# (f: (import (./. + "/${f}") { inherit inputs; }))
|
||||
# (filter (f: f != "default.nix") (attrNames (readDir ./.)));
|
||||
ignore = ["nimlangserver"];
|
||||
overlays =
|
||||
readDir ./.
|
||||
|> attrNames
|
||||
|> filter (f: f != "default.nix" || elem f ignore)
|
||||
|> map (f: import (./. + "/${f}") { inherit inputs; });
|
||||
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = overlays ++ [
|
||||
(final: _prev: {
|
||||
stable = import inputs.stable {
|
||||
system = final.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
{ inputs, loadOverlays }:
|
||||
(loadOverlays inputs ./.)
|
||||
++ [
|
||||
inputs.nim2nix.overlays.default # adds buildNimPackage
|
||||
(final: _prev: {
|
||||
stable = import inputs.stable {
|
||||
system = final.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
})
|
||||
]
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
{ ... }:
|
||||
(final: prev: {
|
||||
nim-atlas = prev.nim-atlas.overrideNimAttrs {
|
||||
version = "unstable";
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "nim-lang";
|
||||
repo = "atlas";
|
||||
rev = "cbba9fa77fa837931bf3c58e20c1f8cb15a22919";
|
||||
hash = "sha256-TsZ8TriVuKEY9/mV6KR89eFOgYrgTqXmyv/vKu362GU=";
|
||||
};
|
||||
};
|
||||
})
|
Loading…
Reference in a new issue