mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
xmonad: removed buildScriptPackages and cleaned up
From the code-review, buildScriptPackages was deemed unnecessary and so has been removed. The ghc package with dependencies was not needed when building without a custom build script so this build dependency has been made contingent on the presence of a custom build script. The install command is used instead of cp and chmod. Finally, an example has been added for the documentation.
This commit is contained in:
committed by
Matthieu Coudron
parent
0d3183953c
commit
93da26b426
@@ -119,12 +119,13 @@ in
|
||||
description = ''
|
||||
Build script for your xmonad configuration.
|
||||
'';
|
||||
};
|
||||
buildScriptPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra packages needed to run the build script.
|
||||
example = literalExpression ''
|
||||
pkgs.writeText "build" '''
|
||||
#!/bin/sh
|
||||
|
||||
# Enable -threaded
|
||||
ghc --make xmonad.hs -threaded -i -ilib -fforce-recomp -main-is main -v0 -O2 -o "$1"
|
||||
'''
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -144,9 +145,10 @@ in
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
xmonad
|
||||
ghc-builder
|
||||
]
|
||||
++ cfg.buildScriptPackages;
|
||||
++ lib.optional (cfg.buildScript != null) [
|
||||
ghc-builder
|
||||
];
|
||||
}
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
@@ -159,7 +161,7 @@ in
|
||||
|
||||
cp ${cfg.config} xmonad-config/xmonad.hs
|
||||
${lib.optionalString (cfg.buildScript != null) ''
|
||||
cp ${cfg.buildScript} xmonad-config/build && chmod +x xmonad-config/build
|
||||
install -m 555 ${cfg.buildScript} xmonad-config/build
|
||||
''}
|
||||
declare -A libFiles
|
||||
libFiles=(${
|
||||
|
||||
Reference in New Issue
Block a user