Compare commits

..

2 commits

Author SHA1 Message Date
b11e752c02
fix: added missing imports 2024-09-18 15:03:59 +02:00
876909959c
fix: added toplevel configuration 2024-09-18 13:13:52 +02:00
3 changed files with 18 additions and 26 deletions

View file

@ -4,13 +4,11 @@
{ lib, pkgs, config, ...}:
let
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr concatStringsSep;
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;
inherit (pkgs.pseudofile) dir symlink;
inherit (pkgs.liminix.networking) address interface;
inherit (pkgs.liminix.services) bundle;
# TODO: escape shell argument.
exportVar = name: value: "export ${name}=\"${value}\"";
type_service = pkgs.liminix.lib.types.service;
in {
@ -24,24 +22,6 @@ in {
/run/current-system, we just add the paths in /etc/profile
'';
};
environmentVariables = mkOption {
type = types.attrsOf types.str;
description = ''
Attribute set of environment variables to make available
in a login shell.
The value is assumed to be escaped and the name to be valid.
'';
};
prompt = mkOption {
type = types.str;
default = "$(whoami)@$(hostname) # ";
description = ''
Prompt string (PS1) for the shell.
'';
};
};
services = mkOption {
type = types.attrsOf type_service;
@ -125,14 +105,15 @@ in {
};
};
};
imports = [ ./nixpkgs.nix ];
config = {
# By default, we enable cross-compilation support.
nixpkgs.buildPlatform = lib.mkDefault builtins.currentSystem;
defaultProfile.packages = with pkgs;
[ s6 s6-init-bin execline s6-linux-init s6-rc ];
# Set the useful PS1 prompt by default.
defaultProfile.environmentVariables.PS1 = lib.mkDefault config.defaultProfile.prompt;
boot.commandLine = [
"panic=10 oops=panic init=/bin/init loglevel=8"
@ -205,7 +186,6 @@ in {
(pkgs.writeScript ".profile" ''
PATH=${lib.makeBinPath config.defaultProfile.packages}:/bin
export PATH
${concatStringsSep "\n" (map exportVar config.defaultProfile.environmentVariables)}
'');
in dir {
inherit profile;

View file

@ -331,6 +331,8 @@ in
};
};
imports = [ ./misc/assertions.nix ];
config = {
_module.args = {
pkgs =

View file

@ -13,6 +13,14 @@ in
boot.initramfs = {
enable = mkEnableOption "initramfs";
};
system.build.toplevel = mkOption {
type = types.package;
description = ''
pkgs.systemconfig for the configured filesystem,
contains 'activate' and 'init' commands
'';
internal = true;
};
system.outputs = {
initramfs = mkOption {
type = types.package;
@ -39,6 +47,8 @@ in
INITRAMFS_COMPRESSION_ZSTD = "y";
};
system.build.toplevel = config.system.outputs.systemConfiguration;
system.outputs = {
initramfs =
let