Compare commits

..

No commits in common. "cce6f6573fd69632bedf2ec051fdd2e9b0a57280" and "cd0c93c6d9a7dfa5ed061a850140f7f4f8bc9323" have entirely different histories.

62 changed files with 736 additions and 825 deletions

3
.gitignore vendored
View File

@ -3,6 +3,7 @@
*.db *.db
**/.direnv/** **/.direnv/**
result result
.luarc.json
private/** private/**
templates/**/flake.lock
!private/**.age !private/**.age
!private/**.sha512

View File

@ -5,7 +5,7 @@
program = "${ program = "${
(import ../modules/common/neovim/package { (import ../modules/common/neovim/package {
inherit pkgs; inherit pkgs;
colors = (import ../colorscheme/nord).dark; colors = (import ../colorscheme/gruvbox).dark;
}) })
}/bin/nvim"; }/bin/nvim";

View File

@ -1,24 +1,20 @@
{ {
name = "everforest"; # dark, hard name = "everforest"; # dark, hard
author = "Sainnhe Park"; author = "Sainnhe Park";
dark = { base00 = "#2b3339"; # Default Background
base00 = "#2b3339"; # Default Background base01 = "#323c41"; # Lighter Background
base01 = "#323c41"; # Lighter Background base02 = "#503946"; # Selection Background
base02 = "#503946"; # Selection Background base03 = "#868d80"; # Comments, Invisibles, Line Highlighting
base03 = "#868d80"; # Comments, Invisibles, Line Highlighting base04 = "#d3c6aa"; # Dark Foreground (Used for status bars)
base04 = "#d3c6aa"; # Dark Foreground (Used for status bars) base05 = "#d3c6aa"; # Default Foreground, Caret, Delimiters, Operators
base05 = "#d3c6aa"; # Default Foreground, Caret, Delimiters, Operators base06 = "#e9e8d2"; # Light Foreground (Not often used)
base06 = "#e9e8d2"; # Light Foreground (Not often used) base07 = "#fff9e8"; # Light Background (Not often used)
base07 = "#fff9e8"; # Light Background (Not often used) base08 = "#7fbbb3"; # Variables, XML Tags, Markup Link Text, ...
base08 = "#7fbbb3"; # Variables, XML Tags, Markup Link Text, ... base09 = "#d699b6"; # Integers, Boolean, Constants, ...
base09 = "#d699b6"; # Integers, Boolean, Constants, ... base0A = "#83c092"; # Classes, Markup Bold, Search Text Background
base0A = "#83c092"; # Classes, Markup Bold, Search Text Background base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ... base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings base0E = "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
base0E = base0F = "#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
"#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F =
"#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
};
} }

View File

@ -1,7 +1,7 @@
{ {
name = "nord";
author = "arcticicestudio";
dark = { dark = {
name = "nord";
author = "arcticicestudio";
base00 = "#2E3440"; base00 = "#2E3440";
base01 = "#3B4252"; base01 = "#3B4252";
base02 = "#434C5E"; base02 = "#434C5E";

View File

@ -0,0 +1,13 @@
local M = {}
M.packer = function(use)
use({
"shaunsingh/nord.nvim",
config = function()
vim.g.nord_italic = true
vim.cmd("colorscheme nord")
end,
})
end
return M

View File

@ -17,22 +17,6 @@
"type": "github" "type": "github"
} }
}, },
"baleia-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1681806450,
"narHash": "sha256-jxRlIzWbnSj89032msc5w+2TVt7zVyzlxdXxiH1dQqY=",
"owner": "m00qek",
"repo": "baleia.nvim",
"rev": "00bb4af31c8c3865b735d40ebefa6c3f07b2dd16",
"type": "github"
},
"original": {
"owner": "m00qek",
"repo": "baleia.nvim",
"type": "github"
}
},
"bufferline-nvim-src": { "bufferline-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -109,16 +93,14 @@
}, },
"firefox-darwin": { "firefox-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": "nixpkgs"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1689731219, "lastModified": 1687568341,
"narHash": "sha256-6S3XfZWe7x0zViHy2Ix0rzHL/RmVT3s0ZtI+LmJMC2g=", "narHash": "sha256-5mnjEy1tPfWjlFq/3UB/AyoqkDOJeVu/y/C6Yw2MW9k=",
"owner": "bandithedoge", "owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin", "repo": "nixpkgs-firefox-darwin",
"rev": "7aa20dbbcbd2371ef13b622ac03f1c3cc5662f37", "rev": "0bb6fa671d1f1964b2cab7a3774cba1e071aa26e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -218,9 +200,7 @@
"nil": { "nil": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": "nixpkgs_2",
"nixpkgs"
],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
@ -296,6 +276,38 @@
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1639237670,
"narHash": "sha256-RTdL4rEQcgaZGpvtDgkp3oK/V+1LM3I53n0ACPSroAQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "edfb969386ebe6c3cf8f878775a7975cd88f926d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1680487167,
"narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "53dad94e874c9586e71decf82d972dfb640ef044",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1687502512, "lastModified": 1687502512,
"narHash": "sha256-dBL/01TayOSZYxtY4cMXuNCBk8UMLoqRZA+94xiFpJA=", "narHash": "sha256-dBL/01TayOSZYxtY4cMXuNCBk8UMLoqRZA+94xiFpJA=",
@ -311,7 +323,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1686929285, "lastModified": 1686929285,
"narHash": "sha256-WGtVzn+vGMPTXDO0DMNKVFtf+zUSqeW+KKk4Y/Ae99I=", "narHash": "sha256-WGtVzn+vGMPTXDO0DMNKVFtf+zUSqeW+KKk4Y/Ae99I=",
@ -411,7 +423,6 @@
"root": { "root": {
"inputs": { "inputs": {
"Comment-nvim-src": "Comment-nvim-src", "Comment-nvim-src": "Comment-nvim-src",
"baleia-nvim-src": "baleia-nvim-src",
"bufferline-nvim-src": "bufferline-nvim-src", "bufferline-nvim-src": "bufferline-nvim-src",
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src", "cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
"darwin": "darwin", "darwin": "darwin",
@ -421,7 +432,7 @@
"nil": "nil", "nil": "nil",
"nix2vim": "nix2vim", "nix2vim": "nix2vim",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_3",
"null-ls-nvim-src": "null-ls-nvim-src", "null-ls-nvim-src": "null-ls-nvim-src",
"nur": "nur", "nur": "nur",
"nvim-lspconfig-src": "nvim-lspconfig-src", "nvim-lspconfig-src": "nvim-lspconfig-src",
@ -430,7 +441,6 @@
"telescope-nvim-src": "telescope-nvim-src", "telescope-nvim-src": "telescope-nvim-src",
"telescope-project-nvim-src": "telescope-project-nvim-src", "telescope-project-nvim-src": "telescope-project-nvim-src",
"toggleterm-nvim-src": "toggleterm-nvim-src", "toggleterm-nvim-src": "toggleterm-nvim-src",
"vscode-terraform-snippets": "vscode-terraform-snippets",
"wallpapers": "wallpapers", "wallpapers": "wallpapers",
"wsl": "wsl" "wsl": "wsl"
} }
@ -540,22 +550,6 @@
"type": "github" "type": "github"
} }
}, },
"vscode-terraform-snippets": {
"flake": false,
"locked": {
"lastModified": 1614849738,
"narHash": "sha256-v392tyzXV+zyBNt5OCB2NBCK7JcByrTa5Ne/nFtSCJI=",
"owner": "run-at-scale",
"repo": "vscode-terraform-doc-snippets",
"rev": "6ab3e44b566e660f38922cf908e6e547eaa5d4b4",
"type": "github"
},
"original": {
"owner": "run-at-scale",
"repo": "vscode-terraform-doc-snippets",
"type": "github"
}
},
"wallpapers": { "wallpapers": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -576,7 +570,7 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1687279045, "lastModified": 1687279045,

View File

@ -20,17 +20,14 @@
home-manager = { home-manager = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = inputs.nixpkgs.follows =
"nixpkgs"; # Use system packages list for their inputs "nixpkgs"; # Use system packages list where available
}; };
# Community packages; used for Firefox extensions # Community packages; used for Firefox extensions
nur.url = "github:nix-community/nur"; nur.url = "github:nix-community/nur";
# Use official Firefox binary for macOS # Use official Firefox binary for macOS
firefox-darwin = { firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
url = "github:bandithedoge/nixpkgs-firefox-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Manage disk format and partitioning # Manage disk format and partitioning
disko = { disko = {
@ -57,10 +54,7 @@
}; };
# Nix language server # Nix language server
nil = { nil.url = "github:oxalica/nil/2023-04-03";
url = "github:oxalica/nil/2023-04-03";
inputs.nixpkgs.follows = "nixpkgs";
};
# Neovim plugins # Neovim plugins
nvim-lspconfig-src = { nvim-lspconfig-src = {
@ -75,10 +69,6 @@
url = "github:jose-elias-alvarez/null-ls.nvim"; url = "github:jose-elias-alvarez/null-ls.nvim";
flake = false; flake = false;
}; };
baleia-nvim-src = {
url = "github:m00qek/baleia.nvim";
flake = false;
};
Comment-nvim-src = { Comment-nvim-src = {
url = "github:numToStr/Comment.nvim/v0.8.0"; url = "github:numToStr/Comment.nvim/v0.8.0";
flake = false; flake = false;
@ -107,10 +97,6 @@
url = "github:kyazdani42/nvim-tree.lua"; url = "github:kyazdani42/nvim-tree.lua";
flake = false; flake = false;
}; };
vscode-terraform-snippets = {
url = "github:run-at-scale/vscode-terraform-doc-snippets";
flake = false;
};
}; };
@ -119,8 +105,7 @@
let let
# Global configuration for my systems # Global configuration for my systems
globals = let baseName = "masu.rs"; globals = rec {
in rec {
user = "noah"; user = "noah";
fullName = "Noah Masur"; fullName = "Noah Masur";
gitName = fullName; gitName = fullName;
@ -129,16 +114,6 @@
mail.imapHost = "imap.purelymail.com"; mail.imapHost = "imap.purelymail.com";
mail.smtpHost = "smtp.purelymail.com"; mail.smtpHost = "smtp.purelymail.com";
dotfilesRepo = "git@github.com:nmasur/dotfiles"; dotfilesRepo = "git@github.com:nmasur/dotfiles";
hostnames = {
git = "git.${baseName}";
metrics = "metrics.${baseName}";
prometheus = "prom.${baseName}";
secrets = "vault.${baseName}";
stream = "stream.${baseName}";
content = "cloud.${baseName}";
books = "books.${baseName}";
download = "download.${baseName}";
};
}; };
# Common overlays to always use # Common overlays to always use
@ -148,7 +123,6 @@
(import ./overlays/neovim-plugins.nix inputs) (import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/calibre-web.nix) (import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs) (import ./overlays/disko.nix inputs)
(import ./overlays/tree-sitter.nix inputs)
]; ];
# System types to support. # System types to support.
@ -176,7 +150,7 @@
import ./hosts/lookingglass { inherit inputs globals overlays; }; import ./hosts/lookingglass { inherit inputs globals overlays; };
}; };
# For quickly applying home-manager settings with: # For quickly applying local settings with:
# home-manager switch --flake .#tempest # home-manager switch --flake .#tempest
homeConfigurations = { homeConfigurations = {
tempest = tempest =

View File

@ -10,7 +10,7 @@ inputs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
globals (removeAttrs globals [ "mail.server" ])
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
@ -43,17 +43,14 @@ inputs.nixpkgs.lib.nixosSystem {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
# Programs and services # Programs and services
caddy.enable = true;
cloudflare.enable = true; # Proxy traffic with Cloudflare cloudflare.enable = true; # Proxy traffic with Cloudflare
dotfiles.enable = true; # Clone dotfiles dotfiles.enable = true; # Clone dotfiles
gaming.minecraft-server.enable = true; # Setup Minecraft server
giteaServer = "git.masu.rs";
metricsServer = "metrics.masu.rs";
neovim.enable = true; neovim.enable = true;
vaultwardenServer = "vault.masu.rs";
services.caddy.enable = true;
services.grafana.enable = true;
services.openssh.enable = true;
services.victoriametrics.enable = true;
services.gitea.enable = true;
services.vaultwarden.enable = true;
services.minecraft-server.enable = true; # Setup Minecraft server
cloudflareTunnel = { cloudflareTunnel = {
enable = true; enable = true;
@ -63,8 +60,6 @@ inputs.nixpkgs.lib.nixosSystem {
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org"; "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
}; };
giteaRunner.enable = true;
# Nextcloud backup config # Nextcloud backup config
backup.s3 = { backup.s3 = {
endpoint = "s3.us-west-002.backblazeb2.com"; endpoint = "s3.us-west-002.backblazeb2.com";

View File

@ -21,7 +21,7 @@ inputs.darwin.lib.darwinSystem {
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519"; identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
gui.enable = true; gui.enable = true;
theme = { theme = {
colors = (import ../../colorscheme/gruvbox-dark).dark; colors = (import ../../colorscheme/gruvbox).dark;
dark = true; dark = true;
}; };
mail.user = globals.user; mail.user = globals.user;

View File

@ -15,7 +15,6 @@ inputs.nixpkgs.lib.nixosSystem {
{ {
# Hardware # Hardware
server = true; server = true;
physical = true;
networking.hostName = "swan"; networking.hostName = "swan";
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
@ -49,19 +48,14 @@ inputs.nixpkgs.lib.nixosSystem {
theme = { colors = (import ../../colorscheme/gruvbox).dark; }; theme = { colors = (import ../../colorscheme/gruvbox).dark; };
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
neovim.enable = true; neovim.enable = true;
caddy.enable = true;
cloudflare.enable = true; cloudflare.enable = true;
dotfiles.enable = true; dotfiles.enable = true;
arrs.enable = true; streamServer = "stream.masu.rs";
nextcloudServer = "cloud.masu.rs";
services.bind.enable = true; bookServer = "books.masu.rs";
services.caddy.enable = true; arrServer = "download.masu.rs";
services.jellyfin.enable = true; samba.enable = true;
services.nextcloud.enable = true;
services.calibre-web.enable = true;
services.openssh.enable = true;
services.prometheus.enable = false;
services.vmagent.enable = true;
services.samba.enable = true;
cloudflareTunnel = { cloudflareTunnel = {
enable = true; enable = true;

View File

@ -91,16 +91,6 @@ inputs.nixpkgs.lib.nixosSystem {
leagueoflegends.enable = true; leagueoflegends.enable = true;
ryujinx.enable = true; ryujinx.enable = true;
}; };
services.vmagent.enable = true;
services.openssh.enable = true; # Required for Cloudflare tunnel
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";
};
} }
]; ];

View File

@ -33,6 +33,7 @@
vimium vimium
multi-account-containers multi-account-containers
facebook-container facebook-container
temporary-containers
(lib.mkIf config._1password.enable onepassword-password-manager) (lib.mkIf config._1password.enable onepassword-password-manager)
okta-browser-plugin okta-browser-plugin
sponsorblock sponsorblock
@ -73,7 +74,6 @@
"media.ffmpeg.vaapi.enabled" = "media.ffmpeg.vaapi.enabled" =
true; # Enable hardware video acceleration true; # Enable hardware video acceleration
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups "cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
"svg.context-properties.content.enabled" = true; # Sidebery styling
}; };
userChrome = '' userChrome = ''
:root { :root {

View File

@ -28,12 +28,6 @@
programs.rofi.terminal = programs.rofi.terminal =
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty"; lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
# Display images in the terminal
programs.fish.shellAliases = {
icat = "kitty +kitten icat";
ssh = "kitty +kitten ssh";
};
programs.kitty = { programs.kitty = {
enable = true; enable = true;
environment = { }; environment = { };
@ -91,6 +85,7 @@
# Scrollback # Scrollback
scrolling_lines = 10000; scrolling_lines = 10000;
scrollback_pager_history_size = 10; # MB scrollback_pager_history_size = 10; # MB
scrollback_pager = "${pkgs.neovim}/bin/nvim -c 'normal G'";
# Window # Window
window_padding_width = 6; window_padding_width = 6;

View File

@ -66,40 +66,6 @@
description = "List of unfree packages to allow."; description = "List of unfree packages to allow.";
default = [ ]; default = [ ];
}; };
hostnames = {
git = lib.mkOption {
type = lib.types.str;
description = "Hostname for git server (Gitea).";
};
metrics = lib.mkOption {
type = lib.types.str;
description = "Hostname for metrics server.";
};
prometheus = lib.mkOption {
type = lib.types.str;
description = "Hostname for Prometheus server.";
};
secrets = lib.mkOption {
type = lib.types.str;
description = "Hostname for passwords and secrets (Vaultwarden).";
};
stream = lib.mkOption {
type = lib.types.str;
description = "Hostname for video/media library (Jellyfin).";
};
content = lib.mkOption {
type = lib.types.str;
description = "Hostname for personal content system (Nextcloud).";
};
books = lib.mkOption {
type = lib.types.str;
description = "Hostname for books library (Calibre-Web).";
};
download = lib.mkOption {
type = lib.types.str;
description = "Hostname for download services.";
};
};
}; };
config = let stateVersion = "23.05"; config = let stateVersion = "23.05";

View File

@ -135,13 +135,6 @@
}; };
lua = '' lua = ''
-- Load snippets
-- Check status: :lua require("luasnip").log.open()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "${
builtins.toString pkgs.vscode-terraform-snippets
}" } })
-- Use buffer source for `/` -- Use buffer source for `/`
require('cmp').setup.cmdline("/", { require('cmp').setup.cmdline("/", {
sources = { sources = {

View File

@ -29,9 +29,6 @@
lua = '' lua = ''
${builtins.readFile ./lsp.lua} ${builtins.readFile ./lsp.lua}
-- Prevent infinite log size (change this when debugging)
vim.lsp.set_log_level("off")
require("null-ls").setup({ require("null-ls").setup({
sources = { sources = {
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }), require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),

View File

@ -11,7 +11,6 @@
setup.Comment = { }; setup.Comment = { };
setup.colorizer = { }; setup.colorizer = { };
setup.glow = { };
vim.o = { vim.o = {
termguicolors = true; # Set to truecolor termguicolors = true; # Set to truecolor

View File

@ -2,7 +2,7 @@
plugins = [ pkgs.vimPlugins.lualine-nvim ]; plugins = [ pkgs.vimPlugins.lualine-nvim ];
setup.lualine = { setup.lualine = {
options = { options = {
theme = "base16"; theme = "gruvbox";
icons_enabled = true; icons_enabled = true;
}; };
}; };

View File

@ -1,39 +1,26 @@
{ pkgs, lib, ... }: { { pkgs, ... }: {
plugins = [ plugins = [
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins: (pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
with pkgs.tree-sitter-grammars; [ with pkgs.tree-sitter-grammars; [
tree-sitter-bash
tree-sitter-fish
tree-sitter-hcl tree-sitter-hcl
tree-sitter-ini
tree-sitter-json
tree-sitter-lua
tree-sitter-markdown
tree-sitter-markdown-inline
tree-sitter-nix
tree-sitter-puppet
tree-sitter-python tree-sitter-python
tree-sitter-rasi tree-sitter-lua
tree-sitter-nix
tree-sitter-fish
tree-sitter-toml tree-sitter-toml
tree-sitter-yaml tree-sitter-yaml
tree-sitter-json
])) ]))
pkgs.vimPlugins.vim-matchup # Better % jumping in languages pkgs.vimPlugins.vim-matchup # Better % jumping in languages
pkgs.vimPlugins.playground # Tree-sitter experimenting
pkgs.vimPlugins.nginx-vim pkgs.vimPlugins.nginx-vim
pkgs.vimPlugins.vim-helm pkgs.vimPlugins.vim-helm
pkgs.baleia-nvim # Clean ANSI from kitty scrollback pkgs.vimPlugins.vim-puppet
(pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nmasur";
version = "0.1";
src = ../plugin;
})
]; ];
setup."nvim-treesitter.configs" = { setup."nvim-treesitter.configs" = {
highlight = { enable = true; }; highlight = { enable = true; };
indent = { enable = true; }; indent = { enable = true; };
matchup = { enable = true; }; # Uses vim-matchup
textobjects = { textobjects = {
select = { select = {
@ -62,10 +49,4 @@
}; };
}; };
# Use mkAfter to ensure tree-sitter is already loaded
lua = lib.mkAfter ''
-- Use HCL parser with .tf files
vim.treesitter.language.register('hcl', 'terraform')
'';
} }

View File

@ -31,8 +31,8 @@ in {
vll = "nvim -c 'Telescope oldfiles'"; vll = "nvim -c 'Telescope oldfiles'";
}; };
}; };
programs.kitty.settings.scrollback_pager = '' programs.kitty.settings.scrollback_pager = lib.mkForce ''
$SHELL -c 'sed -r "s/[[:cntrl:]]\]133;[AC]..//g" | ${neovim}/bin/nvim -c "setlocal nonumber norelativenumber nolist laststatus=0" -c "lua baleia = require(\"baleia\").setup({}); baleia.once(0)" -c "map <silent> q :qa!<CR>" -c "autocmd VimEnter * normal G"' ''; ${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux { xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
name = "Neovim wrapper"; name = "Neovim wrapper";

View File

@ -39,7 +39,7 @@ key("n", "<Leader>fs", ":write<CR>")
key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true }) key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true })
key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true }) key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true })
key("n", "<Leader><Tab>", ":b#<CR>", { silent = true }) key("n", "<Leader><Tab>", ":b#<CR>", { silent = true })
key("n", "<Leader>gr", ":!gh browse %<CR><CR>", { silent = true }) key("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", { silent = true })
key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]]) key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]])
key("n", "<Leader>jj", ":!journal<CR>:e<CR>") key("n", "<Leader>jj", ":!journal<CR>:e<CR>")

View File

@ -4,9 +4,9 @@
vim.filetype.add({ vim.filetype.add({
pattern = { pattern = {
[".*%.tfvars"] = "terraform", [".*%.tfvars"] = "hcl",
[".*%.tf"] = "terraform", [".*%.tf"] = "hcl",
[".*%.rasi"] = "rasi", [".*%.rasi"] = "css",
}, },
}) })

View File

@ -28,8 +28,6 @@
{ pkgs, colors, ... }: { pkgs, colors, ... }:
# Comes from nix2vim overlay:
# https://github.com/gytis-ivaskevicius/nix2vim/blob/master/lib/neovim-builder.nix
pkgs.neovimBuilder { pkgs.neovimBuilder {
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
inherit colors; inherit colors;

View File

@ -1,8 +0,0 @@
expression: (apply_expression
function: (apply_expression
function: (select_expression
attrpath: (attrpath) @writeshell (#match? @writeshell "^writeShell.*$")
)
)
(indented_string_expression) @bash
)

View File

@ -14,7 +14,7 @@ bind -M insert \cp projects
bind -M default \cp projects bind -M default \cp projects
bind -M insert \x1F accept-autosuggestion bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion bind -M default \x1F accept-autosuggestion
bind -M insert \cn 'commandline -r "nix shell nixpkgs#"' bind -M insert \cn 'commandline -r "nix run nixpkgs#"'
bind -M default \cn 'commandline -r "nix shell nixpkgs#"' bind -M default \cn 'commandline -r "nix run nixpkgs#"'
bind -M insert \x11F nix-fzf bind -M insert \x11F nix-fzf
bind -M default \x11F nix-fzf bind -M default \x11F nix-fzf

View File

@ -52,6 +52,10 @@ in {
}; };
}; };
programs.fish.shellAbbrs = {
cat = "bat"; # Swap cat with bat
};
programs.fish.functions = { programs.fish.functions = {
ping = { ping = {
description = "Improved ping"; description = "Improved ping";

View File

@ -40,7 +40,6 @@
defaultApplications."inode/directory" = defaultApplications."inode/directory" =
lib.mkBefore [ "org.gnome.Nautilus.desktop" ]; lib.mkBefore [ "org.gnome.Nautilus.desktop" ];
}; };
}; };
# # Set default for opening directories # # Set default for opening directories
@ -51,13 +50,6 @@
# lib.mkForce [ "org.gnome.Nautilus.desktop" ]; # lib.mkForce [ "org.gnome.Nautilus.desktop" ];
# }; # };
# Delete Trash files older than 1 week
systemd.user.services.empty-trash = {
description = "Empty Trash on a regular basis";
wantedBy = [ "default.target" ];
script = "${pkgs.trash-cli}/bin/trash-empty 7";
};
}; };
} }

View File

@ -9,11 +9,15 @@ let
in { in {
config = lib.mkIf config.services.minecraft-server.enable { options.gaming.minecraft-server.enable =
lib.mkEnableOption "Minecraft Server.";
config = lib.mkIf config.gaming.minecraft-server.enable {
unfreePackages = [ "minecraft-server" ]; unfreePackages = [ "minecraft-server" ];
services.minecraft-server = { services.minecraft-server = {
enable = true;
eula = true; eula = true;
declarative = true; declarative = true;
whitelist = { }; whitelist = { };

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
boot.loader = lib.mkIf (config.physical && !config.server) { boot.loader = lib.mkIf config.physical {
grub = { grub = {
enable = true; enable = true;

View File

@ -2,7 +2,12 @@
config = lib.mkIf config.physical { config = lib.mkIf config.physical {
networking.useDHCP = true; # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp5s0.useDHCP = true;
networking.interfaces.wlp4s0.useDHCP = true;
networking.firewall.allowPing = lib.mkIf config.server true; networking.firewall.allowPing = lib.mkIf config.server true;
@ -10,9 +15,6 @@
services.avahi = { services.avahi = {
enable = true; enable = true;
domainName = "local"; domainName = "local";
ipv6 = false; # Should work either way
# Resolve local hostnames using Avahi DNS
nssmdns = true;
publish = { publish = {
enable = true; enable = true;
addresses = true; addresses = true;
@ -20,6 +22,10 @@
workstation = true; workstation = true;
}; };
}; };
# Resolve local hostnames using Avahi DNS
services.avahi.nssmdns = true;
}; };
} }

View File

@ -1,6 +1,6 @@
{ config, lib, ... }: { { config, pkgs, lib, ... }: {
config = lib.mkIf config.server { config = lib.mkIf (pkgs.stdenv.isLinux && config.server) {
# Servers need a bootloader or they won't start # Servers need a bootloader or they won't start
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
config = lib.mkIf (config.physical && !config.server) { config = lib.mkIf config.physical {
# Prevent wake from keyboard # Prevent wake from keyboard
powerManagement.powerDownCommands = '' powerManagement.powerDownCommands = ''

View File

@ -1,21 +1,16 @@
{ config, lib, ... }: { { config, pkgs, lib, ... }: {
options = { zfs.enable = lib.mkEnableOption "ZFS file system."; }; options = { zfs.enable = lib.mkEnableOption "ZFS file system."; };
config = lib.mkIf (config.server && config.zfs.enable) { config =
lib.mkIf (pkgs.stdenv.isLinux && config.server && config.zfs.enable) {
# Only use compatible Linux kernel, since ZFS can be behind # Only use compatible Linux kernel, since ZFS can be behind
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; boot.kernelPackages =
boot.kernelParams = [ "nohibernate" ]; config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.supportedFilesystems = [ "zfs" ]; boot.kernelParams = [ "nohibernate" ];
services.prometheus.exporters.zfs.enable = boot.supportedFilesystems = [ "zfs" ];
config.prometheus.exporters.enable;
prometheus.scrapeTargets = [
"127.0.0.1:${
builtins.toString config.services.prometheus.exporters.zfs.port
}"
];
}; };
} }

View File

@ -1,8 +1,14 @@
{ config, lib, ... }: { { config, lib, ... }: {
options = { arrs.enable = lib.mkEnableOption "Arr services"; }; options = {
arrServer = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Hostname for arr services";
default = null;
};
};
config = lib.mkIf config.arrs.enable { config = lib.mkIf (config.arrServer != null) {
services = { services = {
bazarr = { bazarr = {
@ -38,7 +44,7 @@
{ {
group = "download"; group = "download";
match = [{ match = [{
host = [ config.hostnames.download ]; host = [ config.arrServer ];
path = [ "/sonarr*" ]; path = [ "/sonarr*" ];
}]; }];
handle = [{ handle = [{
@ -49,7 +55,7 @@
{ {
group = "download"; group = "download";
match = [{ match = [{
host = [ config.hostnames.download ]; host = [ config.arrServer ];
path = [ "/radarr*" ]; path = [ "/radarr*" ];
}]; }];
handle = [{ handle = [{
@ -60,7 +66,7 @@
{ {
group = "download"; group = "download";
match = [{ match = [{
host = [ config.hostnames.download ]; host = [ config.arrServer ];
path = [ "/prowlarr*" ]; path = [ "/prowlarr*" ];
}]; }];
handle = [{ handle = [{
@ -71,7 +77,7 @@
{ {
group = "download"; group = "download";
match = [{ match = [{
host = [ config.hostnames.download ]; host = [ config.arrServer ];
path = [ "/bazarr*" ]; path = [ "/bazarr*" ];
}]; }];
handle = [{ handle = [{
@ -82,7 +88,7 @@
{ {
group = "download"; group = "download";
match = [{ match = [{
host = [ config.hostnames.download ]; host = [ config.arrServer ];
path = [ "/sabnzbd*" ]; path = [ "/sabnzbd*" ];
}]; }];
handle = [{ handle = [{
@ -92,7 +98,7 @@
} }
{ {
group = "download"; group = "download";
match = [{ host = [ config.hostnames.download ]; }]; match = [{ host = [ config.arrServer ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:5055"; }]; upstreams = [{ dial = "localhost:5055"; }];

View File

@ -1,55 +0,0 @@
{ config, pkgs, lib, ... }:
let
localIp = "192.168.1.218";
localServices = [
config.hostnames.stream
config.hostnames.content
config.hostnames.books
config.hostnames.download
];
mkRecord = service: "${service} A ${localIp}";
localRecords = lib.concatLines (map mkRecord localServices);
in {
config = lib.mkIf config.services.bind.enable {
caddy.cidrAllowlist = [ "192.168.0.0/16" ];
services.bind = {
cacheNetworks = [ "127.0.0.0/24" "192.168.0.0/16" ];
forwarders = [ "1.1.1.1" "1.0.0.1" ];
ipv4Only = true;
# Use rpz zone as an override
extraOptions = ''response-policy { zone "rpz"; };'';
zones = {
rpz = {
master = true;
file = pkgs.writeText "db.rpz" ''
$TTL 60 ; 1 minute
@ IN SOA localhost. root.localhost. (
2023071800 ; serial
1h ; refresh
30m ; retry
1w ; expire
30m ; minimum ttl
)
IN NS localhost.
localhost A 127.0.0.1
${localRecords}
'';
};
};
};
networking.firewall.allowedTCPPorts = [ 53 ];
networking.firewall.allowedUDPPorts = [ 53 ];
};
}

View File

@ -1,42 +1,28 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
options = { options = {
caddy = { caddy.enable = lib.mkEnableOption "Caddy reverse proxy.";
tlsPolicies = lib.mkOption { caddy.tlsPolicies = lib.mkOption {
type = lib.types.listOf lib.types.attrs; type = lib.types.listOf lib.types.attrs;
description = "Caddy JSON TLS policies"; description = "Caddy JSON TLS policies";
default = [ ]; default = [ ];
}; };
routes = lib.mkOption { caddy.routes = lib.mkOption {
type = lib.types.listOf lib.types.attrs; type = lib.types.listOf lib.types.attrs;
description = "Caddy JSON routes for http servers"; description = "Caddy JSON routes for http servers";
default = [ ]; default = [ ];
}; };
blocks = lib.mkOption { caddy.blocks = lib.mkOption {
type = lib.types.listOf lib.types.attrs; type = lib.types.listOf lib.types.attrs;
description = "Caddy JSON error blocks for http servers"; description = "Caddy JSON error blocks for http servers";
default = [ ]; default = [ ];
};
cidrAllowlist = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "CIDR blocks to allow for requests";
default = [ "127.0.0.1/32" ];
};
}; };
}; };
config = lib.mkIf config.services.caddy.enable { config = lib.mkIf (config.caddy.enable && config.caddy.routes != [ ]) {
# Force Caddy to 403 if not coming from allowlisted source
caddy.routes = [{
match = [{ not = [{ remote_ip.ranges = config.caddy.cidrAllowlist; }]; }];
handle = [{
handler = "static_response";
status_code = "403";
}];
}];
services.caddy = { services.caddy = {
enable = true;
adapter = "''"; # Required to enable JSON adapter = "''"; # Required to enable JSON
configFile = pkgs.writeText "Caddyfile" (builtins.toJSON { configFile = pkgs.writeText "Caddyfile" (builtins.toJSON {
apps.http.servers.main = { apps.http.servers.main = {
@ -45,7 +31,6 @@
errors.routes = config.caddy.blocks; errors.routes = config.caddy.blocks;
# logs = { }; # Uncomment to collect access logs # logs = { }; # Uncomment to collect access logs
}; };
apps.http.servers.metrics = { }; # Enables Prometheus metrics
apps.tls.automation.policies = config.caddy.tlsPolicies; apps.tls.automation.policies = config.caddy.tlsPolicies;
logging.logs.main = { logging.logs.main = {
encoder = { format = "console"; }; encoder = { format = "console"; };
@ -63,8 +48,6 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ]; networking.firewall.allowedUDPPorts = [ 443 ];
prometheus.scrapeTargets = [ "127.0.0.1:2019" ];
}; };
} }

View File

@ -7,6 +7,11 @@ let
in { in {
options = { options = {
bookServer = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Hostname for Calibre library";
default = null;
};
backups.calibre = lib.mkOption { backups.calibre = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
description = "Whether to backup Calibre library"; description = "Whether to backup Calibre library";
@ -14,9 +19,10 @@ in {
}; };
}; };
config = lib.mkIf config.services.calibre-web.enable { config = lib.mkIf (config.bookServer != null) {
services.calibre-web = { services.calibre-web = {
enable = true;
openFirewall = true; openFirewall = true;
options = { options = {
reverseProxyAuth.enable = false; reverseProxyAuth.enable = false;
@ -27,7 +33,7 @@ in {
}; };
caddy.routes = [{ caddy.routes = [{
match = [{ host = [ config.hostnames.books ]; }]; match = [{ host = [ config.bookServer ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:8083"; }]; upstreams = [{ dial = "localhost:8083"; }];

View File

@ -41,7 +41,13 @@ in {
config = lib.mkIf config.cloudflare.enable { config = lib.mkIf config.cloudflare.enable {
# Forces Caddy to error if coming from a non-Cloudflare IP # Forces Caddy to error if coming from a non-Cloudflare IP
caddy.cidrAllowlist = cloudflareIpRanges; caddy.blocks = [{
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
handle = [{
handler = "static_response";
abort = true;
}];
}];
# Tell Caddy to use Cloudflare DNS for ACME challenge validation # Tell Caddy to use Cloudflare DNS for ACME challenge validation
services.caddy.package = (pkgs.callPackage ../../../overlays/caddy.nix { services.caddy.package = (pkgs.callPackage ../../../overlays/caddy.nix {

View File

@ -3,15 +3,12 @@
imports = [ imports = [
./arr.nix ./arr.nix
./backups.nix ./backups.nix
./bind.nix
./caddy.nix ./caddy.nix
./calibre.nix ./calibre.nix
./cloudflare-tunnel.nix ./cloudflare-tunnel.nix
./cloudflare.nix ./cloudflare.nix
./gitea-runner.nix
./gitea.nix ./gitea.nix
./gnupg.nix ./gnupg.nix
./grafana.nix
./honeypot.nix ./honeypot.nix
./jellyfin.nix ./jellyfin.nix
./keybase.nix ./keybase.nix
@ -25,7 +22,6 @@
./sshd.nix ./sshd.nix
./transmission.nix ./transmission.nix
./vaultwarden.nix ./vaultwarden.nix
./victoriametrics.nix
./wireguard.nix ./wireguard.nix
]; ];

View File

@ -1,53 +0,0 @@
{ config, pkgs, lib, ... }:
{
options.giteaRunner.enable =
lib.mkEnableOption "Enable Gitea Actions runner.";
config = lib.mkIf config.giteaRunner.enable {
services.gitea-actions-runner.instances.${config.networking.hostName} = {
enable = true;
labels = [
# Provide a Debian base with NodeJS for actions
# "debian-latest:docker://node:18-bullseye"
# Fake the Ubuntu name, because Node provides no Ubuntu builds
# "ubuntu-latest:docker://node:18-bullseye"
# Provide native execution on the host using below packages
"native:host"
];
hostPackages = with pkgs; [
bash
coreutils
curl
gawk
gitMinimal
gnused
nodejs
wget
];
name = config.networking.hostName;
url = "https://${config.hostnames.git}";
tokenFile = config.secrets.giteaRunnerToken.dest;
};
secrets.giteaRunnerToken = {
source = ../../../private/gitea-runner-token.age; # TOKEN=xyz
dest = "${config.secretsDirectory}/gitea-runner-token";
};
systemd.services.giteaRunnerToken-secret = {
requiredBy = [
"gitea-runner-${
config.services.gitea-actions-runner.instances.${config.networking.hostName}.name
}.service"
];
before = [
"gitea-runner-${
config.services.gitea-actions-runner.instances.${config.networking.hostName}.name
}.service"
];
};
};
}

View File

@ -1,18 +1,28 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
let giteaPath = "/var/lib/gitea"; # Default service directory let giteaPath = "/var/lib/gitea"; # Default service directory
in { in {
config = lib.mkIf config.services.gitea.enable { options = {
giteaServer = lib.mkOption {
description = "Hostname for Gitea.";
type = lib.types.nullOr lib.types.str;
default = null;
};
};
config = lib.mkIf (config.giteaServer != null) {
services.gitea = { services.gitea = {
enable = true;
database.type = "sqlite3"; database.type = "sqlite3";
settings = { settings = {
actions.ENABLED = true;
repository = { repository = {
DEFAULT_PUSH_CREATE_PRIVATE = true; DEFAULT_PUSH_CREATE_PRIVATE = true;
DISABLE_HTTP_GIT = false; DISABLE_HTTP_GIT = false;
ACCESS_CONTROL_ALLOW_ORIGIN = config.hostnames.git; ACCESS_CONTROL_ALLOW_ORIGIN = config.giteaServer;
ENABLE_PUSH_CREATE_USER = true; ENABLE_PUSH_CREATE_USER = true;
ENABLE_PUSH_CREATE_ORG = true; ENABLE_PUSH_CREATE_ORG = true;
DEFAULT_BRANCH = "main"; DEFAULT_BRANCH = "main";
@ -20,7 +30,7 @@ in {
server = { server = {
HTTP_PORT = 3001; HTTP_PORT = 3001;
HTTP_ADDRESS = "127.0.0.1"; HTTP_ADDRESS = "127.0.0.1";
ROOT_URL = "https://${config.hostnames.git}/"; ROOT_URL = "https://${config.giteaServer}/";
SSH_PORT = 22; SSH_PORT = 22;
START_SSH_SERVER = false; # Use sshd instead START_SSH_SERVER = false; # Use sshd instead
DISABLE_SSH = false; DISABLE_SSH = false;
@ -35,10 +45,9 @@ in {
}; };
networking.firewall.allowedTCPPorts = [ 122 ]; networking.firewall.allowedTCPPorts = [ 122 ];
users.users.${config.user}.extraGroups = [ "gitea" ];
caddy.routes = [{ caddy.routes = [{
match = [{ host = [ config.hostnames.git ]; }]; match = [{ host = [ config.giteaServer ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:3001"; }]; upstreams = [{ dial = "localhost:3001"; }];
@ -76,34 +85,6 @@ in {
requires = [ "gitea.service" ]; requires = [ "gitea.service" ];
}; };
# Run a repository file backup on a schedule
systemd.timers.gitea-backup = lib.mkIf (config.backup.s3.endpoint != null) {
timerConfig = {
OnCalendar = "*-*-* 00:00:00"; # Once per day
Unit = "gitea-backup.service";
};
wantedBy = [ "timers.target" ];
};
# Backup Gitea repos to object storage
systemd.services.gitea-backup =
lib.mkIf (config.backup.s3.endpoint != null) {
description = "Backup Gitea data";
environment.AWS_ACCESS_KEY_ID = config.backup.s3.accessKeyId;
serviceConfig = {
Type = "oneshot";
User = "gitea";
Group = "backup";
EnvironmentFile = config.secrets.backup.dest;
};
script = ''
${pkgs.awscli2}/bin/aws s3 sync --exclude */gitea.db* \
${giteaPath}/ \
s3://${config.backup.s3.bucket}/gitea-data/ \
--endpoint-url=https://${config.backup.s3.endpoint}
'';
};
}; };
} }

