apply new nix fmt specification

This commit is contained in:
Noah Masur 2024-04-13 09:03:44 -04:00
parent e8e0c97e59
commit 07137fdd91
No known key found for this signature in database
23 changed files with 280 additions and 203 deletions

View File

@ -1,4 +1,5 @@
{ disk, ... }: {
{ disk, ... }:
{
disk = {
boot = {
type = "disk";

View File

@ -1,4 +1,5 @@
{ pool, disks, ... }: {
{ pool, disks, ... }:
{
disk = lib.genAttrs disks (disk: {
"${disk}" = {
type = "disk";
@ -6,16 +7,18 @@
content = {
type = "table";
format = "gpt";
partitions = [{
type = "partition";
name = "zfs";
start = "128MiB";
end = "100%";
content = {
type = "zfs";
pool = pool;
};
}];
partitions = [
{
type = "partition";
name = "zfs";
start = "128MiB";
end = "100%";
content = {
type = "zfs";
pool = pool;
};
}
];
};
};
});

View File

@ -1,20 +1,26 @@
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { };
modules = import ./modules.nix { inherit inputs globals overlays; } ++ [{
# This is the root filesystem containing NixOS
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
modules = import ./modules.nix { inherit inputs globals overlays; } ++ [
{
# This is the root filesystem containing NixOS
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
# This is the boot filesystem for Grub
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}];
# This is the boot filesystem for Grub
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}
];
}

View File

@ -1,4 +1,8 @@
{ inputs, globals, overlays }:
{
inputs,
globals,
overlays,
}:
[
globals
@ -21,18 +25,18 @@
services.transmission.enable = true;
# nix-index seems to each up too much memory for Vultr
home-manager.users.${globals.user}.programs.nix-index.enable =
inputs.nixpkgs.lib.mkForce false;
home-manager.users.${globals.user}.programs.nix-index.enable = inputs.nixpkgs.lib.mkForce false;
virtualisation.vmVariant = {
virtualisation.forwardPorts = [{
from = "host";
host.port = 2222;
guest.port = 22;
}];
virtualisation.forwardPorts = [
{
from = "host";
host.port = 2222;
guest.port = 22;
}
];
};
}
../../modules/common
../../modules/nixos
]

View File

@ -1,28 +1,41 @@
{ inputs, system, globals, overlays, ... }:
{
inputs,
system,
globals,
overlays,
...
}:
inputs.nixos-generators.nixosGenerate {
inherit system;
format = "amazon";
modules = [
globals
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = overlays;
networking.hostName = "sheep";
gui.enable = false;
theme.colors = (import ../../colorscheme/gruvbox).dark;
passwordHash = null;
publicKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
];
# AWS settings require this
permitRootLogin = "prohibit-password";
}
../../modules/common
../../modules/nixos
../../modules/nixos/services/sshd.nix
] ++ [
# Required to fix diskSize errors during build
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
];
modules =
[
globals
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = overlays;
networking.hostName = "sheep";
gui.enable = false;
theme.colors = (import ../../colorscheme/gruvbox).dark;
passwordHash = null;
publicKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
];
# AWS settings require this
permitRootLogin = "prohibit-password";
}
../../modules/common
../../modules/nixos
../../modules/nixos/services/sshd.nix
]
++ [
# Required to fix diskSize errors during build
(
{ ... }:
{
amazonImage.sizeMB = 16 * 1024;
}
)
];
}

View File

@ -7,7 +7,12 @@
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
# These days, probably use nixos-anywhere instead.
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
@ -26,7 +31,11 @@ inputs.nixpkgs.lib.nixosSystem {
# Not sure what's necessary but too afraid to remove anything
imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_pci"
"usbhid"
];
# File systems must be declared in order to boot
@ -49,7 +58,9 @@ inputs.nixpkgs.lib.nixosSystem {
gui.enable = false;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
theme = {
colors = (import ../../colorscheme/gruvbox).dark;
};
# Programs and services
atuin.enable = true;
@ -72,8 +83,7 @@ inputs.nixpkgs.lib.nixosSystem {
enable = true;
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
credentialsFile = ../../private/cloudflared-flame.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
};
# Nextcloud backup config
@ -116,7 +126,6 @@ inputs.nixpkgs.lib.nixosSystem {
# # VPN port forwarding
# services.transmission.settings.peer-port = 57599;
}
];
}

View File

