mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 02:34:52 +00:00
try refactoring overlays into flake inputs
This commit is contained in:
parent
00564c0c40
commit
e6d0852be0
106
flake.lock
generated
106
flake.lock
generated
@ -430,9 +430,15 @@
|
||||
"telescope-nvim-src": "telescope-nvim-src",
|
||||
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||
"tree-sitter-bash": "tree-sitter-bash",
|
||||
"tree-sitter-ini": "tree-sitter-ini",
|
||||
"tree-sitter-puppet": "tree-sitter-puppet",
|
||||
"tree-sitter-python": "tree-sitter-python",
|
||||
"tree-sitter-rasi": "tree-sitter-rasi",
|
||||
"vscode-terraform-snippets": "vscode-terraform-snippets",
|
||||
"wallpapers": "wallpapers",
|
||||
"wsl": "wsl"
|
||||
"wsl": "wsl",
|
||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
@ -540,6 +546,88 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-bash": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1688032601,
|
||||
"narHash": "sha256-gl5F3IeZa2VqyH/qFj8ey2pRbGq4X8DL5wiyvRrH56U=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-bash",
|
||||
"rev": "493646764e7ad61ce63ce3b8c59ebeb37f71b841",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-bash",
|
||||
"rev": "493646764e7ad61ce63ce3b8c59ebeb37f71b841",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-ini": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690815608,
|
||||
"narHash": "sha256-IIpKzpA4q1jpYVZ75VZaxWHaqNt8TA427eMOui2s71M=",
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"rev": "7f11a02fb8891482068e0fe419965d7bade81a68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-puppet": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690231696,
|
||||
"narHash": "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw=",
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"rev": "9ce9a5f7d64528572aaa8d59459ba869e634086b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-python": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690493803,
|
||||
"narHash": "sha256-2btd/NRE6NuGNlx4cq535OrwtWXihiP3VMCJjPCiDOk=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-python",
|
||||
"rev": "5af00f64af6bbf822f208243cce5cf75396fb6f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-python",
|
||||
"rev": "5af00f64af6bbf822f208243cce5cf75396fb6f5",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-rasi": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1678701563,
|
||||
"narHash": "sha256-2nYZoLcrxxxiOJEySwHUm93lzMg8mU+V7LIP63ntFdA=",
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"rev": "371dac6bcce0df5566c1cfebde69d90ecbeefd2d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vscode-terraform-snippets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@ -591,6 +679,22 @@
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zenyd-mpv-scripts": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1650625438,
|
||||
"narHash": "sha256-OBCuzCtgfSwj0i/rBNranuu4LRc47jObwQIJgQQoerg=",
|
||||
"owner": "zenyd",
|
||||
"repo": "mpv-scripts",
|
||||
"rev": "19ea069abcb794d1bf8fac2f59b50d71ab992130",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "zenyd",
|
||||
"repo": "mpv-scripts",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
36
flake.nix
36
flake.nix
@ -112,6 +112,40 @@
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Tree-Sitter Grammars
|
||||
tree-sitter-bash = {
|
||||
# Fix: bash highlighting doesn't work as of this commit:
|
||||
# https://github.com/NixOS/nixpkgs/commit/49cce41b7c5f6b88570a482355d9655ca19c1029
|
||||
url =
|
||||
"github:tree-sitter/tree-sitter-bash/493646764e7ad61ce63ce3b8c59ebeb37f71b841";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-python = {
|
||||
# Fix: invalid node in position. Broken as of this commit (replaced with newer):
|
||||
# https://github.com/NixOS/nixpkgs/commit/8ec3627796ecc899e6f47f5bf3c3220856ead9c5
|
||||
url =
|
||||
"github:tree-sitter/tree-sitter-python/5af00f64af6bbf822f208243cce5cf75396fb6f5";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-ini = {
|
||||
url = "github:justinmk/tree-sitter-ini";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-puppet = {
|
||||
url = "github:amaanq/tree-sitter-puppet";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-rasi = {
|
||||
url = "github:Fymyte/tree-sitter-rasi";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# MPV Scripts
|
||||
zenyd-mpv-scripts = {
|
||||
url = "github:zenyd/mpv-scripts";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
@ -149,6 +183,8 @@
|
||||
(import ./overlays/calibre-web.nix)
|
||||
(import ./overlays/disko.nix inputs)
|
||||
(import ./overlays/tree-sitter.nix inputs)
|
||||
(import ./overlays/caddy.nix inputs)
|
||||
(import ./overlays/mpv-scripts.nix inputs)
|
||||
(import ./overlays/betterlockscreen.nix)
|
||||
];
|
||||
|
||||
|
@ -31,21 +31,7 @@
|
||||
pkgs.mpvScripts.autoload
|
||||
|
||||
# Delete current file after quitting
|
||||
(pkgs.stdenv.mkDerivation rec {
|
||||
pname = "mpv-delete-file";
|
||||
version = "0.1"; # made-up
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zenyd";
|
||||
repo = "mpv-scripts";
|
||||
rev = "19ea069abcb794d1bf8fac2f59b50d71ab992130";
|
||||
sha256 = "sha256-OBCuzCtgfSwj0i/rBNranuu4LRc47jObwQIJgQQoerg=";
|
||||
} + "/delete_file.lua";
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
installPhase =
|
||||
"install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua";
|
||||
passthru.scriptName = "delete_file.lua";
|
||||
})
|
||||
pkgs.mpvScripts.mpv-delete-file
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -44,10 +44,7 @@ in {
|
||||
caddy.cidrAllowlist = cloudflareIpRanges;
|
||||
|
||||
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
||||
services.caddy.package = (pkgs.callPackage ../../../overlays/caddy.nix {
|
||||
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
||||
# vendorSha256 = "sha256-K9HPZnr+hMcK5aEd1H4gEg6PXAaNrNWFvaHYm5m62JY=";
|
||||
});
|
||||
services.caddy.package = pkgs.caddy-cloudflare; # Patched overlay
|
||||
caddy.tlsPolicies = [{
|
||||
issuers = [{
|
||||
module = "acme";
|
||||
|
@ -1,9 +1,14 @@
|
||||
# Adds the Cloudflare DNS validation module
|
||||
|
||||
{ lib, buildGo118Module, fetchFromGitHub, plugins ? [ ] }:
|
||||
inputs: _final: prev:
|
||||
|
||||
let
|
||||
goImports = lib.flip lib.concatMapStrings plugins (pkg: " _ \"${pkg}\"\n");
|
||||
goGets = lib.flip lib.concatMapStrings plugins (pkg: "go get ${pkg}\n ");
|
||||
|
||||
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
||||
goImports =
|
||||
prev.lib.flip prev.lib.concatMapStrings plugins (pkg: " _ \"${pkg}\"\n");
|
||||
goGets = prev.lib.flip prev.lib.concatMapStrings plugins
|
||||
(pkg: "go get ${pkg}\n ");
|
||||
main = ''
|
||||
package main
|
||||
import (
|
||||
@ -15,44 +20,43 @@ let
|
||||
caddycmd.Main()
|
||||
}
|
||||
'';
|
||||
in buildGo118Module rec {
|
||||
pname = "caddy";
|
||||
version = "2.6.4";
|
||||
runVend = true;
|
||||
|
||||
subPackages = [ "cmd/caddy" ];
|
||||
in {
|
||||
caddy-cloudflare = prev.buildGo118Module {
|
||||
pname = "caddy-cloudflare";
|
||||
version = prev.caddy.version;
|
||||
runVend = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "caddyserver";
|
||||
repo = "caddy";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256:3a3+nFHmGONvL/TyQRqgJtrSDIn0zdGy9YwhZP17mU0=";
|
||||
};
|
||||
subPackages = [ "cmd/caddy" ];
|
||||
|
||||
vendorSha256 = "sha256:CrHqJcJ0knX+txQ5qvzW4JrU8vfi3FO3M/xtislIC1M=";
|
||||
src = prev.caddy.src;
|
||||
|
||||
overrideModAttrs = (_: {
|
||||
preBuild = ''
|
||||
vendorSha256 = "sha256:CrHqJcJ0knX+txQ5qvzW4JrU8vfi3FO3M/xtislIC1M=";
|
||||
|
||||
overrideModAttrs = (_: {
|
||||
preBuild = ''
|
||||
echo '${main}' > cmd/caddy/main.go
|
||||
${goGets}
|
||||
'';
|
||||
postInstall = "cp go.sum go.mod $out/ && ls $out/";
|
||||
});
|
||||
|
||||
postPatch = ''
|
||||
echo '${main}' > cmd/caddy/main.go
|
||||
${goGets}
|
||||
cat cmd/caddy/main.go
|
||||
'';
|
||||
postInstall = "cp go.sum go.mod $out/ && ls $out/";
|
||||
});
|
||||
|
||||
postPatch = ''
|
||||
echo '${main}' > cmd/caddy/main.go
|
||||
cat cmd/caddy/main.go
|
||||
'';
|
||||
postConfigure = ''
|
||||
cp vendor/go.sum ./
|
||||
cp vendor/go.mod ./
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
cp vendor/go.sum ./
|
||||
cp vendor/go.mod ./
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://caddyserver.com";
|
||||
description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
|
||||
meta = with prev.lib; {
|
||||
homepage = "https://caddyserver.com";
|
||||
description =
|
||||
"Fast, cross-platform HTTP/2 web server with automatic HTTPS";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
17
overlays/mpv-scripts.nix
Normal file
17
overlays/mpv-scripts.nix
Normal file
@ -0,0 +1,17 @@
|
||||
_final: prev: inputs: {
|
||||
|
||||
mpvScripts = prev.mpvScripts // {
|
||||
# Delete current file after quitting
|
||||
mpv-delete-file = prev.stdenv.mkDerivation rec {
|
||||
pname = "mpv-delete-file";
|
||||
version = "0.1"; # made-up
|
||||
src = inputs.zenyd-mpv-scripts + "/delete_file.lua";
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
installPhase =
|
||||
"install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua";
|
||||
passthru.scriptName = "delete_file.lua";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -19,22 +19,20 @@ in {
|
||||
nil = inputs.nil.packages.${prev.system}.nil;
|
||||
vscode-terraform-snippets = inputs.vscode-terraform-snippets;
|
||||
|
||||
nvim-lspconfig =
|
||||
(withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig);
|
||||
cmp-nvim-lsp = (withSrc prev.vimPlugins.cmp-nvim-lsp inputs.cmp-nvim-lsp);
|
||||
null-ls-nvim = (withSrc prev.vimPlugins.null-ls-nvim inputs.null-ls-nvim);
|
||||
comment-nvim = (withSrc prev.vimPlugins.comment-nvim inputs.comment-nvim);
|
||||
nvim-lspconfig = withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig;
|
||||
cmp-nvim-lsp = withSrc prev.vimPlugins.cmp-nvim-lsp inputs.cmp-nvim-lsp;
|
||||
null-ls-nvim = withSrc prev.vimPlugins.null-ls-nvim inputs.null-ls-nvim;
|
||||
comment-nvim = withSrc prev.vimPlugins.comment-nvim inputs.comment-nvim;
|
||||
nvim-treesitter =
|
||||
(withSrc prev.vimPlugins.nvim-treesitter inputs.nvim-treesitter);
|
||||
telescope-nvim =
|
||||
(withSrc prev.vimPlugins.telescope-nvim inputs.telescope-nvim);
|
||||
telescope-project-nvim = (withSrc prev.vimPlugins.telescope-project-nvim
|
||||
inputs.telescope-project-nvim);
|
||||
withSrc prev.vimPlugins.nvim-treesitter inputs.nvim-treesitter;
|
||||
telescope-nvim = withSrc prev.vimPlugins.telescope-nvim inputs.telescope-nvim;
|
||||
telescope-project-nvim = withSrc prev.vimPlugins.telescope-project-nvim
|
||||
inputs.telescope-project-nvim;
|
||||
toggleterm-nvim =
|
||||
(withSrc prev.vimPlugins.toggleterm-nvim inputs.toggleterm-nvim);
|
||||
withSrc prev.vimPlugins.toggleterm-nvim inputs.toggleterm-nvim;
|
||||
bufferline-nvim =
|
||||
(withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim);
|
||||
nvim-tree-lua = (withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua);
|
||||
withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim;
|
||||
nvim-tree-lua = withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua;
|
||||
|
||||
# Packaging plugins entirely with Nix
|
||||
baleia-nvim = plugin "baleia-nvim" inputs.baleia-nvim-src;
|
||||
|
@ -4,57 +4,29 @@ inputs: _final: prev: {
|
||||
# Fix: bash highlighting doesn't work as of this commit:
|
||||
# https://github.com/NixOS/nixpkgs/commit/49cce41b7c5f6b88570a482355d9655ca19c1029
|
||||
tree-sitter-bash = prev.tree-sitter-grammars.tree-sitter-bash.overrideAttrs
|
||||
(old: {
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "tree-sitter";
|
||||
repo = "tree-sitter-bash";
|
||||
rev = "493646764e7ad61ce63ce3b8c59ebeb37f71b841";
|
||||
sha256 = "sha256-gl5F3IeZa2VqyH/qFj8ey2pRbGq4X8DL5wiyvRrH56U=";
|
||||
};
|
||||
});
|
||||
(old: { src = inputs.tree-sitter-bash; });
|
||||
|
||||
# Fix: invalid node in position. Broken as of this commit (replaced with newer):
|
||||
# https://github.com/NixOS/nixpkgs/commit/8ec3627796ecc899e6f47f5bf3c3220856ead9c5
|
||||
tree-sitter-python =
|
||||
prev.tree-sitter-grammars.tree-sitter-python.overrideAttrs (old: {
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "tree-sitter";
|
||||
repo = "tree-sitter-python";
|
||||
rev = "5af00f64af6bbf822f208243cce5cf75396fb6f5";
|
||||
sha256 = "sha256-2btd/NRE6NuGNlx4cq535OrwtWXihiP3VMCJjPCiDOk=";
|
||||
};
|
||||
});
|
||||
prev.tree-sitter-grammars.tree-sitter-python.overrideAttrs
|
||||
(old: { src = inputs.tree-sitter-python; });
|
||||
|
||||
# Add grammars not in nixpks
|
||||
tree-sitter-ini = prev.tree-sitter.buildGrammar {
|
||||
language = "ini";
|
||||
version = "1.0.0";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "justinmk";
|
||||
repo = "tree-sitter-ini";
|
||||
rev = "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44";
|
||||
sha256 = "sha256-pPtKokpTgjoNzPW4dRkOnyzBBJFeJj3+CW3LbHSKsmU=";
|
||||
};
|
||||
src = inputs.tree-sitter-ini;
|
||||
};
|
||||
tree-sitter-puppet = prev.tree-sitter.buildGrammar {
|
||||
language = "puppet";
|
||||
version = "1.0.0";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "amaanq";
|
||||
repo = "tree-sitter-puppet";
|
||||
rev = "v1.0.0";
|
||||
sha256 = "sha256-vk5VJZ9zW2bBuc+DM+fwFyhM1htZGeLlmkjMAH66jBA=";
|
||||
};
|
||||
src = inputs.tree-sitter-puppet;
|
||||
};
|
||||
tree-sitter-rasi = prev.tree-sitter.buildGrammar {
|
||||
language = "rasi";
|
||||
version = "0.1.1";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "Fymyte";
|
||||
repo = "tree-sitter-rasi";
|
||||
rev = "371dac6bcce0df5566c1cfebde69d90ecbeefd2d";
|
||||
sha256 = "sha256-2nYZoLcrxxxiOJEySwHUm93lzMg8mU+V7LIP63ntFdA=";
|
||||
};
|
||||
src = inputs.tree-sitter-rasi;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user