View File

@ -1,27 +0,0 @@
{ config, lib, ... }: {
config = lib.mkIf config.services.grafana.enable {
services.grafana.settings.server = {
domain = config.hostnames.metrics;
http_addr = "127.0.0.1";
http_port = 3000;
protocol = "http";
};
caddy.routes = [{
match = [{ host = [ config.hostnames.metrics ]; }];
handle = [{
handler = "reverse_proxy";
upstreams = [{
dial = "localhost:${
builtins.toString
config.services.grafana.settings.server.http_port
}";
}];
}];
}];
};
}

View File

@ -1,29 +1,26 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
config = lib.mkIf config.services.jellyfin.enable { options = {
streamServer = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Hostname for Jellyfin library";
default = null;
};
};
config = lib.mkIf (config.streamServer != null) {
services.jellyfin.enable = true;
services.jellyfin.group = "media"; services.jellyfin.group = "media";
users.users.jellyfin = { isSystemUser = true; }; users.users.jellyfin = { isSystemUser = true; };
caddy.routes = [ caddy.routes = [{
{ match = [{ host = [ config.streamServer ]; }];
match = [{ handle = [{
host = [ config.hostnames.stream ]; handler = "reverse_proxy";
path = [ "/metrics*" ]; upstreams = [{ dial = "localhost:8096"; }];
}]; }];
handle = [{ }];
handler = "static_response";
status_code = "403";
}];
}
{
match = [{ host = [ config.hostnames.stream ]; }];
handle = [{
handler = "reverse_proxy";
upstreams = [{ dial = "localhost:8096"; }];
}];
}
];
# Create videos directory, allow anyone in Jellyfin group to manage it # Create videos directory, allow anyone in Jellyfin group to manage it
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@ -47,9 +44,6 @@
users.users.jellyfin.extraGroups = users.users.jellyfin.extraGroups =
[ "render" "video" ]; # Access to /dev/dri [ "render" "video" ]; # Access to /dev/dri
# Requires MetricsEnable is true in /var/lib/jellyfin/config/system.xml
prometheus.scrapeTargets = [ "127.0.0.1:8096" ];
}; };
} }

