etc.nix: Fix style
This commit is contained in:
parent
36088abb39
commit
73152e1702
@ -1,12 +1,32 @@
|
|||||||
# Produce a script to generate /etc.
|
# Management of static files in /etc.
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
###### interface
|
|
||||||
let
|
let
|
||||||
|
|
||||||
option = {
|
etc = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "etc";
|
||||||
|
|
||||||
|
builder = ./make-etc.sh;
|
||||||
|
|
||||||
|
preferLocalBuild = true;
|
||||||
|
|
||||||
|
/* !!! Use toXML. */
|
||||||
|
sources = map (x: x.source) config.environment.etc;
|
||||||
|
targets = map (x: x.target) config.environment.etc;
|
||||||
|
modes = map (x: x.mode) config.environment.etc;
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
environment.etc = mkOption {
|
environment.etc = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
example = [
|
example = [
|
||||||
@ -37,37 +57,23 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in
|
|
||||||
|
|
||||||
###### implementation
|
|
||||||
let
|
|
||||||
|
|
||||||
etc = pkgs.stdenv.mkDerivation {
|
|
||||||
name = "etc";
|
|
||||||
|
|
||||||
builder = ./make-etc.sh;
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
|
|
||||||
/* !!! Use toXML. */
|
|
||||||
sources = map (x: x.source) config.environment.etc;
|
|
||||||
targets = map (x: x.target) config.environment.etc;
|
|
||||||
modes = map (x: x.mode) config.environment.etc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
###### implementation
|
||||||
require = [option];
|
|
||||||
|
|
||||||
system.build.etc = etc;
|
config = {
|
||||||
|
|
||||||
system.activationScripts.etc = stringAfter [ "stdio" ]
|
system.build.etc = etc;
|
||||||
''
|
|
||||||
# Set up the statically computed bits of /etc.
|
system.activationScripts.etc = stringAfter [ "stdio" ]
|
||||||
echo "setting up /etc..."
|
''
|
||||||
${pkgs.perl}/bin/perl ${./setup-etc.pl} ${etc}/etc
|
# Set up the statically computed bits of /etc.
|
||||||
'';
|
echo "setting up /etc..."
|
||||||
|
${pkgs.perl}/bin/perl ${./setup-etc.pl} ${etc}/etc
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user