Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into staging
- Loading branch information
Showing
122 changed files
with
2,822 additions
and
1,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ config, pkgs, lib, ... }: | ||
|
||
with lib; | ||
let | ||
cfg = config.programs.ccache; | ||
in { | ||
options.programs.ccache = { | ||
# host configuration | ||
enable = mkEnableOption "CCache"; | ||
cacheDir = mkOption { | ||
type = types.path; | ||
description = "CCache directory"; | ||
default = "/var/cache/ccache"; | ||
}; | ||
# target configuration | ||
packageNames = mkOption { | ||
type = types.listOf types.str; | ||
description = "Nix top-level packages to be compiled using CCache"; | ||
default = []; | ||
example = [ "wxGTK30" "qt48" "ffmpeg_3_3" "libav_all" ]; | ||
}; | ||
}; | ||
|
||
config = mkMerge [ | ||
# host configuration | ||
(mkIf cfg.enable { | ||
systemd.tmpfiles.rules = [ "d ${cfg.cacheDir} 0770 root nixbld -" ]; | ||
|
||
# "nix-ccache --show-stats" and "nix-ccache --clear" | ||
security.wrappers.nix-ccache = { | ||
group = "nixbld"; | ||
setgid = true; | ||
source = pkgs.writeScript "nix-ccache.pl" '' | ||
#!${pkgs.perl}/bin/perl | ||
%ENV=( CCACHE_DIR => '${cfg.cacheDir}' ); | ||
sub untaint { | ||
my $v = shift; | ||
return '-C' if $v eq '-C' || $v eq '--clear'; | ||
return '-V' if $v eq '-V' || $v eq '--version'; | ||
return '-s' if $v eq '-s' || $v eq '--show-stats'; | ||
return '-z' if $v eq '-z' || $v eq '--zero-stats'; | ||
exec('${pkgs.ccache}/bin/ccache', '-h'); | ||
} | ||
exec('${pkgs.ccache}/bin/ccache', map { untaint $_ } @ARGV); | ||
''; | ||
}; | ||
}) | ||
|
||
# target configuration | ||
(mkIf (cfg.packageNames != []) { | ||
nixpkgs.overlays = [ | ||
(self: super: genAttrs cfg.packageNames (pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; })) | ||
|
||
(self: super: { | ||
ccacheWrapper = super.ccacheWrapper.override { | ||
extraConfig = '' | ||
export CCACHE_COMPRESS=1 | ||
export CCACHE_DIR="${cfg.cacheDir}" | ||
export CCACHE_UMASK=007 | ||
if [ ! -d "$CCACHE_DIR" ]; then | ||
echo "=====" | ||
echo "Directory '$CCACHE_DIR' does not exist" | ||
echo "Please create it with:" | ||
echo " sudo mkdir -m0770 '$CCACHE_DIR'" | ||
echo " sudo chown root:nixbld '$CCACHE_DIR'" | ||
echo "=====" | ||
exit 1 | ||
fi | ||
if [ ! -w "$CCACHE_DIR" ]; then | ||
echo "=====" | ||
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)" | ||
echo "Please verify its access permissions" | ||
echo "=====" | ||
exit 1 | ||
fi | ||
''; | ||
}; | ||
}) | ||
]; | ||
}) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ config, pkgs, lib, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.programs.rootston; | ||
|
||
rootstonWrapped = pkgs.writeScriptBin "rootston" '' | ||
#! ${pkgs.stdenv.shell} | ||
if [[ "$#" -ge 1 ]]; then | ||
exec ${pkgs.rootston}/bin/rootston "$@" | ||
else | ||
exec ${pkgs.rootston}/bin/rootston -C ${cfg.configFile} | ||
fi | ||
''; | ||
in { | ||
options.programs.rootston = { | ||
enable = mkEnableOption '' | ||
rootston, the reference compositor for wlroots. The purpose of rootston | ||
is to test and demonstrate the features of wlroots (if you want a real | ||
Wayland compositor you should e.g. use Sway instead). You can manually | ||
start the compositor by running "rootston" from a terminal''; | ||
|
||
extraPackages = mkOption { | ||
type = with types; listOf package; | ||
default = with pkgs; [ | ||
xwayland rxvt_unicode dmenu | ||
]; | ||
defaultText = literalExample '' | ||
with pkgs; [ | ||
xwayland dmenu rxvt_unicode | ||
] | ||
''; | ||
example = literalExample "[ ]"; | ||
description = '' | ||
Extra packages to be installed system wide. | ||
''; | ||
}; | ||
|
||
config = mkOption { | ||
type = types.str; | ||
default = '' | ||
[keyboard] | ||
meta-key = Logo | ||
# Sway/i3 like Keybindings | ||
# Maps key combinations with commands to execute | ||
# Commands include: | ||
# - "exit" to stop the compositor | ||
# - "exec" to execute a shell command | ||
# - "close" to close the current view | ||
# - "next_window" to cycle through windows | ||
[bindings] | ||
Logo+Shift+e = exit | ||
Logo+q = close | ||
Logo+m = maximize | ||
Alt+Tab = next_window | ||
Logo+Return = exec urxvt | ||
# Note: Dmenu will only work properly while e.g. urxvt is running. | ||
Logo+d = exec dmenu_run | ||
''; | ||
description = '' | ||
Default configuration for rootston (used when called without any | ||
parameters). | ||
''; | ||
}; | ||
|
||
configFile = mkOption { | ||
type = types.path; | ||
default = "/etc/rootston.ini"; | ||
example = literalExample "${pkgs.rootston}/etc/rootston.ini"; | ||
description = '' | ||
Path to the default rootston configuration file (the "config" option | ||
will have no effect if you change the path). | ||
''; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.etc."rootston.ini".text = cfg.config; | ||
environment.systemPackages = [ rootstonWrapped ] ++ cfg.extraPackages; | ||
|
||
hardware.opengl.enable = mkDefault true; | ||
fonts.enableDefaultFonts = mkDefault true; | ||
}; | ||
|
||
meta.maintainers = with lib.maintainers; [ primeos ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.