View File

@ -1,38 +1,42 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
let options = {
port = 8080; nextcloudServer = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Hostname for Nextcloud";
default = null;
};
in { };
config = lib.mkIf config.services.nextcloud.enable { config = lib.mkIf (config.nextcloudServer != null) {
services.nextcloud = { services.nextcloud = {
package = pkgs.nextcloud27; # Required to specify enable = true;
package = pkgs.nextcloud26; # Required to specify
datadir = "/data/nextcloud"; datadir = "/data/nextcloud";
https = true; https = true;
hostName = "localhost"; hostName = "localhost";
maxUploadSize = "50G"; maxUploadSize = "50G";
config = { config = {
adminpassFile = config.secrets.nextcloud.dest; adminpassFile = config.secrets.nextcloud.dest;
extraTrustedDomains = [ config.hostnames.content ]; extraTrustedDomains = [ config.nextcloudServer ];
trustedProxies = [ "127.0.0.1" ];
}; };
}; };
# Don't let Nginx use main ports (using Caddy instead) # Don't let Nginx use main ports (using Caddy instead)
services.nginx.virtualHosts."localhost".listen = [{ services.nginx.virtualHosts."localhost".listen = [{
addr = "127.0.0.1"; addr = "127.0.0.1";
port = port; port = 8080;
}]; }];
# Point Caddy to Nginx # Point Caddy to Nginx
caddy.routes = [{ caddy.routes = [{
match = [{ host = [ config.hostnames.content ]; }]; match = [{ host = [ config.nextcloudServer ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:${builtins.toString port}"; }]; upstreams = [{ dial = "localhost:8080"; }];
}]; }];
}]; }];
@ -81,23 +85,6 @@ in {
requires = [ "phpfpm-nextcloud.service" ]; requires = [ "phpfpm-nextcloud.service" ];
}; };
# Log metrics to prometheus
services.prometheus.exporters.nextcloud = {
enable = config.prometheus.exporters.enable;
username = config.services.nextcloud.config.adminuser;
url = "http://localhost:${builtins.toString port}";
passwordFile = config.services.nextcloud.config.adminpassFile;
};
prometheus.scrapeTargets = [
"127.0.0.1:${
builtins.toString config.services.prometheus.exporters.nextcloud.port
}"
];
# Allows nextcloud-exporter to read passwordFile
users.users.nextcloud-exporter.extraGroups =
lib.mkIf config.services.prometheus.exporters.nextcloud.enable
[ "nextcloud" ];
}; };
} }

