refactor: Remove 'defaults' abstraction
This commit is contained in:
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
24
modules/nixos/documentation.nix
Normal file
24
modules/nixos/documentation.nix
Normal 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
14
modules/nixos/nixpkgs.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user