mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
d73389f410
Over time, this helper has shrunk to a single line. It's not worth the extra API surface area anymore.
61 lines
1.6 KiB
Nix
61 lines
1.6 KiB
Nix
{
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
inputs.impermanence.url = "github:nix-community/impermanence";
|
|
|
|
outputs = { self, nixpkgs, impermanence, ... }:
|
|
let
|
|
inherit (nixpkgs) lib;
|
|
|
|
mypkgs = pkgs:
|
|
(lib.mapAttrs'
|
|
(name: type: {
|
|
name = lib.removeSuffix ".nix" name;
|
|
value = pkgs.callPackage (./pkgs + "/${name}") { };
|
|
})
|
|
(builtins.readDir ./pkgs));
|
|
|
|
forAllSystems = lib.genAttrs [ "x86_64-linux" ];
|
|
|
|
pins = {
|
|
nix.registry.nixpkgs.to = {
|
|
inherit (nixpkgs) rev;
|
|
owner = "NixOS";
|
|
repo = "nixpkgs";
|
|
type = "github";
|
|
};
|
|
nix.registry.bck.to = {
|
|
owner = "buckley310";
|
|
repo = "nixos-config";
|
|
type = "github";
|
|
};
|
|
};
|
|
|
|
mods =
|
|
{
|
|
inherit pins;
|
|
inherit (impermanence.nixosModules) impermanence;
|
|
pkgs.nixpkgs.overlays = [ (_: mypkgs) ];
|
|
} //
|
|
lib.mapAttrs'
|
|
(name: type: {
|
|
name = lib.removeSuffix ".nix" name;
|
|
value = import (./modules + "/${name}");
|
|
})
|
|
(builtins.readDir ./modules);
|
|
|
|
in
|
|
{
|
|
lib = {
|
|
gen-ssh-config = import lib/gen-ssh-config.nix lib;
|
|
};
|
|
|
|
nixosModules = mods // { default.imports = builtins.attrValues mods; };
|
|
|
|
nixosConfigurations = builtins.mapAttrs
|
|
(_: lib.nixosSystem)
|
|
(import ./hosts self.nixosModules.default);
|
|
|
|
packages = forAllSystems (system:
|
|
mypkgs nixpkgs.legacyPackages.${system});
|
|
};
|
|
}
|