@ -3,7 +3,12 @@
# See [readme](../README.md) to explain how this file works.
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -32,8 +37,7 @@ inputs.nixpkgs.lib.nixosSystem {
startMenuLaunchers = true;
nativeSystemd = true;
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
interop.includePath =
false; # Including Windows PATH will slow down Neovim command mode
interop.includePath = false; # Including Windows PATH will slow down Neovim command mode
};
neovim.enable = true;

View File

@ -1,7 +1,12 @@
# The Looking Glass
# System configuration for my work Macbook
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.darwin.lib.darwinSystem {
system = "aarch64-darwin";
@ -9,11 +14,14 @@ inputs.darwin.lib.darwinSystem {
modules = [
../../modules/common
../../modules/darwin
(globals // rec {
user = "Noah.Masur";
gitName = "Noah-Masur_1701";
gitEmail = "${user}@take2games.com";
})
(
globals
// rec {
user = "Noah.Masur";
gitName = "Noah-Masur_1701";
gitEmail = "${user}@take2games.com";
}
)
inputs.home-manager.darwinModules.home-manager
{
nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;

View File

@ -1,43 +1,53 @@
# The Staff
# ISO configuration for my USB drive
{ inputs, system, overlays, ... }:
{
inputs,
system,
overlays,
...
}:
inputs.nixos-generators.nixosGenerate {
inherit system;
format = "install-iso";
modules = [{
nixpkgs.overlays = overlays;
networking.hostName = "staff";
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
];
services.openssh = {
enable = true;
ports = [ 22 ];
allowSFTP = true;
settings = {
GatewayPorts = "no";
X11Forwarding = false;
PasswordAuthentication = false;
PermitRootLogin = "yes";
};
};
environment.systemPackages =
let pkgs = import inputs.nixpkgs { inherit system overlays; };
in with pkgs; [
git
vim
wget
curl
(import ../../modules/common/neovim/package {
inherit pkgs;
colors = (import ../../colorscheme/gruvbox).dark;
})
modules = [
{
nixpkgs.overlays = overlays;
networking.hostName = "staff";
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
];
nix.extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
}];
services.openssh = {
enable = true;
ports = [ 22 ];
allowSFTP = true;
settings = {
GatewayPorts = "no";
X11Forwarding = false;
PasswordAuthentication = false;
PermitRootLogin = "yes";
};
};
environment.systemPackages =
let
pkgs = import inputs.nixpkgs { inherit system overlays; };
in
with pkgs;
[
git
vim
wget
curl
(import ../../modules/common/neovim/package {
inherit pkgs;
colors = (import ../../colorscheme/gruvbox).dark;
})
];
nix.extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
}
];
}

View File

@ -3,7 +3,12 @@
# See [readme](../README.md) to explain how this file works.
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -23,8 +28,13 @@ inputs.nixpkgs.lib.nixosSystem {
networking.hostName = "swan";
# Not sure what's necessary but too afraid to remove anything
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
];
# Required for transcoding
boot.initrd.kernelModules = [ "amdgpu" ];
@ -60,8 +70,11 @@ inputs.nixpkgs.lib.nixosSystem {
# Automatically load the ZFS pool on boot
extraPools = [ "tank" ];
# Only try to decrypt datasets with keyfiles
requestEncryptionCredentials =
[ "tank/archive" "tank/generic" "tank/nextcloud" ];
requestEncryptionCredentials = [
"tank/archive"
"tank/generic"
"tank/nextcloud"
];
# If password is requested and fails, continue to boot eventually
passwordTimeout = 300;
};
@ -72,7 +85,9 @@ inputs.nixpkgs.lib.nixosSystem {
gui.enable = false;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
theme = {
colors = (import ../../colorscheme/gruvbox).dark;
};
# Programs and services
atuin.enable = true;
@ -97,8 +112,7 @@ inputs.nixpkgs.lib.nixosSystem {
enable = true;
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
credentialsFile = ../../private/cloudflared-swan.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
};
# Send regular backups and litestream for DBs to an S3-like bucket

View File

@ -3,7 +3,12 @@
# See [readme](../README.md) to explain how this file works.
{ inputs, globals, overlays, ... }:
{
inputs,
globals,
overlays,
...
}:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -20,8 +25,14 @@ inputs.nixpkgs.lib.nixosSystem {
networking.hostName = "tempest";
# Not sure what's necessary but too afraid to remove anything
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
# Graphics and VMs
boot.initrd.kernelModules = [ "amdgpu" ];
@ -114,23 +125,20 @@ inputs.nixpkgs.lib.nixosSystem {
ryujinx.enable = true;
};
services.vmagent.enable = true; # Enables Prometheus metrics
services.openssh.enable =
true; # Required for Cloudflare tunnel and identity file
services.openssh.enable = true; # Required for Cloudflare tunnel and identity file
# Allows private remote access over the internet
cloudflareTunnel = {
enable = true;
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
credentialsFile = ../../private/cloudflared-tempest.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
};
# Allows requests to force machine to wake up
# This network interface might change, needs to be set specifically for each machine.
# Or set usePredictableInterfaceNames = false
networking.interfaces.enp5s0.wakeOnLan.enable = true;
}
];
}

