diff options
-rw-r--r-- | .obsidian/graph.json | 6 | ||||
-rw-r--r-- | .obsidian/workspace.json | 325 | ||||
-rw-r--r-- | A nice way to test flake output.md | 37 | ||||
-rw-r--r-- | Basic building blocks of Nix.md | 21 | ||||
-rw-r--r-- | Building Go applications or packages with Nix.md | 35 | ||||
-rw-r--r-- | Excalidraw/Drawing 2025-04-26 13.13.29.excalidraw.md | 14 | ||||
-rw-r--r-- | GroupVPS Platform Knowledge Base.md | 11 | ||||
-rw-r--r-- | Nix.md | 7 | ||||
-rw-r--r-- | NixOS.md | 2 | ||||
-rw-r--r-- | Specifying a License in a Flake output.md | 9 | ||||
-rw-r--r-- | Untitled.canvas | 1 | ||||
-rw-r--r-- | conflict-files-obsidian-git.md | 17 |
12 files changed, 481 insertions, 4 deletions
diff --git a/.obsidian/graph.json b/.obsidian/graph.json index 4b5202e..fb280bb 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -1,7 +1,7 @@ { "collapse-filter": false, - "search": "tag:#work", - "showTags": true, + "search": "", + "showTags": false, "showAttachments": false, "hideUnresolved": false, "showOrphans": true, @@ -17,6 +17,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 500, - "scale": 1.0136432647705078, + "scale": 0.45050811767578125, "close": true }
\ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 0000000..562aa4a --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,325 @@ +{ + "main": { + "id": "7f0b11e44951b0ae", + "type": "split", + "children": [ + { + "id": "d7ac73dacb8efdbe", + "type": "tabs", + "children": [ + { + "id": "b3764c9f25704f99", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "GroupVPS Platform Knowledge Base.md", + "mode": "source", + "source": false, + "backlinks": true, + "backlinkOpts": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + }, + "icon": "lucide-file", + "title": "GroupVPS Platform Knowledge Base" + } + }, + { + "id": "822398f611b8f173", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "A nice way to test flake output.md", + "mode": "source", + "source": false, + "backlinks": true, + "backlinkOpts": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + }, + "icon": "lucide-file", + "title": "A nice way to test flake output" + } + }, + { + "id": "bb782d1a8c5850d8", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Building Go applications or packages with Nix.md", + "mode": "source", + "source": false, + "backlinks": true, + "backlinkOpts": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + }, + "icon": "lucide-file", + "title": "Building Go applications or packages with Nix" + } + }, + { + "id": "a26014d8fc4e2d9f", + "type": "leaf", + "state": { + "type": "split-diff-view", + "state": { + "aFile": "Basic building blocks of Nix.md", + "bFile": "Basic building blocks of Nix.md", + "aRef": "" + }, + "icon": "diff", + "title": "Diff: Basic building blocks of Nix" + } + }, + { + "id": "79f7d0bfbdc953fa", + "type": "leaf", + "state": { + "type": "split-diff-view", + "state": { + "aFile": ".obsidian/workspace.json", + "bFile": ".obsidian/workspace.json", + "aRef": "HEAD", + "bRef": "" + }, + "icon": "diff", + "title": "Diff: workspace.json" + } + }, + { + "id": "98d6d636842f318b", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "A nice way to test flake output.md", + "mode": "source", + "source": false, + "backlinks": true, + "backlinkOpts": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + }, + "icon": "lucide-file", + "title": "A nice way to test flake output" + } + } + ], + "currentTab": 4 + } + ], + "direction": "vertical" + }, + "left": { + "id": "04edd518860eb1eb", + "type": "split", + "children": [ + { + "id": "2397effb8763e885", + "type": "tabs", + "children": [ + { + "id": "f1111e0bbe22e125", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" + } + }, + { + "id": "a7d38b9dfcdb980e", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": true, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "ab6d5f81f8263ef7", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "4c2d9261a6d27fe3", + "type": "split", + "children": [ + { + "id": "72d892cdc5001398", + "type": "tabs", + "children": [ + { + "id": "85b7e37f12e873f6", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "NixOS - Imperative container management.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for NixOS - Imperative container management" + } + }, + { + "id": "0cd81621ed683245", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "NixOS - Imperative container management.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links from NixOS - Imperative container management" + } + }, + { + "id": "2196498eb2fbdd42", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "00a689c4c9b061ac", + "type": "leaf", + "state": { + "type": "outline", + "state": {}, + "icon": "lucide-list", + "title": "Outline" + } + }, + { + "id": "b0f1c4ab2b436d68", + "type": "leaf", + "state": { + "type": "git-view", + "state": {}, + "icon": "git-pull-request", + "title": "Source Control" + } + } + ], + "currentTab": 4 + } + ], + "direction": "horizontal", + "width": 300 + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false, + "obsidian-git:Open Git source control": false, + "obsidian-excalidraw-plugin:New drawing": false + } + }, + "active": "79f7d0bfbdc953fa", + "lastOpenFiles": [ + "conflict-files-obsidian-git.md", + "daily/25-Apr-2025.md", + "daily/24-Apr-2025.md", + "daily/23-Apr-2025.md", + "daily/22-Apr-2025.md", + "ceilometer data is going into Prometheus as Ihor fixed the out of order issue.md", + "Using JQ to construct an array and filtering empty strings.md", + "Use ssh -O exit user@host to exit a control master session.md", + "Reinstalling packages with APT.md", + "Prometheus endpoints.md", + "OVN Clusters.md", + "Nix flake.md", + "Nix derivations.md", + "Income tax statement and reductions from mortgage.md", + "Hypotheekrenteaftrek.md", + "GroupVPS Platform.md", + "Enable logging with Libvirt.md", + "Bash process substition (tmp file).md", + "Ansible ad-hoc commands.md", + "Excalidraw/Drawing 2025-04-26 13.13.29.excalidraw.md", + "Building Go applications or packages with Nix.md", + "A nice way to test flake output.md", + "Specifying a License in a Flake output.md", + "Basic building blocks of Nix.md", + "Nix.md", + "GroupVPS Platform Knowledge Base.md", + "Untitled.canvas", + "weekly", + "archive", + "daily", + "ESP", + "Excalidraw" + ] +}
\ No newline at end of file diff --git a/A nice way to test flake output.md b/A nice way to test flake output.md new file mode 100644 index 0000000..cddf712 --- /dev/null +++ b/A nice way to test flake output.md @@ -0,0 +1,37 @@ +--- +tags: + - nix +--- +Flakes are described in [[Basic building blocks of Nix]]. + +A way to test flake outputs is by loading the flake in nix-repl and then using `:b` which builds a derivation. I learnt about `:b` from [this Nix Pill](https://nixos.org/guides/nix-pills/06-our-first-derivation.html). + +``` +box main 7s +❯ nix repl +Nix 2.24.14 +Type :? for help. +nix-repl> :lf . +Added 13 variables. + +nix-repl> outputs.packages.x86_64-linux.default +«derivation /nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv» + +nix-repl> :b outputs.packages.x86_64-linux.default +error: builder for '/nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv' failed with exit code 1; + last 9 log lines: + > Running phase: unpackPhase + > unpacking source archive /nix/store/gli7ljgsva1wchy3h4n2lmvs1rfssl40-source + > source root is source + > Running phase: patchPhase + > Running phase: updateAutotoolsGnuConfigScriptsPhase + > Running phase: configurePhase + > no configure script, doing nothing + > Running phase: buildPhase + > failed to initialize build cache at /homeless-shelter/.cache/go-build: mkdir /homeless-shelter: permission denied + For full logs, run 'nix log /nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv'. +[0 built (1 failed)] +nix-repl> + +``` + diff --git a/Basic building blocks of Nix.md b/Basic building blocks of Nix.md new file mode 100644 index 0000000..17f3ea0 --- /dev/null +++ b/Basic building blocks of Nix.md @@ -0,0 +1,21 @@ +--- +tags: + - nix +--- +It's easy to forget the basic building blocks of [[Nix]], because mostly time is spent configuring settings that make it feel like it's just some kind of JSON. + +Then, what are those building blocks? +- Derivations +- Store derivation (.drv) +- Store +- The language + +Derivation = Description of how to build a package, specifying its exact inputs. Following this recipe should result in exactly the same package no matter when we run it. + +Derivation -> instantiate -> Store derivation. (`nix derivation show`) + + +### Flake +Armed with this knowledge it should be easier to recognize what a Flake actually is. We can specify inputs that we can use to build stuff which we specify in outputs. + +The outputs thus have to be derivations. These can be tested as described in [[A nice way to test flake output]].
\ No newline at end of file diff --git a/Building Go applications or packages with Nix.md b/Building Go applications or packages with Nix.md new file mode 100644 index 0000000..27be8e1 --- /dev/null +++ b/Building Go applications or packages with Nix.md @@ -0,0 +1,35 @@ +--- +tags: + - nix +--- +In [[A nice way to test flake output]] we see a failing build due to `go build` requiring an intermediate caching step. + +I learnt [from this article](https://discourse.nixos.org/t/go-package-compilation/29165/2) that there are some helper functions in Nixpkgs to build go packages that we should use. + +The [Go](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix) section of the Nixpkgs manual describes this proces in detail. + +Useful example: +```nix +{ + pet = buildGoModule rec { + pname = "pet"; + version = "0.3.4"; + + src = fetchFromGitHub { + owner = "knqyf263"; + repo = "pet"; + rev = "v${version}"; + hash = "sha256-Gjw1dRrgM8D3G7v6WIM2+50r4HmTXvx0Xxme2fH9TlQ="; + }; + + vendorHash = "sha256-ciBIR+a1oaYH+H1PcC8cD8ncfJczk1IiJ8iYNM+R6aA="; + + meta = { + description = "Simple command-line snippet manager, written in Go"; + homepage = "https://github.com/knqyf263/pet"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ kalbasit ]; + }; + }; +} +``` diff --git a/Excalidraw/Drawing 2025-04-26 13.13.29.excalidraw.md b/Excalidraw/Drawing 2025-04-26 13.13.29.excalidraw.md new file mode 100644 index 0000000..63fb76c --- /dev/null +++ b/Excalidraw/Drawing 2025-04-26 13.13.29.excalidraw.md @@ -0,0 +1,14 @@ +--- + +excalidraw-plugin: parsed +tags: [excalidraw] + +--- +==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving' + + +## Drawing +```compressed-json +N4IgLgngDgpiBcIYA8DGBDANgSwCYCd0B3EAGhADcZ8BnbAewDsEAmcm+gV31TkQAswYKDXgB6MQHNsYfpwBGAOlT0AtmIBeNCtlQbs6RmPry6uA4wC0KDDgLFLUTJ2lH8MTDHQ0YNMWHRJMRZFAE5FFjIkT1UYRjAaBABtAF1ydCgoAGUAsD5QSXw8LOwNPkZOTExyHRgiACF0VABrQq5GXABhekx6fAQQAGIAM1GxkABfCaA== +``` +%%
\ No newline at end of file diff --git a/GroupVPS Platform Knowledge Base.md b/GroupVPS Platform Knowledge Base.md new file mode 100644 index 0000000..439074f --- /dev/null +++ b/GroupVPS Platform Knowledge Base.md @@ -0,0 +1,11 @@ +--- +tags: + - work + - groupvps +--- +This will serve as my internal knowledge base about Group.ONE VPS Platform stuff. Notes on things I encounter in the wild and such should be linked here so I can quickly get an overview. + +[[Updating the image os admin user to fix password resets]] +[[Debugging issues with updating Puppet dependency]] +[[Using Libvirt to manage QEMU image bitmaps]] +[[OVN upgrade]]
\ No newline at end of file @@ -0,0 +1,7 @@ +--- +tags: + - nix +--- +Nix is a build system & package manager with its own functional programming language also called Nix. + +[[NixOS]] is a complete Linux operating system built and packaged with Nix.
\ No newline at end of file @@ -1,3 +1,3 @@ -A declaratively configured Linux OS using the Nix build system. +A declaratively configured Linux OS using the [[Nix]] build system. The [Manual](https://nixos.org/manual/nixos/stable/) holds a lot of valuable information.
\ No newline at end of file diff --git a/Specifying a License in a Flake output.md b/Specifying a License in a Flake output.md new file mode 100644 index 0000000..b14b0a4 --- /dev/null +++ b/Specifying a License in a Flake output.md @@ -0,0 +1,9 @@ +--- +tags: + - nix +--- +While [[Building Go applications or packages with Nix]] I encountered a step where we need to specify a license. + +Documentation on this can be found [here](https://nixos.org/manual/nixpkgs/stable/#var-meta-license). [This](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix) file in Nixpkgs on Github shows available licenses. + +For example, the Apache-2.0 License is referenced through `lib.licenses.asl20`.
\ No newline at end of file diff --git a/Untitled.canvas b/Untitled.canvas new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/Untitled.canvas @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/conflict-files-obsidian-git.md b/conflict-files-obsidian-git.md new file mode 100644 index 0000000..d8bbd4f --- /dev/null +++ b/conflict-files-obsidian-git.md @@ -0,0 +1,17 @@ +# Conflicts +Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push` +(This file will automatically be deleted before commit) +[[#Additional Instructions]] available below file list + +- Not a file: .obsidian/workspace.json + +# Additional Instructions +I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. + +```diff +<<<<<<< HEAD + File changes in local repository +======= + File changes in remote repository +>>>>>>> origin/main +```
\ No newline at end of file |