From 4520dece5f0a96e762c032e7d98d9080481f33a4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 16:24:43 +0200 Subject: [PATCH 01/16] neovim: use nvfetcher for custom plugins --- modules/terminal-life/nvim/default.nix | 72 ++------------------- overlays/neovim-plugins.nix | 22 +++++++ overlays/rnix-lsp.nix | 9 +-- pkgs/_sources/generated.nix | 90 ++++++++++++++++++++++++-- pkgs/sources.toml | 28 ++++++++ 5 files changed, 140 insertions(+), 81 deletions(-) create mode 100644 overlays/neovim-plugins.nix diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index bc06943b..4df1892a 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -5,66 +5,6 @@ let xdg = config.home-manager.users."${psCfg.user.name}".xdg; preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs); - - vimagit-master = pkgs.vimUtils.buildVimPlugin { - name = "vimagit-master"; - src = pkgs.fetchFromGitHub { - owner = "jreybert"; - repo = "vimagit"; - rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; - sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; - }; - }; - - instant-nvim = pkgs.vimUtils.buildVimPlugin { - name = "instant"; - src = pkgs.fetchFromGitHub { - owner = "jbyuki"; - repo = "instant.nvim"; - rev = "c02d72267b12130609b7ad39b76cf7f4a3bc9554"; - sha256 = "sha256-7Pr2Au/oGKp5kMXuLsQY4BK5Wny9L1EBdXtyS5EaZPI="; - }; - }; - - vim-caddyfile = pkgs.vimUtils.buildVimPlugin { - name = "vim-caddyfile"; - src = pkgs.fetchFromGitHub { - owner = "isobit"; - repo = "vim-caddyfile"; - rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; - sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; - }; - }; - - workspace = pkgs.vimUtils.buildVimPlugin { - name = "vim-workspace"; - src = pkgs.fetchFromGitHub { - owner = "thaerkh"; - repo = "vim-workspace"; - rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; - sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI="; - }; - }; - - beautify = pkgs.vimUtils.buildVimPlugin { - name = "vim-beautify"; - src = pkgs.fetchFromGitHub { - owner = "zeekay"; - repo = "vim-beautify"; - rev = "e0691483927dc5a0c051433602397419f9628623"; - sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; - }; - }; - - apprentice = pkgs.vimUtils.buildVimPlugin { - name = "vim-apprentice"; - src = pkgs.fetchFromGitHub { - owner = "romainl"; - repo = "Apprentice"; - rev = "ecd41698037f15a58125b349be76dbd2595bfb6d"; - sha256 = "sha256-9s7Yzn3IEJBjcyUq9NBIQ9wb45Xr7jOkEIoWf0lAYYg="; - }; - }; in { enable = true; @@ -108,7 +48,7 @@ in lsp_extensions-nvim nvim-lspconfig - instant-nvim + instant-nvim-nvfetcher ack-vim vim-airline @@ -119,23 +59,23 @@ in syntastic vim-gutentags vim-vinegar - workspace + vim-workspace-nvfetcher sonokai vim-hybrid-material vim-airline-themes - apprentice + vim-apprentice-nvfetcher fugitive vim-gitgutter vim-rhubarb - vimagit-master + vimagit-nvfetcher fzf-vim fzfWrapper vim-highlightedyank - beautify + vim-beautify-nvfetcher vim-surround vim-bufkill @@ -144,7 +84,7 @@ in ansible-vim emmet-vim rust-vim - vim-caddyfile + vim-caddyfile-nvfetcher vim-go vim-javascript vim-json diff --git a/overlays/neovim-plugins.nix b/overlays/neovim-plugins.nix new file mode 100644 index 00000000..b022049c --- /dev/null +++ b/overlays/neovim-plugins.nix @@ -0,0 +1,22 @@ +final: prev: { + vimPlugins = prev.vimPlugins // { + instant-nvim-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.instant-nvim-nvfetcher) pname version src; + }; + vimagit-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vimagit-nvfetcher) pname version src; + }; + vim-caddyfile-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-caddyfile-nvfetcher) pname version src; + }; + vim-workspace-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-workspace-nvfetcher) pname version src; + }; + vim-beautify-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-beautify-nvfetcher) pname version src; + }; + vim-apprentice-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-apprentice-nvfetcher) pname version src; + }; + }; +} diff --git a/overlays/rnix-lsp.nix b/overlays/rnix-lsp.nix index 62c0f2b0..f755d110 100644 --- a/overlays/rnix-lsp.nix +++ b/overlays/rnix-lsp.nix @@ -1,13 +1,6 @@ final: prev: { rnix-lsp = prev.rnix-lsp.overrideAttrs (oldAttrs: rec { - version = "unstable-2022-07-28"; - - src = prev.fetchFromGitHub { - owner = "nix-community"; - repo = "rnix-lsp"; - rev = "ff18e04551a39ccdab0ff9c83926db3807b23478"; - sha256 = "sha256-4OIpATLdPQvryyhRQPELeqNYC0n6PCyjD6LCPdwOztc="; - }; + inherit (prev.sources.rnix-lsp-nvfetcher) pname version src; cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { name = "rnix-lsp-vendor.tar.gz"; diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 71be3965..f8bdd149 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -1,16 +1,92 @@ # This file was generated by nvfetcher, please do not modify it manually. -{ fetchgit, fetchurl }: +{ fetchgit, fetchurl, fetchFromGitHub }: { + instant-nvim-nvfetcher = { + pname = "instant-nvim-nvfetcher"; + version = "294b6d08143b3db8f9db7f606829270149e1a786"; + src = fetchFromGitHub ({ + owner = "jbyuki"; + repo = "instant.nvim"; + rev = "294b6d08143b3db8f9db7f606829270149e1a786"; + fetchSubmodules = false; + sha256 = "sha256-DXJWji/NR8ZCxe014rD51v3EHJHMhRQeOoI3SsY8mR4="; + }); + }; manix = { pname = "manix"; version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - src = fetchgit { - url = "https://github.com/mlvzk/manix"; + src = fetchFromGitHub ({ + owner = "mlvzk"; + repo = "manix"; rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; fetchSubmodules = false; - deepClone = false; - leaveDotGit = false; - sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; - }; + sha256 = "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw="; + }); + }; + rnix-lsp-nvfetcher = { + pname = "rnix-lsp-nvfetcher"; + version = "6925256babec4307479a4080b44f2be38056f210"; + src = fetchFromGitHub ({ + owner = "nix-community"; + repo = "rnix-lsp"; + rev = "6925256babec4307479a4080b44f2be38056f210"; + fetchSubmodules = false; + sha256 = "sha256-OKLyIXIXhUnRB3Xw+7zI3u6XkwF7Mrbfz1XaasV6i7Q="; + }); + }; + vim-apprentice-nvfetcher = { + pname = "vim-apprentice-nvfetcher"; + version = "9942d0bb0a5d82f7a24450b00051c1f2cc008659"; + src = fetchFromGitHub ({ + owner = "romainl"; + repo = "Apprentice"; + rev = "9942d0bb0a5d82f7a24450b00051c1f2cc008659"; + fetchSubmodules = false; + sha256 = "sha256-Xs+vTdnihNbBFPOKsW+NB40pqN9eaadqzc0DIeNoOFo="; + }); + }; + vim-beautify-nvfetcher = { + pname = "vim-beautify-nvfetcher"; + version = "e0691483927dc5a0c051433602397419f9628623"; + src = fetchFromGitHub ({ + owner = "zeekay"; + repo = "vim-beautify"; + rev = "e0691483927dc5a0c051433602397419f9628623"; + fetchSubmodules = false; + sha256 = "sha256-QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; + }); + }; + vim-caddyfile-nvfetcher = { + pname = "vim-caddyfile-nvfetcher"; + version = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + src = fetchFromGitHub ({ + owner = "isobit"; + repo = "vim-caddyfile"; + rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + fetchSubmodules = false; + sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; + }); + }; + vim-workspace-nvfetcher = { + pname = "vim-workspace-nvfetcher"; + version = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; + src = fetchFromGitHub ({ + owner = "thaerkh"; + repo = "vim-workspace"; + rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; + fetchSubmodules = false; + sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI="; + }); + }; + vimagit-nvfetcher = { + pname = "vimagit-nvfetcher"; + version = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; + src = fetchFromGitHub ({ + owner = "jreybert"; + repo = "vimagit"; + rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; + fetchSubmodules = false; + sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; + }); }; } diff --git a/pkgs/sources.toml b/pkgs/sources.toml index f7af168e..b3535048 100644 --- a/pkgs/sources.toml +++ b/pkgs/sources.toml @@ -2,3 +2,31 @@ [manix] src.git = "https://github.com/mlvzk/manix" fetch.github = "mlvzk/manix" + +[rnix-lsp-nvfetcher] +src.git = "https://github.com/nix-community/rnix-lsp" +fetch.github = "nix-community/rnix-lsp" + +[vimagit-nvfetcher] +src.git = "https://github.com/jreybert/vimagit" +fetch.github = "jreybert/vimagit" + +[instant-nvim-nvfetcher] +src.git = "https://github.com/jbyuki/instant.nvim" +fetch.github = "jbyuki/instant.nvim" + +[vim-caddyfile-nvfetcher] +src.git = "https://github.com/isobit/vim-caddyfile" +fetch.github = "isobit/vim-caddyfile" + +[vim-workspace-nvfetcher] +src.git = "https://github.com/thaerkh/vim-workspace" +fetch.github = "thaerkh/vim-workspace" + +[vim-beautify-nvfetcher] +src.git = "https://github.com/zeekay/vim-beautify" +fetch.github = "zeekay/vim-beautify" + +[vim-apprentice-nvfetcher] +src.git = "https://github.com/romainl/Apprentice" +fetch.github = "romainl/Apprentice" From e69c8fe9c74e9e27d0897b338aa97a55067278de Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 17:02:23 +0200 Subject: [PATCH 02/16] Bump flake.lock --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index 4e02f07a..ebcef0ac 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1664140963, - "narHash": "sha256-pFxDtOLduRFlol0Y4ShE+soRQX4kbhaCNBtDOvx7ykw=", + "lastModified": 1665870395, + "narHash": "sha256-Tsbqb27LDNxOoPLh0gw2hIb6L/6Ow/6lIBvqcHzEKBI=", "owner": "ryantm", "repo": "agenix", - "rev": "6acb1fe5f8597d5ce63fc82bc7fcac7774b1cdf0", + "rev": "a630400067c6d03c9b3e0455347dc8559db14288", "type": "github" }, "original": { @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1664210064, - "narHash": "sha256-df6nKVZe/yAhmJ9csirTPahc0dldwm3HBhCVNA6qWr0=", + "lastModified": 1665392861, + "narHash": "sha256-bCd8fYJMAb0LzabsiXl4nxECDoz483bJOCa2hjox7N0=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "02d2551c927b7d65ded1b3c7cd13da5cc7ae3fcf", + "rev": "ef56fd8979b5f4e800c4716f62076e00600b1172", "type": "github" }, "original": { @@ -276,11 +276,11 @@ ] }, "locked": { - "lastModified": 1656169755, - "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", + "lastModified": 1665996265, + "narHash": "sha256-/k9og6LDBQwT+f/tJ5ClcWiUl8kCX5m6ognhsAxOiCY=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", + "rev": "b81e128fc053ab3159d7b464d9b7dedc9d6a6891", "type": "github" }, "original": { @@ -308,11 +308,11 @@ }, "latest_2": { "locked": { - "lastModified": 1664538465, - "narHash": "sha256-EnlC7dDKX7X1wlnXkB1gmn9rBZQ0J9+biVTZHw//8us=", + "lastModified": 1665940183, + "narHash": "sha256-cPe3F7CtnxU9YbJpc3Adl4d9kX+turqTv5FxM98i8vg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "10ecda252ce1b3b1d6403caeadbcc8f30d5ab796", + "rev": "104e8082de1b20f9d0e1f05b1028795ed0e0e4bc", "type": "github" }, "original": { @@ -359,11 +359,11 @@ }, "nixos": { "locked": { - "lastModified": 1664594436, - "narHash": "sha256-YHowMADGzdi7fKnGlg47qe0PIljq+11VqLarmXDuKxQ=", + "lastModified": 1666014999, + "narHash": "sha256-gvKl8xlPJreezNG1NVTJv/HdGC69MSrM+IpCxS+eFvw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9cac45850280978a21a3eb67b15a18f34cbffa2d", + "rev": "1935dd8fdab8e022a9d958419663162fd840014c", "type": "github" }, "original": { @@ -379,11 +379,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1660727616, - "narHash": "sha256-zYTIvdPMYMx/EYqXODAwIIU30RiEHqNHdgarIHuEYZc=", + "lastModified": 1666016402, + "narHash": "sha256-Cm/nrdUMXwXiFQforG1Mv8OA4o8yhuVx6E1eDFH4rew=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "adccd191a0e83039d537e021f19495b7bad546a1", + "rev": "688db42a1eb34853f050267ff65c975f664312f0", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1664628729, - "narHash": "sha256-A1J0ZPhBfZZiWI6ipjKJ8+RpMllzOMu/An/8Tk3t4oo=", + "lastModified": 1665987993, + "narHash": "sha256-MvlaIYTRiqefG4dzI5p6vVCfl+9V8A1cPniUjcn6Ngc=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "3024c67a2e9a35450558426c42e7419ab37efd95", + "rev": "0e6593630071440eb89cd97a52921497482b22c6", "type": "github" }, "original": { From e4418bfe0c9c7ca95aac590e4466fee293db9f48 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 20 Oct 2022 13:56:57 +0200 Subject: [PATCH 03/16] drone: use our custom drone-scp image --- .drone.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5e20924e..4cf4b3b2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -108,7 +108,9 @@ steps: - nix run nixpkgs#gnused -- --in-place "s/$ISO_NAME/PubSolarOS-latest.iso/" PubSolarOS-latest.iso.sha256 - name: "Publish ISO" - image: appleboy/drone-scp + # custom drone-scp image, source: https://git.b12f.io/pub-solar/drone-scp/ + # docker build --tag registry.greenbaum.cloud/library/drone-scp:v1.6.5 --file ./docker/Dockerfile.linux.amd64 . + image: registry.greenbaum.cloud/library/drone-scp:v1.6.5 volumes: - name: file-exchange path: /var/nix/iso-cache @@ -125,7 +127,7 @@ steps: source: - /var/nix/iso-cache/*.iso - /var/nix/iso-cache/*.iso.sha256 - overwrite: true + unlink_first: true strip_components: 3 depends_on: @@ -143,6 +145,6 @@ volumes: --- kind: signature -hmac: 8823c7103f6a075bb291a497c7ab5d5db47a91f9bc7d8ef95329b5620c9cf91d +hmac: 3e6a89e903e214f21d488eba82863683b130ef6dbc2dc352377d4fd94ab3cd0c ... From eece344083ec64ce0d5f9006d2751fe33c91eb0e Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 23 Oct 2022 18:33:11 +0200 Subject: [PATCH 04/16] Make resume_offset optional --- modules/core/hibernation.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/core/hibernation.nix b/modules/core/hibernation.nix index 0454d82b..a71ffd37 100644 --- a/modules/core/hibernation.nix +++ b/modules/core/hibernation.nix @@ -27,9 +27,7 @@ in config = { boot = mkIf cfg.enable { resumeDevice = cfg.resumeDevice; - kernelParams = - if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true." - else [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; + kernelParams = mkIf (cfg.resumeOffset != null) [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; }; }; } From ea6233f57e994286bd989c4527f4999c108713db Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 16:44:00 +0200 Subject: [PATCH 05/16] zsh: fetch plugins using nvfetcher --- modules/terminal-life/zsh/default.nix | 31 ++++--------------- pkgs/_sources/generated.nix | 44 +++++++++++++++++++++++++++ pkgs/sources.toml | 16 ++++++++++ 3 files changed, 66 insertions(+), 25 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index b68a4270..36ec41ad 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -40,46 +40,27 @@ in myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; }; plugins = [ + # src gets fetched by nvfetcher, see: ./pkgs/sources.toml { # will source ohmyzsh/plugins/z/ name = "zsh-plugins-z"; - file = "plugins/z/z.sh"; - src = pkgs.fetchFromGitHub { - owner = "ohmyzsh"; - repo = "ohmyzsh"; - rev = "249c708ed3a4a7a63d16a6e911a46b6fb9623cbd"; - sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; - }; + file = "plugins/z/z.plugin.zsh"; + src = pkgs.sources.ohmyzsh.src; } { name = "zsh-powerlevel10k"; file = "powerlevel10k.zsh-theme"; - src = pkgs.fetchFromGitHub { - owner = "romkatv"; - repo = "powerlevel10k"; - rev = "2dd6a29e4d7a33bfef10973d6550e087be37ddee"; - sha256 = "sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys="; - }; + src = pkgs.sources.powerlevel10k.src; } { name = "zsh-fast-syntax-highlighting"; file = "F-Sy-H.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "z-shell"; - repo = "F-Sy-H"; - rev = "c4bdc485b67b58351a24f21fcac92c9e0232b939"; - sha256 = "sha256-uXBGIdJwubuueNhQRdGxPUi0eJN17cflYAuHTjeQ8FQ="; - }; + src = pkgs.sources.F-Sy-H.src; } { name = "zsh-nix-shell"; file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; - sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; - }; + src = pkgs.sources.zsh-nix-shell.src; } ]; diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index f8bdd149..30bcbdef 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -1,6 +1,17 @@ # This file was generated by nvfetcher, please do not modify it manually. { fetchgit, fetchurl, fetchFromGitHub }: { + F-Sy-H = { + pname = "F-Sy-H"; + version = "b935a87a75560f8173dd78deee6717c59d464e06"; + src = fetchFromGitHub ({ + owner = "z-shell"; + repo = "F-Sy-H"; + rev = "b935a87a75560f8173dd78deee6717c59d464e06"; + fetchSubmodules = false; + sha256 = "sha256-448OlDnrDkUjvaSLDhXsa9bkgYXzj1Ju8CTpJVjH8LM="; + }); + }; instant-nvim-nvfetcher = { pname = "instant-nvim-nvfetcher"; version = "294b6d08143b3db8f9db7f606829270149e1a786"; @@ -23,6 +34,28 @@ sha256 = "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw="; }); }; + ohmyzsh = { + pname = "ohmyzsh"; + version = "65a1e4edbe678cdac37ad96ca4bc4f6d77e27adf"; + src = fetchFromGitHub ({ + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "65a1e4edbe678cdac37ad96ca4bc4f6d77e27adf"; + fetchSubmodules = false; + sha256 = "sha256-qyI7CU0vKhhADZfQtD73GsyAbqdMPhDQ1uA03h4erpw="; + }); + }; + powerlevel10k = { + pname = "powerlevel10k"; + version = "8091c8a3a8a845c70046684235a01cd500075def"; + src = fetchFromGitHub ({ + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "8091c8a3a8a845c70046684235a01cd500075def"; + fetchSubmodules = false; + sha256 = "sha256-I0/tktXCbZ3hMYTNvPoWfOEYWRgmHoXsar/jcUB6bpo="; + }); + }; rnix-lsp-nvfetcher = { pname = "rnix-lsp-nvfetcher"; version = "6925256babec4307479a4080b44f2be38056f210"; @@ -89,4 +122,15 @@ sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; }); }; + zsh-nix-shell = { + pname = "zsh-nix-shell"; + version = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; + src = fetchFromGitHub ({ + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; + fetchSubmodules = false; + sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; + }); + }; } diff --git a/pkgs/sources.toml b/pkgs/sources.toml index b3535048..5ec5e936 100644 --- a/pkgs/sources.toml +++ b/pkgs/sources.toml @@ -3,6 +3,22 @@ src.git = "https://github.com/mlvzk/manix" fetch.github = "mlvzk/manix" +[ohmyzsh] +src.git = "https://github.com/ohmyzsh/ohmyzsh" +fetch.github = "ohmyzsh/ohmyzsh" + +[powerlevel10k] +src.git = "https://github.com/romkatv/powerlevel10k" +fetch.github = "romkatv/powerlevel10k" + +[F-Sy-H] +src.git = "https://github.com/z-shell/F-Sy-H" +fetch.github = "z-shell/F-Sy-H" + +[zsh-nix-shell] +src.git = "https://github.com/chisui/zsh-nix-shell" +fetch.github = "chisui/zsh-nix-shell" + [rnix-lsp-nvfetcher] src.git = "https://github.com/nix-community/rnix-lsp" fetch.github = "nix-community/rnix-lsp" From 630d0afc5e0b389c1ad956230b9ad96a381a157a Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 15 Oct 2022 01:58:36 +0200 Subject: [PATCH 06/16] Update drone-config --- .drone.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4cf4b3b2..b4d4bb92 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,11 +1,12 @@ --- kind: pipeline -type: docker +type: exec name: Check +node: + hosttype: baremetal steps: - name: "Check" - image: docker.nix-community.org/nixpkgs/nix-flakes:latest when: event: - pull_request @@ -20,6 +21,8 @@ steps: kind: pipeline type: exec name: Tests +node: + hosttype: baremetal steps: - name: "Tests" @@ -145,6 +148,6 @@ volumes: --- kind: signature -hmac: 3e6a89e903e214f21d488eba82863683b130ef6dbc2dc352377d4fd94ab3cd0c +hmac: 291be33bbf2954d1f5e4bf569679e24a773e7d6f90db4765fb9dacb3686a825e ... From 02c145697b3539077c7217ce4edc872c2a656408 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 7 Nov 2022 11:24:59 +0100 Subject: [PATCH 07/16] Pull in upstream commits from https://github.com/divnix/digga/pull/490 Improved flake-compat Get the rev from the flake.lock file. Shouldn't be an issue for first time users as the guide instructs users to generate a lock file. `builtins.file` was used in accordance with nix.dev reccommendations. https://nix.dev/anti-patterns/language#reproducibility-referencing-top-level-directory-with Rm tempfix --- flake.nix | 3 +++ lib/compat/default.nix | 8 ++++---- shell/devos.nix | 15 --------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 4ac60e8a..cce3f8ee 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,9 @@ nixos.url = "github:nixos/nixpkgs/nixos-22.05"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; + digga.url = "github:pub-solar/digga/fix/bootstrap-iso"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; diff --git a/lib/compat/default.nix b/lib/compat/default.nix index 9d0c2837..ae3b4426 100644 --- a/lib/compat/default.nix +++ b/lib/compat/default.nix @@ -1,14 +1,14 @@ let - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; + lock = builtins.fromJSON (builtins.readFile builtins.path { path = ../../flake.lock; name = "lockPath"; }); flake = (import ( fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; } ) { - src = ../../.; + src = builtins.path { path = ../../.; name = "projectRoot"; }; }); in flake diff --git a/shell/devos.nix b/shell/devos.nix index 9aefcc6f..382a6d34 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -28,21 +28,6 @@ in # override for our own welcome devshell.name = pkgs.lib.mkForce "PubSolarOS"; - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 - devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry '' - # PATH is devshell's exorbitant privilige: - # fence against its pollution - _PATH=''${PATH} - # Load installed profiles - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do - # If that folder doesn't exist, bash loves to return the whole glob - [[ -f "$file" ]] && source "$file" - done - # Exert exorbitant privilige and leave no trace - export PATH=''${_PATH} - unset _PATH - ''); - commands = with pkgs; [ (devos nix) (devos agenix) From 06ed2a78a9fdf8bee7b83b31f1ae823d02c0168e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 7 Nov 2022 11:26:58 +0100 Subject: [PATCH 08/16] Bump flake.lock --- flake.lock | 67 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index ebcef0ac..060a2aea 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1665392861, - "narHash": "sha256-bCd8fYJMAb0LzabsiXl4nxECDoz483bJOCa2hjox7N0=", + "lastModified": 1667419884, + "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "ef56fd8979b5f4e800c4716f62076e00600b1172", + "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100", "type": "github" }, "original": { @@ -205,6 +205,22 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1642700792, @@ -256,11 +272,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667077288, + "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", "type": "github" }, "original": { @@ -276,11 +292,11 @@ ] }, "locked": { - "lastModified": 1665996265, - "narHash": "sha256-/k9og6LDBQwT+f/tJ5ClcWiUl8kCX5m6ognhsAxOiCY=", + "lastModified": 1667677389, + "narHash": "sha256-y9Zdq8vtsn0T5TO1iTvWA7JndYIAGjzCjbYVi/hOSmA=", "owner": "nix-community", "repo": "home-manager", - "rev": "b81e128fc053ab3159d7b464d9b7dedc9d6a6891", + "rev": "87d55517f6f36aa1afbd7a4a064869d5a1d405b8", "type": "github" }, "original": { @@ -308,11 +324,11 @@ }, "latest_2": { "locked": { - "lastModified": 1665940183, - "narHash": "sha256-cPe3F7CtnxU9YbJpc3Adl4d9kX+turqTv5FxM98i8vg=", + "lastModified": 1667629849, + "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "104e8082de1b20f9d0e1f05b1028795ed0e0e4bc", + "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", "type": "github" }, "original": { @@ -359,11 +375,11 @@ }, "nixos": { "locked": { - "lastModified": 1666014999, - "narHash": "sha256-gvKl8xlPJreezNG1NVTJv/HdGC69MSrM+IpCxS+eFvw=", + "lastModified": 1667653703, + "narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1935dd8fdab8e022a9d958419663162fd840014c", + "rev": "f09ad462c5a121d0239fde645aacb2221553a217", "type": "github" }, "original": { @@ -379,11 +395,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1666016402, - "narHash": "sha256-Cm/nrdUMXwXiFQforG1Mv8OA4o8yhuVx6E1eDFH4rew=", + "lastModified": 1666812839, + "narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "688db42a1eb34853f050267ff65c975f664312f0", + "rev": "41f3518bc194389df22a3d198215eae75e6b5ab9", "type": "github" }, "original": { @@ -394,11 +410,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1665987993, - "narHash": "sha256-MvlaIYTRiqefG4dzI5p6vVCfl+9V8A1cPniUjcn6Ngc=", + "lastModified": 1667768008, + "narHash": "sha256-PGbX0s2hhXGnZDFVE6UIhPSOf5YegpWs5dUXpT/14F0=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "0e6593630071440eb89cd97a52921497482b22c6", + "rev": "f6483e0def85efb9c1e884efbaff45a5e7aabb34", "type": "github" }, "original": { @@ -453,18 +469,18 @@ }, "nvfetcher": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_3", "nixpkgs": [ "nixos" ] }, "locked": { - "lastModified": 1664550666, - "narHash": "sha256-eXfMRd9uItEp3PsYI31FSVGPG9dVC6yF++65ZrGwW8A=", + "lastModified": 1667620329, + "narHash": "sha256-v1Zk7rtEbAGpevBGPZvZBKpwbmw4I+uVwxvd+pBlp3o=", "owner": "berberman", "repo": "nvfetcher", - "rev": "9763ad40d59a044e90726653d9253efaeeb053b2", + "rev": "294826951113dcd3aa9abbcacfb1aa5b95a19116", "type": "github" }, "original": { @@ -479,6 +495,7 @@ "darwin": "darwin", "deploy": "deploy", "digga": "digga", + "flake-compat": "flake-compat_3", "home": "home", "latest": "latest_2", "naersk": "naersk", From f97cf1d0e9fc7220a4ccc79454a5f18857c272cf Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 22 Nov 2022 12:30:54 +0100 Subject: [PATCH 09/16] nix: use new nix.settings syntax --- modules/core/networking.nix | 31 +++++++++++++++++-------------- modules/core/nix.nix | 26 ++++++++++++++++---------- profiles/cachix/default.nix | 12 +++++++----- profiles/cachix/nix-community.nix | 6 +++--- profiles/cachix/nrdxp.nix | 6 +++--- 5 files changed, 46 insertions(+), 35 deletions(-) diff --git a/modules/core/networking.nix b/modules/core/networking.nix index c5ec9cbe..43e35c34 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -1,10 +1,12 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let cfg = config.pub-solar.core; -in { + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.pub-solar.core; +in { options.pub-solar.core = { enableCaddy = mkOption { type = types.bool; @@ -17,12 +19,12 @@ in binaryCaches = mkOption { type = types.listOf types.str; - default = [ ]; + default = []; description = "Binary caches to use."; }; publicKeys = mkOption { type = types.listOf types.str; - default = [ ]; + default = []; description = "Public keys of binary caches."; }; }; @@ -39,15 +41,16 @@ in networking.firewall.enable = true; # Customized binary caches list (with fallback to official binary cache) - nix.binaryCaches = cfg.binaryCaches; - nix.binaryCachePublicKeys = cfg.publicKeys; + nix.settings.substituters = cfg.binaryCaches; + nix.settings.trusted-public-keys = cfg.publicKeys; # These entries get added to /etc/hosts networking.hosts = { - "127.0.0.1" = [ ] - ++ lib.optionals cfg.enableCaddy [ "caddy.local" ] - ++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] - ++ lib.optionals cfg.enableHelp [ "help.local" ]; + "127.0.0.1" = + [] + ++ lib.optionals cfg.enableCaddy ["caddy.local"] + ++ lib.optionals config.pub-solar.printing.enable ["cups.local"] + ++ lib.optionals cfg.enableHelp ["help.local"]; }; # Caddy reverse proxy for local services like cups diff --git a/modules/core/nix.nix b/modules/core/nix.nix index f7ff5fa4..711304ba 100644 --- a/modules/core/nix.nix +++ b/modules/core/nix.nix @@ -1,19 +1,25 @@ -{ config, pkgs, lib, inputs, ... }: - { + config, + pkgs, + lib, + inputs, + ... +}: { nix = { # Use default version alias for nix package package = pkgs.nix; - # Improve nix store disk usage - autoOptimiseStore = true; gc.automatic = true; optimise.automatic = true; - # Prevents impurities in builds - useSandbox = true; - # give root and @wheel special privileges with nix - trustedUsers = [ "root" "@wheel" ]; - # This is just a representation of the nix default - systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + settings = { + # Improve nix store disk usage + auto-optimise-store = true; + # Prevents impurities in builds + sandbox = true; + # give root and @wheel special privileges with nix + trusted-users = ["root" "@wheel"]; + # This is just a representation of the nix default + system-features = ["nixos-test" "benchmark" "big-parallel" "kvm"]; + }; # Generally useful nix option defaults extraOptions = '' min-free = 536870912 diff --git a/profiles/cachix/default.nix b/profiles/cachix/default.nix index d88a3f75..9b810da7 100644 --- a/profiles/cachix/default.nix +++ b/profiles/cachix/default.nix @@ -1,11 +1,13 @@ -{ pkgs, lib, ... }: -let +{ + pkgs, + lib, + ... +}: let folder = ./.; toImport = name: value: folder + ("/" + name); filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); -in -{ +in { inherit imports; - nix.binaryCaches = [ "https://cache.nixos.org/" ]; + nix.settings.substituters = ["https://cache.nixos.org/"]; } diff --git a/profiles/cachix/nix-community.nix b/profiles/cachix/nix-community.nix index 7e4be286..3c957fcd 100644 --- a/profiles/cachix/nix-community.nix +++ b/profiles/cachix/nix-community.nix @@ -1,9 +1,9 @@ { - nix = { - binaryCaches = [ + nix.settings = { + substituters = [ "https://nix-community.cachix.org" ]; - binaryCachePublicKeys = [ + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; diff --git a/profiles/cachix/nrdxp.nix b/profiles/cachix/nrdxp.nix index bb3b4a59..ddced9c3 100644 --- a/profiles/cachix/nrdxp.nix +++ b/profiles/cachix/nrdxp.nix @@ -1,9 +1,9 @@ { - nix = { - binaryCaches = [ + nix.settings = { + substituters = [ "https://nrdxp.cachix.org" ]; - binaryCachePublicKeys = [ + trusted-public-keys = [ "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4=" ]; }; From d6236d0b0dec19dd794950a75ad3daf4eaaf2285 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 22 Nov 2022 12:31:45 +0100 Subject: [PATCH 10/16] neovim: config updates for 0.8.x use default_capabilities set mouse= to disable new default mouse behaviour --- modules/terminal-life/nvim/init.vim | 1 + modules/terminal-life/nvim/lsp.vim | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/terminal-life/nvim/init.vim b/modules/terminal-life/nvim/init.vim index 9d4ac597..4ce8a197 100644 --- a/modules/terminal-life/nvim/init.vim +++ b/modules/terminal-life/nvim/init.vim @@ -13,6 +13,7 @@ set expandtab set shiftwidth=2 set number set relativenumber +set mouse= set undolevels=1000 set undoreload=10000 diff --git a/modules/terminal-life/nvim/lsp.vim b/modules/terminal-life/nvim/lsp.vim index 97e9e21a..ef238fe6 100644 --- a/modules/terminal-life/nvim/lsp.vim +++ b/modules/terminal-life/nvim/lsp.vim @@ -73,8 +73,7 @@ lua < Date: Tue, 22 Nov 2022 12:32:54 +0100 Subject: [PATCH 11/16] alacritty: remove use_thin_strokes see: https://github.com/alacritty/alacritty/pull/6186 --- modules/graphical/alacritty.nix | 138 ++++++++++++++++++++++++++------ 1 file changed, 112 insertions(+), 26 deletions(-) diff --git a/modules/graphical/alacritty.nix b/modules/graphical/alacritty.nix index b389343c..d52a6cad 100644 --- a/modules/graphical/alacritty.nix +++ b/modules/graphical/alacritty.nix @@ -66,29 +66,97 @@ x = 0; y = 0; }; - - use_thin_strokes = true; }; key_bindings = [ - { key = "V"; mods = "Control|Alt"; action = "Paste"; } - { key = "C"; mods = "Control|Alt"; action = "Copy"; } - { key = "Paste"; action = "Paste"; } - { key = "Copy"; action = "Copy"; } - { key = "Q"; mods = "Command"; action = "Quit"; } - { key = "W"; mods = "Command"; action = "Quit"; } - { key = "Insert"; mods = "Shift"; action = "PasteSelection"; } - { key = "Key0"; mods = "Control"; action = "ResetFontSize"; } - { key = "Equals"; mods = "Control"; action = "IncreaseFontSize"; } - { key = "PageUp"; mods = "Shift"; action = "ScrollPageUp"; } - { key = "PageDown"; mods = "Shift"; action = "ScrollPageDown"; } - { key = "Minus"; mods = "Control"; action = "DecreaseFontSize"; } - { key = "H"; mode = "Vi|~Search"; action = "ScrollToBottom"; } - { key = "H"; mode = "Vi|~Search"; action = "ToggleViMode"; } - { key = "I"; mode = "Vi|~Search"; action = "Up"; } - { key = "K"; mode = "Vi|~Search"; action = "Down"; } - { key = "J"; mode = "Vi|~Search"; action = "Left"; } - { key = "L"; mode = "Vi|~Search"; action = "Right"; } + { + key = "V"; + mods = "Control|Alt"; + action = "Paste"; + } + { + key = "C"; + mods = "Control|Alt"; + action = "Copy"; + } + { + key = "Paste"; + action = "Paste"; + } + { + key = "Copy"; + action = "Copy"; + } + { + key = "Q"; + mods = "Command"; + action = "Quit"; + } + { + key = "W"; + mods = "Command"; + action = "Quit"; + } + { + key = "Insert"; + mods = "Shift"; + action = "PasteSelection"; + } + { + key = "Key0"; + mods = "Control"; + action = "ResetFontSize"; + } + { + key = "Equals"; + mods = "Control"; + action = "IncreaseFontSize"; + } + { + key = "PageUp"; + mods = "Shift"; + action = "ScrollPageUp"; + } + { + key = "PageDown"; + mods = "Shift"; + action = "ScrollPageDown"; + } + { + key = "Minus"; + mods = "Control"; + action = "DecreaseFontSize"; + } + { + key = "H"; + mode = "Vi|~Search"; + action = "ScrollToBottom"; + } + { + key = "H"; + mode = "Vi|~Search"; + action = "ToggleViMode"; + } + { + key = "I"; + mode = "Vi|~Search"; + action = "Up"; + } + { + key = "K"; + mode = "Vi|~Search"; + action = "Down"; + } + { + key = "J"; + mode = "Vi|~Search"; + action = "Left"; + } + { + key = "L"; + mode = "Vi|~Search"; + action = "Right"; + } ]; # Base16 Burn 256 - alacritty color config @@ -164,12 +232,30 @@ }; indexed_colors = [ - { index = 16; color = "0xdf5923"; } - { index = 17; color = "0xd70000"; } - { index = 18; color = "0x2d2a2e"; } - { index = 19; color = "0x303030"; } - { index = 20; color = "0xd3d1d4"; } - { index = 21; color = "0x303030"; } + { + index = 16; + color = "0xdf5923"; + } + { + index = 17; + color = "0xd70000"; + } + { + index = 18; + color = "0x2d2a2e"; + } + { + index = 19; + color = "0x303030"; + } + { + index = 20; + color = "0xd3d1d4"; + } + { + index = 21; + color = "0x303030"; + } ]; }; } From e7ef245e3247cf6372c9f18d77415fdb0dd348fe Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 22 Nov 2022 12:35:42 +0100 Subject: [PATCH 12/16] docker-compose default to version 2 now --- modules/docker/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/docker/default.nix b/modules/docker/default.nix index 668c4005..ef733b45 100644 --- a/modules/docker/default.nix +++ b/modules/docker/default.nix @@ -1,19 +1,23 @@ -{ lib, config, pkgs, ... }: -with lib; -let +{ + lib, + config, + pkgs, + ... +}: +with lib; let psCfg = config.pub-solar; cfg = config.pub-solar.docker; -in -{ +in { options.pub-solar.docker = { enable = mkEnableOption "Life in metal boxes"; }; config = mkIf cfg.enable { virtualisation.docker.enable = true; - users.users = with pkgs; pkgs.lib.setAttrByPath [ psCfg.user.name ] { - extraGroups = [ "docker" ]; - }; + users.users = with pkgs; + pkgs.lib.setAttrByPath [psCfg.user.name] { + extraGroups = ["docker"]; + }; environment.systemPackages = with pkgs; [ docker-compose From 6a343e754066a57486cbcc9afea88fa47765c36c Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 22 Nov 2022 12:36:32 +0100 Subject: [PATCH 13/16] sway: don't use gtkUsePortal, it's deprecated see: https://github.com/NixOS/nixpkgs/commit/ebde08adf37932ff59c27b5935840aa733965bdb --- modules/sway/default.nix | 109 ++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/modules/sway/default.nix b/modules/sway/default.nix index c173e9ce..71ce2cb2 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - psCfg = config.pub-solar; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { options.pub-solar.sway = { enable = mkEnableOption "Life in boxes"; @@ -22,14 +25,14 @@ in config = mkIf psCfg.sway.enable (mkMerge [ (mkIf (psCfg.sway.v4l2loopback.enable) { - boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - boot.kernelModules = [ "v4l2loopback" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; + boot.kernelModules = ["v4l2loopback"]; boot.extraModprobeConfig = '' options v4l2loopback exclusive_caps=1 devices=3 ''; }) - ({ + { environment.systemPackages = with pkgs; [ linuxPackages.v4l2loopback ]; @@ -48,60 +51,60 @@ in }; }; }; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; - gtkUsePortal = true; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; }; services.pipewire.enable = true; - home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { - home.packages = with pkgs; [ - sway - grim - kanshi - mako - slurp - swayidle - swaylock - swaybg - xwayland + home-manager = with pkgs; + pkgs.lib.setAttrByPath ["users" psCfg.user.name] { + home.packages = with pkgs; [ + sway + grim + kanshi + mako + slurp + swayidle + swaylock + swaybg + xwayland - libappindicator-gtk3 + libappindicator-gtk3 - wl-clipboard - wf-recorder - brightnessctl - gammastep - geoclue2 - xsettingsd - ydotool + wl-clipboard + wf-recorder + brightnessctl + gammastep + geoclue2 + xsettingsd + ydotool - sway-launcher - record-screen - import-gtk-settings - s - wcwd - ]; + sway-launcher + record-screen + import-gtk-settings + s + wcwd + ]; - programs.waybar.enable = true; - #programs.waybar.systemd.enable = true; + programs.waybar.enable = true; + #programs.waybar.systemd.enable = true; - systemd.user.services.mako = import ./mako.service.nix { inherit pkgs psCfg; }; - systemd.user.services.sway = import ./sway.service.nix { inherit pkgs psCfg; }; - systemd.user.services.swayidle = import ./swayidle.service.nix { inherit pkgs psCfg; }; - systemd.user.services.xsettingsd = import ./xsettingsd.service.nix { inherit pkgs psCfg; }; - systemd.user.services.waybar = import ./waybar.service.nix { inherit pkgs psCfg; }; - systemd.user.targets.sway-session = import ./sway-session.target.nix { inherit pkgs psCfg; }; + systemd.user.services.mako = import ./mako.service.nix { inherit pkgs psCfg; }; + systemd.user.services.sway = import ./sway.service.nix {inherit pkgs psCfg;}; + systemd.user.services.swayidle = import ./swayidle.service.nix {inherit pkgs psCfg;}; + systemd.user.services.xsettingsd = import ./xsettingsd.service.nix {inherit pkgs psCfg;}; + systemd.user.services.waybar = import ./waybar.service.nix {inherit pkgs psCfg;}; + systemd.user.targets.sway-session = import ./sway-session.target.nix {inherit pkgs psCfg;}; - xdg.configFile."sway/config".text = import ./config/config.nix { inherit config pkgs; }; - xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf; - xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf; - xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf; - xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf; - xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix { inherit pkgs psCfg; }; - xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf; - xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf; - }; - }) + xdg.configFile."sway/config".text = import ./config/config.nix {inherit config pkgs;}; + xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf; + xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf; + xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf; + xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf; + xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix {inherit pkgs psCfg;}; + xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf; + xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf; + }; + } ]); } From f51e4f3633fc502fec0a7144294fb26c1eb945e4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 26 Nov 2022 04:48:58 +0100 Subject: [PATCH 14/16] nixos: 22.11 racoon, bump flake.lock --- flake.lock | 70 +++++++++++++++++++++++++++++++++--------------------- flake.nix | 4 ++-- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/flake.lock b/flake.lock index 060a2aea..a9930151 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1667419884, - "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=", + "lastModified": 1668784520, + "narHash": "sha256-gGgVAMwYPPmrfnvnoRi6OkEB5KRsNTb9uYzEceLdO/g=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100", + "rev": "6349b99bc2b96ded34d068a88c7c5ced406b7f7f", "type": "github" }, "original": { @@ -85,11 +85,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1659725433, - "narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=", + "lastModified": 1668797197, + "narHash": "sha256-0w6iD3GSSQbIeSFVDzAAQZB+hDq670ZTms3d9XI+BtM=", "owner": "serokell", "repo": "deploy-rs", - "rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb", + "rev": "2a3c5f70eee04a465aa534d8bd4fcc9bb3c4a8ce", "type": "github" }, "original": { @@ -192,11 +192,11 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", "type": "github" }, "original": { @@ -289,19 +289,20 @@ "inputs": { "nixpkgs": [ "nixos" - ] + ], + "utils": "utils_2" }, "locked": { - "lastModified": 1667677389, - "narHash": "sha256-y9Zdq8vtsn0T5TO1iTvWA7JndYIAGjzCjbYVi/hOSmA=", + "lastModified": 1669071065, + "narHash": "sha256-KBpgj3JkvlPsJ3duOZqFJe6tgr+wc75t8sFmgRbBSbw=", "owner": "nix-community", "repo": "home-manager", - "rev": "87d55517f6f36aa1afbd7a4a064869d5a1d405b8", + "rev": "f7641a3ff398ccce952e19a199d775934e518c1d", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.05", + "ref": "release-22.11", "repo": "home-manager", "type": "github" } @@ -324,11 +325,11 @@ }, "latest_2": { "locked": { - "lastModified": 1667629849, - "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", + "lastModified": 1669320964, + "narHash": "sha256-EBFw+ge12Pcr3qCk8If3/eMBAoQLR7ytndXZoRevUtM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", + "rev": "27ccd29078f974ddbdd7edc8e38c8c8ae003c877", "type": "github" }, "original": { @@ -375,16 +376,16 @@ }, "nixos": { "locked": { - "lastModified": 1667653703, - "narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=", + "lastModified": 1669379897, + "narHash": "sha256-XM3xBfQD5tOtV4KAhQHyh53cJdqkLwotZa5JJIUjbQc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f09ad462c5a121d0239fde645aacb2221553a217", + "rev": "8690906c4d80db5d85f52313a8487bf2e7b8d4c5", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-22.05", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } @@ -395,11 +396,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1666812839, - "narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=", + "lastModified": 1669065280, + "narHash": "sha256-3+pq1oJWjGDLfd8G/vR3IIFZ+EQ/aglukA0bTiMlf3o=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "41f3518bc194389df22a3d198215eae75e6b5ab9", + "rev": "50aeec40f2072d2ab267c8ec8a345573704ec110", "type": "github" }, "original": { @@ -410,11 +411,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1667768008, - "narHash": "sha256-PGbX0s2hhXGnZDFVE6UIhPSOf5YegpWs5dUXpT/14F0=", + "lastModified": 1669146234, + "narHash": "sha256-HEby7EG1yaq1oT2Ze6Cvok9CFju1XHkSvVHmkptLW9U=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "f6483e0def85efb9c1e884efbaff45a5e7aabb34", + "rev": "0099253ad0b5283f06ffe31cf010af3f9ad7837d", "type": "github" }, "original": { @@ -520,6 +521,21 @@ "repo": "flake-utils", "type": "github" } + }, + "utils_2": { + "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" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index cce3f8ee..f25d7c8c 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs = { # Track channels with commits tested and built by hydra - nixos.url = "github:nixos/nixpkgs/nixos-22.05"; + nixos.url = "github:nixos/nixpkgs/nixos-22.11"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; flake-compat.url = "github:edolstra/flake-compat"; @@ -20,7 +20,7 @@ digga.inputs.home-manager.follows = "home"; digga.inputs.deploy.follows = "deploy"; - home.url = "github:nix-community/home-manager/release-22.05"; + home.url = "github:nix-community/home-manager/release-22.11"; home.inputs.nixpkgs.follows = "nixos"; darwin.url = "github:LnL7/nix-darwin"; From fd58c1b1a3559033be75fc46d6a035e5cb3af884 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 26 Nov 2022 15:41:13 +0100 Subject: [PATCH 15/16] rename deprecated property --- modules/compat/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/compat/default.nix b/modules/compat/default.nix index af39a951..3f21b3d5 100644 --- a/modules/compat/default.nix +++ b/modules/compat/default.nix @@ -2,5 +2,5 @@ # Both things below are for # https://github.com/NixOS/nixpkgs/issues/124215 documentation.info.enable = lib.mkForce false; - nix.sandboxPaths = [ "/bin/sh=${pkgs.bash}/bin/sh" ]; + nix.settings.extra-sandbox-paths = [ "/bin/sh=${pkgs.bash}/bin/sh" ]; } From 215a55e14566fba604bbdf95788f9ef3365643ae Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 26 Nov 2022 15:41:27 +0100 Subject: [PATCH 16/16] rename terraform, remove version --- modules/devops/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devops/default.nix b/modules/devops/default.nix index 9c0d9a9e..05fe65fc 100644 --- a/modules/devops/default.nix +++ b/modules/devops/default.nix @@ -19,7 +19,7 @@ in ansible-lint restic shellcheck - terraform_0_15 + terraform ]; }; };