1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-05-13 06:15:15 +00:00

ultra super mega over overengineering

This commit is contained in:
nixzoid 2025-03-02 12:36:00 +09:00
parent 6c052df2f7
commit 75a5ac0681
4 changed files with 79 additions and 33 deletions

View file

@ -11,42 +11,30 @@ let
build = import ./builder { inherit self inputs; };
machines = (import "${self}/machines");
in
{
nixosConfigurations = build machines;
formatter.${system} = pkgs.nixfmt-rfc-style;
packages.${system} = import ./packages.nix {
mk = import ./other {
inherit
forAllSystems
inputs
pkgs
lib
;
};
devShells.${system} =
with pkgs;
let
mk =
p:
mkShell {
shellHook = ''exec fish'';
packages = p;
};
in
{
nixDev = mk [
nixfmt-rfc-style
nix-init
cachix
];
rust = mk [
rustfmt
rustc
cargo
];
python = mk [
python3
pipx
];
};
forAllSystems = i: lib.genAttrs sys i;
sys = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
{
nixosConfigurations = build machines;
}
// (lib.genAttrs [
"formatter"
"packages"
"devShells"
] (n: mk.${n}))

28
xlib/other/default.nix Normal file
View file

@ -0,0 +1,28 @@
{
forAllSystems,
inputs,
pkgs,
lib,
}:
{
"packages" = forAllSystems (
system:
(import ./packages.nix {
inherit
inputs
pkgs
lib
;
})
);
"devShells" = forAllSystems (
system:
(import ./shells.nix {
inherit
pkgs
;
})
);
"formatter" = forAllSystems (system: pkgs.nixfmt-rfc-style);
}

View file

@ -23,7 +23,7 @@ let
);
legacyPackages = scope.packages scope;
scope = scopeFromDirectory ../pkgs;
scope = scopeFromDirectory ../../pkgs;
in
flattenPkgs "/" [ ] legacyPackages

30
xlib/other/shells.nix Normal file
View file

@ -0,0 +1,30 @@
{
pkgs,
}:
with pkgs;
let
mk =
p:
mkShell {
shellHook = ''exec fish'';
packages = p;
};
in
{
nixDev = mk [
nixfmt-rfc-style
nix-init
cachix
];
rust = mk [
rustfmt
rustc
cargo
];
python = mk [
python3
pipx
];
}