flake: sitch to npins
Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a6964f4aa3349951fe7574622564452ad1af1
This commit is contained in:
parent
45179ade64
commit
2e7d11c2ed
24 changed files with 707 additions and 731 deletions
40
default.nix
Normal file
40
default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
let
|
||||
inherit (builtins) mapAttrs;
|
||||
inherit (builtins) filter;
|
||||
inherit (builtins) currentSystem;
|
||||
|
||||
# https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers
|
||||
src = import ./npins;
|
||||
pkgs = import src.nixpkgs {};
|
||||
sources = mapAttrs (k: v: v {inherit pkgs;}) src;
|
||||
|
||||
inherit (pkgs) lib;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
inherit (lib.strings) hasSuffix;
|
||||
|
||||
mkSystem = system: hostname:
|
||||
import (src.nixpkgs + "/nixos/lib/eval-config.nix") {
|
||||
system = currentSystem;
|
||||
specialArgs = {
|
||||
inherit sources;
|
||||
self = ./.;
|
||||
};
|
||||
modules =
|
||||
[
|
||||
# This is used to pre-emptively set the hostPlatform for nixpkgs.
|
||||
# Also, we set the system hostname here.
|
||||
{
|
||||
networking.hostName = hostname;
|
||||
nixpkgs.hostPlatform = system;
|
||||
}
|
||||
./hosts/common.nix
|
||||
./hosts/${hostname}
|
||||
]
|
||||
++ ((listFilesRecursive ./modules)
|
||||
|> filter (hasSuffix ".mod.nix"));
|
||||
};
|
||||
in {
|
||||
temperance = mkSystem "x86_64-linux" "temperance";
|
||||
hermit = mkSystem "x86_64-linux" "hermit";
|
||||
tower = mkSystem "aarch64-linux" "tower";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue