diff --git a/content/about.md b/content/about.md index 04e7c7e..7611d6c 100644 --- a/content/about.md +++ b/content/about.md @@ -2,8 +2,8 @@ title: About me --- -I'm a freelancing Mathematician, Full Stack Developer and DevOps. -[NixOS](https://nixos.org) is my Operation System of choice. +I'm a freelancing Mathematician, Full Stack Developer and DevOps Engineer. +[NixOS](https://nixos.org) is my Operating System of choice. When I'm not doing stuff on my computer I play video games or make some photos on my journeys. Have a look at my [travel page](http://travel.ingolf-wagner.de). diff --git a/content/nixos/krops.md b/content/nixos/krops.md index 1c9757f..74ad6c2 100644 --- a/content/nixos/krops.md +++ b/content/nixos/krops.md @@ -9,9 +9,9 @@ tags: - password-store summary: > krops is an alternative to - NixOps trying to solve some of theses flaws, + NixOps trying to solve some of these flaws, with some very simple concepts. - In this article we will checkout on how to deploy a server + In this article we will see on how to deploy a server using krops and discuss all involved parameters and steps. --- @@ -20,7 +20,7 @@ summary: > the official DevOps tool of [NixOS ](https://nixos.org) is nice, but it has some flaws. [krops](https://cgit.krebsco.de/krops/about/) is an alternative to -[NixOps](https://nixos.org/nixops/) trying to solve some of theses flaws, +[NixOps](https://nixos.org/nixops/) trying to solve some of these flaws, with some very simple concepts. If you're looking for a good document on how to use @@ -101,7 +101,7 @@ have a look at ## krops Structure by Example krops is not an executable like NixOps, -it is a library you use to write executables which do the actual deployment. +it is a library to write executables which do the actual deployment. Let's say you have a very simple `configuration.nix` @@ -210,15 +210,15 @@ to change the ssh port and the target folder it should be copied. {{% /note %}} ```nix - source = lib.evalSource [ - { - nixpkgs.git = { - ref = "nixos-18.03"; - url = https://github.com/NixOS/nixpkgs-channels; - }; - nixos-config.file = toString ./configuration.nix; - } - ]; +source = lib.evalSource [ + { + nixpkgs.git = { + ref = "nixos-18.03"; + url = https://github.com/NixOS/nixpkgs-channels; + }; + nixos-config.file = toString ./configuration.nix; + } +]; ``` The list of folders and files are managed by the `source` parameter. @@ -316,7 +316,6 @@ source = lib.evalSource [ }; } ]; - ``` This copies `secrets/server01` to `/var/src/secrets` after it is decrypted. @@ -464,19 +463,19 @@ It is very easy to install packages from different channels. For example add `nixpkgs-unstable` the same way you add `nixpkgs`. ```nix - source = lib.evalSource [ - { - nixpkgs.git = { - ref = "nixos-18.09"; - url = https://github.com/NixOS/nixpkgs-channels; - }; - nixpkgs-unstable.git = { - ref = "nixos-unstable"; - url = https://github.com/NixOS/nixpkgs-channels; - }; - nixos-config.file = toString ./configuration.nix; - } - ]; +source = lib.evalSource [ + { + nixpkgs.git = { + ref = "nixos-18.09"; + url = https://github.com/NixOS/nixpkgs-channels; + }; + nixpkgs-unstable.git = { + ref = "nixos-unstable"; + url = https://github.com/NixOS/nixpkgs-channels; + }; + nixos-config.file = toString ./configuration.nix; + } +]; ``` To install a package from the `unstable` channel you just have to import the channel diff --git a/content/nixos/language-server.md b/content/nixos/language-server.md index 19ad832..f3603c0 100755 --- a/content/nixos/language-server.md +++ b/content/nixos/language-server.md @@ -36,13 +36,13 @@ but this does not play well with updates and with `customization`. Now I'm using [home-manager](https://github.com/rycee/home-manager) to configure files in `~/.spacemacs.d/` and `load` them in -the configuration functions inside `~/.spacemacs`. A simple `(load "~/.spacemacs.d/hook-user-config.el")` +the configuration functions inside `~/.spacemacs`. +A simple `(load "~/.spacemacs.d/hook-user-config.el")` inside the `dotspacemacs/user-config` function is enough, to make it work. ```nix { pkgs, lib, config, ... }: let - user = "mainUser"; userName = config.users.users."${user}".name; home = config.users.users."${user}".home; @@ -52,10 +52,7 @@ let url = "https://github.com/NixOS/nixos-homepage/raw/master/logo/nix-wiki.png"; sha256 = "1hrz7wr7i0b2bips60ygacbkmdzv466lsbxi22hycg42kv4m0173"; }; - -in -{ - +in { systemd.services = let clone = @@ -77,65 +74,61 @@ in home-manager.users."${user}" = { - home.file.".spacemacs.d/hook-init.el".text = '' - ;; just add (load "~/.spacemacs.d/hook-init.el") - ;; at the end of dotspacemacs/init function + home.file.".spacemacs.d/hook-init.el".text = '' + ;; just add (load "~/.spacemacs.d/hook-init.el") + ;; at the end of dotspacemacs/init function + ;; overrides of dotspacemacs/init () + (setq-default + dotspacemacs-themes '(solarized-light solarized-dark) + dotspacemacs-startup-banner "${startupBanner}" + dotspacemacs-default-font + '("Terminus" :size ${toString fontSize} + :weight normal + :width normal + :powerline-scale 1.1)) + ''; - ;; overrides of dotspacemacs/init () - (setq-default - dotspacemacs-themes '(solarized-light solarized-dark) - dotspacemacs-startup-banner "${startupBanner}" - dotspacemacs-default-font '("Terminus" - :size ${toString fontSize} - :weight normal - :width normal - :powerline-scale 1.1)) - ''; + home.file.".spacemacs.d/hook-layers.el".text = '' + ;; just add (load "~/.spacemacs.d/hook-layers.el") + ;; at the end of dotspacemacs/layers function + (let + ((user-layers dotspacemacs-configuration-layers)) + (setq + dotspacemacs-configuration-layers + (append user-layers + '( spell-checking + syntax-checking + (haskell :variables + haskell-enable-hindent t + haskell-completion-backend 'lsp + haskell-enable-hindent-style "gibiansky" + haskell-process-type 'cabal-new-repl) + )))) + (let + ((user-packages dotspacemacs-additional-packages )) + (setq + dotspacemacs-additional-packages + (append user-packages + '( lsp-mode + lsp-ui + lsp-haskell + direnv + )))) + ''; - home.file.".spacemacs.d/hook-layers.el".text = '' - ;; just add (load "~/.spacemacs.d/hook-layers.el") - ;; at the end of dotspacemacs/layers function + home.file.".spacemacs.d/hook-user-config.el".text = '' + ;; just add (load "~/.spacemacs.d/hook-user-config.el") + ;; at the end of dotspacemacs/user-config function - (let - ((user-layers dotspacemacs-configuration-layers)) - (setq - dotspacemacs-configuration-layers - (append user-layers - '( spell-checking - syntax-checking - (haskell :variables - haskell-enable-hindent t - haskell-completion-backend 'lsp - haskell-enable-hindent-style "gibiansky" - haskell-process-type 'cabal-new-repl) - )))) - - (let - ((user-packages dotspacemacs-additional-packages )) - (setq - dotspacemacs-additional-packages - (append user-packages - '( lsp-mode - lsp-ui - lsp-haskell - direnv - )))) - ''; - - home.file.".spacemacs.d/hook-user-config.el".text = '' - ;; just add (load "~/.spacemacs.d/hook-user-config.el") - ;; at the end of dotspacemacs/user-config function - - ;; lsp setup for haskell - ;; hie-wrapper must be installed and configured in the direnv setup - (setq lsp-haskell-process-path-hie "hie-wrapper") - (setq lsp-response-timeout 60) - (require 'lsp-haskell) - (add-hook 'haskell-mode-hook #'lsp) - (add-hook 'haskell-mode-hook #'direnv-update-environment) - ''; - - }; + ;; lsp setup for haskell + ;; hie-wrapper must be installed and configured in the direnv setup + (setq lsp-haskell-process-path-hie "hie-wrapper") + (setq lsp-response-timeout 60) + (require 'lsp-haskell) + (add-hook 'haskell-mode-hook #'lsp) + (add-hook 'haskell-mode-hook #'direnv-update-environment) + ''; + }; } ``` @@ -150,21 +143,21 @@ You can install the `lsp` (in our case `hie-wrapper`) globally in your `configur I usually do this in my projects (via `lsp.nix`). Here is the part that differs. ```nix - home.file.".spacemacs.d/hook-user-config.el".text = - let - all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; - in '' - ;; just add (load "~/.spacemacs.d/hook-user-config.el") - ;; at the end of dotspacemacs/user-config function +home.file.".spacemacs.d/hook-user-config.el".text = + let + all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; + in '' + ;; just add (load "~/.spacemacs.d/hook-user-config.el") + ;; at the end of dotspacemacs/user-config function - ;; lsp setup for haskell - (setq lsp-haskell-process-path-hie - "${all-hies.selection{ selector = p: { inherit (p) ghc864;}; } }/bin/hie-wrapper") - (setq lsp-response-timeout 60) - (require 'lsp-haskell) - (add-hook 'haskell-mode-hook #'lsp) - (add-hook 'haskell-mode-hook #'direnv-update-environment) ;; still needed - ''; + ;; lsp setup for haskell + (setq lsp-haskell-process-path-hie + "${all-hies.selection{ selector = p: { inherit (p) ghc864;}; } }/bin/hie-wrapper") + (setq lsp-response-timeout 60) + (require 'lsp-haskell) + (add-hook 'haskell-mode-hook #'lsp) + (add-hook 'haskell-mode-hook #'direnv-update-environment) ;; still needed + ''; ``` ## Setup the project diff --git a/content/nixos/nix-instantiate.md b/content/nixos/nix-instantiate.md index 8863dd5..aac944b 100644 --- a/content/nixos/nix-instantiate.md +++ b/content/nixos/nix-instantiate.md @@ -562,7 +562,6 @@ in { # we create hcloud_ssh_keys, if admins exist ( mkIf ( length ( attrNames config.admins ) > 0 ) adminSshKeys) - ]; } ``` diff --git a/content/nixos/tinc.md b/content/nixos/tinc.md index e014ae4..3f2a9a4 100644 --- a/content/nixos/tinc.md +++ b/content/nixos/tinc.md @@ -135,8 +135,7 @@ in { # for all machines # ---------------- -default = -{config, pkgs, lib, ... }: +default = { config, pkgs, lib, ... }: { with lib; services.custom.tinc = @@ -227,7 +226,6 @@ PING HAL.private (10.1.1.3) 56(84) bytes of data. **Awesome!** That was easy! - ## Connect 2 sub-networks So far so good, @@ -245,9 +243,7 @@ just add the `tincSubnet` parameter in the `hosts` attribute and your done. ```nix ... - -default = -{config, pkgs, lib, ... }: +default = { config, pkgs, lib, ... }: { with lib; services.custom.tinc = diff --git a/content/slides/_index.md b/content/slides/_index.md index e94ebfb..7485dc0 100644 --- a/content/slides/_index.md +++ b/content/slides/_index.md @@ -3,4 +3,5 @@ title: "slides" date: 2021-07-24T21:43:24+02:00 --- -Here is a collection of Slides I presented to people. Feel free to use and download them. \ No newline at end of file +Here is a collection of Slides I presented to people. +Feel free to use and download them. \ No newline at end of file