From a4e71f9825353ef8338ba9370144f1489bfc8cb3 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 5 Apr 2023 10:10:31 +0200 Subject: [PATCH] attic: nginx+attic cli --- agenix/hosts/attic/atticd/environment.age | 33 +++++++++++++---------- flake.lock | 12 ++++----- home/config/nvim/nifoc/tabline.fnl | 3 +-- home/programs/nvim/plugins.nix | 12 ++++----- home/programs/scripts/attic-system-cache | 8 ++++++ system/darwin/attic.nix | 5 ++++ system/flakes/Styx.nix | 2 ++ system/hosts/Styx.nix | 5 ++++ 8 files changed, 52 insertions(+), 28 deletions(-) create mode 100755 home/programs/scripts/attic-system-cache create mode 100644 system/darwin/attic.nix diff --git a/agenix/hosts/attic/atticd/environment.age b/agenix/hosts/attic/atticd/environment.age index b3a3e09..4f4b13e 100644 --- a/agenix/hosts/attic/atticd/environment.age +++ b/agenix/hosts/attic/atticd/environment.age @@ -1,16 +1,21 @@ -----BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE10R3A2ZyBMTEJS -VlZKUHpKODJTWWo4d2kvZVFUQmcvZ2pBcHZ2cVhEcTRkQVhTZ1gwCmxHREdibjBh -dXkzQXVWdU5zSXdleVZZWXI3QWF2NnMzd2h3TXRKZ2tOb2MKLT4gc3NoLWVkMjU1 -MTkgc1ZmNkNBIEIyb21xU3dwWHRKNFRFaHJ0S2tTTzYrZW5NYkYrVXlhczc5REV2 -Vjd0Q3cKcVozUzdvakZCM0h4QTgvU2ZScDZWbGYzWGFGQStkMmdVaG80T1FWU0lO -VQotPiBcTlVaYS1ncmVhc2UgM3toQTFGTyB1IE5jJ3RfMlBHIE9TV219YnFhCklQ -dWZUMVBFTWhDZgotLS0gYlZKZUl1SVZiemMxZnVVamRuQjZTNnY4azJRRS91QmhM -ZUs5UTg4SG81MArjrMCURh6yHWzvioUQpgOvKqzL0zq+jFCdy0W4HCUnQGipes36 -D8nJgDtvlZpQN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28Lw4B4a4 +NaIa980GSUE/mycowS5pn1G/Yw78iLyzpVaMlqQN+0p9JljvydOV4z7Qnjawyx8o +MdLEg6dtCrutPW3DW9hd1gwJxkFevFZcOW98y8EbVOrtwQwkhT+2yyM8w4fq60CK +rurgybWFsj943YZwPD/FT9Tt64CLpO62Z6P1I/nQZjTSpkCiVwFJD0gP2xwTvGMj +fmEtlHg83lzEaO0X40m8PKAce7b0GVbLW/UjGkQ4QFvsRjkJCKXW7xKXHCXGDm85 +PWa3XWS7I/mtvBJuYS2uR4CposhZ8XSsluk0xRVOgZw7Mwq4aZlAN67gdsEQzuqR +v2+TWg26MWe9Kqinraj7zy20L81bkWovDGApcVI5QNPIP6v9wQipLQVtsQbEN6p8 +Int8Y/gI+YJJWhr13sD1KVwqvXAioI155SvyXlcLip2tNbjEip/HF7bJUhxo/fEc +H6QZ4am3o6sv2F0yzzUuQtwakS1pAY2VmT/zXb/Yd4B8KyKGnVh51Xx6rPo= -----END AGE ENCRYPTED FILE----- diff --git a/flake.lock b/flake.lock index 413b6aa..4d3e1b0 100644 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1679445945, - "narHash": "sha256-UadTIRRA/okmLmdM+OzhCwSoovr72Pq0+3Tt7CAyYcg=", + "lastModified": 1680646146, + "narHash": "sha256-NH+EhLFYDwLQ01BqfTwGvZAjfmZynnP1xxPjqH0XJss=", "owner": "zhaofengli", "repo": "attic", - "rev": "4d92e69fc1b279676f997e6b99d2cacc4d0a3e87", + "rev": "efa15b9788add910f6e8409dddfb7bb69c2ad201", "type": "github" }, "original": { @@ -285,11 +285,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1680577567, - "narHash": "sha256-Y4W57i0TzczqwMTjfVSbAZT5RJx7u+mpQIW/ofrkTQs=", + "lastModified": 1680637761, + "narHash": "sha256-VuXWnGU4g88Rs4njfZ0hxVJGHSyEmnQCsO+i58LXFNo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b01f185e4866de7c5b5a82f833ca9ea3c3f72fc4", + "rev": "74c56f2e51d08f0196ed48d32e01d5d408e64451", "type": "github" }, "original": { diff --git a/home/config/nvim/nifoc/tabline.fnl b/home/config/nvim/nifoc/tabline.fnl index 29b068a..e7651e3 100644 --- a/home/config/nvim/nifoc/tabline.fnl +++ b/home/config/nvim/nifoc/tabline.fnl @@ -50,8 +50,7 @@ mod.filename mod.file-flags)) ;; Tabpages (set mod.tabpage - {:provider (fn [self] - (.. "%" self.tabnr "T " self.tabnr " %T")) + {:provider #(.. "%" $1.tabnr "T " $1.tabnr " %T") :hl (fn [self] (if self.is_active :TabLineSel :TabLine))}) ;; Buttons diff --git a/home/programs/nvim/plugins.nix b/home/programs/nvim/plugins.nix index 00ab1f9..99c998c 100644 --- a/home/programs/nvim/plugins.nix +++ b/home/programs/nvim/plugins.nix @@ -102,12 +102,12 @@ rec { }; nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-treesitter"; - version = "2023-04-04"; + version = "2023-04-05"; src = pkgs.fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter"; - rev = "871f5665d92d59a369cf916e9aa4d321d466f1e3"; - sha256 = "1psdawbsrp68qqpsbdmpnl9xp0p3y08s470vc4yaajrcn35mdb9l"; + rev = "411e771d511442ab81670701f5c830f6c74aadd7"; + sha256 = "19843p5chl4lr7lza6bzz3xrgbmgjqs0v6q8zgqk6pd9q23gbwbx"; fetchSubmodules = false; }; }; @@ -215,12 +215,12 @@ rec { }; nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-lspconfig"; - version = "2023-04-02"; + version = "2023-04-05"; src = pkgs.fetchFromGitHub { owner = "neovim"; repo = "nvim-lspconfig"; - rev = "0bc0c38e1b11dfb6b5f1794d53869f89ccf9e78f"; - sha256 = "0ivr4iyq85gb2ddv6dzarp9wjfydi0ynvwa0vabziv4wxd55w9c3"; + rev = "8dc63a44bfe3188708f0b968c17a5260bdf75650"; + sha256 = "0d37qs8jf9130134mp4yqj9xf54b0r5ga9zj3s6lk2f0hpxvxvaw"; fetchSubmodules = false; }; }; diff --git a/home/programs/scripts/attic-system-cache b/home/programs/scripts/attic-system-cache new file mode 100755 index 0000000..d3aead3 --- /dev/null +++ b/home/programs/scripts/attic-system-cache @@ -0,0 +1,8 @@ +#!/bin/sh + +set -eu +set -f # disable globbing +export IFS=' ' + +echo "Uploading $OUT_PATHS ..." +exec /run/current-system/sw/bin/attic push nifoc-systems $OUT_PATHS diff --git a/system/darwin/attic.nix b/system/darwin/attic.nix new file mode 100644 index 0000000..2ac317d --- /dev/null +++ b/system/darwin/attic.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = [ pkgs.attic-client ]; +} diff --git a/system/flakes/Styx.nix b/system/flakes/Styx.nix index 5779ac1..5a35afe 100644 --- a/system/flakes/Styx.nix +++ b/system/flakes/Styx.nix @@ -15,6 +15,7 @@ let overlay-x86 = _: _: { pkgs-x86 = import nixpkgs { system = "x86_64-darwin"; }; }; overlay-agenix = inputs.ragenix.overlays.default; + overlay-attic = inputs.attic.overlays.default; overlay-neovim = inputs.neovim-nightly-overlay.overlay; overlay-nifoc = inputs.nifoc-overlay.overlay; @@ -22,6 +23,7 @@ let overlays = [ overlay-x86 overlay-agenix + overlay-attic overlay-neovim overlay-nifoc ]; diff --git a/system/hosts/Styx.nix b/system/hosts/Styx.nix index 196ab2c..b84b378 100644 --- a/system/hosts/Styx.nix +++ b/system/hosts/Styx.nix @@ -4,6 +4,7 @@ ../darwin/fonts.nix ../darwin/sudo.nix ../darwin/fish.nix + ../darwin/attic.nix ]; nix = { @@ -30,6 +31,10 @@ trusted-users = [ "@admin" ]; }; + extraOptions = '' + post-build-hook = /Users/daniel/.config/nixpkgs/home/programs/scripts/attic-system-cache + ''; + configureBuildUsers = true; distributedBuilds = true;