mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
default.nix: support for traditional channels
Though, it's limited compared to flakes. I supposed that's better than nothing.
This commit is contained in:
parent
0c7f57f5a9
commit
6a0c115432
@ -113,6 +113,7 @@ nixos-config
|
||||
├── shells/
|
||||
├── templates/
|
||||
├── users/
|
||||
├── default.nix
|
||||
├── flake.lock
|
||||
├── flake.nix
|
||||
└── README.adoc
|
||||
|
11
default.nix
Normal file
11
default.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
let
|
||||
lib' = pkgs.lib.extend (final: prev:
|
||||
import ./lib { lib = prev; } // import ./lib/private.nix { lib = final; });
|
||||
in {
|
||||
lib = import ./lib { lib = pkgs.lib; };
|
||||
modules = lib'.importModules (lib'.filesToAttr ./modules/nixos);
|
||||
overlays.foo-dogsquared-pkgs = final: prev: import ./pkgs { pkgs = prev; };
|
||||
hmModules = lib'.importModules (lib'.filesToAttr ./modules/home-manager);
|
||||
} // (import ./pkgs { inherit pkgs; })
|
14
flake.nix
14
flake.nix
@ -232,16 +232,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
# A list of module namespaces that will not be imported into the output.
|
||||
# It could be blocked for whatever reason or as indicated.
|
||||
blocklist = [
|
||||
# The modules under this attribute are often incomplete and needing
|
||||
# very specific requirements that is 99% going to be absent from the
|
||||
# outside so we're not going to export it.
|
||||
"tasks"
|
||||
];
|
||||
importModules = attrs:
|
||||
lib'.filterAttrs (n: v: !lib'.elem n blocklist) (lib'.mapAttrsRecursive (_: path: import path) attrs);
|
||||
in {
|
||||
# Exposes only my library with the custom functions to make it easier to
|
||||
# include in other flakes for whatever reason may be.
|
||||
@ -260,7 +250,7 @@
|
||||
|
||||
# We're going to make our custom modules available for our flake. Whether
|
||||
# or not this is a good thing is debatable, I just want to test it.
|
||||
nixosModules = importModules (lib'.filesToAttr ./modules/nixos);
|
||||
nixosModules = lib'.importModules (lib'.filesToAttr ./modules/nixos);
|
||||
|
||||
# I can now install home-manager users in non-NixOS systems.
|
||||
# NICE!
|
||||
@ -278,7 +268,7 @@
|
||||
(lib'.filesToAttr ./users/home-manager);
|
||||
|
||||
# Extending home-manager with my custom modules, if anyone cares.
|
||||
homeManagerModules = importModules (lib'.filesToAttr ./modules/home-manager);
|
||||
homeManagerModules = lib'.importModules (lib'.filesToAttr ./modules/home-manager);
|
||||
|
||||
# My custom packages, available in here as well. Though, I mainly support
|
||||
# "x86_64-linux". I just want to try out supporting other systems.
|
||||
|
@ -35,4 +35,15 @@ rec {
|
||||
|
||||
getUser = type: user:
|
||||
lib.getAttr user (getUsers type [ user ]);
|
||||
|
||||
# Import modules with a set blocklist.
|
||||
importModules = let
|
||||
blocklist = [
|
||||
# The modules under this attribute are often incomplete and needing
|
||||
# very specific requirements that is 99% going to be absent from the
|
||||
# outside so we're not going to export it.
|
||||
"tasks"
|
||||
];
|
||||
in attrs:
|
||||
lib.filterAttrs (n: v: !lib.elem n blocklist) (lib.mapAttrsRecursive (_: path: import path) attrs);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user