From 9566f776bef07e9ab5e69ad25bbe6d5b54e99ef3 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 29 May 2018 21:52:35 +0200 Subject: [PATCH] More config --- home-manager/default.nix | 21 +++----- home-manager/packages/jali/default.nix | 13 +++++ hosts/apollo/configuration.nix | 63 ++++++---------------- hosts/apollo/secret/.gitattributes | 2 + hosts/apollo/secret/pw-maralorn | Bin 0 -> 126 bytes hosts/apollo/secret/tinc/ed25519_key.priv | Bin 0 -> 426 bytes system/{common.nix => default.nix} | 17 ++---- system/laptop.nix | 35 ++++++++++++ system/server.nix | 17 ++++++ 9 files changed, 94 insertions(+), 74 deletions(-) create mode 100644 home-manager/packages/jali/default.nix create mode 100644 hosts/apollo/secret/.gitattributes create mode 100644 hosts/apollo/secret/pw-maralorn create mode 100644 hosts/apollo/secret/tinc/ed25519_key.priv rename system/{common.nix => default.nix} (82%) create mode 100644 system/laptop.nix diff --git a/home-manager/default.nix b/home-manager/default.nix index 6652ff19..83c1a081 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,14 +1,12 @@ { pkgs, config, ... }: -let - rust-scripts = with pkgs; callPackage ../packages/rust-scripts {}; - unstable-pkgs = import {}; - eventd = unstable-pkgs.callPackage ../packages/eventd {}; - st = import graphical/st; -in { +{ nixpkgs.config.packageOverrides = pkgs: { - eventd = eventd; - st = st pkgs config.common.colors; + rust-scripts = pkgs.callPackage ./packages/rust-scripts {}; + jali = pkgs.callPackage ./packages/jali {}; + eventd = (import {}).callPackage ./packages/eventd {}; + st = (import graphical/st) pkgs config.common.colors; }; + home.file.".tmux.conf".text = '' set -g default-terminal "st-256color" set -ga terminal-overrides ",st-256color:Tc" @@ -16,6 +14,7 @@ in { set -g status off set -g escape-time 1 ''; + programs = { home-manager = { enable = true; @@ -129,8 +128,6 @@ in { pythonPackages.qrcode ranger -# rust-scripts - (pkgs.neovim.override { vimAlias = true; withPython3 = true; @@ -145,7 +142,6 @@ in { ''; packages.myVimPackage = with pkgs.vimPlugins; { start = [ -# deoplete-nvim vim-nix ctrlp vimtex @@ -153,11 +149,8 @@ in { UltiSnips airline rust-vim -# deoplete-rust fugitive airline -# ale -# vim-snippets vim-trailing-whitespace vim-polyglot nvim-cm-racer diff --git a/home-manager/packages/jali/default.nix b/home-manager/packages/jali/default.nix new file mode 100644 index 00000000..73274ecd --- /dev/null +++ b/home-manager/packages/jali/default.nix @@ -0,0 +1,13 @@ +{ jinja2, pendulum, GitPython, aqbanking, python36Packages, fetchgit }: +with python36Packages; buildPythonApplication rec { + name = "${pname}-${version}"; + pname = "jali"; + doCheck = false; + version = "1d1c5d0a"; + src = fetchgit { + url = "https://git.darmstadt.ccc.de/jali/jali.git"; + rev = version; + sha256 = "1nzzangp7yr2gq66qz7wk2cqqwjlhrfaqmc85qigjv4vpfmlphl0"; + }; + propagatedBuildInputs = [ jinja2 pendulum GitPython aqbanking ]; +} diff --git a/hosts/apollo/configuration.nix b/hosts/apollo/configuration.nix index 5dd8bf23..7c29521a 100644 --- a/hosts/apollo/configuration.nix +++ b/hosts/apollo/configuration.nix @@ -1,22 +1,23 @@ { config, pkgs, ... }: { -networking = { - hostName = "apollo"; - networkmanager.enable = true; - hostId = "38d29f92"; -}; - -i18n.consoleKeyMap = "neo"; - -imports = [ + imports = [ ./hardware-configuration.nix - ../../modules/cdarknet - ../../host-common/common.nix + ../../system ]; -home-manager.users = {}; +networking = { + hostName = "apollo"; +}; + +m-0 = { + laptop.enable = true; +}; + +home-manager.users.maralorn = { + imports = [ ./home.nix ]; +}; # Use the systemd-boot EFI boot loader. boot = { @@ -27,47 +28,13 @@ boot = { supportedFilesystems = [ "exfat" ]; }; -security.rngd.enable = true; - cdark_net = { enable = true; hostName = "maralorn_apollo"; - ed25519PrivateKeyFile = /etc/nixos/local/tinc/ed25519_key.priv; - hostsDirectory = /etc/nixos/config/modules/cdarknet/hosts; + ed25519PrivateKeyFile = /etc/nixos/hosts/apollo/secret/tinc/ed25519_key.priv; + hostsDirectory = /etc/nixos/system/modules/cdarknet/hosts; ip6address = "fd23:42:cda:4342::2"; ip4address = "172.20.71.2"; }; - -hardware.pulseaudio.enable = true; -services = { -# printing = { -# enable = true; -# drivers = [pkgs.hplip]; -# }; -# gnome3 = { -# gnome-keyring.enable = true; -# evolution-data-server.enable = true; -# gnome-disks.enable = true; -# }; - xserver = { - enable = true; - layout = "de"; - xkbVariant = "neo"; - libinput.enable = true; - desktopManager.gnome3.enable = true; - displayManager.auto = { - enable = true; - user = "maralorn"; - }; - config = '' - Section "InputClass" - Identifier "Enable libinput for TrackPoint" - MatchIsPointer "on" - Driver "libinput" - EndSection - ''; - }; -}; -#virtualisation.docker.enable = true; } diff --git a/hosts/apollo/secret/.gitattributes b/hosts/apollo/secret/.gitattributes new file mode 100644 index 00000000..7de5522c --- /dev/null +++ b/hosts/apollo/secret/.gitattributes @@ -0,0 +1,2 @@ +* filter=git-crypt-apollo diff=git-crypt-apollo +.gitattributes !filter !diff diff --git a/hosts/apollo/secret/pw-maralorn b/hosts/apollo/secret/pw-maralorn new file mode 100644 index 0000000000000000000000000000000000000000..653c2d6f0b99153c8f420b478bd748b552340a38 GIT binary patch literal 126 zcmV-^0D=DiM@dveQdv+`01WGog4xk`E0AaMm^C6KDPZU~A~1FHq61&osg!mw`^y|~yT30)W@dvw zq>1q{KEMQsN29oHw?i>_NbzTKbW z_P0{mRh3Kdtu3e2)Qq@xb7}DfN&B?}uz(JBknlvTa8lEsoLHnFuvMS7&ycyP1ju0G UWg`xkTw~X4(e^|xvt(&{h$;!xCIA2c literal 0 HcmV?d00001 diff --git a/system/common.nix b/system/default.nix similarity index 82% rename from system/common.nix rename to system/default.nix index f26882f2..1b6269ff 100644 --- a/system/common.nix +++ b/system/default.nix @@ -3,29 +3,23 @@ # channel = 18.03 imports = [ + ./laptop.nix ./admin.nix ./syncthing.nix + modules/cdarknet ]; - i18n = { defaultLocale = "en_US.UTF-8"; }; + time.timeZone = "Europe/Berlin"; + security.rngd.enable = true; + # So that boot does not fill up with old kernels boot.loader.grub.configurationLimit = 5; - nix = { - gc = { - automatic = true; - options = "--delete-older-than 5d"; - }; - optimise.automatic = true; - }; - system.autoUpgrade.enable = true; - system.autoUpgrade.dates = "22:00"; - users = { defaultUserShell = pkgs.zsh; mutableUsers = false; @@ -46,7 +40,6 @@ git gnumake python3 - python mkpasswd rxvt_unicode.terminfo htop diff --git a/system/laptop.nix b/system/laptop.nix new file mode 100644 index 00000000..9c3c732b --- /dev/null +++ b/system/laptop.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: +{ + options = { + m-0.laptop.enable = mkOption { + type = types.bool; + }; + }; + config = mkIf config.m-0.laptop.enable { + networking = { + networkmanager.enable = true; + }; + i18n.consoleKeyMap = "neo"; + hardware.pulseaudio.enable = true; + services = { + xserver = { + enable = true; + layout = "de"; + xkbVariant = "neo"; + libinput.enable = true; + desktopManager.gnome3.enable = true; + displayManager.auto = { + enable = true; + user = "maralorn"; + }; + config = '' + Section "InputClass" + Identifier "Enable libinput for TrackPoint" + MatchIsPointer "on" + Driver "libinput" + EndSection + ''; + }; + }; + }; +} diff --git a/system/server.nix b/system/server.nix index 7278641f..241ff8cd 100644 --- a/system/server.nix +++ b/system/server.nix @@ -1,4 +1,21 @@ { config, pkgs, ... }: { + options = { + m-0.server.enable = mkOption { + type = types.bool; + }; + }; + + config = mkIf config.m-0.server.enable { + nix = { + gc = { + automatic = true; + options = "--delete-older-than 5d"; + }; + optimise.automatic = true; + }; + system.autoUpgrade.enable = true; + system.autoUpgrade.dates = "22:00"; + }; }