View File

@ -1,103 +1,32 @@
{ config, pkgs, lib, ... }: { { config, lib, ... }: {
options.prometheus = { options.metricsServer = lib.mkOption {
exporters.enable = lib.mkEnableOption "Enable Prometheus exporters"; type = lib.types.nullOr lib.types.str;
scrapeTargets = lib.mkOption { description = "Hostname of the Grafana server.";
type = lib.types.listOf lib.types.str; default = null;
description = "Prometheus scrape targets";
default = [ ];
};
}; };
config = let config = lib.mkIf (config.metricsServer != null) {
# If hosting Grafana, host local Prometheus and listen for inbound jobs. If services.grafana.enable = true;
# not hosting Grafana, send remote Prometheus writes to primary host.
isServer = config.services.grafana.enable;
in { # Required to fix error in latest nixpkgs
services.grafana.settings = { };
# Turn on exporters if any Prometheus scraper is running
prometheus.exporters.enable = builtins.any (x: x) [
config.services.prometheus.enable
config.services.victoriametrics.enable
config.services.vmagent.enable
];
prometheus.scrapeTargets = [
"127.0.0.1:${
builtins.toString config.services.prometheus.exporters.node.port
}"
"127.0.0.1:${
builtins.toString config.services.prometheus.exporters.systemd.port
}"
"127.0.0.1:${
builtins.toString config.services.prometheus.exporters.process.port
}"
];
services.prometheus = { services.prometheus = {
exporters.node.enable = config.prometheus.exporters.enable; enable = true;
exporters.node.enabledCollectors = [ ]; exporters.node.enable = true;
exporters.node.disabledCollectors = [ "cpufreq" ];
exporters.systemd.enable = config.prometheus.exporters.enable;
exporters.process.enable = config.prometheus.exporters.enable;
exporters.process.settings.process_names = [
# Remove nix store path from process name
{
name = "{{.Matches.Wrapped}} {{ .Matches.Args }}";
cmdline = [ "^/nix/store[^ ]*/(?P<Wrapped>[^ /]*) (?P<Args>.*)" ];
}
];
extraFlags = lib.mkIf isServer [ "--web.enable-remote-write-receiver" ];
scrapeConfigs = [{ scrapeConfigs = [{
job_name = config.networking.hostName; job_name = "local";
static_configs = [{ targets = config.scrapeTargets; }]; static_configs = [{ targets = [ "127.0.0.1:9100" ]; }];
}];
webExternalUrl =
lib.mkIf isServer "https://${config.hostnames.prometheus}";
# Web config file: https://prometheus.io/docs/prometheus/latest/configuration/https/
webConfigFile = lib.mkIf isServer
((pkgs.formats.yaml { }).generate "webconfig.yml" {
basic_auth_users = {
# Generate password: htpasswd -nBC 10 "" | tr -d ':\n'
# Encrypt and place in private/prometheus.age
"prometheus" =
"$2y$10$r7FWHLHTGPAY312PdhkPEuvb05aGn9Nk1IO7qtUUUjmaDl35l6sLa";
};
});
remoteWrite = lib.mkIf (!isServer) [{
name = config.networking.hostName;
url = "https://${config.hostnames.prometheus}/api/v1/write";
basic_auth = {
# Uses password hashed with bcrypt above
username = "prometheus";
password_file = config.secrets.prometheus.dest;
};
}]; }];
}; };
# Create credentials file for remote Prometheus push caddy.routes = [{
secrets.prometheus = match = [{ host = [ config.metricsServer ]; }];
lib.mkIf (config.services.prometheus.enable && !isServer) {
source = ../../../private/prometheus.age;
dest = "${config.secretsDirectory}/prometheus";
owner = "prometheus";
group = "prometheus";
permissions = "0440";
};
systemd.services.prometheus-secret =
lib.mkIf (config.services.prometheus.enable && !isServer) {
requiredBy = [ "prometheus.service" ];
before = [ "prometheus.service" ];
};
caddy.routes = lib.mkIf (config.services.prometheus.enable && isServer) [{
match = [{ host = [ config.hostnames.prometheus ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = upstreams = [{ dial = "localhost:3000"; }];
[{ dial = "localhost:${config.services.prometheus.port}"; }];
}]; }];
}]; }];

