mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
* Move the /etc generation to modules/system/etc.
svn path=/nixos/branches/modular-nixos/; revision=15767
This commit is contained in:
parent
14f1c81822
commit
3c84d56273
6 changed files with 35 additions and 41 deletions
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
require = [
|
require = [
|
||||||
../etc/default.nix
|
|
||||||
../system/assertion.nix
|
../system/assertion.nix
|
||||||
../system/nixos-environment.nix
|
../system/nixos-environment.nix
|
||||||
../system/nixos-installer.nix
|
../system/nixos-installer.nix
|
||||||
|
|
|
@ -117,6 +117,7 @@
|
||||||
./system/boot/kernel.nix
|
./system/boot/kernel.nix
|
||||||
./system/boot/stage-1.nix
|
./system/boot/stage-1.nix
|
||||||
./system/boot/stage-2.nix
|
./system/boot/stage-2.nix
|
||||||
|
./system/etc/etc.nix
|
||||||
./system/upstart-events/ctrl-alt-delete.nix
|
./system/upstart-events/ctrl-alt-delete.nix
|
||||||
./system/upstart-events/halt.nix
|
./system/upstart-events/halt.nix
|
||||||
./system/upstart-events/maintenance-shell.nix
|
./system/upstart-events/maintenance-shell.nix
|
||||||
|
|
|
@ -3,7 +3,26 @@
|
||||||
|
|
||||||
{config, pkgs, ...}:
|
{config, pkgs, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
environment.shellInit = pkgs.lib.mkOption {
|
||||||
|
default = "";
|
||||||
|
example = ''export PATH=/godi/bin/:$PATH'';
|
||||||
|
description = "
|
||||||
|
Script used to initialized user shell environments.
|
||||||
|
";
|
||||||
|
merge = pkgs.lib.mergeStringOption;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
require = [options];
|
||||||
|
|
||||||
environment.etc =
|
environment.etc =
|
||||||
[ { # /etc/bashrc: script executed when the shell starts as a
|
[ { # /etc/bashrc: script executed when the shell starts as a
|
||||||
# non-login shell. /etc/profile also sources this file, so
|
# non-login shell. /etc/profile also sources this file, so
|
||||||
|
|
|
@ -6,41 +6,23 @@ let
|
||||||
inherit (pkgs.lib) mkOption;
|
inherit (pkgs.lib) mkOption;
|
||||||
|
|
||||||
option = {
|
option = {
|
||||||
environment = {
|
environment.etc = mkOption {
|
||||||
etc = mkOption {
|
default = [];
|
||||||
default = [];
|
example = [
|
||||||
example = [
|
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
||||||
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
target = "dir/file.conf";
|
||||||
target = "dir/file.conf";
|
mode = "0440";
|
||||||
mode = "0440";
|
}
|
||||||
}
|
];
|
||||||
];
|
description = ''
|
||||||
description = "
|
List of files that have to be linked in /etc.
|
||||||
List of files that have to be linked in /etc.
|
'';
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
# !!! This should be moved outside of /etc/default.nix.
|
|
||||||
shellInit = mkOption {
|
|
||||||
default = "";
|
|
||||||
example = ''export PATH=/godi/bin/:$PATH'';
|
|
||||||
description = "
|
|
||||||
Script used to initialized user shell environments.
|
|
||||||
";
|
|
||||||
merge = pkgs.lib.mergeStringOption;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
let
|
let
|
||||||
optional = pkgs.lib.optional;
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (pkgs.stringsWithDeps) noDepEntry fullDepEntry packEntry;
|
|
||||||
|
|
||||||
copyScript = {source, target, mode ? "644", own ? "root.root"}:
|
copyScript = {source, target, mode ? "644", own ? "root.root"}:
|
||||||
assert target != "nixos";
|
assert target != "nixos";
|
||||||
|
@ -54,22 +36,15 @@ let
|
||||||
chmod ${mode} "$target"
|
chmod ${mode} "$target"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeEtc = import ../helpers/make-etc.nix {
|
makeEtc = import ./make-etc.nix {
|
||||||
inherit (pkgs) stdenv;
|
inherit (pkgs) stdenv;
|
||||||
configFiles = config.environment.etc;
|
configFiles = config.environment.etc;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
require = [
|
require = [option];
|
||||||
option
|
|
||||||
|
|
||||||
# config.system.build
|
|
||||||
# ../system/system-options.nix
|
|
||||||
|
|
||||||
# config.system.activationScripts
|
|
||||||
# ../system/activate-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
build = {
|
build = {
|
||||||
|
@ -77,7 +52,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
activationScripts = {
|
activationScripts = {
|
||||||
etc = fullDepEntry ''
|
etc = pkgs.lib.fullDepEntry ''
|
||||||
# Set up the statically computed bits of /etc.
|
# Set up the statically computed bits of /etc.
|
||||||
staticEtc=/etc/static
|
staticEtc=/etc/static
|
||||||
rm -f $staticEtc
|
rm -f $staticEtc
|
Loading…
Add table
Add a link
Reference in a new issue