A simple and generic NixOS configuration framework written in pure Nix. (currently only on unstable channel)
- A plugin toolkit
- A system configuration setup framework
- A set of simple Nix expressions
- A plugin/package manager. (It could not handle version and dependencies yet since it is really simple. And I have no intention currently to do it).
- flake
Simply use following in your /etc/nixos/configuration.nix
:
let
icebox = builtins.fetchTarball
"https://github.com/LEXUGE/icebox/archive/master.tar.gz";
in {
imports = [
"${icebox}"
# Other imports
];
# Other settings
}
Plugins could be any Nix modules! icebox provides plugins tools to configure per user stuff and abilities of sharing "interface" inter-pluginly, providing functions to other plugins. Also it endows users with uniform experience and ability of doing less. Some typical stuff a plugin could do would be:
- Provide user a hot fix which could be applied in a multi-user way. Example
- Provide a configuration pack with overlays for new packages. Example
Here is an example of a hacky hotfix towards home-manager issue #948. It would be automatically applied to every user defined in icebox.users.users
(if it is listed in icebox.users.plugins
.
{ config, lib, pkgs, ... }:
let
iceLib = config.icebox.static.lib;
cfg = config.icebox.static.users.hm-fix;
in {
options.icebox.static.users.hm-fix = with lib;
mkOption {
type = types.submodule {
options = {
enable = mkEnableOption
"the Desktop Environment falovored by ash"; # If this is off, nothing should be configured at all.
configs = mkOption {
type = with types;
attrsOf (submodule {
options.enable = mkOption {
type = types.bool;
default = true;
description =
"Whether to enable a (hacky) patch plugin for home-manager issue #948.";
};
});
default = { };
};
};
};
default = { };
};
config.systemd.services =
iceLib.functions.mkUserConfigs (n: c: "home-manager-${n}") (n: c: {
# Hacky workaround of issue 948 of home-manager
preStart = ''
${pkgs.nix}/bin/nix-env -i -E
'';
}) cfg;
}
Plugins are like packages and should go under scrutiny. icebox ensures that if plugin is using functions provided (like iceLib.functions.mkUserConfigs
), and
it does nothing under enable = false
, then this plugin would only take effect if you list it explicitly in the respective plugins
option.
- netkit.nix. Verstile icebox plugins for advanced networking scenarios in NixOS. (I use it heavily, and it works out-of-box!)
- std. Standard library for icebox.
- nixos. My personal nixos configuration consisting of icebox plugins only.