View File

@ -1,8 +1,11 @@
{ config, lib, ... }: { { config, lib, ... }: {
options = { samba.enable = lib.mkEnableOption "Enable Samba sharing."; };
config = { config = {
services.samba = lib.mkIf config.services.samba.enable { services.samba = lib.mkIf (config.samba.enable) {
enable = true;
openFirewall = true; openFirewall = true;
shares.data = { shares.data = {
path = "/data"; path = "/data";

View File

@ -39,11 +39,6 @@
type = lib.types.str; type = lib.types.str;
description = "Permissions expressed as octal."; description = "Permissions expressed as octal.";
}; };
prefix = lib.mkOption {
default = "";
type = lib.types.str;
description = "Prefix for secret value (for environment files).";
};
}; };
}); });
description = "Set of secrets to decrypt to disk."; description = "Set of secrets to decrypt to disk.";
@ -70,10 +65,10 @@
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
echo "${attrs.prefix}$( ${pkgs.age}/bin/age --decrypt \
${pkgs.age}/bin/age --decrypt \ --identity ${config.identityFile} \
--identity ${config.identityFile} ${attrs.source} --output ${attrs.dest} \
)" > ${attrs.dest} ${attrs.source}
chown '${attrs.owner}':'${attrs.group}' '${attrs.dest}' chown '${attrs.owner}':'${attrs.group}' '${attrs.dest}'
chmod '${attrs.permissions}' '${attrs.dest}' chmod '${attrs.permissions}' '${attrs.dest}'

