From 60a08c6783d8bf1be90d3212d02a85b955ce06eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Thu, 11 Apr 2019 07:43:08 +0200 Subject: [PATCH] kropsify some more --- .gitignore | 2 +- configs/editors.nix | 4 ++-- configs/graphics.nix | 16 +++++++------- configs/hu-berlin.nix | 2 +- configs/packages.nix | 16 +++++++------- configs/retiolum.nix | 4 ++-- configs/scripts.nix | 2 +- configs/shells.nix | 10 +++++++-- systems/krops.nix => deploy.nix | 19 +++++++++++----- dot/dunst.nix | 2 +- dot/haskells.nix | 2 +- dot/i3.nix | 4 ++-- dot/rofi.nix | 2 +- theme.nix => dot/theme.nix | 0 dot/urxvt.nix | 2 +- dot/xresources.nix | 2 +- .../defaultApplications.nix | 2 +- systems/catullus/configuration.nix | 4 ++-- systems/catullus/containers.nix | 6 ++--- main.nix => systems/generic.nix | 22 +++++++++---------- .../homeros/{config.nix => configuration.nix} | 3 ++- ...hysical.nix => hardware-configuration.nix} | 1 - .../{config.nix => configuration.nix} | 3 ++- ...hysical.nix => hardware-configuration.nix} | 1 - 24 files changed, 72 insertions(+), 59 deletions(-) rename systems/krops.nix => deploy.nix (68%) rename theme.nix => dot/theme.nix (100%) rename options.nix => modules/defaultApplications.nix (98%) rename main.nix => systems/generic.nix (88%) rename systems/homeros/{config.nix => configuration.nix} (76%) rename systems/homeros/{physical.nix => hardware-configuration.nix} (98%) rename systems/scardanelli/{config.nix => configuration.nix} (76%) rename systems/scardanelli/{physical.nix => hardware-configuration.nix} (97%) diff --git a/.gitignore b/.gitignore index c6ca54d..ce548ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/secrets.nix +secrets.nix result diff --git a/configs/editors.nix b/configs/editors.nix index a9f9a8e..5bdc025 100644 --- a/configs/editors.nix +++ b/configs/editors.nix @@ -1,5 +1,5 @@ { pkgs, config, ... }: -let vimConfig = import { 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 ; + customRC = builtins.readFile ; packages.nvim = with pkgs.vimPlugins; { start = with pkgs.vimPlugins; [ ale diff --git a/configs/graphics.nix b/configs/graphics.nix index a092bcc..88f4132 100644 --- a/configs/graphics.nix +++ b/configs/graphics.nix @@ -1,6 +1,6 @@ { pkgs, lib, config, ... }: { - services.xserver = with import ; with import ; { + 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 ${} -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 ; 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 { inherit lib pkgs config; }; + config = import { inherit lib pkgs config; }; }; - xresources.properties = import { inherit lib; }; - programs.rofi = import { inherit config; }; - services.dunst = import { inherit pkgs config; }; - programs.urxvt = import { 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 9c42f35..fa963ed 100644 --- a/configs/hu-berlin.nix +++ b/configs/hu-berlin.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let - eduroam = (import ).eduroam; + eduroam = (import ).eduroam; eduroamConfig = { auth = '' key_mgmt=WPA-EAP diff --git a/configs/packages.nix b/configs/packages.nix index ceb1a6f..4b7a42b 100644 --- a/configs/packages.nix +++ b/configs/packages.nix @@ -1,13 +1,13 @@ { config, pkgs, lib, ... }: let - 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 ; + 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; diff --git a/configs/retiolum.nix b/configs/retiolum.nix index b78b83f..0cc39bb 100644 --- a/configs/retiolum.nix +++ b/configs/retiolum.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: { - imports = [ ]; + 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 ).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 92a0897..f9434ba 100644 --- a/configs/scripts.nix +++ b/configs/scripts.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - theme = import ; + 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/configs/shells.nix b/configs/shells.nix index 5666cc3..93fdb09 100644 --- a/configs/shells.nix +++ b/configs/shells.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ config, pkgs, lib, ... }: let zsh-plugins-file = pkgs.writeText "zsh_plugins.txt" (lib.concatStringsSep "\n" [ @@ -69,7 +69,7 @@ in { export KEYTIMEOUT=1 - hash -d nixos=/etc/nixos + hash -d nixos=/etc/nixos niveum=${config.users.users.kfm.home}/prog/git/niveum autoload -U zmv run-help @@ -77,6 +77,12 @@ in { mkdir $1 cd $1 } + + niveum-deploy() { + for system in "$@"; do + eval $(nix-build ~niveum/deploy.nix -A "$system") + done + } ''; promptInit = '' autoload -Uz vcs_info diff --git a/systems/krops.nix b/deploy.nix similarity index 68% rename from systems/krops.nix rename to deploy.nix index e4ec5a2..97c8189 100644 --- a/systems/krops.nix +++ b/deploy.nix @@ -17,11 +17,18 @@ let }; # stockholm.git = { # url = https://cgit.krebsco.de/stockholm; - # ref = "9b2355521f8447e7da3af30bce8fb7ba6f83ed69"; + # ref = "7e1b197dab13d024ba491c96dc959306324943c0"; # }; system.file = toString path; - niveum.file = toString ../.; - nixos-config.symlink = "system/physical.nix"; + art.file = toString ./art; + lib.file = toString ./lib; + packages.file = toString ./packages; + systems.file = toString ./systems; + configs.file = toString ./configs; + dot.file = toString ./dot; + modules.file = toString ./modules; + + nixos-config.symlink = "system/configuration.nix"; # secrets.pass = { # dir = toString ~/.password-store; # name = name; @@ -29,17 +36,17 @@ let }]; systems.scardanelli = pkgs.krops.writeDeploy "deploy-scardanelli" { - source = source "scardanelli" ./scardanelli; + source = source "scardanelli" ./systems/scardanelli; target = scardanelli-ssh; }; systems.homeros = pkgs.krops.writeDeploy "deploy-homeros" { - source = source "homeros" ./homeros; + source = source "homeros" ./systems/homeros; target = homeros-ssh; }; systems.catullus = pkgs.krops.writeDeploy "deploy-catullus" { - source = source "catullus" ./catullus; + source = source "catullus" ./systems/catullus; target = catullus-ssh; }; in systems // { diff --git a/dot/dunst.nix b/dot/dunst.nix index f3a4420..e1bf3c3 100644 --- a/dot/dunst.nix +++ b/dot/dunst.nix @@ -1,5 +1,5 @@ { config, pkgs }: -with import ; +with import ; { enable = true; iconTheme = config.constants.theme.icon; diff --git a/dot/haskells.nix b/dot/haskells.nix index 27190e9..39f75c8 100644 --- a/dot/haskells.nix +++ b/dot/haskells.nix @@ -1,6 +1,6 @@ haskellPackages: with haskellPackages; [ - (callPackage {}) + (callPackage {}) HTTP HUnit MissingH diff --git a/dot/i3.nix b/dot/i3.nix index be565db..079ffec 100644 --- a/dot/i3.nix +++ b/dot/i3.nix @@ -1,7 +1,7 @@ { pkgs, config, lib }: let unstable = import {}; - i3blocks_conf = import { 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 ; +in with import ; rec { fonts = [ "${uiFont.name} ${toString uiFont.size}" ]; modifier = "Mod4"; diff --git a/dot/rofi.nix b/dot/rofi.nix index 83692e8..1d50b39 100644 --- a/dot/rofi.nix +++ b/dot/rofi.nix @@ -1,5 +1,5 @@ { config }: -with import ; +with import ; { enable = true; separator = "solid"; diff --git a/theme.nix b/dot/theme.nix similarity index 100% rename from theme.nix rename to dot/theme.nix diff --git a/dot/urxvt.nix b/dot/urxvt.nix index fd1685d..44c091a 100644 --- a/dot/urxvt.nix +++ b/dot/urxvt.nix @@ -1,5 +1,5 @@ { config, pkgs }: -with import ; +with import ; { enable = true; package = pkgs.rxvt_unicode-with-plugins; diff --git a/dot/xresources.nix b/dot/xresources.nix index de627bc..8d57a8f 100644 --- a/dot/xresources.nix +++ b/dot/xresources.nix @@ -1,5 +1,5 @@ { lib }: -let theme = import ; +let theme = import ; in with lib; lists.foldr (i: cs: cs // { "*color${toString i}" = builtins.elemAt theme.colorPalette i; }) { diff --git a/options.nix b/modules/defaultApplications.nix similarity index 98% rename from options.nix rename to modules/defaultApplications.nix index 92d8e5c..12c0688 100644 --- a/options.nix +++ b/modules/defaultApplications.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with import ; +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 9a03413..c82d202 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 baa67ed..b7da59e 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/main.nix b/systems/generic.nix similarity index 88% rename from main.nix rename to systems/generic.nix index 38e31a9..e743e6c 100644 --- a/main.nix +++ b/systems/generic.nix @@ -1,18 +1,18 @@ { config, lib, pkgs, ... }: let - helpers = import ; + helpers = import ; in { imports = [ "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/release-18.09.tar.gz}/nixos" - - - - - - - - - + + + + + + + + + ]; boot.cleanTmpDir = true; @@ -62,7 +62,7 @@ in { programs.tmux = { enable = true; - extraTmuxConf = import ; + extraTmuxConf = import ; keyMode = "vi"; terminal = "screen-256color"; }; diff --git a/systems/homeros/config.nix b/systems/homeros/configuration.nix similarity index 76% rename from systems/homeros/config.nix rename to systems/homeros/configuration.nix index 5ba9b40..837ae57 100644 --- a/systems/homeros/config.nix +++ b/systems/homeros/configuration.nix @@ -1,7 +1,8 @@ { config, pkgs, ... }: { imports = - [ + [ + ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/systems/homeros/physical.nix b/systems/homeros/hardware-configuration.nix similarity index 98% rename from systems/homeros/physical.nix rename to systems/homeros/hardware-configuration.nix index a300bfa..d2d7cf5 100644 --- a/systems/homeros/physical.nix +++ b/systems/homeros/hardware-configuration.nix @@ -6,7 +6,6 @@ { imports = [ - ./config.nix ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ]; diff --git a/systems/scardanelli/config.nix b/systems/scardanelli/configuration.nix similarity index 76% rename from systems/scardanelli/config.nix rename to systems/scardanelli/configuration.nix index 0aa3ce7..37f9744 100644 --- a/systems/scardanelli/config.nix +++ b/systems/scardanelli/configuration.nix @@ -1,7 +1,8 @@ { config, pkgs, ... }: { imports = - [ + [ + ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/systems/scardanelli/physical.nix b/systems/scardanelli/hardware-configuration.nix similarity index 97% rename from systems/scardanelli/physical.nix rename to systems/scardanelli/hardware-configuration.nix index e156e5f..87cc0b7 100644 --- a/systems/scardanelli/physical.nix +++ b/systems/scardanelli/hardware-configuration.nix @@ -6,7 +6,6 @@ { imports = [ - ./config.nix ]; boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" "rtsx_usb_sdmmc" ];