View File

@ -1,4 +1,2 @@
# Disable dunst so that it's not attempting to reach a non-existent dunst service
_final: prev: {
betterlockscreen = prev.betterlockscreen.override { withDunst = false; };
}
_final: prev: { betterlockscreen = prev.betterlockscreen.override { withDunst = false; }; }

View File

@ -3,18 +3,20 @@ inputs: _final: prev: {
# Based on:
# https://git.sr.ht/~rycee/nur-expressions/tree/master/item/pkgs/firefox-addons/default.nix#L34
bypass-paywalls-clean = let addonId = "magnolia@12.34";
in prev.stdenv.mkDerivation rec {
pname = "bypass-paywalls-clean";
version = "3.4.9.0";
src = inputs.bypass-paywalls-clean + "/bypass_paywalls_clean-latest.xpi";
preferLocalBuild = true;
allowSubstitutes = true;
buildCommand = ''
dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
mkdir -p "$dst"
install -v -m644 "${src}" "$dst/${addonId}.xpi"
'';
};
bypass-paywalls-clean =
let
addonId = "magnolia@12.34";
in
prev.stdenv.mkDerivation rec {
pname = "bypass-paywalls-clean";
version = "3.4.9.0";
src = inputs.bypass-paywalls-clean + "/bypass_paywalls_clean-latest.xpi";
preferLocalBuild = true;
allowSubstitutes = true;
buildCommand = ''
dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
mkdir -p "$dst"
install -v -m644 "${src}" "$dst/${addonId}.xpi"
'';
};
}

View File

@ -5,10 +5,8 @@ inputs: _final: prev:
let
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 ");
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 (
@ -20,8 +18,8 @@ let
caddycmd.Main()
}
'';
in {
in
{
caddy-cloudflare = prev.buildGo122Module {
pname = "caddy-cloudflare";
version = prev.caddy.version;
@ -33,13 +31,15 @@ in {
vendorHash = "sha256-zeuvCk7kZa/W/roC12faCQDav4RB8RT1dR2Suh2yjD8=";
overrideModAttrs = (_: {
preBuild = ''
echo '${main}' > cmd/caddy/main.go
${goGets}
'';
postInstall = "cp go.sum go.mod $out/ && ls $out/";
});
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
@ -53,10 +53,12 @@ in {
meta = with prev.lib; {
homepage = "https://caddyserver.com";
description =
"Fast, cross-platform HTTP/2 web server with automatic HTTPS";
description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS";
license = licenses.asl20;
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
maintainers = with maintainers; [
Br1ght0ne
techknowlogick
];
};
};
}

View File

@ -1,5 +1,3 @@
# Add disko to nixpkgs from its input flake
inputs: _final: prev: {
disko = inputs.disko.packages.${prev.system}.disko;
}
inputs: _final: prev: { disko = inputs.disko.packages.${prev.system}.disko; }

View File

@ -19,7 +19,5 @@ _final: prev: {
"-X github.com/katiem0/gh-collaborators/cmd.Version=${version}"
# "-X main.Version=${version}"
];
};
}

View File

@ -8,10 +8,8 @@ inputs: _final: prev: {
src = inputs.zenyd-mpv-scripts + "/delete_file.lua";
dontBuild = true;
dontUnpack = true;
installPhase =
"install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua";
installPhase = "install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua";
passthru.scriptName = "delete_file.lua";
};
};
}

View File