View File

@ -13,8 +13,9 @@
}; };
}; };
config = lib.mkIf config.services.openssh.enable { config = lib.mkIf (config.publicKey != null) {
services.openssh = { services.openssh = {
enable = true;
ports = [ 22 ]; ports = [ 22 ];
allowSFTP = true; allowSFTP = true;
settings = { settings = {
@ -26,7 +27,7 @@
}; };
users.users.${config.user}.openssh.authorizedKeys.keys = users.users.${config.user}.openssh.authorizedKeys.keys =
lib.mkIf (config.publicKey != null) [ config.publicKey ]; [ config.publicKey ];
# Implement a simple fail2ban service for sshd # Implement a simple fail2ban service for sshd
services.sshguard.enable = true; services.sshguard.enable = true;

View File

@ -42,7 +42,7 @@
# Create reverse proxy for web UI # Create reverse proxy for web UI
caddy.routes = lib.mkAfter [{ caddy.routes = lib.mkAfter [{
group = if (config.hostnames.download == config.transmissionServer) then group = if (config.arrServer == config.transmissionServer) then
"download" "download"
else else
"transmission"; "transmission";

View File

@ -4,10 +4,21 @@ let vaultwardenPath = "/var/lib/bitwarden_rs"; # Default service directory
in { in {
config = lib.mkIf config.services.vaultwarden.enable { options = {
vaultwardenServer = lib.mkOption {
description = "Hostname for Vaultwarden.";
type = lib.types.nullOr lib.types.str;
default = null;
};
};
config = lib.mkIf (config.vaultwardenServer != null) {
services.vaultwarden = { services.vaultwarden = {
enable = true;
config = { config = {
DOMAIN = "https://${config.hostnames.secrets}"; DOMAIN = "https://${config.vaultwardenServer}";
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
SIGNUPS_VERIFY = true; SIGNUPS_VERIFY = true;
INVITATIONS_ALLOWED = true; INVITATIONS_ALLOWED = true;
@ -36,7 +47,7 @@ in {
networking.firewall.allowedTCPPorts = [ 3012 ]; networking.firewall.allowedTCPPorts = [ 3012 ];
caddy.routes = [{ caddy.routes = [{
match = [{ host = [ config.hostnames.secrets ]; }]; match = [{ host = [ config.vaultwardenServer ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:8222"; }]; upstreams = [{ dial = "localhost:8222"; }];

View File

@ -1,95 +0,0 @@
{ config, pkgs, lib, ... }:
let
username = "prometheus";
prometheusConfig = (pkgs.formats.yaml { }).generate "prometheus.yml" {
scrape_configs = [{
job_name = config.networking.hostName;
stream_parse = true;
static_configs = [{ targets = config.prometheus.scrapeTargets; }];
}];
};
authConfig = (pkgs.formats.yaml { }).generate "auth.yml" {
users = [{
username = username;
password = "%{PASSWORD}";
url_prefix =
"http://localhost${config.services.victoriametrics.listenAddress}";
}];
};
authPort = "8427";
in {
config = {
services.victoriametrics.extraOptions =
[ "-promscrape.config=${prometheusConfig}" ];
systemd.services.vmauth = lib.mkIf config.services.victoriametrics.enable {
description = "VictoriaMetrics basic auth proxy";
after = [ "network.target" ];
startLimitBurst = 5;
serviceConfig = {
Restart = "on-failure";
RestartSec = 1;
DynamicUser = true;
EnvironmentFile = config.secrets.vmauth.dest;
ExecStart = ''
${pkgs.victoriametrics}/bin/vmauth \
-auth.config=${authConfig} \
-httpListenAddr=:${authPort}'';
};
wantedBy = [ "multi-user.target" ];
};
secrets.vmauth = lib.mkIf config.services.victoriametrics.enable {
source = ../../../private/prometheus.age;
dest = "${config.secretsDirectory}/vmauth";
prefix = "PASSWORD=";
};
systemd.services.vmauth-secret =
lib.mkIf config.services.victoriametrics.enable {
requiredBy = [ "vmauth.service" ];
before = [ "vmauth.service" ];
};
caddy.routes = lib.mkIf config.services.victoriametrics.enable [{
match = [{ host = [ config.hostnames.prometheus ]; }];
handle = [{
handler = "reverse_proxy";
upstreams = [{ dial = "localhost:${authPort}"; }];
}];
}];
# VMAgent
services.vmagent.prometheusConfig = prometheusConfig; # Overwritten below
systemd.services.vmagent.serviceConfig =
lib.mkIf config.services.vmagent.enable {
ExecStart = lib.mkForce ''
${pkgs.victoriametrics}/bin/vmagent \
-promscrape.config=${prometheusConfig} \
-remoteWrite.url="https://${config.hostnames.prometheus}/api/v1/write" \
-remoteWrite.basicAuth.username=${username} \
-remoteWrite.basicAuth.passwordFile=${config.secrets.vmagent.dest}'';
};
secrets.vmagent = lib.mkIf config.services.vmagent.enable {
source = ../../../private/prometheus.age;
dest = "${config.secretsDirectory}/vmagent";
owner = "vmagent";
group = "vmagent";
};
systemd.services.vmagent-secret = lib.mkIf config.services.vmagent.enable {
requiredBy = [ "vmagent.service" ];
before = [ "vmagent.service" ];
};
};
}

View File

@ -7,17 +7,16 @@ let
# Use nixpkgs vimPlugin but with source directly from plugin author # 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 # Package plugin - disabling until in use
plugin = pname: src: # plugin = pname: src:
prev.vimUtils.buildVimPluginFrom2Nix { # prev.vimUtils.buildVimPluginFrom2Nix {
inherit pname src; # inherit pname src;
version = "master"; # version = "master";
}; # };
in { in {
nil = inputs.nil.packages.${prev.system}.nil; nil = inputs.nil.packages.${prev.system}.nil;
vscode-terraform-snippets = inputs.vscode-terraform-snippets;
nvim-lspconfig = nvim-lspconfig =
(withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig); (withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig);
@ -36,7 +35,8 @@ in {
(withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim); (withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim);
nvim-tree-lua = (withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua); nvim-tree-lua = (withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua);
# Packaging plugins entirely with Nix # Packaging plugins with Nix
baleia-nvim = plugin "baleia-nvim" inputs.baleia-nvim-src; # comment-nvim = plugin "comment-nvim" comment-nvim-src;
# plenary-nvim = plugin "plenary-nvim" plenary-nvim-src;
} }

View File

@ -1,47 +0,0 @@
# Fix: bash highlighting doesn't work as of this commit:
# https://github.com/NixOS/nixpkgs/commit/49cce41b7c5f6b88570a482355d9655ca19c1029
inputs: _final: prev: {
tree-sitter-grammars = prev.tree-sitter-grammars // {
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=";
};
});
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=";
};
};
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=";
};
};
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=";
};
};
};
}

View File

@ -1,15 +0,0 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyB1VnBt
RTV5eWc3RDNUR2lOWFRaMlgzREQyMlcvUFNxV0N2Vm9lVVZKOUZ3ClJjaWtYZjR5
ZTB4L2M4MFB0UThaMzlRT3JkUEE1N3RrSUlpZnRFbmFDdWcKLT4gc3NoLWVkMjU1
MTkgWXlTVU1RIE5iTUs1ak9VZjRIRGpLMWtDcVB0RjVFRW8vOENQZlkzeGhsYmFB
QzJ6Z00KZmcvZ0hYMjN1bGZwY3NvMjlCbnpHUWVjdVU4cnBGcDQxTU8wZ0EyQXdU
MAotPiBzc2gtZWQyNTUxOSBuanZYNUEgazRzK2ZnSUZNWURoKzZMZmM4VTlDbVBh
WGc4MlE5TGFiN1MzV01FT1oyQQppRUhUNjdlQURNQm8rR0JOOUJFNm9vaXhPTXFW
U2lJU09jWVA0TDRrVHY4Ci0tLSBudWJTclRTek1RWHYzYzA4aTduODB0NUNWbVVP
cUIyVzJncWhDS053d25nCneJhp1QT1v+dAguW9wAKDgWST59KNBgbY01jkf1IqXc
FbmkctPIMggim3uCBqjzBboYvf+dtt0Fcu9aiB+4YmGUeQNb+9mdPweXoHmVrego
XygVsbuSP4xKWtIJhBJ/3/jEK9LqBtv+owdUIxbw5Ci6A0JvSu+tnUj5oAgMyT2z
YrGRK9plQZteeUkMcd6+anSEUpP45lzfz/T7loD9ViCbPHRuUFgwkwUcRGjQStm3
pnx9bi8N4ac599f4KqInm5gd
-----END AGE ENCRYPTED FILE-----

View File

@ -1,12 +0,0 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBoOVF1
NmZocHpQQnRJcWpWUHh2bU93NkdnZWNzSlFiaHdTd24rcHpsczFRCmJaSzNkNGs1
UDJCN2dYUVE3UTE1OU5RUWljQlN4dmxuUnpOMFYxQTdUaVEKLT4gc3NoLWVkMjU1
MTkgWXlTVU1RIE5HdGd6aTlKM0lFUlYzT1VhS05nZ2ZxTndVZHBNQlJxYlovdXkx
ei96d2cKdzlUYVFFaEIzaS9LZmY3MzM1RmNnR0xjOEpHK1kxM0FMTWRQSlVnczVF
dwotPiBzc2gtZWQyNTUxOSBuanZYNUEgQ1lhMGQvUy9OWkRBR3BZV1pFNmNtb2pq
Y2VEUzhRWGVWUkZJY1l4RGtWdwphdFZtM0ZLZURvYVZQYjV4bWVPdWJxa3RmWmVh
SHl0T0pQWmxnVlFPR2drCi0tLSBnd2lwS3dqUk5Jelg0b3RxbFdEcnJ6ZkkvZTVN
UllBeUUyOXBxVDBKMG5BCkGo9kj9sMVhbnXVM35lGScAb8r5LH9vf5jOdhLC/Wj2
+uA0ONIh7F2GELzf5Cw1KZJ8aHTURM2r41vZvfAQN1RwrmYOiUzlyMrvTDe78cY=
-----END AGE ENCRYPTED FILE-----

View File

@ -1,12 +0,0 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBDRWNi
YlJubmg1Ly94cHgxbHV3dStaRkZDRXdNZzVjRCt0R2RNMFkxUEZNCnJxZnc1UHFB
MURselZuL1U5OHFQb0tPLytWelRzYXlvNngya3RQOXREUEkKLT4gc3NoLWVkMjU1
MTkgWXlTVU1RIDRiR2ZEMUZsYTlGbXFoR0NyZXVXMEZmS3BONDNFQUo4VU1XNkZ0
ZWFzMHcKM1crbDVsR2VmVTFNckxaa21MTW9UVWE3Z01qMi9VT0kwMm80V0tMSWM1
bwotPiBzc2gtZWQyNTUxOSBuanZYNUEgd0tIampOVU5ZeWtxNWZpaGdFQTBlWlha
Z0lBQWp0dzhMRHU5UnVzWVlUSQpnUHlCZ0w5Z1hMYm1Dc1UxQ1lLRHlnaUhJQllW
RGMvTEhhc29VL2JXZnhNCi0tLSB6TThQbmV0eFJ0d2pZd1h0c2RuTGFzUHhyYWJp
b2RhVTNkSXczRGJpN1UwCt7I+OsqQdQbFXhYPV5/kqDAr/jVoJ9H5PSfdLkeVIrr
AqScUaOrdctUZEBIF8/FouJkSbIiU8muBNrBKx9CylI=
-----END AGE ENCRYPTED FILE-----

1
templates/basic/.envrc Normal file
View File

@ -0,0 +1 @@
use flake

View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1659803779,
"narHash": "sha256-+5zkHlbcbFyN5f3buO1RAZ9pH1wXLxCesUJ0vFmLr9Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f44884060cb94240efbe55620f38a8ec8d9af601",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

1
templates/haskell/.envrc Normal file
View File

@ -0,0 +1 @@
use flake

View File

@ -0,0 +1,419 @@
{
"nodes": {
"HTTP": {
"flake": false,
"locked": {
"lastModified": 1451647621,
"narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=",
"owner": "phadej",
"repo": "HTTP",
"rev": "9bc0996d412fef1787449d841277ef663ad9a915",
"type": "github"
},
"original": {
"owner": "phadej",
"repo": "HTTP",
"type": "github"
}
},
"cabal-32": {
"flake": false,
"locked": {
"lastModified": 1603716527,
"narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=",
"owner": "haskell",
"repo": "cabal",
"rev": "48bf10787e27364730dd37a42b603cee8d6af7ee",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.2",
"repo": "cabal",
"type": "github"
}
},
"cabal-34": {
"flake": false,
"locked": {
"lastModified": 1640353650,
"narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=",
"owner": "haskell",
"repo": "cabal",
"rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.4",
"repo": "cabal",
"type": "github"
}
},
"cabal-36": {
"flake": false,
"locked": {
"lastModified": 1641652457,
"narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=",
"owner": "haskell",
"repo": "cabal",
"rev": "f27667f8ec360c475027dcaee0138c937477b070",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.6",
"repo": "cabal",
"type": "github"
}
},
"cardano-shell": {
"flake": false,
"locked": {
"lastModified": 1608537748,
"narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=",
"owner": "input-output-hk",
"repo": "cardano-shell",
"rev": "9392c75087cb9a3d453998f4230930dea3a95725",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "cardano-shell",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1656065134,
"narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghc-8.6.5-iohk": {
"flake": false,
"locked": {
"lastModified": 1600920045,
"narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=",
"owner": "input-output-hk",
"repo": "ghc",
"rev": "95713a6ecce4551240da7c96b6176f980af75cae",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"ref": "release/8.6.5-iohk",
"repo": "ghc",
"type": "github"
}
},
"hackage": {
"flake": false,
"locked": {
"lastModified": 1656724378,
"narHash": "sha256-JdtnbKzKiP1GMWuVt3aQYELxFb8A2OhH/TJBfPn3QMg=",
"owner": "input-output-hk",
"repo": "hackage.nix",
"rev": "6e2d054b0876d3f9709da1df9dfe27325886927e",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "hackage.nix",
"type": "github"
}
},
"haskellNix": {
"inputs": {
"HTTP": "HTTP",
"cabal-32": "cabal-32",
"cabal-34": "cabal-34",
"cabal-36": "cabal-36",
"cardano-shell": "cardano-shell",
"flake-utils": "flake-utils_2",
"ghc-8.6.5-iohk": "ghc-8.6.5-iohk",
"hackage": "hackage",
"hpc-coveralls": "hpc-coveralls",
"hydra": "hydra",
"nix-tools": "nix-tools",
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
],
"nixpkgs-2003": "nixpkgs-2003",
"nixpkgs-2105": "nixpkgs-2105",
"nixpkgs-2111": "nixpkgs-2111",
"nixpkgs-unstable": "nixpkgs-unstable",
"old-ghc-nix": "old-ghc-nix",
"stackage": "stackage"
},
"locked": {
"lastModified": 1656752829,
"narHash": "sha256-Xz7aGLynjihmgp5a9dTX5Ax5GsL3Fcd2GQUEJ2BEYAU=",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "4e100b2ad96c221a78580701aa0a5a4f48f49130",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "haskell.nix",
"type": "github"
}
},
"hpc-coveralls": {
"flake": false,
"locked": {
"lastModified": 1607498076,
"narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=",
"owner": "sevanspowell",
"repo": "hpc-coveralls",
"rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430",
"type": "github"
},
"original": {
"owner": "sevanspowell",
"repo": "hpc-coveralls",
"type": "github"
}
},
"hydra": {
"inputs": {
"nix": "nix",
"nixpkgs": [
"haskellNix",
"hydra",
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1646878427,
"narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=",
"owner": "NixOS",
"repo": "hydra",
"rev": "28b682b85b7efc5cf7974065792a1f22203a5927",
"type": "github"
},
"original": {
"id": "hydra",
"type": "indirect"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1643066034,
"narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=",
"owner": "NixOS",
"repo": "nix",
"rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "2.6.0",
"repo": "nix",
"type": "github"
}
},
"nix-tools": {
"flake": false,
"locked": {
"lastModified": 1649424170,
"narHash": "sha256-XgKXWispvv5RCvZzPb+p7e6Hy3LMuRjafKMl7kXzxGw=",
"owner": "input-output-hk",
"repo": "nix-tools",
"rev": "e109c94016e3b6e0db7ed413c793e2d4bdb24aa7",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "nix-tools",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1632864508,
"narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "82891b5e2c2359d7e58d08849e4c89511ab94234",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05-small",
"type": "indirect"
}
},
"nixpkgs-2003": {
"locked": {
"lastModified": 1620055814,
"narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-20.03-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2105": {
"locked": {
"lastModified": 1645296114,
"narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-21.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2111": {
"locked": {
"lastModified": 1648744337,
"narHash": "sha256-bYe1dFJAXovjqiaPKrmAbSBEK5KUkgwVaZcTbSoJ7hg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0a58eebd8ec65ffdef2ce9562784123a73922052",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-21.11-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "indirect"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1648219316,
"narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"old-ghc-nix": {
"flake": false,
"locked": {
"lastModified": 1631092763,
"narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=",
"owner": "angerman",
"repo": "old-ghc-nix",
"rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8",
"type": "github"
},
"original": {
"owner": "angerman",
"ref": "master",
"repo": "old-ghc-nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"haskellNix": "haskellNix",
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
]
}
},
"stackage": {
"flake": false,
"locked": {
"lastModified": 1656638371,
"narHash": "sha256-waxiLSFvKxpaG4zl8YpLtuhLf5OrFi6CgAIZAOXpnQ8=",
"owner": "input-output-hk",
"repo": "stackage.nix",
"rev": "4f1ad0f4b0f01010df8dab254fc8b453934823e7",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "stackage.nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

1
templates/poetry/.envrc Normal file
View File

@ -0,0 +1 @@
use flake . --no-use-registries

1
templates/python/.envrc Normal file
View File

@ -0,0 +1 @@
use flake