wip main list

master
Ingolf Wagner 2021-09-06 10:05:56 +02:00
parent 154528cb05
commit fd81758637
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
6 changed files with 101 additions and 113 deletions

View File

@ -2,8 +2,8 @@
title: About me title: About me
--- ---
I'm a freelancing Mathematician, Full Stack Developer and DevOps. I'm a freelancing Mathematician, Full Stack Developer and DevOps Engineer.
[NixOS](https://nixos.org) is my Operation System of choice. [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 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). on my journeys. Have a look at my [travel page](http://travel.ingolf-wagner.de).

View File

@ -9,9 +9,9 @@ tags:
- password-store - password-store
summary: > summary: >
krops is an alternative to 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. 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. using krops and discuss all involved parameters and steps.
--- ---
@ -20,7 +20,7 @@ summary: >
the official DevOps tool of the official DevOps tool of
[NixOS ](https://nixos.org) is nice, but it has some flaws. [NixOS ](https://nixos.org) is nice, but it has some flaws.
[krops](https://cgit.krebsco.de/krops/about/) is an alternative to [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. with some very simple concepts.
If you're looking for a good document on how to use 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 Structure by Example
krops is not an executable like NixOps, 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` 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 %}} {{% /note %}}
```nix ```nix
source = lib.evalSource [ source = lib.evalSource [
{ {
nixpkgs.git = { nixpkgs.git = {
ref = "nixos-18.03"; ref = "nixos-18.03";
url = https://github.com/NixOS/nixpkgs-channels; url = https://github.com/NixOS/nixpkgs-channels;
}; };
nixos-config.file = toString ./configuration.nix; nixos-config.file = toString ./configuration.nix;
} }
]; ];
``` ```
The list of folders and files are managed by the `source` parameter. 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. 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`. For example add `nixpkgs-unstable` the same way you add `nixpkgs`.
```nix ```nix
source = lib.evalSource [ source = lib.evalSource [
{ {
nixpkgs.git = { nixpkgs.git = {
ref = "nixos-18.09"; ref = "nixos-18.09";
url = https://github.com/NixOS/nixpkgs-channels; url = https://github.com/NixOS/nixpkgs-channels;
}; };
nixpkgs-unstable.git = { nixpkgs-unstable.git = {
ref = "nixos-unstable"; ref = "nixos-unstable";
url = https://github.com/NixOS/nixpkgs-channels; url = https://github.com/NixOS/nixpkgs-channels;
}; };
nixos-config.file = toString ./configuration.nix; nixos-config.file = toString ./configuration.nix;
} }
]; ];
``` ```
To install a package from the `unstable` channel you just have to import the channel To install a package from the `unstable` channel you just have to import the channel

View File

@ -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) Now I'm using [home-manager](https://github.com/rycee/home-manager)
to configure files in `~/.spacemacs.d/` and `load` them in 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. inside the `dotspacemacs/user-config` function is enough, to make it work.
```nix ```nix
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let let
user = "mainUser"; user = "mainUser";
userName = config.users.users."${user}".name; userName = config.users.users."${user}".name;
home = config.users.users."${user}".home; home = config.users.users."${user}".home;
@ -52,10 +52,7 @@ let
url = "https://github.com/NixOS/nixos-homepage/raw/master/logo/nix-wiki.png"; url = "https://github.com/NixOS/nixos-homepage/raw/master/logo/nix-wiki.png";
sha256 = "1hrz7wr7i0b2bips60ygacbkmdzv466lsbxi22hycg42kv4m0173"; sha256 = "1hrz7wr7i0b2bips60ygacbkmdzv466lsbxi22hycg42kv4m0173";
}; };
in {
in
{
systemd.services = systemd.services =
let let
clone = clone =
@ -77,65 +74,61 @@ in
home-manager.users."${user}" = { home-manager.users."${user}" = {
home.file.".spacemacs.d/hook-init.el".text = '' home.file.".spacemacs.d/hook-init.el".text = ''
;; just add (load "~/.spacemacs.d/hook-init.el") ;; just add (load "~/.spacemacs.d/hook-init.el")
;; at the end of dotspacemacs/init function ;; 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 () home.file.".spacemacs.d/hook-layers.el".text = ''
(setq-default ;; just add (load "~/.spacemacs.d/hook-layers.el")
dotspacemacs-themes '(solarized-light solarized-dark) ;; at the end of dotspacemacs/layers function
dotspacemacs-startup-banner "${startupBanner}" (let
dotspacemacs-default-font '("Terminus" ((user-layers dotspacemacs-configuration-layers))
:size ${toString fontSize} (setq
:weight normal dotspacemacs-configuration-layers
:width normal (append user-layers
:powerline-scale 1.1)) '( 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 = '' home.file.".spacemacs.d/hook-user-config.el".text = ''
;; just add (load "~/.spacemacs.d/hook-layers.el") ;; just add (load "~/.spacemacs.d/hook-user-config.el")
;; at the end of dotspacemacs/layers function ;; at the end of dotspacemacs/user-config function
(let ;; lsp setup for haskell
((user-layers dotspacemacs-configuration-layers)) ;; hie-wrapper must be installed and configured in the direnv setup
(setq (setq lsp-haskell-process-path-hie "hie-wrapper")
dotspacemacs-configuration-layers (setq lsp-response-timeout 60)
(append user-layers (require 'lsp-haskell)
'( spell-checking (add-hook 'haskell-mode-hook #'lsp)
syntax-checking (add-hook 'haskell-mode-hook #'direnv-update-environment)
(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)
'';
};
} }
``` ```
@ -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. I usually do this in my projects (via `lsp.nix`). Here is the part that differs.
```nix ```nix
home.file.".spacemacs.d/hook-user-config.el".text = home.file.".spacemacs.d/hook-user-config.el".text =
let let
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
in '' in ''
;; just add (load "~/.spacemacs.d/hook-user-config.el") ;; just add (load "~/.spacemacs.d/hook-user-config.el")
;; at the end of dotspacemacs/user-config function ;; at the end of dotspacemacs/user-config function
;; lsp setup for haskell ;; lsp setup for haskell
(setq lsp-haskell-process-path-hie (setq lsp-haskell-process-path-hie
"${all-hies.selection{ selector = p: { inherit (p) ghc864;}; } }/bin/hie-wrapper") "${all-hies.selection{ selector = p: { inherit (p) ghc864;}; } }/bin/hie-wrapper")
(setq lsp-response-timeout 60) (setq lsp-response-timeout 60)
(require 'lsp-haskell) (require 'lsp-haskell)
(add-hook 'haskell-mode-hook #'lsp) (add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-mode-hook #'direnv-update-environment) ;; still needed (add-hook 'haskell-mode-hook #'direnv-update-environment) ;; still needed
''; '';
``` ```
## Setup the project ## Setup the project

View File

@ -562,7 +562,6 @@ in {
# we create hcloud_ssh_keys, if admins exist # we create hcloud_ssh_keys, if admins exist
( mkIf ( length ( attrNames config.admins ) > 0 ) ( mkIf ( length ( attrNames config.admins ) > 0 )
adminSshKeys) adminSshKeys)
]; ];
} }
``` ```

View File

@ -135,8 +135,7 @@ in {
# for all machines # for all machines
# ---------------- # ----------------
default = default = { config, pkgs, lib, ... }:
{config, pkgs, lib, ... }:
{ {
with lib; with lib;
services.custom.tinc = services.custom.tinc =
@ -227,7 +226,6 @@ PING HAL.private (10.1.1.3) 56(84) bytes of data.
**Awesome!** That was easy! **Awesome!** That was easy!
## Connect 2 sub-networks ## Connect 2 sub-networks
So far so good, So far so good,
@ -245,9 +243,7 @@ just add the `tincSubnet` parameter in the `hosts` attribute and your done.
```nix ```nix
... ...
default = { config, pkgs, lib, ... }:
default =
{config, pkgs, lib, ... }:
{ {
with lib; with lib;
services.custom.tinc = services.custom.tinc =

View File

@ -3,4 +3,5 @@ title: "slides"
date: 2021-07-24T21:43:24+02:00 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. Here is a collection of Slides I presented to people.
Feel free to use and download them.