@ -5,35 +5,33 @@ inputs: _final: prev:
let
# Use nixpkgs vimPlugin but with source directly from plugin author
withSrc = pkg: src: pkg.overrideAttrs (_: { inherit src; });
withSrc =
pkg: src:
pkg.overrideAttrs (_: {
inherit src;
});
# Package plugin - for plugins not found in nixpkgs at all
plugin = pname: src:
plugin =
pname: src:
prev.vimUtils.buildVimPlugin {
inherit pname src;
version = "master";
};
in {
in
{
vimPlugins = prev.vimPlugins // {
nvim-lspconfig =
withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig-src;
nvim-lspconfig = withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig-src;
cmp-nvim-lsp = withSrc prev.vimPlugins.cmp-nvim-lsp inputs.cmp-nvim-lsp-src;
comment-nvim = withSrc prev.vimPlugins.comment-nvim inputs.comment-nvim-src;
nvim-treesitter =
withSrc prev.vimPlugins.nvim-treesitter inputs.nvim-treesitter-src;
telescope-nvim =
withSrc prev.vimPlugins.telescope-nvim inputs.telescope-nvim-src;
telescope-project-nvim = withSrc prev.vimPlugins.telescope-project-nvim
inputs.telescope-project-nvim-src;
toggleterm-nvim =
withSrc prev.vimPlugins.toggleterm-nvim inputs.toggleterm-nvim-src;
bufferline-nvim =
withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim-src;
nvim-tree-lua =
withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua-src;
nvim-treesitter = withSrc prev.vimPlugins.nvim-treesitter inputs.nvim-treesitter-src;
telescope-nvim = withSrc prev.vimPlugins.telescope-nvim inputs.telescope-nvim-src;
telescope-project-nvim = withSrc prev.vimPlugins.telescope-project-nvim inputs.telescope-project-nvim-src;
toggleterm-nvim = withSrc prev.vimPlugins.toggleterm-nvim inputs.toggleterm-nvim-src;
bufferline-nvim = withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim-src;
nvim-tree-lua = withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua-src;
fidget-nvim = withSrc prev.vimPlugins.fidget-nvim inputs.fidget-nvim-src;
nvim-lint = withSrc prev.vimPlugins.nvim-lint inputs.nvim-lint-src;
@ -47,7 +45,5 @@ in {
version = "master";
patches = [ ./kitty-scrollback-nvim.patch ];
};
};
}

View File

@ -22,5 +22,4 @@ inputs: _final: prev: {
license = "agpl3Plus";
};
};
}

View File

@ -5,9 +5,9 @@
inputs: _final: prev: {
proton-ge-custom = prev.stdenv.mkDerivation (finalAttrs: rec {
name = "proton-ge-custom";
version = prev.lib.removeSuffix "\n" (builtins.head
(builtins.match ".*GE-Proton(.*)"
(builtins.readFile "${inputs.proton-ge}/version")));
version = prev.lib.removeSuffix "\n" (
builtins.head (builtins.match ".*GE-Proton(.*)" (builtins.readFile "${inputs.proton-ge}/version"))
);
src = inputs.proton-ge;
# Took from https://github.com/AtaraxiaSjel/nur/blob/cf83b14b102985a587a498ba2c56f9f2bd9b9eb6/pkgs/proton-ge/default.nix
installPhase = ''

View File

@ -13,5 +13,4 @@ inputs: _final: prev: {
# src = inputs.rep;
# cargoHash = "sha256-GEr3VvQ0VTKHUbW/GFEgwLpQWP2ZhS/4KYjDvfFLgxo=";
# };
}

View File

@ -3,18 +3,20 @@ 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 = inputs.tree-sitter-bash; });
tree-sitter-bash = prev.tree-sitter-grammars.tree-sitter-bash.overrideAttrs (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 = inputs.tree-sitter-python; });
tree-sitter-python = prev.tree-sitter-grammars.tree-sitter-python.overrideAttrs (old: {
src = inputs.tree-sitter-python;
});
# Fix: invalid structure in position.
tree-sitter-lua = prev.tree-sitter-grammars.tree-sitter-lua.overrideAttrs
(old: { src = inputs.tree-sitter-lua; });
tree-sitter-lua = prev.tree-sitter-grammars.tree-sitter-lua.overrideAttrs (old: {
src = inputs.tree-sitter-lua;
});
# Add grammars not in nixpks
tree-sitter-ini = prev.tree-sitter.buildGrammar {
@ -38,5 +40,4 @@ inputs: _final: prev: {
src = inputs.tree-sitter-vimdoc;
};
};
}

View File

@ -1,7 +1,8 @@
{
description = "Basic Rust project";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
outputs =
{ self, nixpkgs }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
@ -9,10 +10,14 @@
"aarch64-linux"
"aarch64-darwin"
];
in {
devShells = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in {
in
{
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
gcc
@ -24,6 +29,7 @@
openssl
];
};
});
}
);
};
}