1
0
Fork 0

Lots of changes

This commit is contained in:
Malte Brandy 2019-08-02 20:41:58 +02:00
parent 733ac4d4e2
commit 48257078eb
12 changed files with 134 additions and 173 deletions

View file

@ -10,7 +10,8 @@ in {
default = ""; default = "";
}; };
user = mkOption { type = types.str; }; user = mkOption { type = types.str; };
pw = mkOption { type = types.str; }; hackint_pw = mkOption { type = types.str; };
freenode_pw = mkOption { type = types.str; };
}; };
config = mkIf config.m-0.weechat.enable { config = mkIf config.m-0.weechat.enable {
@ -23,14 +24,14 @@ in {
target = ".weechat/perl"; target = ".weechat/perl";
source = ./plugins/perl; source = ./plugins/perl;
}; };
plugins = { # plugins = {
target = ".weechat/plugins.conf"; # target = ".weechat/plugins.conf";
text = '' # text = ''
[var] # [var]
python.buffer_autohide.hide_inactive = on # python.buffer_autohide.hide_inactive = off
python.buffer_autohide.hide_private = on # python.buffer_autohide.hide_private = off
''; # '';
}; # };
weechat = { weechat = {
target = ".weechat/weechat.conf"; target = ".weechat/weechat.conf";
text = '' text = ''
@ -67,7 +68,7 @@ in {
freenode.ssl = on freenode.ssl = on
freenode.sasl_mechanism = plain freenode.sasl_mechanism = plain
freenode.sasl_username = "${config.m-0.weechat.user}" freenode.sasl_username = "${config.m-0.weechat.user}"
freenode.sasl_password = "${config.m-0.weechat.pw}" freenode.sasl_password = "${config.m-0.weechat.freenode_pw}"
freenode.autoconnect = on freenode.autoconnect = on
freenode.username = "${config.m-0.weechat.user}" freenode.username = "${config.m-0.weechat.user}"
freenode.autojoin = "#nixos,#matrix,#haskell" freenode.autojoin = "#nixos,#matrix,#haskell"
@ -77,7 +78,7 @@ in {
hackint.ssl = on hackint.ssl = on
hackint.sasl_mechanism = plain hackint.sasl_mechanism = plain
hackint.sasl_username = "${config.m-0.weechat.user}" hackint.sasl_username = "${config.m-0.weechat.user}"
hackint.sasl_password = "${config.m-0.weechat.pw}" hackint.sasl_password = "${config.m-0.weechat.hackint_pw}"
hackint.autoconnect = on hackint.autoconnect = on
hackint.username = "${config.m-0.weechat.user}" hackint.username = "${config.m-0.weechat.user}"
hackint.autojoin = "${config.m-0.weechat.channels}" hackint.autojoin = "${config.m-0.weechat.channels}"

View file

@ -1 +0,0 @@
../buffer_autohide.py

View file

@ -13,9 +13,7 @@
}; };
weechat = { weechat = {
enable = true; enable = true;
user = config.m-0.private.hackint.user; inherit (config.m-0.private.hackint) user hackint_pw freenode_pw channels;
pw = config.m-0.private.hackint.hackint_pw;
channels = config.m-0.private.hackint.channels;
}; };
}; };

Binary file not shown.

View file

@ -51,6 +51,7 @@ in {
}; };
containers.web = { containers.web = {
bindMounts = { bindMounts = {
"/var/www" = { hostPath = "/var/www"; };
"${certPath}" = { "${certPath}" = {
hostPath = certPath; hostPath = certPath;
isReadOnly = false; isReadOnly = false;
@ -60,7 +61,7 @@ in {
privateNetwork = true; privateNetwork = true;
hostBridge = "bridge"; hostBridge = "bridge";
config = { pkgs, lib, ... }: { config = { pkgs, lib, ... }: {
imports = [ ../../system ]; imports = [ ../../system ../../system/blog.nix ];
networking = { networking = {
interfaces.eth0 = { interfaces.eth0 = {
ipv6.addresses = [{ ipv6.addresses = [{
@ -76,7 +77,6 @@ in {
firewall.allowedTCPPorts = [ 80 443 ]; firewall.allowedTCPPorts = [ 80 443 ];
}; };
m-0 = { m-0 = {
blog.enable = true;
mathechor-de = { mathechor-de = {
enable = true; enable = true;
password = config.m-0.private.mathechor-pw; password = config.m-0.private.mathechor-pw;

View file

@ -12,7 +12,7 @@ in rec {
main = do main = do
(configDir:hostname:args) <- getArgs (configDir:hostname:args) <- getArgs
paths <- concat <$> mapM (getNivAssign configDir) ["nixpkgs", "unstable", "home-manager"] paths <- concat <$> mapM (getNivAssign configDir) ["nixpkgs", "unstable", "home-manager"]
putStrLn [i|Trying to build ${name} config for #{hostname}] putStrLn [i|Trying to build ${name} config for #{hostname}|]
${commandline} ${commandline}
''; '';
bins = [ get-niv-path pkgs.nix ]; bins = [ get-niv-path pkgs.nix ];

View file

@ -98,7 +98,6 @@ in rec {
runScript = "${gw2wrapper}/bin/gw2wrapper"; runScript = "${gw2wrapper}/bin/gw2wrapper";
}; };
cachix = import sources.cachix { }; cachix = import sources.cachix { };
nixfmt = import sources.nixfmt { };
inherit (pkgs.gnome3) nautilus; inherit (pkgs.gnome3) nautilus;
inherit (pkgs.xorg) xev xbacklight; inherit (pkgs.xorg) xev xbacklight;
inherit (pkgs) inherit (pkgs)
@ -152,6 +151,7 @@ in rec {
inherit (pkgs.gnome3) dconf; inherit (pkgs.gnome3) dconf;
}; };
home-pkgs = { home-pkgs = {
nixfmt = import sources.nixfmt { };
inherit (pkgs.pythonPackages) yapf jsbeautifier; inherit (pkgs.pythonPackages) yapf jsbeautifier;
inherit (pkgs) ncmpcpp shfmt htmlTidy astyle; inherit (pkgs) ncmpcpp shfmt htmlTidy astyle;
inherit (my-lib) ghc; inherit (my-lib) ghc;
@ -169,4 +169,4 @@ in rec {
}; };
foreign-home-pkgs = extra-system-pkgs; foreign-home-pkgs = extra-system-pkgs;
eventd = pkgs.callPackage ./eventd { }; eventd = pkgs.callPackage ./eventd { };
} }

20
system/blog.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }: {
networking.firewall.allowedTCPPorts = [ 80 443 ];
services = {
nginx = {
enable = true;
virtualHosts."blog.maralorn.de" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
root = "/var/www/blog";
index = "index.html";
};
};
};
};
};
}

View file

@ -8,7 +8,6 @@ in {
../common ../common
./modules/laptop.nix ./modules/laptop.nix
./modules/mathechor.de.nix ./modules/mathechor.de.nix
./modules/blog.nix
./modules/riot.nix ./modules/riot.nix
./modules/loginctl-linger.nix ./modules/loginctl-linger.nix
]; ];
@ -40,11 +39,8 @@ in {
}; };
nix = { nix = {
binaryCaches = [ binaryCaches =
"https://cache.nixos.org/" [ "https://cache.nixos.org/" "https://nixcache.reflex-frp.org" ];
"https://nixcache.reflex-frp.org"
"ssh://nix-ssh@hera.m-0.eu"
];
binaryCachePublicKeys = binaryCachePublicKeys =
[ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ]; [ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
nixPath = [ "/etc/nix-path" ]; nixPath = [ "/etc/nix-path" ];

View file

@ -11,8 +11,19 @@ let
post-update = writeHaskellScript { post-update = writeHaskellScript {
name = "post-update"; name = "post-update";
bins = [ pkgs.git pkgs.nix ]; bins = [ pkgs.git pkgs.nix ];
imports = [ "System.Environment (lookupEnv)" "Data.Foldable (for_)" ]; imports = [
"System.Environment (lookupEnv)"
"Data.Foldable (for_)"
"Control.Monad (ap)"
"Control.Exception (bracket)"
"System.Directory (withCurrentDirectory)"
];
} '' } ''
checkout :: String -> IO FilePath
checkout pwd = (mktemp "-d" |> captureTrim)
>>= ((ap (<$) $ git "clone" pwd) . LBSC.unpack)
main = do main = do
mirror <- lookupEnv "GL_OPTION_MIRROR" mirror <- lookupEnv "GL_OPTION_MIRROR"
for_ mirror $ \mirror -> do for_ mirror $ \mirror -> do
@ -20,8 +31,9 @@ let
git "push" "--all" mirror git "push" "--all" mirror
deploy <- lookupEnv "GL_OPTION_WEB_DEPLOY" deploy <- lookupEnv "GL_OPTION_WEB_DEPLOY"
for_ deploy $ \deploy -> do for_ deploy $ \deploy -> do
path <- readTrim pwd
echo ([i|Deploying build to /var/www/#{deploy}|] :: String) echo ([i|Deploying build to /var/www/#{deploy}|] :: String)
nix "build" "-o" ([i|/var/www/#{deploy}|] :: String) bracket (checkout $ LBSC.unpack path)(rm "-rf") $ \dir -> withCurrentDirectory dir $ nix "build" "-o" ([i|/var/www/#{deploy}|] :: String)
echo "Done" echo "Done"
test <- lookupEnv "GL_OPTION_TEST" test <- lookupEnv "GL_OPTION_TEST"
for_ test $ \_ -> do for_ test $ \_ -> do

View file

@ -1,53 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
page = pkgs.stdenv.mkDerivation {
name = "blog.maralorn.de";
src = builtins.fetchGit "git@hera:blog";
buildInputs =
[ (pkgs.python3.withPackages (ps: [ ps.pelican ps.markdown ])) ];
LC_ALL = "en_US.UTF-8";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
buildPhase = ''
make html
'';
installPhase = ''
mkdir $out
cp -r output/* $out
'';
};
in {
options = {
m-0.blog = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf config.m-0.blog.enable {
networking.firewall.allowedTCPPorts = [ 80 443 ];
services = {
nginx = {
enable = true;
virtualHosts."blog.maralorn.de" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
root = "${page}";
index = "index.html";
};
};
};
};
};
};
}

View file

@ -4,18 +4,6 @@ with lib;
let let
me = config.m-0.private.me; me = config.m-0.private.me;
page = pkgs.stdenv.mkDerivation {
name = "mathechor.de";
src = builtins.fetchGit "git@hera:mathechor.de";
buildInputs = [ pkgs.pandoc pkgs.python3 ];
LC_ALL = "en_US.UTF-8";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
installPhase = ''
mkdir $out
cp -r intern/output $out/intern
cp -r public/output $out/public
'';
};
in { in {
@ -41,7 +29,7 @@ in {
enableACME = true; enableACME = true;
locations = { locations = {
"/" = { "/" = {
root = "${page}/public"; root = "/var/www/mathechor/public";
index = "index.html"; index = "index.html";
extraConfig = extraConfig =
"location ~* .(otf)$ {add_header Access-Control-Allow-Origin *;}"; "location ~* .(otf)$ {add_header Access-Control-Allow-Origin *;}";
@ -54,7 +42,7 @@ in {
basicAuth.mathechor = config.m-0.mathechor-de.password; basicAuth.mathechor = config.m-0.mathechor-de.password;
locations = { locations = {
"/" = { "/" = {
root = "${page}/intern"; root = "/var/www/mathechor/intern";
index = "index.html"; index = "index.html";
}; };
"/mathechor.ics" = { "/mathechor.ics" = {