summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-09-23 12:27:40 +0200
committerAdrian Kummerlaender2018-09-23 12:27:40 +0200
commit34b73e34e2d6a280264421663c7bce326c68f897 (patch)
tree2a36319ac54965b38f74094673f5f4efcc37e413
parent325e80caaaaa202a71bc1111d3e19a92d99e7ada (diff)
downloadnixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar.gz
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar.bz2
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar.lz
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar.xz
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.tar.zst
nixos_system-34b73e34e2d6a280264421663c7bce326c68f897.zip
Restructure host config, derivations
-rw-r--r--configuration.nix12
-rw-r--r--host/asterix.nix2
-rw-r--r--host/automatix.nix40
-rw-r--r--host/obelix.nix2
-rw-r--r--host/role/conf/vpn/kit.ovpn.nix19
-rw-r--r--host/software/asset/T-TeleSec_GlobalRoot_Class_2.pem (renamed from host/role/conf/vpn/T-TeleSec_GlobalRoot_Class_2.pem)0
-rw-r--r--host/software/asset/dir_colors (renamed from conf/dir_colors)0
-rw-r--r--host/software/code.kummerlaender.eu.nix42
-rw-r--r--host/software/desktop.nix (renamed from host/role/desktop.nix)11
-rw-r--r--host/software/fish.nix (renamed from conf/fish.nix)7
-rw-r--r--host/software/kit.vpn.nix27
-rw-r--r--host/software/pkgs/vim/asset/rc.vim (renamed from pkgs/vim/conf/rc.vim)0
-rw-r--r--host/software/pkgs/vim/asset/vim-color-akr/autoload/airline/themes/akr.vim (renamed from pkgs/vim/conf/vim-color-akr/autoload/airline/themes/akr.vim)0
-rw-r--r--host/software/pkgs/vim/asset/vim-color-akr/colors/akr.vim (renamed from pkgs/vim/conf/vim-color-akr/colors/akr.vim)0
-rw-r--r--host/software/pkgs/vim/custom.nix (renamed from pkgs/vim/custom.nix)2
-rw-r--r--host/software/pkgs/vim/default.nix (renamed from pkgs/vim/vim.nix)2
-rw-r--r--host/software/pkgs/vim/plugins.nix (renamed from pkgs/vim/plugins.nix)2
-rw-r--r--host/software/vim.nix9
-rw-r--r--user/common.nix (renamed from conf/common.nix)0
19 files changed, 102 insertions, 75 deletions
diff --git a/configuration.nix b/configuration.nix
index 82e83a6..fda8323 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -5,8 +5,9 @@
imports = [
./host/current.nix
- ./conf/common.nix
- ./conf/fish.nix
+ ./host/software/vim.nix
+ ./host/software/fish.nix
+ ./user/common.nix
];
i18n = {
@@ -33,10 +34,8 @@
};
environment = {
- systemPackages = let
- custom_vim = import ./pkgs/vim/vim.nix pkgs;
- in with pkgs; [
- psmisc htop fish git silver-searcher custom_vim
+ systemPackages = with pkgs; [
+ psmisc htop git silver-searcher
];
shellAliases = {
@@ -44,7 +43,6 @@
};
shellInit = ''
- export TERM=xterm
export LC_NUMERIC=de_DE.UTF8
export LC_TIME=de_DE.UTF8
export LC_MONETARY=de_DE.UTF8
diff --git a/host/asterix.nix b/host/asterix.nix
index d925259..0d078e9 100644
--- a/host/asterix.nix
+++ b/host/asterix.nix
@@ -1,7 +1,7 @@
{
imports = [
./hardware/asterix.nix
- ./role/desktop.nix
+ ./software/desktop.nix
];
boot = {
diff --git a/host/automatix.nix b/host/automatix.nix
index 9724b95..cbd0aeb 100644
--- a/host/automatix.nix
+++ b/host/automatix.nix
@@ -1,7 +1,10 @@
{ pkgs, ... }:
{
- imports = [ ./hardware/automatix.nix ];
+ imports = [
+ ./hardware/automatix.nix
+ ./software/code.kummerlaender.eu.nix
+ ];
boot.loader.grub = {
enable = true;
@@ -18,31 +21,6 @@
};
services = {
- gitea = {
- enable = true;
- database.type = "sqlite3";
-
- appName = "~/projects";
- domain = "code.kummerlaender.eu";
- rootUrl = "https://code.kummerlaender.eu/";
- httpPort = 3000;
-
- extraConfig = ''
- [server]
- LANDING_PAGE = "explore"
- [service]
- DISABLE_REGISTRATION = true
- SHOW_REGISTRATION_BUTTON = false
- [api]
- ENABLE_SWAGGER_ENDPOINT = false
- [picture]
- DISABLE_GRAVATAR = true
- [other]
- SHOW_FOOTER_VERSION = false
- SHOW_FOOTER_TEMPLATE_LOAD_TIME = false
- '';
- };
-
nginx = {
enable = true;
@@ -50,16 +28,6 @@
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
-
- virtualHosts."code.kummerlaender.eu" = {
- addSSL = true;
- enableACME = true;
- locations = {
- "/" = {
- proxyPass = "http://localhost:3000/";
- };
- };
- };
};
};
}
diff --git a/host/obelix.nix b/host/obelix.nix
index f876a61..8eea35e 100644
--- a/host/obelix.nix
+++ b/host/obelix.nix
@@ -3,7 +3,7 @@
{
imports = [
./hardware/obelix.nix
- ./role/desktop.nix
+ ./software/desktop.nix
];
boot = {
diff --git a/host/role/conf/vpn/kit.ovpn.nix b/host/role/conf/vpn/kit.ovpn.nix
deleted file mode 100644
index 82a21ee..0000000
--- a/host/role/conf/vpn/kit.ovpn.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-# adapted from https://www.scc.kit.edu/scc/net/openvpn/os/debian/kit.ovpn
-
-''
-client
-remote 141.52.8.20
-port 1194
-dev tun
-proto udp
-auth-user-pass
-nobind
-comp-lzo no
-tls-version-min 1.2
-ca ${./T-TeleSec_GlobalRoot_Class_2.pem}
-verify-x509-name "C=DE, ST=Baden-Wuerttemberg, L=Karlsruhe, O=Karlsruhe Institute of Technology, OU=Steinbuch Centre for Computing, CN=ovpn.scc.kit.edu" subject
-cipher AES-256-CBC
-auth SHA384
-verb 3
-script-security 2
-''
diff --git a/host/role/conf/vpn/T-TeleSec_GlobalRoot_Class_2.pem b/host/software/asset/T-TeleSec_GlobalRoot_Class_2.pem
index 374b050..374b050 100644
--- a/host/role/conf/vpn/T-TeleSec_GlobalRoot_Class_2.pem
+++ b/host/software/asset/T-TeleSec_GlobalRoot_Class_2.pem
diff --git a/conf/dir_colors b/host/software/asset/dir_colors
index bbe79d9..bbe79d9 100644
--- a/conf/dir_colors
+++ b/host/software/asset/dir_colors
diff --git a/host/software/code.kummerlaender.eu.nix b/host/software/code.kummerlaender.eu.nix
new file mode 100644
index 0000000..b2507e4
--- /dev/null
+++ b/host/software/code.kummerlaender.eu.nix
@@ -0,0 +1,42 @@
+{ pkgs, ... }:
+
+{
+ services = {
+ gitea = {
+ enable = true;
+ database.type = "sqlite3";
+
+ appName = "~/projects";
+ domain = "code.kummerlaender.eu";
+ rootUrl = "https://code.kummerlaender.eu/";
+ httpPort = 3000;
+
+ extraConfig = ''
+ [server]
+ LANDING_PAGE = "explore"
+ [service]
+ DISABLE_REGISTRATION = true
+ SHOW_REGISTRATION_BUTTON = false
+ [other]
+ SHOW_FOOTER_VERSION = false
+ SHOW_FOOTER_TEMPLATE_LOAD_TIME = false
+ [api]
+ ENABLE_SWAGGER_ENDPOINT = false
+ [picture]
+ DISABLE_GRAVATAR = true
+ [indexer]
+ REPO_INDEXER_ENABLED = true
+ '';
+ };
+
+ nginx.virtualHosts."code.kummerlaender.eu" = {
+ addSSL = true;
+ enableACME = true;
+ locations = {
+ "/" = {
+ proxyPass = "http://localhost:3000/";
+ };
+ };
+ };
+ };
+}
diff --git a/host/role/desktop.nix b/host/software/desktop.nix
index cf20500..501a561 100644
--- a/host/role/desktop.nix
+++ b/host/software/desktop.nix
@@ -1,6 +1,10 @@
{ pkgs, ... }:
{
+ imports = [
+ ./kit.vpn.nix
+ ];
+
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
sound.enable = true;
@@ -17,13 +21,6 @@
extraConfig = ''Storage=volatile'';
};
- openvpn.servers = {
- KIT = {
- config = import ./conf/vpn/kit.ovpn.nix;
- autoStart = false;
- };
- };
-
xserver = {
enable = true;
layout = "de";
diff --git a/conf/fish.nix b/host/software/fish.nix
index 6a654f5..d1e46c9 100644
--- a/conf/fish.nix
+++ b/host/software/fish.nix
@@ -1,11 +1,15 @@
+{ pkgs, ... }:
+
{
programs.fish = {
enable = true;
+
shellInit = ''
set fish_greeting ""
'';
+
interactiveShellInit = ''
- eval (dircolors -c ${./dir_colors})
+ eval (dircolors -c ${./asset/dir_colors})
set fish_color_normal white
set fish_color_command magenta --bold
@@ -18,6 +22,7 @@
set fish_color_autosuggestion 555
set fish_color_redirection white
'';
+
promptInit = ''
function fish_prompt
set last_status $status
diff --git a/host/software/kit.vpn.nix b/host/software/kit.vpn.nix
new file mode 100644
index 0000000..726356d
--- /dev/null
+++ b/host/software/kit.vpn.nix
@@ -0,0 +1,27 @@
+{ pkgs, ... }:
+
+{
+ services.openvpn.servers = {
+ KIT = {
+ # adapted from https://www.scc.kit.edu/scc/net/openvpn/os/debian/kit.ovpn
+ config = ''
+ client
+ remote 141.52.8.20
+ port 1194
+ dev tun
+ proto udp
+ auth-user-pass
+ nobind
+ comp-lzo no
+ tls-version-min 1.2
+ ca ${./asset/T-TeleSec_GlobalRoot_Class_2.pem}
+ verify-x509-name "C=DE, ST=Baden-Wuerttemberg, L=Karlsruhe, O=Karlsruhe Institute of Technology, OU=Steinbuch Centre for Computing, CN=ovpn.scc.kit.edu" subject
+ cipher AES-256-CBC
+ auth SHA384
+ verb 3
+ script-security 2
+ '';
+ autoStart = false;
+ };
+ };
+}
diff --git a/pkgs/vim/conf/rc.vim b/host/software/pkgs/vim/asset/rc.vim
index 81f48e0..81f48e0 100644
--- a/pkgs/vim/conf/rc.vim
+++ b/host/software/pkgs/vim/asset/rc.vim
diff --git a/pkgs/vim/conf/vim-color-akr/autoload/airline/themes/akr.vim b/host/software/pkgs/vim/asset/vim-color-akr/autoload/airline/themes/akr.vim
index 1b847c4..1b847c4 100644
--- a/pkgs/vim/conf/vim-color-akr/autoload/airline/themes/akr.vim
+++ b/host/software/pkgs/vim/asset/vim-color-akr/autoload/airline/themes/akr.vim
diff --git a/pkgs/vim/conf/vim-color-akr/colors/akr.vim b/host/software/pkgs/vim/asset/vim-color-akr/colors/akr.vim
index 4ffd2ca..4ffd2ca 100644
--- a/pkgs/vim/conf/vim-color-akr/colors/akr.vim
+++ b/host/software/pkgs/vim/asset/vim-color-akr/colors/akr.vim
diff --git a/pkgs/vim/custom.nix b/host/software/pkgs/vim/custom.nix
index f0150d2..4719b72 100644
--- a/pkgs/vim/custom.nix
+++ b/host/software/pkgs/vim/custom.nix
@@ -1,7 +1,7 @@
{ pkgs }:
let
- vimrc = builtins.readFile ./conf/rc.vim;
+ vimrc = builtins.readFile ./asset/rc.vim;
plugins = pkgs.callPackage ./plugins.nix {};
in
{
diff --git a/pkgs/vim/vim.nix b/host/software/pkgs/vim/default.nix
index da78a1a..0b0001d 100644
--- a/pkgs/vim/vim.nix
+++ b/host/software/pkgs/vim/default.nix
@@ -6,6 +6,6 @@ let
vimrcConfig = (import ./custom.nix { pkgs = pkgs; });
};
in pkgs.lib.overrideDerivation custom_vim ( o: {
- gui = true;
+ gui = false;
multibyteSupport = true;
} )
diff --git a/pkgs/vim/plugins.nix b/host/software/pkgs/vim/plugins.nix
index b2f94d1..87abea4 100644
--- a/pkgs/vim/plugins.nix
+++ b/host/software/pkgs/vim/plugins.nix
@@ -78,7 +78,7 @@ in {
"vim-color-akr" = buildVimPlugin {
name = "vim-color-akr";
- src = ./conf/vim-color-akr;
+ src = ./asset/vim-color-akr;
};
}
diff --git a/host/software/vim.nix b/host/software/vim.nix
new file mode 100644
index 0000000..8bd9b7f
--- /dev/null
+++ b/host/software/vim.nix
@@ -0,0 +1,9 @@
+{ pkgs, ... }:
+
+{
+ environment.systemPackages = let
+ custom_vim = import ./pkgs/vim/default.nix pkgs;
+ in [
+ custom_vim
+ ];
+}
diff --git a/conf/common.nix b/user/common.nix
index ade26d3..ade26d3 100644
--- a/conf/common.nix
+++ b/user/common.nix