From 9fedf21534aecbe4279e7618bfb9fc9e56c12e73 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Fri, 6 Jan 2023 15:19:00 +0400 Subject: [PATCH] Add remapper --- flake.lock | 130 ++++++++++++++++++++- flake.nix | 2 + machines/T420-Laptop/default.nix | 1 + overlay.nix | 2 + profiles/applications/vscodium/default.nix | 3 +- profiles/servers/remapper.nix | 21 ++++ 6 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 profiles/servers/remapper.nix diff --git a/flake.lock b/flake.lock index f94e7da..437b55a 100644 --- a/flake.lock +++ b/flake.lock @@ -289,6 +289,36 @@ "type": "github" } }, + "flake-utils_4": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs_3", @@ -559,6 +589,36 @@ "type": "github" } }, + "nixpkgs_10": { + "locked": { + "lastModified": 1671741567, + "narHash": "sha256-SSmlJkiSOkrM0CW6pASLAMs1+3TaAogmw0hwch+VvhQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7ed9bbb62d807957938a46a136113cf18b7552fe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { + "locked": { + "lastModified": 1599773960, + "narHash": "sha256-5bL52aaUOOyOBjgKh9/6jQlFbeE+WfVX7dpvjohmD+w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5916b9637048446755629c84ae6f13361f623d13", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1671877799, @@ -670,15 +730,16 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1599773960, - "narHash": "sha256-5bL52aaUOOyOBjgKh9/6jQlFbeE+WfVX7dpvjohmD+w=", - "owner": "nixos", + "lastModified": 1672791794, + "narHash": "sha256-mqGPpGmwap0Wfsf3o2b6qHJW1w2kk/I6cGCGIU+3t6o=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "5916b9637048446755629c84ae6f13361f623d13", + "rev": "9813adc7f7c0edd738c6bdd8431439688bb0cb3d", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -699,6 +760,26 @@ "type": "github" } }, + "remapper": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_9", + "telegram-bot-monadic": "telegram-bot-monadic" + }, + "locked": { + "lastModified": 1672953367, + "narHash": "sha256-UxZoBfiOayax8R53KoP7HuzR3DY9P2cZEP6WJIwWFYc=", + "owner": "balsoft", + "repo": "remapper", + "rev": "f7729afe256c694da1a19e9a780e43710e0a8119", + "type": "github" + }, + "original": { + "owner": "balsoft", + "repo": "remapper", + "type": "github" + } + }, "root": { "inputs": { "NUR": "NUR", @@ -725,6 +806,7 @@ "nixpkgs": "nixpkgs_8", "nixpkgs-old": "nixpkgs-old", "nixpkgs-wayland": "nixpkgs-wayland", + "remapper": "remapper", "rycee": "rycee", "simple-nixos-mailserver": "simple-nixos-mailserver", "simple-osd-daemons": "simple-osd-daemons", @@ -766,7 +848,7 @@ "simple-osd-daemons": { "inputs": { "crate2nix": "crate2nix", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1651606905, @@ -798,6 +880,42 @@ "type": "github" } }, + "telegram-bot-monadic": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_10", + "telegram-bot-simple": "telegram-bot-simple" + }, + "locked": { + "lastModified": 1672247639, + "narHash": "sha256-zqor3Yf/Ezh1VC6gemD+nm1pxZut7fulDeNOmXZpqwY=", + "owner": "balsoft", + "repo": "telegram-bot-monadic", + "rev": "ac9ac7a353b44ea5c5b83758078df677b8691bc5", + "type": "github" + }, + "original": { + "owner": "balsoft", + "repo": "telegram-bot-monadic", + "type": "github" + } + }, + "telegram-bot-simple": { + "flake": false, + "locked": { + "lastModified": 1671981417, + "narHash": "sha256-Q9Pe6dCvCuGsRv3wmxqU8mCWhasQhRwDDIKO8XvdpJA=", + "owner": "fizruk", + "repo": "telegram-bot-simple", + "rev": "a0aa517586fd3bb2324a617d2d185c0b65e56398", + "type": "github" + }, + "original": { + "owner": "fizruk", + "repo": "telegram-bot-simple", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index efbc234..eb4133b 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,8 @@ }; nix-vscode-marketplace.url = "github:AmeerTaweel/nix-vscode-marketplace"; + + remapper.url = "github:balsoft/remapper"; }; outputs = { nixpkgs, self, nix, deploy-rs, ... }@inputs: diff --git a/machines/T420-Laptop/default.nix b/machines/T420-Laptop/default.nix index f5ba131..1ddef04 100644 --- a/machines/T420-Laptop/default.nix +++ b/machines/T420-Laptop/default.nix @@ -13,6 +13,7 @@ # home-assistant # mastodon irc + remapper ]; services.logind.lidSwitch = "ignore"; diff --git a/overlay.nix b/overlay.nix index 9b708da..95dd943 100644 --- a/overlay.nix +++ b/overlay.nix @@ -129,4 +129,6 @@ in rec { codebraid = prev.codebraid.overrideAttrs (_: { src = inputs.codebraid; }); + + remapper = inputs.remapper.packages.${final.system}.default; } diff --git a/profiles/applications/vscodium/default.nix b/profiles/applications/vscodium/default.nix index 21e5fed..937fe6f 100644 --- a/profiles/applications/vscodium/default.nix +++ b/profiles/applications/vscodium/default.nix @@ -47,12 +47,11 @@ in { desktop = "codium-wayland"; }; home-manager.users.balsoft = { - programs.vscode = { enable = true; package = pkgs.vscodium; - mutableExtensionsDir = false; + mutableExtensionsDir = true; extensions = with inputs.nix-vscode-marketplace.packages.${pkgs.system}.vscode; with inputs.nix-vscode-marketplace.packages.${pkgs.system}.open-vsx; diff --git a/profiles/servers/remapper.nix b/profiles/servers/remapper.nix new file mode 100644 index 0000000..44468d3 --- /dev/null +++ b/profiles/servers/remapper.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: { + systemd.services.remapper = { + path = [ pkgs.remapper ]; + script = "remapper"; + serviceConfig = { + EnvironmentFile = config.secrets.remapper-telegram-token.decrypted; + PrivateTmp = true; + User = "remapper"; + Group = "remapper"; + }; + }; + users.users.remapper = { + isSystemUser = true; + group = "remapper"; + }; + users.groups.remapper = { }; + secrets.remapper-telegram-token = { + owner = "remapper:remapper"; + services = [ "remapper" ]; + }; +} \ No newline at end of file