refactor: Remove 'defaults' abstraction

This commit is contained in:
2025-09-14 01:12:04 -06:00
parent 4d18ed530e
commit f12308326e
5 changed files with 38 additions and 65 deletions

View File

@@ -1,15 +0,0 @@
{ config, lib, pkgs, ... }:
let
# TODO: Move to a fucking utility library already!
listNixFilesInDirectory = dir:
builtins.attrNames
(lib.filterAttrs
(k: _v: lib.hasSuffix ".nix" k)
(builtins.readDir dir));
in {
imports =
builtins.map
(k: ./defaults/${k})
(listNixFilesInDirectory ./defaults);
}

View File

@@ -1,30 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.defaults.documentation;
in {
options = {
sydnix.defaults.documentation = {
enable = mkOption {
description = "Madeleine's default documentation settings";
default = true;
type = types.bool;
};
};
};
config = mkIf cfg.enable {
documentation = {
man.enable = true;
info.enable = true;
};
environment.systemPackages = with pkgs; [
man-pages
stdman
man-pages-posix
stdmanpages
];
};
}

View File

@@ -1,20 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.defaults.nixpkgs;
in {
options = {
sydnix.defaults.nixpkgs = {
enable = mkOption {
description = "Madeleine's default Nixpkgs settings";
default = true;
type = types.bool;
};
};
};
config = mkIf cfg.enable {
nixpkgs.config.allowUnfree = true;
};
}

View File

@@ -0,0 +1,24 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.documentation;
in {
options.sydnix.documentation = {
enable = lib.mkEnableOption "man and info pages" // {
default = true;
};
};
config = lib.mkIf cfg.enable {
documentation = {
man.enable = true;
info.enable = true;
};
environment.systemPackages = with pkgs; [
man-pages
stdman
man-pages-posix
stdmanpages
];
};
}

14
modules/nixos/nixpkgs.nix Normal file
View File

@@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.nixpkgs;
in {
options.sydnix.nixpkgs = {
enable = lib.mkEnableOption "some default Nixpkgs settings" // {
default = true;
};
};
config = lib.mkIf cfg.enable {
nixpkgs.config.allowUnfree = true;
};
}