style: format entire depot with nixpkgs-fmt

This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-01-30 19:06:58 +03:00 committed by tazjin
parent 2d10d60fac
commit aa122cbae7
310 changed files with 7278 additions and 5490 deletions

View file

@ -1,4 +1,4 @@
with (import ../../.. {}).third_party.nixpkgs;
with (import ../../.. { }).third_party.nixpkgs;
mkShell {
buildInputs = [

View file

@ -1,2 +1,2 @@
let depot = import ../../.. {};
let depot = import ../../.. { };
in depot.third_party.nixpkgs

View file

@ -8,27 +8,28 @@ let
deps = import ./deps.nix {
inherit (pkgs) fetchMavenArtifact fetchgit lib;
};
in rec {
in
rec {
meta.targets = [
"db-util"
"server"
"tf"
];
depsPaths = deps.makePaths {};
depsPaths = deps.makePaths { };
resources = builtins.filterSource (_: type: type != "symlink") ./resources;
classpath.dev = concatStringsSep ":" (
(map gitignoreSource [./src ./test ./env/dev]) ++ [resources] ++ depsPaths
(map gitignoreSource [ ./src ./test ./env/dev ]) ++ [ resources ] ++ depsPaths
);
classpath.test = concatStringsSep ":" (
(map gitignoreSource [./src ./test ./env/test]) ++ [resources] ++ depsPaths
(map gitignoreSource [ ./src ./test ./env/test ]) ++ [ resources ] ++ depsPaths
);
classpath.prod = concatStringsSep ":" (
(map gitignoreSource [./src ./env/prod]) ++ [resources] ++ depsPaths
(map gitignoreSource [ ./src ./env/prod ]) ++ [ resources ] ++ depsPaths
);
testClojure = pkgs.writeShellScript "test-clojure" ''

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,8 @@
let
bbbg = depot.users.grfn.bbbg;
cfg = config.services.bbbg;
in {
in
{
options = with lib; {
services.bbbg = {
enable = mkEnableOption "BBBG Server";
@ -81,9 +82,9 @@ in {
description = "Run database migrations for BBBG";
wantedBy = [ "bbbg-server.service" ];
after = ([ "network.target" ]
++ (if cfg.database.enable
then ["postgresql.service"]
else []));
++ (if cfg.database.enable
then [ "postgresql.service" ]
else [ ]));
serviceConfig = {
Type = "oneshot";

View file

@ -1,5 +1,5 @@
let
depot = import ../../.. {};
depot = import ../../.. { };
in
with depot.third_party.nixpkgs;

View file

@ -3,14 +3,17 @@
let
inherit (depot.users.grfn)
terraform
;
;
in terraform.workspace "bbbg" {
in
terraform.workspace "bbbg"
{
plugins = (p: with p; [
aws
cloudflare
]);
} {
}
{
machine = terraform.nixosMachine {
name = "bbbg";
instanceType = "t3a.small";
@ -52,8 +55,8 @@ in terraform.workspace "bbbg" {
};
security.sudo.extraRules = [{
groups = ["wheel"];
commands = [{ command = "ALL"; options = ["NOPASSWD"]; }];
groups = [ "wheel" ];
commands = [{ command = "ALL"; options = [ "NOPASSWD" ]; }];
}];
nix.gc = {

View file

@ -6,13 +6,14 @@ let
bucket = "s3://gws.fyi";
distributionID = "E2ST43JNBH8C64";
css = runCommand "main.css" {
buildInputs = [ pkgs.minify ];
} ''
css = runCommand "main.css"
{
buildInputs = [ pkgs.minify ];
} ''
minify --type css < ${./main.css} > $out
'';
keys = runCommand "ssh-keys" {} ''
keys = runCommand "ssh-keys" { } ''
touch $out
echo "${depot.users.grfn.keys.main}" >> $out
'';
@ -27,7 +28,8 @@ let
cp ${keys} $out/keys
'';
in (writeShellScript "deploy.sh" ''
in
(writeShellScript "deploy.sh" ''
${awscli2}/bin/aws --profile personal s3 sync ${website}/ ${bucket}
echo "Deployed to http://gws.fyi"
'') // {

View file

@ -25,15 +25,16 @@ let
outName =
if isNull headline
then
let bn = builtins.baseNameOf src;
filename = elemAt (splitString "." bn) 0;
let
bn = builtins.baseNameOf src;
filename = elemAt (splitString "." bn) 0;
in
if depot.nix.utils.isDirectory src
then filename
else filename + ".html"
if depot.nix.utils.isDirectory src
then filename
else filename + ".html"
else "${filename}-${replaceStrings [" "] ["-"] filename}.html";
escapeDoubleQuotes = replaceStrings ["\""] ["\\\""];
escapeDoubleQuotes = replaceStrings [ "\"" ] [ "\\\"" ];
navToHeadline = optionalString (! isNull headline) ''
(search-forward "${escapeDoubleQuotes headline}")

View file

@ -1,4 +1,4 @@
args@{ pkgs ? import <nixpkgs> {}, ... }:
args@{ pkgs ? import <nixpkgs> { }, ... }:
let

View file

@ -2,31 +2,34 @@
with pkgs.lib;
pkgs.runCommandNoCC "resume.pdf" {
buildInputs = [(pkgs.texlive.combine {
inherit (pkgs.texlive)
capt-of
collection-fontsrecommended
enumitem
etoolbox
fancyvrb
float
fncychap
framed
l3packages
microtype
needspace
parskip
scheme-basic
tabulary
titlesec
ulem
upquote
varwidth
wrapfig
xcolor
;
})];
pkgs.runCommandNoCC "resume.pdf"
{
buildInputs = [
(pkgs.texlive.combine {
inherit (pkgs.texlive)
capt-of
collection-fontsrecommended
enumitem
etoolbox
fancyvrb
float
fncychap
framed
l3packages
microtype
needspace
parskip
scheme-basic
tabulary
titlesec
ulem
upquote
varwidth
wrapfig
xcolor
;
})
];
} ''
cp ${builtins.filterSource (path: type:
type == "regular" &&

View file

@ -1,5 +1,5 @@
let
depot = import ../../.. {};
depot = import ../../.. { };
in
depot.third_party.nixpkgs.mkShell {
buildInputs = [

View file

@ -1,18 +1,18 @@
rec {
base03 = "#002B36";
base02 = "#073642";
base01 = "#586e75";
base00 = "#657b83";
base0 = "#839496";
base1 = "#93a1a1";
base2 = "#eee8d5";
base3 = "#fdf6e3";
yellow = "#b58900";
orange = "#cb4b16";
red = "#dc322f";
base03 = "#002B36";
base02 = "#073642";
base01 = "#586e75";
base00 = "#657b83";
base0 = "#839496";
base1 = "#93a1a1";
base2 = "#eee8d5";
base3 = "#fdf6e3";
yellow = "#b58900";
orange = "#cb4b16";
red = "#dc322f";
magenta = "#d33682";
violet = "#6c71c4";
blue = "#268bd2";
cyan = "#2aa198";
green = "#859900";
violet = "#6c71c4";
blue = "#268bd2";
cyan = "#2aa198";
green = "#859900";
}

View file

@ -19,7 +19,8 @@ in
htop
killall
bind
zip unzip
zip
unzip
tree
ncat
bc

View file

@ -58,10 +58,10 @@ in
RemainAfterExit = true;
ExecStart = (
"${pkgs.xorg.setxkbmap}/bin/setxkbmap "
+ "-device ${laptopKeyboardId} "
+ "-option caps:swapescape "
+ "-option compose:ralt "
+ "-option altwin:swap_alt_win"
+ "-device ${laptopKeyboardId} "
+ "-option caps:swapescape "
+ "-option compose:ralt "
+ "-option altwin:swap_alt_win"
);
};
};

View file

@ -10,30 +10,30 @@
xdg.configFile."alsi/alsi.conf" = {
force = true;
text = ''
#!${pkgs.perl}/bin/perl
#!${pkgs.perl}/bin/perl
scalar {
ALSI_VERSION => "0.4.8",
COLORS_FILE => "/home/grfn/.config/alsi/alsi.colors",
DE_FILE => "/home/grfn/.config/alsi/alsi.de",
DEFAULT_COLOR_BOLD => "blue",
DEFAULT_COLOR_NORMAL => "blue",
DF_COMMAND => "df -Th -x sys -x tmpfs -x devtmpfs &>/dev/stdout",
GTK2_RC_FILE => "/home/grfn/.gtkrc-2.0",
GTK3_RC_FILE => "/home/grfn/.config/gtk-3.0/settings.ini",
LOGO_FILE => "/home/grfn/.config/alsi/alsi.logo",
OUTPUT_FILE => "/home/grfn/.config/alsi/alsi.output",
# PACKAGES_PATH => "/var/lib/pacman/local/",
PS_COMMAND => "ps -A",
USAGE_COLORS => 0,
USAGE_COLORS_BOLD => 0,
USAGE_PRECENT_GREEN => 50,
USAGE_PRECENT_RED => 100,
USAGE_PRECENT_YELLOW => 85,
USE_LOGO_FROM_FILE => 1,
USE_VALUES_COLOR => 0,
WM_FILE => "/home/grfn/.config/alsi/alsi.wm",
}
scalar {
ALSI_VERSION => "0.4.8",
COLORS_FILE => "/home/grfn/.config/alsi/alsi.colors",
DE_FILE => "/home/grfn/.config/alsi/alsi.de",
DEFAULT_COLOR_BOLD => "blue",
DEFAULT_COLOR_NORMAL => "blue",
DF_COMMAND => "df -Th -x sys -x tmpfs -x devtmpfs &>/dev/stdout",
GTK2_RC_FILE => "/home/grfn/.gtkrc-2.0",
GTK3_RC_FILE => "/home/grfn/.config/gtk-3.0/settings.ini",
LOGO_FILE => "/home/grfn/.config/alsi/alsi.logo",
OUTPUT_FILE => "/home/grfn/.config/alsi/alsi.output",
# PACKAGES_PATH => "/var/lib/pacman/local/",
PS_COMMAND => "ps -A",
USAGE_COLORS => 0,
USAGE_COLORS_BOLD => 0,
USAGE_PRECENT_GREEN => 50,
USAGE_PRECENT_RED => 100,
USAGE_PRECENT_YELLOW => 85,
USE_LOGO_FROM_FILE => 1,
USE_VALUES_COLOR => 0,
WM_FILE => "/home/grfn/.config/alsi/alsi.wm",
}
'';
};

View file

@ -28,7 +28,8 @@
htop
killall
bind
zip unzip
zip
unzip
tree
ncat
bc

View file

@ -2,12 +2,14 @@
let
clj2nix = pkgs.callPackage (pkgs.fetchFromGitHub {
owner = "hlolli";
repo = "clj2nix";
rev = "3ab3480a25e850b35d1f532a5e4e7b3202232383";
sha256 = "1lry026mlpxp1j563qs13nhxf37i2zpl7lh0lgfdwc44afybqka6";
}) {};
clj2nix = pkgs.callPackage
(pkgs.fetchFromGitHub {
owner = "hlolli";
repo = "clj2nix";
rev = "3ab3480a25e850b35d1f532a5e4e7b3202232383";
sha256 = "1lry026mlpxp1j563qs13nhxf37i2zpl7lh0lgfdwc44afybqka6";
})
{ };
pg-dump-upsert = pkgs.buildGoModule rec {
pname = "pg-dump-upsert";
@ -87,7 +89,7 @@ with lib;
enable = true;
package = pkgs.gitFull;
userEmail = "root@gws.fyi";
userName = "Griffin Smith";
userName = "Griffin Smith";
ignores = [
"*.sw*"
".classpath"
@ -206,7 +208,7 @@ with lib;
functions = {
gdelmerged = ''
git branch --merged | egrep -v 'master' | tr -d '+ ' | xargs git branch -d
git branch --merged | egrep -v 'master' | tr -d '+ ' | xargs git branch -d
'';
};
};

View file

@ -16,7 +16,7 @@
"kpa" = "kubectl get pods --all-namespaces";
"klf" = "kubectl logs -f";
"kdep" = "kubectl get deployments";
"ked" = "kubectl edit deployment";
"ked" = "kubectl edit deployment";
"kpw" = "kubectl get pods -w";
"kew" = "kubectl get events -w";
"kdel" = "kubectl delete";

View file

@ -3,16 +3,17 @@
with lib;
let
# doom-emacs = pkgs.callPackage (builtins.fetchTarball {
# url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz;
# }) {
# doomPrivateDir = ./doom.d; # Directory containing your config.el init.el
# # and packages.el files
# };
# doom-emacs = pkgs.callPackage (builtins.fetchTarball {
# url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz;
# }) {
# doomPrivateDir = ./doom.d; # Directory containing your config.el init.el
# # and packages.el files
# };
depot = config.lib.depot;
in {
in
{
imports = [
./lib/cloneRepo.nix
];
@ -47,7 +48,7 @@ in {
upquote
varwidth
wrapfig
;
;
})
ispell
@ -82,14 +83,14 @@ in {
doomEmacs = {
github = "hlissner/doom-emacs";
path = ".emacs.d";
after = ["emacs.d"];
after = [ "emacs.d" ];
onClone = "bin/doom install";
};
"emacs.d" = {
github = "glittershark/emacs.d";
path = ".doom.d";
after = ["orgClubhouse"];
after = [ "orgClubhouse" ];
};
};

View file

@ -9,7 +9,8 @@ let
let
good = upperChars ++ lowerChars ++ stringToCharacters "0123456789-_";
subst = c: if any (x: x == c) good then c else "-";
in stringAsChars subst name;
in
stringAsChars subst name;
accounts = {
personal = {
@ -26,7 +27,8 @@ let
};
in {
in
{
programs.lieer.enable = true;
programs.notmuch.enable = true;
services.lieer.enable = true;
@ -37,16 +39,18 @@ in {
msmtp
];
systemd.user.services = mapAttrs' (name: account: {
name = escapeUnitName "lieer-${name}";
value.Service = {
ExecStart = mkForce "${pkgs.writeShellScript "sync-${name}" ''
systemd.user.services = mapAttrs'
(name: account: {
name = escapeUnitName "lieer-${name}";
value.Service = {
ExecStart = mkForce "${pkgs.writeShellScript "sync-${name}" ''
${pkgs.gmailieer}/bin/gmi sync --path ~/mail/${name}
''}";
Environment = "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}";
};
Environment = "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}";
};
}) accounts;
})
accounts;
# xdg.configFile."notifymuch/notifymuch.cfg".text = generators.toINI {} {
# notifymuch = {
@ -58,30 +62,32 @@ in {
# };
accounts.email.maildirBasePath = "mail";
accounts.email.accounts = mapAttrs (_: params@{ passEntry, ... }: {
realName = "Griffin Smith";
passwordCommand = "pass ${passEntry}";
accounts.email.accounts = mapAttrs
(_: params@{ passEntry, ... }: {
realName = "Griffin Smith";
passwordCommand = "pass ${passEntry}";
flavor = "gmail.com";
flavor = "gmail.com";
imapnotify = {
enable = true;
boxes = [ "Inbox" ];
};
gpg = {
key = "0F11A989879E8BBBFDC1E23644EF5B5E861C09A7";
signByDefault = true;
};
notmuch.enable = true;
lieer = {
enable = true;
sync = {
imapnotify = {
enable = true;
frequency = "*:*";
boxes = [ "Inbox" ];
};
};
msmtp.enable = true;
} // builtins.removeAttrs params ["passEntry"]) accounts;
gpg = {
key = "0F11A989879E8BBBFDC1E23644EF5B5E861C09A7";
signByDefault = true;
};
notmuch.enable = true;
lieer = {
enable = true;
sync = {
enable = true;
frequency = "*:*";
};
};
msmtp.enable = true;
} // builtins.removeAttrs params [ "passEntry" ])
accounts;
}

View file

@ -13,14 +13,14 @@ let
enableFPS = true;
});
init = runCommand "init.txt" {} ''
init = runCommand "init.txt" { } ''
substitute "${df-orig}/data/init/init.txt" $out \
--replace "[INTRO:YES]" "[INTRO:NO]" \
--replace "[VOLUME:255]" "[VOLUME:0]" \
--replace "[FPS:NO]" "[FPS:YES]"
'';
d_init = runCommand "d_init.txt" {} ''
d_init = runCommand "d_init.txt" { } ''
substitute "${df-orig}/data/init/d_init.txt" $out \
--replace "[AUTOSAVE:NONE]" "[AUTOSAVE:SEASONAL]" \
--replace "[AUTOSAVE_PAUSE:NO]" "[AUTOSAVE_PAUSE:YES]" \
@ -30,7 +30,7 @@ let
--replace "[SHOW_FLOW_AMOUNTS:NO]" "[SHOW_FLOW_AMOUNTS:YES]"
'';
df = runCommand "dwarf-fortress" {} ''
df = runCommand "dwarf-fortress" { } ''
mkdir -p $out/bin
sed \
-e '4icp -f ${init} "$DF_DIR/data/init/init.txt"' \
@ -43,7 +43,8 @@ let
chmod +x $out/bin/dwarf-fortress
'';
in mkMerge [
in
mkMerge [
{
home.packages = [
crawl

View file

@ -20,7 +20,8 @@ let
inherit (builtins) map;
inherit (lib) mkMerge range;
in {
in
{
options = with lib; {
system.machine.wirelessInterface = mkOption {
description = ''
@ -77,50 +78,51 @@ in {
"move container to workspace ${toString n}";
})
(range 0 9))
++ [(rec {
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
"${mod}+semicolon" = "focus parent";
++ [
(rec {
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
"${mod}+semicolon" = "focus parent";
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
"${mod}+Shift+x" = "kill";
"${mod}+Shift+x" = "kill";
"${mod}+Return" = "exec alacritty";
"${mod}+Return" = "exec alacritty";
"${mod}+Shift+s" = "split h";
"${mod}+Shift+v" = "split v";
"${mod}+e" = "layout toggle split";
"${mod}+w" = "layout tabbed";
"${mod}+s" = "layout stacking";
"${mod}+Shift+s" = "split h";
"${mod}+Shift+v" = "split v";
"${mod}+e" = "layout toggle split";
"${mod}+w" = "layout tabbed";
"${mod}+s" = "layout stacking";
"${mod}+f" = "fullscreen";
"${mod}+f" = "fullscreen";
"${mod}+Shift+r" = "restart";
"${mod}+Shift+r" = "restart";
"${mod}+r" = "mode resize";
"${mod}+r" = "mode resize";
# Marks
"${mod}+Shift+m" = ''exec i3-input -F "mark %s" -l 1 -P 'Mark: ' '';
"${mod}+m" = ''exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Go to: ' '';
# Marks
"${mod}+Shift+m" = ''exec i3-input -F "mark %s" -l 1 -P 'Mark: ' '';
"${mod}+m" = ''exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Go to: ' '';
# Screenshots
"${mod}+q" = "exec \"maim | xclip -selection clipboard -t image/png\"";
"${mod}+Shift+q" = "exec \"maim -s | xclip -selection clipboard -t image/png\"";
"${mod}+Ctrl+q" = "exec ${pkgs.writeShellScript "peek.sh" ''
# Screenshots
"${mod}+q" = "exec \"maim | xclip -selection clipboard -t image/png\"";
"${mod}+Shift+q" = "exec \"maim -s | xclip -selection clipboard -t image/png\"";
"${mod}+Ctrl+q" = "exec ${pkgs.writeShellScript "peek.sh" ''
${pkgs.picom}/bin/picom &
picom_pid=$!
${pkgs.peek}/bin/peek || true
kill -SIGINT $picom_pid
''}";
# Launching applications
"${mod}+u" = "exec ${pkgs.writeShellScript "rofi" ''
# Launching applications
"${mod}+u" = "exec ${pkgs.writeShellScript "rofi" ''
rofi \
-modi 'combi' \
-combi-modi "window,drun,ssh,run" \
@ -128,49 +130,51 @@ in {
-show combi
''}";
# Passwords
"${mod}+p" = "exec rofi-pass -font '${decorationFont}'";
# Passwords
"${mod}+p" = "exec rofi-pass -font '${decorationFont}'";
# Media
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
"XF86AudioRaiseVolume" = "exec pulseaudio-ctl up";
"XF86AudioLowerVolume" = "exec pulseaudio-ctl down";
"XF86AudioMute" = "exec pulseaudio-ctl mute";
# Media
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
"XF86AudioRaiseVolume" = "exec pulseaudio-ctl up";
"XF86AudioLowerVolume" = "exec pulseaudio-ctl down";
"XF86AudioMute" = "exec pulseaudio-ctl mute";
# Lock
Pause = "exec lock";
# Lock
Pause = "exec lock";
# Brightness
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%-";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%+";
# Brightness
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%-";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%+";
# Sleep/hibernate
# "${mod}+Escape" = "exec systemctl suspend";
# "${mod}+Shift+Escape" = "exec systemctl hibernate";
# Sleep/hibernate
# "${mod}+Escape" = "exec systemctl suspend";
# "${mod}+Shift+Escape" = "exec systemctl hibernate";
# Scratch buffer
"${mod}+minus" = "scratchpad show";
"${mod}+Shift+minus" = "move scratchpad";
"${mod}+space" = "focus mode_toggle";
"${mod}+Shift+space" = "floating toggle";
# Scratch buffer
"${mod}+minus" = "scratchpad show";
"${mod}+Shift+minus" = "move scratchpad";
"${mod}+space" = "focus mode_toggle";
"${mod}+Shift+space" = "floating toggle";
# Screen Layout
"${mod}+Shift+t" = "exec xrandr --auto";
"${mod}+t" = "exec ${screenlayout.home}";
"${mod}+Ctrl+t" = "exec ${pkgs.writeShellScript "fix_term.sh" ''
# Screen Layout
"${mod}+Shift+t" = "exec xrandr --auto";
"${mod}+t" = "exec ${screenlayout.home}";
"${mod}+Ctrl+t" = "exec ${pkgs.writeShellScript "fix_term.sh" ''
xrandr --output eDP-1 --off && ${screenlayout.home}
''}";
# Notifications
"${mod}+Shift+n" = "exec killall -SIGUSR1 .dunst-wrapped";
"${mod}+n" = "exec killall -SIGUSR2 .dunst-wrapped";
"Control+space" = "exec ${pkgs.dunst}/bin/dunstctl close";
"Control+Shift+space" = "exec ${pkgs.dunst}/bin/dunstctl close-all";
"Control+grave" = "exec ${pkgs.dunst}/bin/dunstctl history-pop";
"Control+Shift+period" = "exec ${pkgs.dunst}/bin/dunstctl action";
})]);
# Notifications
"${mod}+Shift+n" = "exec killall -SIGUSR1 .dunst-wrapped";
"${mod}+n" = "exec killall -SIGUSR2 .dunst-wrapped";
"Control+space" = "exec ${pkgs.dunst}/bin/dunstctl close";
"Control+Shift+space" = "exec ${pkgs.dunst}/bin/dunstctl close-all";
"Control+grave" = "exec ${pkgs.dunst}/bin/dunstctl history-pop";
"Control+Shift+period" = "exec ${pkgs.dunst}/bin/dunstctl action";
})
]
);
fonts = [ decorationFont ];
@ -202,94 +206,96 @@ in {
bars = [{
statusCommand =
let i3status-conf = pkgs.writeText "i3status.conf" ''
general {
output_format = i3bar
colors = true
color_good = "#859900"
let
i3status-conf = pkgs.writeText "i3status.conf" ''
general {
output_format = i3bar
colors = true
color_good = "#859900"
interval = 1
}
interval = 1
}
order += "external_script current_task"
order += "external_script inbox"
order += "spotify"
order += "volume_status"
order += "wireless ${config.system.machine.wirelessInterface}"
# order += "ethernet enp3s0f0"
order += "cpu_usage"
order += "battery 0"
# order += "volume master"
order += "time"
order += "tztime utc"
order += "external_script current_task"
order += "external_script inbox"
order += "spotify"
order += "volume_status"
order += "wireless ${config.system.machine.wirelessInterface}"
# order += "ethernet enp3s0f0"
order += "cpu_usage"
order += "battery 0"
# order += "volume master"
order += "time"
order += "tztime utc"
mpd {
format = "%artist - %album - %title"
}
mpd {
format = "%artist - %album - %title"
}
wireless ${config.system.machine.wirelessInterface} {
format_up = "W: (%quality - %essid - %bitrate) %ip"
format_down = "W: -"
}
wireless ${config.system.machine.wirelessInterface} {
format_up = "W: (%quality - %essid - %bitrate) %ip"
format_down = "W: -"
}
ethernet enp3s0f0 {
format_up = "E: %ip"
format_down = "E: -"
}
ethernet enp3s0f0 {
format_up = "E: %ip"
format_down = "E: -"
}
battery 0 {
format = "%status %percentage"
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
}
battery 0 {
format = "%status %percentage"
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
}
cpu_usage {
format = "CPU: %usage"
}
cpu_usage {
format = "CPU: %usage"
}
load {
format = "%5min"
}
load {
format = "%5min"
}
time {
format = " %a %h %d %I:%M "
}
time {
format = " %a %h %d %I:%M "
}
spotify {
color_playing = "#fdf6e3"
color_paused = "#93a1a1"
format_stopped = ""
format_down = ""
format = "{title} - {artist} ({album})"
}
spotify {
color_playing = "#fdf6e3"
color_paused = "#93a1a1"
format_stopped = ""
format_down = ""
format = "{title} - {artist} ({album})"
}
external_script inbox {
script_path = '${emacsclient "(grfn/num-inbox-items-message)"}'
format = 'Inbox: {output}'
cache_timeout = 120
color = "#93a1a1"
}
external_script inbox {
script_path = '${emacsclient "(grfn/num-inbox-items-message)"}'
format = 'Inbox: {output}'
cache_timeout = 120
color = "#93a1a1"
}
external_script current_task {
script_path = '${emacsclient "(grfn/org-current-clocked-in-task-message)"}'
# format = '{output}'
cache_timeout = 60
color = "#93a1a1"
}
external_script current_task {
script_path = '${emacsclient "(grfn/org-current-clocked-in-task-message)"}'
# format = '{output}'
cache_timeout = 60
color = "#93a1a1"
}
tztime utc {
timezone = "UTC"
format = " %H·%M "
}
tztime utc {
timezone = "UTC"
format = " %H·%M "
}
volume_status {
format = " {percentage}"
format_muted = " X"
# device = "default"
# mixer_idx = 0
}
'';
in "py3status -c ${i3status-conf}";
volume_status {
format = " {percentage}"
format_muted = " X"
# device = "default"
# mixer_idx = 0
}
'';
in
"py3status -c ${i3status-conf}";
fonts = [ decorationFont ];
position = "top";
colors = with solarized; rec {
@ -362,5 +368,5 @@ in {
iconTheme.name = "Adwaita";
theme.name = "Adwaita";
};
};
};
}

View file

@ -4,44 +4,46 @@ with lib;
options = {
grfn.impure.clonedRepos = mkOption {
description = "Repositories to clone";
default = {};
default = { };
type = with types; loaOf (
let sm = submodule {
options = {
url = mkOption {
type = nullOr str;
description = "URL of repository to clone";
default = null;
};
let
sm = submodule {
options = {
url = mkOption {
type = nullOr str;
description = "URL of repository to clone";
default = null;
};
github = mkOption {
type = nullOr str;
description = "Github owner/repo of repository to clone";
default = null;
};
github = mkOption {
type = nullOr str;
description = "Github owner/repo of repository to clone";
default = null;
};
path = mkOption {
type = str;
description = "Path to clone to";
};
path = mkOption {
type = str;
description = "Path to clone to";
};
onClone = mkOption {
type = str;
description = ''
Shell command to run after cloning the repo for the first time.
Runs inside the repo itself.
'';
default = "";
};
onClone = mkOption {
type = str;
description = ''
Shell command to run after cloning the repo for the first time.
Runs inside the repo itself.
'';
default = "";
};
after = mkOption {
type = listOf str;
description = "Activation hooks that this repository must be cloned after";
default = [];
after = mkOption {
type = listOf str;
description = "Activation hooks that this repository must be cloned after";
default = [ ];
};
};
};
};
in addCheck sm (cr: (! isNull cr.url || ! isNull cr.github))
in
addCheck sm (cr: (! isNull cr.url || ! isNull cr.github))
);
};
};
@ -49,19 +51,23 @@ with lib;
config = {
home.activation =
mapAttrs
(_: {
url, path, github, onClone, after, ...
}:
let repoURL = if isNull url then "git@github.com:${github}" else url;
in hm.dag.entryAfter (["writeBoundary"] ++ after) ''
$DRY_RUN_CMD mkdir -p $(dirname "${path}")
if [[ ! -d ${path} ]]; then
$DRY_RUN_CMD git clone "${repoURL}" "${path}"
pushd ${path}
$DRY_RUN_CMD ${onClone}
popd
fi
'')
config.grfn.impure.clonedRepos;
(_: { url
, path
, github
, onClone
, after
, ...
}:
let repoURL = if isNull url then "git@github.com:${github}" else url;
in hm.dag.entryAfter ([ "writeBoundary" ] ++ after) ''
$DRY_RUN_CMD mkdir -p $(dirname "${path}")
if [[ ! -d ${path} ]]; then
$DRY_RUN_CMD git clone "${repoURL}" "${path}"
pushd ${path}
$DRY_RUN_CMD ${onClone}
popd
fi
'')
config.grfn.impure.clonedRepos;
};
}

View file

@ -6,16 +6,18 @@ with lib;
options = {
programs.zsh.functions = mkOption {
description = "An attribute set that maps function names to their source";
default = {};
default = { };
type = with types; attrsOf (either str path);
};
};
config.programs.zsh.initExtra = concatStringsSep "\n" (
mapAttrsToList (name: funSrc: ''
function ${name}() {
${funSrc}
}
'') config.programs.zsh.functions
mapAttrsToList
(name: funSrc: ''
function ${name}() {
${funSrc}
}
'')
config.programs.zsh.functions
);
}

View file

@ -19,7 +19,9 @@ let
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libtool autoconf automake
libtool
autoconf
automake
x11
xorg.libXtst
xorg.libXinerama

View file

@ -2,12 +2,14 @@
let
nixpkgs-gnuradio = import (pkgs.fetchFromGitHub {
owner = "doronbehar";
repo = "nixpkgs";
rev = "712561aa5f10bfe6112a1726a912585612a70d1f";
sha256 = "04yqflbwjcfl9vlplphpj82csqqz9k6m3nj1ybhwgmsc4by7vivl";
}) {};
nixpkgs-gnuradio = import
(pkgs.fetchFromGitHub {
owner = "doronbehar";
repo = "nixpkgs";
rev = "712561aa5f10bfe6112a1726a912585612a70d1f";
sha256 = "04yqflbwjcfl9vlplphpj82csqqz9k6m3nj1ybhwgmsc4by7vivl";
})
{ };
in

View file

@ -30,7 +30,7 @@ let
# Directories
stck = "dirs -v";
b= "cd ~1";
b = "cd ~1";
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
@ -63,7 +63,8 @@ let
"ll" = "ls -al";
"la" = "ls -a";
};
in {
in
{
home.packages = with pkgs; [
zsh
autojump

View file

@ -6,59 +6,59 @@
];
home.file.".tarsnaprc".text = ''
### Recommended options
### Recommended options
# Tarsnap cache directory
cachedir /home/grfn/.cache/tarsnap
# Tarsnap cache directory
cachedir /home/grfn/.cache/tarsnap
# Tarsnap key file
keyfile /home/grfn/.private/tarsnap.key
# Tarsnap key file
keyfile /home/grfn/.private/tarsnap.key
# Don't archive files which have the nodump flag set.
nodump
# Don't archive files which have the nodump flag set.
nodump
# Print statistics when creating or deleting archives.
print-stats
# Print statistics when creating or deleting archives.
print-stats
# Create a checkpoint once per GB of uploaded data.
checkpoint-bytes 1G
# Create a checkpoint once per GB of uploaded data.
checkpoint-bytes 1G
### Commonly useful options
### Commonly useful options
# Use SI prefixes to make numbers printed by --print-stats more readable.
humanize-numbers
# Use SI prefixes to make numbers printed by --print-stats more readable.
humanize-numbers
### Other options, not applicable to most systems
### Other options, not applicable to most systems
# Aggressive network behaviour: Use multiple TCP connections when
# writing archives. Use of this option is recommended only in
# cases where TCP congestion control is known to be the limiting
# factor in upload performance.
#aggressive-networking
# Aggressive network behaviour: Use multiple TCP connections when
# writing archives. Use of this option is recommended only in
# cases where TCP congestion control is known to be the limiting
# factor in upload performance.
#aggressive-networking
# Exclude files and directories matching specified patterns.
# Only one file or directory per command; multiple "exclude"
# commands may be given.
#exclude
# Exclude files and directories matching specified patterns.
# Only one file or directory per command; multiple "exclude"
# commands may be given.
#exclude
# Include only files and directories matching specified patterns.
# Only one file or directory per command; multiple "include"
# commands may be given.
#include
# Include only files and directories matching specified patterns.
# Only one file or directory per command; multiple "include"
# commands may be given.
#include
# Attempt to reduce tarsnap memory consumption. This option
# will slow down the process of creating archives, but may help
# on systems where the average size of files being backed up is
# less than 1 MB.
#lowmem
# Attempt to reduce tarsnap memory consumption. This option
# will slow down the process of creating archives, but may help
# on systems where the average size of files being backed up is
# less than 1 MB.
#lowmem
# Try even harder to reduce tarsnap memory consumption. This can
# significantly slow down tarsnap, but reduces its memory usage
# by an additional factor of 2 beyond what the lowmem option does.
#verylowmem
# Try even harder to reduce tarsnap memory consumption. This can
# significantly slow down tarsnap, but reduces its memory usage
# by an additional factor of 2 beyond what the lowmem option does.
#verylowmem
# Snapshot time. Use this option if you are backing up files
# from a filesystem snapshot rather than from a "live" filesystem.
#snaptime <file>
# Snapshot time. Use this option if you are backing up files
# from a filesystem snapshot rather than from a "live" filesystem.
#snaptime <file>
'';
}

View file

@ -10,7 +10,7 @@ with lib;
pinentry_mac
];
home.activation.linkApplications = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.linkApplications = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD ln -sf $VERBOSE_ARG \
~/.nix-profile/Applications/* ~/Applications/
'';

View file

@ -12,6 +12,7 @@ let
networking.firewall.enable = false;
networking.wireless.enable = lib.mkForce false;
};
in (depot.third_party.nixos {
in
(depot.third_party.nixos {
inherit configuration;
}).config.system.build.isoImage

View file

@ -23,7 +23,12 @@ with lib;
initrd = {
availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
kernelModules = [
"uas" "usbcore" "usb_storage" "vfat" "nls_cp437" "nls_iso8859_1"
"uas"
"usbcore"
"usb_storage"
"vfat"
"nls_cp437"
"nls_iso8859_1"
];
postDeviceCommands = pkgs.lib.mkBefore ''
@ -60,31 +65,33 @@ with lib;
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
security.sudo.extraRules = [{
groups = ["wheel"];
commands = [{ command = "ALL"; options = ["NOPASSWD"]; }];
groups = [ "wheel" ];
commands = [{ command = "ALL"; options = [ "NOPASSWD" ]; }];
}];
nix.gc.dates = "monthly";
age.secrets = let
secret = name: depot.users.grfn.secrets."${name}.age";
in {
bbbg.file = secret "bbbg";
cloudflare.file = secret "cloudflare";
ddclient-password.file = secret "ddclient-password";
age.secrets =
let
secret = name: depot.users.grfn.secrets."${name}.age";
in
{
bbbg.file = secret "bbbg";
cloudflare.file = secret "cloudflare";
ddclient-password.file = secret "ddclient-password";
buildkite-ssh-key = {
file = secret "buildkite-ssh-key";
group = "keys";
mode = "0440";
};
buildkite-ssh-key = {
file = secret "buildkite-ssh-key";
group = "keys";
mode = "0440";
};
buildkite-token = {
file = secret "buildkite-token";
group = "keys";
mode = "0440";
buildkite-token = {
file = secret "buildkite-token";
group = "keys";
mode = "0440";
};
};
};
services.depot.auto-deploy = {
enable = true;
@ -207,44 +214,49 @@ with lib;
job_name = "node";
scrape_interval = "5s";
static_configs = [{
targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
}];
} {
job_name = "nginx";
scrape_interval = "5s";
static_configs = [{
targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];
}
{
job_name = "nginx";
scrape_interval = "5s";
static_configs = [{
targets = [ "localhost:${toString config.services.prometheus.exporters.nginx.port}" ];
}];
}
{
job_name = "xanthous_server";
scrape_interval = "1s";
static_configs = [{
targets = [ "localhost:${toString config.services.xanthous-server.metricsPort}" ];
}];
}
{
job_name = "blackbox";
metrics_path = "/probe";
params.module = [ "https_2xx" ];
scrape_interval = "5s";
static_configs = [{
targets = [
"https://gws.fyi"
"https://windtunnel.ci"
"https://app.windtunnel.ci"
"https://metrics.gws.fyi"
];
}];
relabel_configs = [{
source_labels = [ "__address__" ];
target_label = "__param_target";
}
{
source_labels = [ "__param_target" ];
target_label = "instance";
}
{
target_label = "__address__";
replacement = "localhost:${toString config.services.prometheus.exporters.blackbox.port}";
}];
}];
} {
job_name = "xanthous_server";
scrape_interval = "1s";
static_configs = [{
targets = ["localhost:${toString config.services.xanthous-server.metricsPort}"];
}];
} {
job_name = "blackbox";
metrics_path = "/probe";
params.module = ["https_2xx"];
scrape_interval = "5s";
static_configs = [{
targets = [
"https://gws.fyi"
"https://windtunnel.ci"
"https://app.windtunnel.ci"
"https://metrics.gws.fyi"
];
}];
relabel_configs = [{
source_labels = ["__address__"];
target_label = "__param_target";
} {
source_labels = ["__param_target"];
target_label = "instance";
} {
target_label = "__address__";
replacement = "localhost:${toString config.services.prometheus.exporters.blackbox.port}";
}];
}];
};
services.xanthous-server.enable = true;
@ -256,21 +268,23 @@ with lib;
virtualisation.docker.enable = true;
services.buildkite-agents = listToAttrs (map (n: rec {
name = "mugwump-${toString n}";
value = {
inherit name;
enable = true;
tokenPath = "/run/agenix/buildkite-agent-token";
privateSshKeyPath = "/run/agenix/buildkite-ssh-key";
runtimePackages = with pkgs; [
docker
nix
gnutar
gzip
];
};
}) (range 1 1));
services.buildkite-agents = listToAttrs (map
(n: rec {
name = "mugwump-${toString n}";
value = {
inherit name;
enable = true;
tokenPath = "/run/agenix/buildkite-agent-token";
privateSshKeyPath = "/run/agenix/buildkite-ssh-key";
runtimePackages = with pkgs; [
docker
nix
gnutar
gzip
];
};
})
(range 1 1));
users.users."buildkite-agent-mugwump-1" = {
isSystemUser = true;

View file

@ -2,7 +2,7 @@
let
depot = import ../../../../.. {};
depot = import ../../../../.. { };
in

View file

@ -7,6 +7,6 @@
twitter-color-emoji
];
fontconfig.defaultFonts.emoji = ["Twitter Color Emoji"];
fontconfig.defaultFonts.emoji = [ "Twitter Color Emoji" ];
};
}

View file

@ -22,11 +22,11 @@ with lib;
config =
let cfg = config.laptop.onLowBattery;
in mkIf cfg.enable {
services.udev.extraRules = concatStrings [
''SUBSYSTEM=="power_supply", ''
''ATTR{status}=="Discharging", ''
''ATTR{capacity}=="[0-${toString cfg.thresholdPercentage}]", ''
''RUN+="${pkgs.systemd}/bin/systemctl ${cfg.action}"''
];
};
services.udev.extraRules = concatStrings [
''SUBSYSTEM=="power_supply", ''
''ATTR{status}=="Discharging", ''
''ATTR{capacity}=="[0-${toString cfg.thresholdPercentage}]", ''
''RUN+="${pkgs.systemd}/bin/systemctl ${cfg.action}"''
];
};
}

View file

@ -8,7 +8,7 @@
sshKey = "/root/.ssh/id_rsa";
system = "x86_64-linux";
maxJobs = 64;
supportedFeatures = ["big-parallel" "kvm" "nixos-test" "benchmark"];
supportedFeatures = [ "big-parallel" "kvm" "nixos-test" "benchmark" ];
}];
extraOptions = ''
@ -29,7 +29,7 @@
};
programs.ssh.knownHosts.whitby = {
hostNames = [ "whitby" "whitby.tvl.fyi" "49.12.129.211"];
hostNames = [ "whitby" "whitby.tvl.fyi" "49.12.129.211" ];
publicKeyFile = pkgs.writeText "whitby.pub" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNh/w4BSKov0jdz3gKBc98tpoLta5bb87fQXWBhAl2I
'';

View file

@ -3,9 +3,10 @@
let
deb = ./kolide.deb;
kolide = pkgs.runCommand "kolide-data" {
buildInputs = [ pkgs.binutils-unwrapped ];
} ''
kolide = pkgs.runCommand "kolide-data"
{
buildInputs = [ pkgs.binutils-unwrapped ];
} ''
cp ${deb} ./kolide.deb
ar x kolide.deb
mkdir result
@ -19,7 +20,8 @@ let
mv result $out
'';
in {
in
{
systemd.services."launcher.kolide-k2" = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "syslog.service" ];

View file

@ -1,20 +1,23 @@
{ pkgs, ... }:
{
provider.aws = map (region: {
inherit region;
alias = region;
profile = "personal";
}) [
provider.aws = map
(region: {
inherit region;
alias = region;
profile = "personal";
}) [
"us-east-1"
"us-east-2"
"us-west-2"
];
data.external.cloudflare_api_key = {
program = [(pkgs.writeShellScript "cloudflare_api_key" ''
jq -n --arg api_key "$(pass cloudflare-api-key)" '{"api_key":$api_key}'
'')];
program = [
(pkgs.writeShellScript "cloudflare_api_key" ''
jq -n --arg api_key "$(pass cloudflare-api-key)" '{"api_key":$api_key}'
'')
];
};
provider.cloudflare = {

View file

@ -9,7 +9,7 @@
, region ? "us-east-2"
, rootVolumeSizeGb ? 50
, securityGroupId ? null
, extraIngressPorts ? []
, extraIngressPorts ? [ ]
}:
let
@ -40,13 +40,14 @@ let
machineResource = "aws_instance.${prefix}machine";
recursiveMerge = builtins.foldl' lib.recursiveUpdate {};
recursiveMerge = builtins.foldl' lib.recursiveUpdate { };
securityGroupId' =
if isNull securityGroupId
then "\${aws_security_group.${prefix}group.id}"
else securityGroupId;
in recursiveMerge [
in
recursiveMerge [
(lib.optionalAttrs (isNull securityGroupId) {
resource.aws_security_group."${prefix}group" = {
provider = "aws.${region}";
@ -60,12 +61,12 @@ in recursiveMerge [
resource.aws_security_group_rule.all_egress = {
provider = "aws.${region}";
security_group_id = securityGroupId';
type = "egress";
protocol = "-1";
from_port = 0;
to_port = 0;
cidr_blocks = ["0.0.0.0/0"];
ipv6_cidr_blocks = ["::/0"];
type = "egress";
protocol = "-1";
from_port = 0;
to_port = 0;
cidr_blocks = [ "0.0.0.0/0" ];
ipv6_cidr_blocks = [ "::/0" ];
description = null;
prefix_list_ids = null;
@ -74,12 +75,14 @@ in recursiveMerge [
})
rec {
data.external.my_ip = {
program = [(pkgs.writeShellScript "my_ip" ''
${pkgs.jq}/bin/jq \
-n \
--arg ip "$(curl ifconfig.me)" \
'{"ip":$ip}'
'')];
program = [
(pkgs.writeShellScript "my_ip" ''
${pkgs.jq}/bin/jq \
-n \
--arg ip "$(curl ifconfig.me)" \
'{"ip":$ip}'
'')
];
};
resource.aws_security_group_rule.provision_ssh_access = {
@ -89,8 +92,8 @@ in recursiveMerge [
protocol = "TCP";
from_port = 22;
to_port = 22;
cidr_blocks = ["\${data.external.my_ip.result.ip}/32"];
ipv6_cidr_blocks = [];
cidr_blocks = [ "\${data.external.my_ip.result.ip}/32" ];
ipv6_cidr_blocks = [ ];
description = null;
prefix_list_ids = null;
self = null;
@ -183,21 +186,23 @@ in recursiveMerge [
}
{
resource.aws_security_group_rule = builtins.listToAttrs (map (port: {
name = "ingress_${toString port}";
value = {
provider = "aws.${region}";
security_group_id = securityGroupId';
type = "ingress";
protocol = "TCP";
from_port = port;
to_port = port;
cidr_blocks = ["0.0.0.0/0"];
ipv6_cidr_blocks = [];
description = null;
prefix_list_ids = null;
self = null;
};
}) extraIngressPorts);
resource.aws_security_group_rule = builtins.listToAttrs (map
(port: {
name = "ingress_${toString port}";
value = {
provider = "aws.${region}";
security_group_id = securityGroupId';
type = "ingress";
protocol = "TCP";
from_port = port;
to_port = port;
cidr_blocks = [ "0.0.0.0/0" ];
ipv6_cidr_blocks = [ ];
description = null;
prefix_list_ids = null;
self = null;
};
})
extraIngressPorts);
}
]

View file

@ -21,13 +21,15 @@ let
]));
plugins_tf = {
terraform.required_providers = (builtins.listToAttrs (map (p: {
name = lib.last (lib.splitString "/" p.provider-source-address);
value = {
source = p.provider-source-address;
version = p.version;
};
}) (allPlugins pkgs.terraform.plugins)));
terraform.required_providers = (builtins.listToAttrs (map
(p: {
name = lib.last (lib.splitString "/" p.provider-source-address);
value = {
source = p.provider-source-address;
version = p.version;
};
})
(allPlugins pkgs.terraform.plugins)));
};
@ -36,7 +38,7 @@ let
plugins = plugins_tf;
};
module = runCommandNoCC "module" {} ''
module = runCommandNoCC "module" { } ''
mkdir $out
${lib.concatStrings (lib.mapAttrsToList (k: config_tf:
(let
@ -70,7 +72,7 @@ let
'';
# TODO: import (-config)
tfcmds = runCommandNoCC "${name}-tfcmds" {} ''
tfcmds = runCommandNoCC "${name}-tfcmds" { } ''
mkdir -p $out/bin
ln -s ${init} $out/bin/init
ln -s ${tfcmd} $out/bin/validate
@ -79,7 +81,8 @@ let
ln -s ${tfcmd} $out/bin/destroy
'';
in {
in
{
inherit name module;
terraform = tf;
cmds = tfcmds;
@ -92,7 +95,7 @@ in {
# destroy = depot.nix.nixRunWrapper "destroy" tfcmds;
# };
test = runCommandNoCC "${name}-test" {} ''
test = runCommandNoCC "${name}-test" { } ''
set -e
export TF_STATE_ROOT=$(pwd)
${tfcmds}/bin/init

View file

@ -1,6 +1,7 @@
{ depot ? (import ../../../. {})
{ depot ? (import ../../../. { })
, pkgs ? depot.third_party.nixpkgs
, ... }:
, ...
}:
let
ignore = depot.third_party.gitignoreSource.gitignoreFilter ./.;
@ -11,7 +12,7 @@ let
!(type == "directory" && builtins.baseNameOf path == "server")
&& !(type == "directory" && builtins.baseNameOf path == "docs")
&& (ignore path type
|| builtins.baseNameOf path == "package.yaml");
|| builtins.baseNameOf path == "package.yaml");
};
# generated by cabal2nix
basePkg = pkgs.haskellPackages.callPackage ./pkg.nix { };
@ -22,5 +23,5 @@ pkgs.haskell.lib.overrideCabal basePkg (default: {
version = "canon";
configureFlags = [
"--ghc-option=-Wall --ghc-option=-Werror"
] ++ (default.configureFlags or []);
] ++ (default.configureFlags or [ ]);
})

View file

@ -1,17 +1,74 @@
{ mkDerivation, aeson, array, async, base, bifunctors, brick
, checkers, classy-prelude, comonad, comonad-extras, constraints
, containers, criterion, data-default, data-interval, deepseq
, directory, fgl, fgl-arbitrary, file-embed, filepath
, generic-arbitrary, generic-lens, groups, hgeometry
, hgeometry-combinatorial, hpack, JuicyPixels, lens
, lens-properties, lib, lifted-async, linear, megaparsec, mmorph
, monad-control, MonadRandom, mtl, optparse-applicative, parallel
, parser-combinators, pointed, QuickCheck, quickcheck-instances
, quickcheck-text, random, random-extras, random-fu, random-source
, Rasterific, raw-strings-qq, reflection, semigroupoids, semigroups
, splitmix, stache, streams, tasty, tasty-hunit, tasty-quickcheck
, tasty-rerun, text, text-zipper, tomland, transformers, vector
, vty, witherable, yaml, zlib
{ mkDerivation
, aeson
, array
, async
, base
, bifunctors
, brick
, checkers
, classy-prelude
, comonad
, comonad-extras
, constraints
, containers
, criterion
, data-default
, data-interval
, deepseq
, directory
, fgl
, fgl-arbitrary
, file-embed
, filepath
, generic-arbitrary
, generic-lens
, groups
, hgeometry
, hgeometry-combinatorial
, hpack
, JuicyPixels
, lens
, lens-properties
, lib
, lifted-async
, linear
, megaparsec
, mmorph
, monad-control
, MonadRandom
, mtl
, optparse-applicative
, parallel
, parser-combinators
, pointed
, QuickCheck
, quickcheck-instances
, quickcheck-text
, random
, random-extras
, random-fu
, random-source
, Rasterific
, raw-strings-qq
, reflection
, semigroupoids
, semigroups
, splitmix
, stache
, streams
, tasty
, tasty-hunit
, tasty-quickcheck
, tasty-rerun
, text
, text-zipper
, tomland
, transformers
, vector
, vty
, witherable
, yaml
, zlib
}:
mkDerivation {
pname = "xanthous";
@ -20,58 +77,270 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson array async base bifunctors brick checkers classy-prelude
comonad comonad-extras constraints containers criterion
data-default data-interval deepseq directory fgl fgl-arbitrary
file-embed filepath generic-arbitrary generic-lens groups hgeometry
hgeometry-combinatorial JuicyPixels lens lifted-async linear
megaparsec mmorph monad-control MonadRandom mtl
optparse-applicative parallel parser-combinators pointed QuickCheck
quickcheck-instances quickcheck-text random random-extras random-fu
random-source Rasterific raw-strings-qq reflection semigroupoids
semigroups splitmix stache streams text text-zipper tomland
transformers vector vty witherable yaml zlib
aeson
array
async
base
bifunctors
brick
checkers
classy-prelude
comonad
comonad-extras
constraints
containers
criterion
data-default
data-interval
deepseq
directory
fgl
fgl-arbitrary
file-embed
filepath
generic-arbitrary
generic-lens
groups
hgeometry
hgeometry-combinatorial
JuicyPixels
lens
lifted-async
linear
megaparsec
mmorph
monad-control
MonadRandom
mtl
optparse-applicative
parallel
parser-combinators
pointed
QuickCheck
quickcheck-instances
quickcheck-text
random
random-extras
random-fu
random-source
Rasterific
raw-strings-qq
reflection
semigroupoids
semigroups
splitmix
stache
streams
text
text-zipper
tomland
transformers
vector
vty
witherable
yaml
zlib
];
libraryToolDepends = [ hpack ];
executableHaskellDepends = [
aeson array async base bifunctors brick checkers classy-prelude
comonad comonad-extras constraints containers criterion
data-default data-interval deepseq directory fgl fgl-arbitrary
file-embed filepath generic-arbitrary generic-lens groups hgeometry
hgeometry-combinatorial JuicyPixels lens lifted-async linear
megaparsec mmorph monad-control MonadRandom mtl
optparse-applicative parallel parser-combinators pointed QuickCheck
quickcheck-instances quickcheck-text random random-extras random-fu
random-source Rasterific raw-strings-qq reflection semigroupoids
semigroups splitmix stache streams text text-zipper tomland
transformers vector vty witherable yaml zlib
aeson
array
async
base
bifunctors
brick
checkers
classy-prelude
comonad
comonad-extras
constraints
containers
criterion
data-default
data-interval
deepseq
directory
fgl
fgl-arbitrary
file-embed
filepath
generic-arbitrary
generic-lens
groups
hgeometry
hgeometry-combinatorial
JuicyPixels
lens
lifted-async
linear
megaparsec
mmorph
monad-control
MonadRandom
mtl
optparse-applicative
parallel
parser-combinators
pointed
QuickCheck
quickcheck-instances
quickcheck-text
random
random-extras
random-fu
random-source
Rasterific
raw-strings-qq
reflection
semigroupoids
semigroups
splitmix
stache
streams
text
text-zipper
tomland
transformers
vector
vty
witherable
yaml
zlib
];
testHaskellDepends = [
aeson array async base bifunctors brick checkers classy-prelude
comonad comonad-extras constraints containers criterion
data-default data-interval deepseq directory fgl fgl-arbitrary
file-embed filepath generic-arbitrary generic-lens groups hgeometry
hgeometry-combinatorial JuicyPixels lens lens-properties
lifted-async linear megaparsec mmorph monad-control MonadRandom mtl
optparse-applicative parallel parser-combinators pointed QuickCheck
quickcheck-instances quickcheck-text random random-extras random-fu
random-source Rasterific raw-strings-qq reflection semigroupoids
semigroups splitmix stache streams tasty tasty-hunit
tasty-quickcheck tasty-rerun text text-zipper tomland transformers
vector vty witherable yaml zlib
aeson
array
async
base
bifunctors
brick
checkers
classy-prelude
comonad
comonad-extras
constraints
containers
criterion
data-default
data-interval
deepseq
directory
fgl
fgl-arbitrary
file-embed
filepath
generic-arbitrary
generic-lens
groups
hgeometry
hgeometry-combinatorial
JuicyPixels
lens
lens-properties
lifted-async
linear
megaparsec
mmorph
monad-control
MonadRandom
mtl
optparse-applicative
parallel
parser-combinators
pointed
QuickCheck
quickcheck-instances
quickcheck-text
random
random-extras
random-fu
random-source
Rasterific
raw-strings-qq
reflection
semigroupoids
semigroups
splitmix
stache
streams
tasty
tasty-hunit
tasty-quickcheck
tasty-rerun
text
text-zipper
tomland
transformers
vector
vty
witherable
yaml
zlib
];
benchmarkHaskellDepends = [
aeson array async base bifunctors brick checkers classy-prelude
comonad comonad-extras constraints containers criterion
data-default data-interval deepseq directory fgl fgl-arbitrary
file-embed filepath generic-arbitrary generic-lens groups hgeometry
hgeometry-combinatorial JuicyPixels lens lifted-async linear
megaparsec mmorph monad-control MonadRandom mtl
optparse-applicative parallel parser-combinators pointed QuickCheck
quickcheck-instances quickcheck-text random random-extras random-fu
random-source Rasterific raw-strings-qq reflection semigroupoids
semigroups splitmix stache streams text text-zipper tomland
transformers vector vty witherable yaml zlib
aeson
array
async
base
bifunctors
brick
checkers
classy-prelude
comonad
comonad-extras
constraints
containers
criterion
data-default
data-interval
deepseq
directory
fgl
fgl-arbitrary
file-embed
filepath
generic-arbitrary
generic-lens
groups
hgeometry
hgeometry-combinatorial
JuicyPixels
lens
lifted-async
linear
megaparsec
mmorph
monad-control
MonadRandom
mtl
optparse-applicative
parallel
parser-combinators
pointed
QuickCheck
quickcheck-instances
quickcheck-text
random
random-extras
random-fu
random-source
Rasterific
raw-strings-qq
reflection
semigroupoids
semigroups
splitmix
stache
streams
text
text-zipper
tomland
transformers
vector
vty
witherable
yaml
zlib
];
prePatch = "hpack";
homepage = "https://github.com/glittershark/xanthous#readme";

View file

@ -1,5 +1,4 @@
args@{
depot ? import ../../../.. {}
args@{ depot ? import ../../../.. { }
, pkgs ? depot.third_party.nixpkgs
, ...
}:

View file

@ -1,4 +1,4 @@
{ depot ? import ../../../.. {}
{ depot ? import ../../../.. { }
, pkgs ? depot.third_party.nixpkgs
, ...
}:
@ -6,14 +6,16 @@
let
inherit (depot.users.grfn) xanthous;
xanthous-server = xanthous.server;
in pkgs.dockerTools.buildLayeredImage {
in
pkgs.dockerTools.buildLayeredImage {
name = "xanthous-server";
tag = "latest";
contents = [ xanthous xanthous-server ];
config = {
Cmd = [
"${xanthous-server}/bin/xanthous-server"
"--xanthous-binary-path" "${xanthous}/bin/xanthous"
"--xanthous-binary-path"
"${xanthous}/bin/xanthous"
];
};
}

View file

@ -2,7 +2,8 @@
let
cfg = config.services.xanthous-server;
in {
in
{
options = with lib; {
services.xanthous-server = {
enable = mkEnableOption "xanthous server";

View file

@ -1,5 +1,5 @@
let
depot = import ../../../.. {};
depot = import ../../../.. { };
pkgs = depot.third_party.nixpkgs;
in

View file

@ -1,5 +1,5 @@
let
depot = import ../../../. {};
depot = import ../../../. { };
inherit (depot) third_party;
pkgs = third_party.nixpkgs;
in
@ -7,7 +7,7 @@ in
(pkgs.haskellPackages.extend (pkgs.haskell.lib.packageSourceOverrides {
xanthous = third_party.gitignoreSource ./.;
})).shellFor {
packages = p: [p.xanthous];
packages = p: [ p.xanthous ];
withHoogle = true;
doBenchmark = true;
buildInputs = (with pkgs.haskellPackages; [