From b9a6f33aa4261d3ad282d7f456eb2e9a46f0dbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 10 Apr 2019 21:14:29 +0200 Subject: [PATCH] kropsify --- configs/editors.nix | 4 ++-- configs/graphics.nix | 16 ++++++------- configs/hu-berlin.nix | 2 +- configs/networks.nix | 9 ++++++++ configs/packages.nix | 17 +++++++------- configs/retiolum.nix | 4 ++-- configs/scripts.nix | 2 +- dot/dunst.nix | 2 +- dot/haskells.nix | 2 +- dot/i3.nix | 4 ++-- dot/rofi.nix | 2 +- dot/urxvt.nix | 2 +- dot/xresources.nix | 2 +- helpers.nix => lib/default.nix | 0 main.nix | 30 ++++++++++++------------- options.nix | 2 +- systems/catullus/configuration.nix | 4 ++-- systems/catullus/containers.nix | 6 ++--- systems/homeros/config.nix | 2 +- systems/krops.nix | 36 +++++++++++++++++++++--------- systems/scardanelli/config.nix | 2 +- 21 files changed, 88 insertions(+), 62 deletions(-) rename helpers.nix => lib/default.nix (100%) diff --git a/configs/editors.nix b/configs/editors.nix index 379e835..a9f9a8e 100644 --- a/configs/editors.nix +++ b/configs/editors.nix @@ -1,5 +1,5 @@ { pkgs, config, ... }: -let vimConfig = import ../dot/vim.nix { inherit config pkgs; }; +let vimConfig = import { inherit config pkgs; }; in { programs.nano.nanorc = '' set autoindent @@ -19,7 +19,7 @@ in { nixpkgs.config.packageOverrides = pkgs: { nvim = pkgs.neovim.override { configure = { - customRC = builtins.readFile ../dot/vimrc; + customRC = builtins.readFile ; packages.nvim = with pkgs.vimPlugins; { start = with pkgs.vimPlugins; [ ale diff --git a/configs/graphics.nix b/configs/graphics.nix index b408390..a092bcc 100644 --- a/configs/graphics.nix +++ b/configs/graphics.nix @@ -1,6 +1,6 @@ { pkgs, lib, config, ... }: { - services.xserver = with import ../helpers.nix; with import ../theme.nix; { + services.xserver = with import ; with import ; { enable = true; layout = commaSep [ "de" "gr" "ru" ]; xkbVariant = commaSep [ "T3" "polytonic" "phonetic_winkeys" ]; @@ -17,7 +17,7 @@ notifier = ''${pkgs.libnotify}/bin/notify-send -u normal -a xautolock "Locking soon" "The screen will lock in 10 seconds."''; }; displayManager.sessionCommands = '' - ${pkgs.feh}/bin/feh --bg-fill $(find ${../art} -type f | shuf -n 1) & + ${pkgs.feh}/bin/feh --bg-fill $(find ${} -type f | shuf -n 1) & ${pkgs.dropbox-cli}/bin/dropbox start & ${pkgs.seafile-client}/bin/seafile-applet & ${pkgs.systemd}/bin/systemctl --user import-environment XDG_SESSION_PATH @@ -43,7 +43,7 @@ i18n = { defaultLocale = "en_GB.UTF-8"; consoleKeyMap = "de"; - consoleColors = with import ../theme.nix; map (c: lib.strings.removePrefix "#" c) colorPalette; + consoleColors = with import ; map (c: lib.strings.removePrefix "#" c) colorPalette; }; services.compton = { @@ -83,12 +83,12 @@ xsession.windowManager.i3 = { enable = true; - config = import ../dot/i3.nix { inherit lib pkgs config; }; + config = import { inherit lib pkgs config; }; }; - xresources.properties = import ../dot/xresources.nix { inherit lib; }; - programs.rofi = import ../dot/rofi.nix { inherit config; }; - services.dunst = import ../dot/dunst.nix { inherit pkgs config; }; - programs.urxvt = import ../dot/urxvt.nix { inherit pkgs config; }; + xresources.properties = import { inherit lib; }; + programs.rofi = import { inherit config; }; + services.dunst = import { inherit pkgs config; }; + programs.urxvt = import { inherit pkgs config; }; }; } diff --git a/configs/hu-berlin.nix b/configs/hu-berlin.nix index 4f9b0b0..9c42f35 100644 --- a/configs/hu-berlin.nix +++ b/configs/hu-berlin.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let - eduroam = (import ../secrets.nix).eduroam; + eduroam = (import ).eduroam; eduroamConfig = { auth = '' key_mgmt=WPA-EAP diff --git a/configs/networks.nix b/configs/networks.nix index a9d649f..1d48597 100644 --- a/configs/networks.nix +++ b/configs/networks.nix @@ -56,6 +56,11 @@ in { hostname = "catullus.local"; user = "root"; }; + menstruation-logs = { + user = "root"; + hostname = "v22017123717457389.megasrv.de"; + port = 49123; + }; "gitlab.peixdev.net".port = 999; }; }; @@ -79,6 +84,10 @@ in { openDefaultPorts = true; }; + users.users.root.openssh.authorizedKeys.keys = [ + sshKey.homeros + sshKey.scardanelli + ]; users.users.kfm.openssh.authorizedKeys.keys = [ sshKey.homeros sshKey.scardanelli diff --git a/configs/packages.nix b/configs/packages.nix index 094861f..ceb1a6f 100644 --- a/configs/packages.nix +++ b/configs/packages.nix @@ -1,13 +1,13 @@ { config, pkgs, lib, ... }: let - bvg = pkgs.callPackage ../packages/bvg.nix {}; - daybook = pkgs.callPackage ../packages/daybook.nix {}; - iolanguage = pkgs.callPackage ../packages/iolanguage.nix {}; - sncli = pkgs.python3Packages.callPackage ../packages/sncli.nix {}; - todoist = pkgs.callPackage ../packages/todoist {}; - spotify-cli-linux = pkgs.python3Packages.callPackage ../packages/spotify-cli-linux.nix {}; - instaloader = pkgs.python3Packages.callPackage ../packages/instaloader.nix {}; - haskells = import ../dot/haskells.nix; + bvg = pkgs.callPackage {}; + daybook = pkgs.callPackage {}; + iolanguage = pkgs.callPackage {}; + sncli = pkgs.python3Packages.callPackage {}; + todoist = pkgs.callPackage {}; + spotify-cli-linux = pkgs.python3Packages.callPackage {}; + instaloader = pkgs.python3Packages.callPackage {}; + haskells = import ; unstable = import {}; executables = pkgs.haskell.lib.justStaticExecutables; in with pkgs; @@ -49,6 +49,7 @@ in with pkgs; wget httpie whois + ddgr instaloader ] ++ [ # media ffmpeg diff --git a/configs/retiolum.nix b/configs/retiolum.nix index dc0ad68..b78b83f 100644 --- a/configs/retiolum.nix +++ b/configs/retiolum.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: { - imports = [ ../modules/retiolum.nix ]; + imports = [ ]; networking.hosts = { "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; @@ -18,7 +18,7 @@ }.${config.networking.hostName}; environment.etc."tinc/retiolum/rsa_key.priv" = { - text = (import ../secrets.nix).retiolum.privateKey.${config.networking.hostName}; + text = (import ).retiolum.privateKey.${config.networking.hostName}; mode = "400"; }; } diff --git a/configs/scripts.nix b/configs/scripts.nix index fd5ebc0..92a0897 100644 --- a/configs/scripts.nix +++ b/configs/scripts.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - theme = import ../theme.nix; + theme = import ; unstable = import {}; scripts.dic = pkgs.callPackage (pkgs.fetchurl { url = "https://cgit.krebsco.de/stockholm/plain/krebs/5pkgs/simple/dic/default.nix?id=8371e21c10bdb5d5353cc581efba7e09e4ce7a91"; diff --git a/dot/dunst.nix b/dot/dunst.nix index 0131c1e..f3a4420 100644 --- a/dot/dunst.nix +++ b/dot/dunst.nix @@ -1,5 +1,5 @@ { config, pkgs }: -with import ../theme.nix; +with import ; { enable = true; iconTheme = config.constants.theme.icon; diff --git a/dot/haskells.nix b/dot/haskells.nix index 8028ed5..27190e9 100644 --- a/dot/haskells.nix +++ b/dot/haskells.nix @@ -1,6 +1,6 @@ haskellPackages: with haskellPackages; [ - (callPackage ../packages/blessings.nix {}) + (callPackage {}) HTTP HUnit MissingH diff --git a/dot/i3.nix b/dot/i3.nix index bbadc96..be565db 100644 --- a/dot/i3.nix +++ b/dot/i3.nix @@ -1,7 +1,7 @@ { pkgs, config, lib }: let unstable = import {}; - i3blocks_conf = import ./i3blocks.nix { inherit pkgs; }; + i3blocks_conf = import { inherit pkgs; }; new-workspace = unstable.writers.writeDash "new-workspace" '' i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1)) ''; @@ -12,7 +12,7 @@ let scardanelli = "wlp2s0"; homeros = "wlp3s0"; }.${config.networking.hostName}; -in with import ../theme.nix; +in with import ; rec { fonts = [ "${uiFont.name} ${toString uiFont.size}" ]; modifier = "Mod4"; diff --git a/dot/rofi.nix b/dot/rofi.nix index 51a6571..83692e8 100644 --- a/dot/rofi.nix +++ b/dot/rofi.nix @@ -1,5 +1,5 @@ { config }: -with import ../theme.nix; +with import ; { enable = true; separator = "solid"; diff --git a/dot/urxvt.nix b/dot/urxvt.nix index c63574b..fd1685d 100644 --- a/dot/urxvt.nix +++ b/dot/urxvt.nix @@ -1,5 +1,5 @@ { config, pkgs }: -with import ../theme.nix; +with import ; { enable = true; package = pkgs.rxvt_unicode-with-plugins; diff --git a/dot/xresources.nix b/dot/xresources.nix index c503dd6..de627bc 100644 --- a/dot/xresources.nix +++ b/dot/xresources.nix @@ -1,5 +1,5 @@ { lib }: -let theme = import ../theme.nix; +let theme = import ; in with lib; lists.foldr (i: cs: cs // { "*color${toString i}" = builtins.elemAt theme.colorPalette i; }) { diff --git a/helpers.nix b/lib/default.nix similarity index 100% rename from helpers.nix rename to lib/default.nix diff --git a/main.nix b/main.nix index a566e28..38e31a9 100644 --- a/main.nix +++ b/main.nix @@ -1,18 +1,18 @@ { config, lib, pkgs, ... }: let - helpers = import ./helpers.nix; + helpers = import ; in { imports = [ "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/release-18.09.tar.gz}/nixos" - ./options.nix - configs/hu-berlin.nix - configs/shells.nix - configs/editors.nix - configs/graphics.nix - configs/packages.nix - configs/networks.nix - configs/scripts.nix - configs/retiolum.nix + + + + + + + + + ]; boot.cleanTmpDir = true; @@ -62,7 +62,7 @@ in { programs.tmux = { enable = true; - extraTmuxConf = import dot/tmux.nix; + extraTmuxConf = import ; keyMode = "vi"; terminal = "screen-256color"; }; @@ -102,8 +102,8 @@ in { }; xdg.configFile = { - "mpv/input.conf".text = import dot/mpv.nix; - "htop/htoprc".text = builtins.readFile dot/htoprc; + "mpv/input.conf".text = import ; + "htop/htoprc".text = builtins.readFile ; "zathura/zathurarc".text = "set selection-clipboard clipboard"; "pycodestyle".text = '' [pycodestyle] @@ -112,8 +112,8 @@ in { }; home.file = { - ".ghc/ghci.conf".text = import dot/ghci.nix { inherit pkgs; }; - ".stack/config.yaml".text = import dot/stack.nix { user = config.constants.user; }; + ".ghc/ghci.conf".text = import { inherit pkgs; }; + ".stack/config.yaml".text = import { user = config.constants.user; }; ".zshrc".text = "# nothing to see here"; }; }; diff --git a/options.nix b/options.nix index 95d034a..92d8e5c 100644 --- a/options.nix +++ b/options.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with import ./theme.nix; +with import ; let unstable = import {}; stringOption = def: mkOption { type = types.string; default = def; }; diff --git a/systems/catullus/configuration.nix b/systems/catullus/configuration.nix index 98a72f7..9a03413 100644 --- a/systems/catullus/configuration.nix +++ b/systems/catullus/configuration.nix @@ -8,7 +8,7 @@ in { imports = [ - + ]; boot.loader.grub.enable = false; @@ -24,7 +24,7 @@ in { }; environment.variables.TERM = "linux"; - environment.variables.HTOPRC = toString ; + environment.variables.HTOPRC = toString ; documentation.enable = false; documentation.doc.enable = false; diff --git a/systems/catullus/containers.nix b/systems/catullus/containers.nix index b7da59e..baa67ed 100644 --- a/systems/catullus/containers.nix +++ b/systems/catullus/containers.nix @@ -1,8 +1,8 @@ { config, pkgs, ... }: let - telegram-reverse = pkgs.python3Packages.callPackage {}; - telegram-betacode = pkgs.python3Packages.callPackage {}; - telegram-horoscope = pkgs.python3Packages.callPackage {}; + telegram-reverse = pkgs.python3Packages.callPackage {}; + telegram-betacode = pkgs.python3Packages.callPackage {}; + telegram-horoscope = pkgs.python3Packages.callPackage {}; in { containers.telegram-bots = { autoStart = true; diff --git a/systems/homeros/config.nix b/systems/homeros/config.nix index 19bea72..5ba9b40 100644 --- a/systems/homeros/config.nix +++ b/systems/homeros/config.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { imports = - [ ../../main.nix + [ ]; boot.loader.systemd-boot.enable = true; diff --git a/systems/krops.nix b/systems/krops.nix index 879dca5..e4ec5a2 100644 --- a/systems/krops.nix +++ b/systems/krops.nix @@ -1,4 +1,7 @@ -{ catullus-ssh ? "root@catullus.r" }: +{ catullus-ssh ? "root@catullus.r" +, scardanelli-ssh ? "root@scardanelli.r:22022" +, homeros-ssh ? "root@homeros.r:22022" +}: let krops = builtins.fetchGit { url = "https://cgit.krebsco.de/krops/"; @@ -8,20 +11,33 @@ let source = name: path: lib.evalSource [{ nixpkgs.git = { - ref = "6a3f5bcb061e1822f50e299f5616a0731636e4e7"; # 18.09 url = https://github.com/NixOS/nixpkgs-channels; + # ref = "6a3f5bcb061e1822f50e299f5616a0731636e4e7"; # 18.09 + ref = "22a606e20d662e2575552ab9b5e7c31aa8331e0e"; }; + # stockholm.git = { + # url = https://cgit.krebsco.de/stockholm; + # ref = "9b2355521f8447e7da3af30bce8fb7ba6f83ed69"; + # }; system.file = toString path; - modules.file = toString ../modules; - htoprc.file = toString ../dot/htoprc; - packages.file = toString ../packages; - nixos-config.symlink = "system/configuration.nix"; - secrets.pass = { - dir = toString ~/.password-store; - name = name; - }; + niveum.file = toString ../.; + nixos-config.symlink = "system/physical.nix"; + # secrets.pass = { + # dir = toString ~/.password-store; + # name = name; + # }; }]; + systems.scardanelli = pkgs.krops.writeDeploy "deploy-scardanelli" { + source = source "scardanelli" ./scardanelli; + target = scardanelli-ssh; + }; + + systems.homeros = pkgs.krops.writeDeploy "deploy-homeros" { + source = source "homeros" ./homeros; + target = homeros-ssh; + }; + systems.catullus = pkgs.krops.writeDeploy "deploy-catullus" { source = source "catullus" ./catullus; target = catullus-ssh; diff --git a/systems/scardanelli/config.nix b/systems/scardanelli/config.nix index ce85d37..0aa3ce7 100644 --- a/systems/scardanelli/config.nix +++ b/systems/scardanelli/config.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { imports = - [ ../../main.nix + [ ]; boot.loader.systemd-boot.enable = true;