From c6d1b9a2ad51b8a69348d4d16999196ef0493e6d Mon Sep 17 00:00:00 2001 From: m3tam3re Date: Thu, 17 Oct 2024 18:57:52 +0200 Subject: [PATCH] video15 --- flake.lock | 32 ++++++++++---------- flake.nix | 2 -- home/m3tam3re/home.nix | 3 +- hosts/m3-kratos/configuration.nix | 2 +- hosts/m3-kratos/services/containers/echo.nix | 2 +- hosts/m3-kratos/services/default.nix | 1 + hosts/m3-kratos/services/n8n.nix | 11 +++++++ overlays/default.nix | 13 +++----- overlays/mods/n8n.nix | 17 +++++++++++ pkgs/default.nix | 1 + pkgs/n8n-custom/default.nix | 21 +++++++++++++ 11 files changed, 76 insertions(+), 29 deletions(-) create mode 100644 hosts/m3-kratos/services/n8n.nix create mode 100644 overlays/mods/n8n.nix create mode 100644 pkgs/n8n-custom/default.nix diff --git a/flake.lock b/flake.lock index 4de797e..3a88c99 100644 --- a/flake.lock +++ b/flake.lock @@ -50,11 +50,11 @@ ] }, "locked": { - "lastModified": 1726524467, - "narHash": "sha256-xkPPPvfHhHK7BNX5ZrQ9N6AIEixCmFzRZHduDf0zv30=", + "lastModified": 1728922573, + "narHash": "sha256-FegyBabjV4868aJUbvFtqH0zKDEtUpeCAfnB1vWXeBg=", "owner": "nix-community", "repo": "disko", - "rev": "22ee467a54a3ab7fa9d637ccad5330c6c087e9dc", + "rev": "3b778f10eb275573da9f5c8a7a49e774200b87e5", "type": "github" }, "original": { @@ -66,11 +66,11 @@ "dotfiles": { "flake": false, "locked": { - "lastModified": 1725956275, - "narHash": "sha256-4tHKP+PLpJKnFfOT6MY3p/NDBr/3NDyWljB8/iELVZs=", + "lastModified": 1726139078, + "narHash": "sha256-FiyYP/hTiSOkj99P1YcIxc9uJjjInpMPAp6fKtZlkNs=", "ref": "refs/heads/master", - "rev": "b1393f4b54b8e908b770450ccc49400713d8e457", - "revCount": 1, + "rev": "d9f3a3ba9d8430306a4f6f7e9fd3ad618d274c8e", + "revCount": 2, "type": "git", "url": "https://code.m3tam3re.com/m3tam3re/dotfiles-flake-demo.git" }, @@ -107,11 +107,11 @@ ] }, "locked": { - "lastModified": 1712016346, - "narHash": "sha256-O2nO7pD+krq+4HgkLB4VThRtAucIPfXDs/jJqCGlK1w=", + "lastModified": 1726817922, + "narHash": "sha256-gO91NgBTTbVHBlvnn6g6XFeXzJquBH5MrVhYMFTnB0Q=", "owner": "nix-community", "repo": "home-manager", - "rev": "4be0464472675212654dedf3e021bd5f1d58b92f", + "rev": "f48b181f0161db6246a1bd1b05d70a7b3a87ab41", "type": "github" }, "original": { @@ -138,11 +138,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1724531977, - "narHash": "sha256-XROVLf9ti4rrNCFLr+DmXRZtPjCQTW4cYy59owTEmxk=", + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2527da1ef492c495d5391f3bcf9c1dd9f4514e32", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "type": "github" }, "original": { @@ -154,11 +154,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", + "lastModified": 1726463316, + "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3c667cf..856dc3c 100644 --- a/flake.nix +++ b/flake.nix @@ -34,8 +34,6 @@ outputs = { self, agenix, - disko, - dotfiles, home-manager, nixpkgs, ... diff --git a/home/m3tam3re/home.nix b/home/m3tam3re/home.nix index 7fb0053..2c99a97 100644 --- a/home/m3tam3re/home.nix +++ b/home/m3tam3re/home.nix @@ -26,6 +26,8 @@ home.packages = with pkgs; [ kitty wofi + firefox + n8n # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. # pkgs.hello @@ -85,7 +87,6 @@ enable = true; projectFolders = [ "${config.home.homeDirectory}/.config" - "${config.home.homeDirectory}" ]; layout = '' layout { diff --git a/hosts/m3-kratos/configuration.nix b/hosts/m3-kratos/configuration.nix index e8904a4..204500f 100644 --- a/hosts/m3-kratos/configuration.nix +++ b/hosts/m3-kratos/configuration.nix @@ -96,5 +96,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.11"; # Did you read the comment? } diff --git a/hosts/m3-kratos/services/containers/echo.nix b/hosts/m3-kratos/services/containers/echo.nix index 1c010f5..fc58469 100644 --- a/hosts/m3-kratos/services/containers/echo.nix +++ b/hosts/m3-kratos/services/containers/echo.nix @@ -2,7 +2,7 @@ virtualisation.oci-containers.containers."echo-http-service" = { image = "hashicorp/http-echo"; extraOptions = ["-text='Hello, World!'" "--network=web"]; - ports = ["5678:5678"]; + ports = ["5679:5678"]; }; system.activationScripts.createPodmanNetworkWeb = lib.mkAfter '' if ! /run/current-system/sw/bin/podman network exists web; then diff --git a/hosts/m3-kratos/services/default.nix b/hosts/m3-kratos/services/default.nix index c935f53..5c419de 100644 --- a/hosts/m3-kratos/services/default.nix +++ b/hosts/m3-kratos/services/default.nix @@ -1,5 +1,6 @@ { imports = [ ./containers + ./n8n.nix ]; } diff --git a/hosts/m3-kratos/services/n8n.nix b/hosts/m3-kratos/services/n8n.nix new file mode 100644 index 0000000..3751aaa --- /dev/null +++ b/hosts/m3-kratos/services/n8n.nix @@ -0,0 +1,11 @@ +{ + services.n8n = { + enable = true; + openFirewall = true; + }; + systemd.services.n8n = { + environment = { + N8N_SECURE_COOKIE = "false"; + }; + }; +} diff --git a/overlays/default.nix b/overlays/default.nix index ab3fc10..d34485b 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,16 +1,13 @@ -{ inputs, ... }: { +{inputs, ...}: { # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs { pkgs = final; }; + additions = final: _prev: import ../pkgs {pkgs = final;}; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. # https://nixos.wiki/wiki/Overlays - modifications = final: prev: - { - # example = prev.example.overrideAttrs (oldAttrs: rec { - # ... - # }); - }; + modifications = final: prev: { + n8n = import ./mods/n8n.nix {inherit prev;}; + }; stable-packages = final: _prev: { stable = import inputs.nixpkgs-stable { diff --git a/overlays/mods/n8n.nix b/overlays/mods/n8n.nix new file mode 100644 index 0000000..f43f4c0 --- /dev/null +++ b/overlays/mods/n8n.nix @@ -0,0 +1,17 @@ +{prev}: +prev.n8n.overrideAttrs (oldAttrs: rec { + pname = oldAttrs.pname; + version = "1.63.0"; + + src = prev.fetchFromGitHub { + owner = "n8n-io"; + repo = "n8n"; + rev = "n8n@${version}"; + hash = "sha256-zJHveCbBPJs8qbgCsU+dgucoXpAKa7PVLH4tfdcJZlE="; + }; + + pnpmDeps = prev.pnpm.fetchDeps { + inherit pname version src; + hash = "sha256-FsBA/QENfreCJnYCw8MnX5W2D+WJ3DUuTIakH78TYU8="; + }; +}) diff --git a/pkgs/default.nix b/pkgs/default.nix index 321a739..5e12295 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ {pkgs, ...}: { # Define your custom packages here zellij-ps = pkgs.callPackage ./zellij-ps {}; + n8n-custom = pkgs.callPackage ./n8n-custom {}; } diff --git a/pkgs/n8n-custom/default.nix b/pkgs/n8n-custom/default.nix new file mode 100644 index 0000000..014403b --- /dev/null +++ b/pkgs/n8n-custom/default.nix @@ -0,0 +1,21 @@ +{ + fetchFromGitHub, + n8n, + pnpm, +}: +n8n.overrideAttrs (oldAttrs: rec { + pname = oldAttrs.pname; + version = "1.63.0"; + + src = fetchFromGitHub { + owner = "n8n-io"; + repo = "n8n"; + rev = "n8n@${version}"; + hash = "sha256-zJHveCbBPJs8qbgCsU+dgucoXpAKa7PVLH4tfdcJZlE="; + }; + + pnpmDeps = pnpm.fetchDeps { + inherit pname version src; + hash = "sha256-FsBA/QENfreCJnYCw8MnX5W2D+WJ3DUuTIakH78TYU8="; + }; +})