mirror of
https://github.com/nmasur/dotfiles
synced 2026-10-31 04:45:02 +00:00
continuing dev
This commit is contained in:
55 files changed
+362
-347
No files matched your search
Generated
-17
@@ -492,22 +492,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-caddy": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1699107987,
|
|
||||||
"narHash": "sha256-nWXETr4Oqy/vOfzgWyMY04qzEN2iREFJc5ycQ3XNu0A=",
|
|
||||||
"owner": "jpds",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "a33b02fa9d664f31dadc8a874eb1a5dbaa9f4ecf",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "jpds",
|
|
||||||
"ref": "caddy-external-plugins",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735563628,
|
"lastModified": 1735563628,
|
||||||
@@ -697,7 +681,6 @@
|
|||||||
"nix2vim": "nix2vim",
|
"nix2vim": "nix2vim",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-caddy": "nixpkgs-caddy",
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"nvim-lint-src": "nvim-lint-src",
|
"nvim-lint-src": "nvim-lint-src",
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
# Used for specific stable packages
|
# Used for specific stable packages
|
||||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
|
|
||||||
# Used for caddy plugins
|
|
||||||
nixpkgs-caddy.url = "github:jpds/nixpkgs/caddy-external-plugins";
|
|
||||||
|
|
||||||
# Used for MacOS system config
|
# Used for MacOS system config
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/master";
|
url = "github:lnl7/nix-darwin/master";
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./haskell.nix
|
|
||||||
./kubernetes.nix
|
|
||||||
./lua.nix
|
|
||||||
./python.nix
|
|
||||||
./rust.nix
|
|
||||||
./terraform.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.lua.enable {
|
|
||||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
|
||||||
stylua # Lua formatter
|
|
||||||
sumneko-lua-language-server # Lua LSP
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.python.enable = lib.mkEnableOption "Python programming language.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.python.enable {
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
# python310 # Standard Python interpreter
|
|
||||||
pyright # Python language server
|
|
||||||
black # Python formatter
|
|
||||||
python310Packages.flake8 # Python linter
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
py = "python3";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.rust.enable = lib.mkEnableOption "Rust programming language.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.rust.enable {
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
ca = "cargo";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
gcc
|
|
||||||
rustc
|
|
||||||
cargo
|
|
||||||
cargo-watch
|
|
||||||
clippy
|
|
||||||
rustfmt
|
|
||||||
pkg-config
|
|
||||||
openssl
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.terraform.enable {
|
|
||||||
unfreePackages = [ "terraform" ];
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
# Terraform
|
|
||||||
te = "terraform";
|
|
||||||
};
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
terraform # Terraform executable
|
|
||||||
terraform-ls # Language server
|
|
||||||
tflint # Linter
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
|
||||||
|
|
||||||
home.packages = with pkgs; [ nerd-fonts.victor-mono ];
|
|
||||||
|
|
||||||
programs.alacritty.settings = {
|
|
||||||
font.normal.family = "VictorMono";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.kitty.font = {
|
|
||||||
package = pkgs.nerd-fonts.victor-mono;
|
|
||||||
name = "VictorMono Nerd Font Mono";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
home-packages = config.home-manager.users.${config.user}.home.packages;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
options.gaming.legendary.enable = lib.mkEnableOption "Legendary Epic Games launcher.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.gaming.legendary.enable {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
legendary-gl
|
|
||||||
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages, see https://nixos.wiki/wiki/Wine
|
|
||||||
heroic # GUI launcher
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
xdg.configFile."legendary/config.ini".text = ''
|
|
||||||
[Legendary]
|
|
||||||
; Disables the automatic update check
|
|
||||||
disable_update_check = false
|
|
||||||
; Disables the notice about an available update on exit
|
|
||||||
disable_update_notice = true
|
|
||||||
; Set install directory
|
|
||||||
install_dir = ${config.homePath}/media/games
|
|
||||||
; Make output quiet
|
|
||||||
log_level = error
|
|
||||||
'';
|
|
||||||
|
|
||||||
home.file =
|
|
||||||
let
|
|
||||||
ignorePatterns = ''
|
|
||||||
.wine/
|
|
||||||
drive_c/'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
".rgignore".text = ignorePatterns;
|
|
||||||
".fdignore".text = ignorePatterns;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fish.functions = lib.mkIf (builtins.elem pkgs.fzf home-packages) {
|
|
||||||
epic-games = {
|
|
||||||
body = ''
|
|
||||||
set game (legendary list 2>/dev/null \
|
|
||||||
| awk '/^ \* / { print $0; }' \
|
|
||||||
| sed -e 's/ (.*)$//' -e 's/ \* //' \
|
|
||||||
| fzf)
|
|
||||||
and legendary launch "$game" &> /dev/null
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.gaming.lutris.enable = lib.mkEnableOption "Lutris game installer.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.gaming.lutris.enable {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
lutris
|
|
||||||
amdvlk # Vulkan drivers (probably already installed)
|
|
||||||
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.gaming.ryujinx.enable = lib.mkEnableOption "Ryujinx Nintendo Switch application.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.gaming.ryujinx.enable {
|
|
||||||
environment.systemPackages = with pkgs; [ ryujinx ];
|
|
||||||
|
|
||||||
home-manager.users.${config.user}.xdg.desktopEntries.ryujinx = lib.mkIf pkgs.stdenv.isLinux {
|
|
||||||
name = "Ryujinx";
|
|
||||||
exec = "env DOTNET_EnableAlternateStackCheck=1 Ryujinx -r /home/${config.user}/media/games/ryujinx/ %f";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Include stable packages
|
||||||
|
# Adapted from https://github.com/PsychoLlama/dotfiles/blob/dd41f8c60fdc85868dbd7d88cf933348b497dcf0/lib/overlays/latest-packages.nix
|
||||||
|
|
||||||
|
inputs: _final: prev: {
|
||||||
|
# Provides `pkgs.stable`.
|
||||||
|
stable = import inputs.nixpkgs-stable {
|
||||||
|
inherit (prev) system config;
|
||||||
|
overlays = [
|
||||||
|
# inputs.self.overlays.vim-plugins
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.fonts;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.fonts.enable = lib.mkEnableOption "Font configuration";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
pkgs.victor-mono # Used for Vim and Terminal
|
||||||
|
pkgs.nerd-fonts.hack # For Polybar, Rofi
|
||||||
|
];
|
||||||
|
fonts.fontconfig = {
|
||||||
|
enable = true;
|
||||||
|
defaultFonts.monospace = [ "Victor Mono" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
xsession.windowManager.i3.config.fonts = {
|
||||||
|
names = [ "pango:Victor Mono" ];
|
||||||
|
# style = "Regular";
|
||||||
|
# size = 11.0;
|
||||||
|
};
|
||||||
|
services.polybar.config."bar/main".font-0 = "Hack Nerd Font:size=10;2";
|
||||||
|
programs.rofi.font = "Hack Nerd Font 14";
|
||||||
|
programs.alacritty.settings.font.normal.family = "VictorMono";
|
||||||
|
programs.kitty.font.name = "VictorMono Nerd Font Mono";
|
||||||
|
config.nmasur.presets.programs.wezterm.font = "VictorMono Nerd Font Mono";
|
||||||
|
services.dunst.settings.global.font = "Hack Nerd Font 14";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.cargo;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.programs.cargo.enable = lib.mkEnableOption "Cargo for programming language.";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
ca = "cargo";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
gcc
|
||||||
|
rustc
|
||||||
|
cargo
|
||||||
|
cargo-watch
|
||||||
|
clippy
|
||||||
|
rustfmt
|
||||||
|
pkg-config
|
||||||
|
openssl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
+6
-2
@@ -1,9 +1,13 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.haskell;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
options.nmasur.presets.programs.haskell.enable =
|
||||||
|
lib.mkEnableOption "Haskell programming language config.";
|
||||||
|
|
||||||
config = lib.mkIf config.haskell.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# Binary Cache for Haskell.nix
|
# Binary Cache for Haskell.nix
|
||||||
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.lua;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.programs.lua.enable = lib.mkEnableOption "Lua programming language.";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [
|
||||||
|
pkgs.stylua # Lua formatter
|
||||||
|
pkgs.sumneko-lua-language-server # Lua LSP
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.python;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.programs.python.enable = lib.mkEnableOption "Python programming language.";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
pkgs.pyright # Python language server
|
||||||
|
pkgs.black # Python formatter
|
||||||
|
pkgs.python310Packages.flake8 # Python linter
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
py = "python3";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
File renamed without changes.
+1
-1
@@ -168,7 +168,7 @@ in
|
|||||||
|
|
||||||
home.file.".local/share/rofi/themes" = {
|
home.file.".local/share/rofi/themes" = {
|
||||||
recursive = true;
|
recursive = true;
|
||||||
source = ./rofi/themes;
|
source = ./themes;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.terraform;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.programs.terraform.enable =
|
||||||
|
lib.mkEnableOption "Terraform infrastructure management";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
unfreePackages = [ "terraform" ];
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
te = "terraform";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
terraform
|
||||||
|
terraform-ls
|
||||||
|
tflint
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,12 +7,17 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.programs.wezterm;
|
cfg = config.nmasur.presets.programs.wezterm;
|
||||||
font = config.programs.kitty.font.name;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.wezterm.enable = lib.mkEnableOption "WezTerm terminal";
|
options.nmasur.presets.programs.wezterm = {
|
||||||
|
enable = lib.mkEnableOption "WezTerm terminal";
|
||||||
|
font = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Name of the font for WezTerm";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# Set the i3 terminal
|
# Set the i3 terminal
|
||||||
@@ -99,7 +104,7 @@ in
|
|||||||
bottom = 12,
|
bottom = 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
config.font = wezterm.font('${font}', { weight = 'Bold'})
|
config.font = wezterm.font('${cfg.font}', { weight = 'Bold'})
|
||||||
config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"}
|
config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"}
|
||||||
|
|
||||||
-- Fix color blocks instead of text
|
-- Fix color blocks instead of text
|
||||||
@@ -108,7 +113,7 @@ in
|
|||||||
-- Tab Bar
|
-- Tab Bar
|
||||||
config.hide_tab_bar_if_only_one_tab = true
|
config.hide_tab_bar_if_only_one_tab = true
|
||||||
config.window_frame = {
|
config.window_frame = {
|
||||||
font = wezterm.font('${font}', { weight = 'Bold'}),
|
font = wezterm.font('${cfg.font}', { weight = 'Bold'}),
|
||||||
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
|
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.wine;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.nmasur.presets.programs.wine.enable = lib.mkEnableOption "Wine settings";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Ignore wine directories in searches
|
||||||
|
home.file =
|
||||||
|
let
|
||||||
|
ignorePatterns = ''
|
||||||
|
.wine/
|
||||||
|
drive_c/'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
".rgignore".text = ignorePatterns;
|
||||||
|
".fdignore".text = ignorePatterns;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
-7
@@ -15,20 +15,18 @@ in
|
|||||||
lib.mkEnableOption "Hammerspoon macOS automation";
|
lib.mkEnableOption "Hammerspoon macOS automation";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua;
|
xdg.configFile."hammerspoon/init.lua".source = ./init.lua;
|
||||||
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source =
|
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source = ./Spoons/ControlEscape.spoon;
|
||||||
./hammerspoon/Spoons/ControlEscape.spoon;
|
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source = ./Spoons/DismissAlerts.spoon;
|
||||||
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source =
|
|
||||||
./hammerspoon/Spoons/DismissAlerts.spoon;
|
|
||||||
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll {
|
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll {
|
||||||
src = ./hammerspoon/Spoons/Launcher.spoon/init.lua;
|
src = ./Spoons/Launcher.spoon/init.lua;
|
||||||
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
||||||
discord = "${pkgs.discord}/Applications/Discord.app";
|
discord = "${pkgs.discord}/Applications/Discord.app";
|
||||||
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
||||||
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
||||||
slack = "${pkgs.slack}/Applications/Slack.app";
|
slack = "${pkgs.slack}/Applications/Slack.app";
|
||||||
};
|
};
|
||||||
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./hammerspoon/Spoons/MoveWindow.spoon;
|
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./Spoons/MoveWindow.spoon;
|
||||||
|
|
||||||
home.activation.reloadHammerspoon =
|
home.activation.reloadHammerspoon =
|
||||||
config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ]
|
config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ]
|
||||||
File renamed without changes.
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.services.loadkey;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.services.loadkey.enable =
|
||||||
|
lib.mkEnableOption "Load the private key as an SSH file";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.activation = {
|
||||||
|
|
||||||
|
# Always load the key if it doesn't exist
|
||||||
|
cloneDotfiles = config.lib.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
if [ ! -f ~/.ssh/id_ed25519 ]; then
|
||||||
|
run mkdir -p ~/.ssh/
|
||||||
|
|
||||||
|
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||||
|
$DRY_RUN_CMD ${pkgs.git}/bin/git \
|
||||||
|
clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,10 +15,12 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = lib.mkDefault [
|
||||||
pgcli # Postgres client with autocomplete
|
pkgs.pgcli # Postgres client with autocomplete
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.helix.enable = lib.mkDefault true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,14 +15,14 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = lib.mkDefault [
|
||||||
|
|
||||||
# Charm tools
|
# Charm tools
|
||||||
|
|
||||||
glow # Markdown previews
|
pkgs.glow # Markdown previews
|
||||||
skate # Key-value store
|
pkgs.skate # Key-value store
|
||||||
charm # Manage account and filesystem
|
pkgs.charm # Manage account and filesystem
|
||||||
pop # Send emails from a TUI
|
pkgs.pop # Send emails from a TUI
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -16,28 +16,28 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# Allow Nix to manage the default applications list
|
# Allow Nix to manage the default applications list
|
||||||
mimeApps.enable = true;
|
mimeApps.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Set directories for application defaults
|
# Set directories for application defaults
|
||||||
userDirs = {
|
userDirs = {
|
||||||
enable = true;
|
enable = lib.mkDefault true;
|
||||||
createDirectories = true;
|
createDirectories = lib.mkDefault true;
|
||||||
documents = "$HOME/documents";
|
documents = lib.mkDefault "$HOME/documents";
|
||||||
download = config.userDirs.download;
|
download = lib.mkDefault config.userDirs.download;
|
||||||
music = "$HOME/media/music";
|
music = lib.mkDefault "$HOME/media/music";
|
||||||
pictures = "$HOME/media/images";
|
pictures = lib.mkDefault "$HOME/media/images";
|
||||||
videos = "$HOME/media/videos";
|
videos = lib.mkDefault "$HOME/media/videos";
|
||||||
desktop = "$HOME/other/desktop";
|
desktop = lib.mkDefault "$HOME/other/desktop";
|
||||||
publicShare = "$HOME/other/public";
|
publicShare = lib.mkDefault "$HOME/other/public";
|
||||||
templates = "$HOME/other/templates";
|
templates = lib.mkDefault "$HOME/other/templates";
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
XDG_DEV_DIR = "$HOME/dev";
|
XDG_DEV_DIR = lib.mkDefault "$HOME/dev";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish.shellAliases = {
|
programs.fish.shellAliases = {
|
||||||
# Move files to XDG trash on the commandline
|
# Move files to XDG trash on the commandline
|
||||||
trash = "${pkgs.trash-cli}/bin/trash-put";
|
trash = lib.mkDefault "${pkgs.trash-cli}/bin/trash-put";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.profiles.linux-gaming;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.profiles.linux-gaming.enable = lib.mkEnableOption "Linux gaming home";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
config.nmasur.programs.wine.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
home.packages = lib.mkDefault [
|
||||||
|
pkgs.heroic
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -17,32 +17,34 @@ in
|
|||||||
|
|
||||||
# Cursor
|
# Cursor
|
||||||
home.pointerCursor = {
|
home.pointerCursor = {
|
||||||
name = "Adwaita";
|
name = lib.mkDefault "Adwaita";
|
||||||
package = pkgs.adwaita-icon-theme;
|
package = lib.mkDefault pkgs.adwaita-icon-theme;
|
||||||
size = 24;
|
size = lib.mkDefault 24;
|
||||||
gtk.enable = true;
|
gtk.enable = lib.mkDefault true;
|
||||||
x11.enable = true;
|
x11.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable num lock on login
|
# Enable num lock on login
|
||||||
xsession.numlock.enable = true;
|
xsession.numlock.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Dark theme
|
# Dark theme
|
||||||
gtk =
|
gtk =
|
||||||
let
|
let
|
||||||
gtkExtraConfig = {
|
gtkExtraConfig = {
|
||||||
gtk-application-prefer-dark-theme = config.theme.dark;
|
gtk-application-prefer-dark-theme = lib.mkDefault config.theme.dark;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = lib.mkDefault true;
|
||||||
theme = {
|
theme = {
|
||||||
name = config.gtk.theme.name;
|
name = lib.mkDefault config.gtk.theme.name;
|
||||||
package = config.gtk.theme.package;
|
package = lib.mkDefault config.gtk.theme.package;
|
||||||
};
|
};
|
||||||
gtk3.extraConfig = gtkExtraConfig;
|
gtk3.extraConfig = lib.mkDefault gtkExtraConfig;
|
||||||
gtk4.extraConfig = gtkExtraConfig;
|
gtk4.extraConfig = lib.mkDefault gtkExtraConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.zed-editor.enable = lib.mkDefault true;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -58,6 +58,12 @@ in
|
|||||||
text = builtins.readFile ../../modules/common/shell/bash/scripts/terraform-init.sh;
|
text = builtins.readFile ../../modules/common/shell/bash/scripts/terraform-init.sh;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.helix.enable = lib.mkDefault true;
|
||||||
|
programs.zed-editor.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
config.nmasur.presets.programs.terraform.enable = lib.mkDefault true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -22,5 +22,10 @@ in
|
|||||||
"notunes" # Don't launch Apple Music with the play button
|
"notunes" # Don't launch Apple Music with the play button
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Add homebrew paths to CLI path
|
||||||
|
home.sessionPath = [
|
||||||
|
"/opt/homebrew/opt/trash/bin"
|
||||||
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ in
|
|||||||
|
|
||||||
# Normally I block all requests not coming from Cloudflare, so I have to also
|
# Normally I block all requests not coming from Cloudflare, so I have to also
|
||||||
# allow my local network.
|
# allow my local network.
|
||||||
caddy.cidrAllowlist = [ "192.168.0.0/16" ];
|
config.nmasur.presets.services.caddy.cidrAllowlist = [ "192.168.0.0/16" ];
|
||||||
|
|
||||||
services.bind = {
|
services.bind = {
|
||||||
|
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# Force Caddy to 403 if not coming from allowlisted source
|
# Force Caddy to 403 if not coming from allowlisted source
|
||||||
caddy.cidrAllowlist = lib.mkDefault [ "127.0.0.1/32" ];
|
cfg.cidrAllowlist = lib.mkDefault [ "127.0.0.1/32" ];
|
||||||
caddy.routes = lib.mkBefore [
|
cfg.routes = lib.mkBefore [
|
||||||
{
|
{
|
||||||
match = [ { not = [ { remote_ip.ranges = config.caddy.cidrAllowlist; } ]; } ];
|
match = [ { not = [ { remote_ip.ranges = cfg.cidrAllowlist; } ]; } ];
|
||||||
handle = [
|
handle = [
|
||||||
{
|
{
|
||||||
handler = "static_response";
|
handler = "static_response";
|
||||||
|
|||||||
+14
-17
@@ -11,13 +11,14 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgs-caddy,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
cfg = config.nmasur.presets.services.cloudflare;
|
||||||
|
|
||||||
cloudflareIpRanges = [
|
cloudflareIpRanges = [
|
||||||
|
|
||||||
# Cloudflare IPv4: https://www.cloudflare.com/ips-v4
|
# Cloudflare IPv4: https://www.cloudflare.com/ips-v4
|
||||||
@@ -49,29 +50,25 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options.cloudflare.enable = lib.mkEnableOption "Use Cloudflare.";
|
options.nmasur.presets.services.cloudflare = {
|
||||||
|
enable = lib.mkEnableOption "Cloudflare proxy configuration";
|
||||||
|
|
||||||
options.cloudflare.noProxyDomains = lib.mkOption {
|
noProxyDomains = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
description = "Domains to use for dyndns without CDN proxying.";
|
description = "Domains to use for dyndns without CDN proxying.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.cloudflare.enable {
|
config = lib.mkIf cfg.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;
|
config.nmasur.presets.services.caddy.cidrAllowlist = cloudflareIpRanges;
|
||||||
|
|
||||||
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
||||||
services.caddy.package = pkgs-caddy.caddy.override {
|
services.caddy.package = pkgs.caddy.withPlugins {
|
||||||
externalPlugins = [
|
plugins = [ "github.com/caddy-dns/cloudflare@master" ];
|
||||||
{
|
hash = "sha256-C7JOGd4sXsRZL561oP84V2/pTg7szEgF4OFOw35yS1s=";
|
||||||
name = "cloudflare";
|
|
||||||
repo = "github.com/caddy-dns/cloudflare";
|
|
||||||
version = "master";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
vendorHash = "sha256-C7JOGd4sXsRZL561oP84V2/pTg7szEgF4OFOw35yS1s=";
|
|
||||||
};
|
};
|
||||||
caddy.tlsPolicies = [
|
caddy.tlsPolicies = [
|
||||||
{
|
{
|
||||||
@@ -25,5 +25,6 @@ in
|
|||||||
programs.gamemode.enable = true;
|
programs.gamemode.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ moonlight-qt ];
|
environment.systemPackages = with pkgs; [ moonlight-qt ];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
File renamed without changes.
@@ -18,7 +18,7 @@ in
|
|||||||
# Run a second copy of dyn-dns for non-proxied domains
|
# Run a second copy of dyn-dns for non-proxied domains
|
||||||
# Adapted from: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/cloudflare-dyndns.nix
|
# Adapted from: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/cloudflare-dyndns.nix
|
||||||
systemd.services.cloudflare-dyndns-noproxy =
|
systemd.services.cloudflare-dyndns-noproxy =
|
||||||
lib.mkIf ((builtins.length config.cloudflare.noProxyDomains) > 0)
|
lib.mkIf ((builtins.length config.nmasur.presets.services.cloudflare.noProxyDomains) > 0)
|
||||||
{
|
{
|
||||||
description = "CloudFlare Dynamic DNS Client (no proxy)";
|
description = "CloudFlare Dynamic DNS Client (no proxy)";
|
||||||
after = [
|
after = [
|
||||||
@@ -30,7 +30,7 @@ in
|
|||||||
startAt = "*:0/5";
|
startAt = "*:0/5";
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
CLOUDFLARE_DOMAINS = toString config.cloudflare.noProxyDomains;
|
CLOUDFLARE_DOMAINS = toString config.nmasur.presets.services.cloudflare.noProxyDomains;
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|||||||
+30
-26
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
cfg = config.services.honeypot;
|
||||||
|
|
||||||
portsToBlock = [
|
portsToBlock = [
|
||||||
25545
|
25545
|
||||||
25565
|
25565
|
||||||
@@ -47,35 +49,37 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options.honeypot.enable = lib.mkEnableOption "Honeypot fail2ban system.";
|
options.services.honeypot.enable = lib.mkEnableOption "Honeypot fail2ban system.";
|
||||||
|
|
||||||
config.networking.firewall = lib.mkIf config.honeypot.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
networking.firewall = {
|
||||||
|
|
||||||
extraPackages = [ pkgs.ipset ];
|
extraPackages = [ pkgs.ipset ];
|
||||||
# allowedTCPPorts = portsToBlock;
|
# allowedTCPPorts = portsToBlock;
|
||||||
|
|
||||||
# Restore ban list when starting up
|
# Restore ban list when starting up
|
||||||
extraCommands = ''
|
extraCommands = ''
|
||||||
if test -f /var/lib/ipset.conf
|
if test -f /var/lib/ipset.conf
|
||||||
then
|
then
|
||||||
ipset restore -! < /var/lib/ipset.conf
|
ipset restore -! < /var/lib/ipset.conf
|
||||||
else
|
else
|
||||||
ipset -exist create blocked hash:ip ${if expire > 0 then "timeout ${toString expire}" else ""}
|
ipset -exist create blocked hash:ip ${if expire > 0 then "timeout ${toString expire}" else ""}
|
||||||
ipset -exist create blocked6 hash:ip family inet6 ${
|
ipset -exist create blocked6 hash:ip family inet6 ${
|
||||||
if expire > 0 then "timeout ${toString expire}" else ""
|
if expire > 0 then "timeout ${toString expire}" else ""
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
${create-rules}
|
${create-rules}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Save list when shutting down
|
# Save list when shutting down
|
||||||
extraStopCommands = ''
|
extraStopCommands = ''
|
||||||
ipset -exist create blocked hash:ip ${if expire > 0 then "timeout ${toString expire}" else ""}
|
ipset -exist create blocked hash:ip ${if expire > 0 then "timeout ${toString expire}" else ""}
|
||||||
ipset -exist create blocked6 hash:ip family inet6 ${
|
ipset -exist create blocked6 hash:ip family inet6 ${
|
||||||
if expire > 0 then "timeout ${toString expire}" else ""
|
if expire > 0 then "timeout ${toString expire}" else ""
|
||||||
}
|
}
|
||||||
ipset save > /var/lib/ipset.conf
|
ipset save > /var/lib/ipset.conf
|
||||||
${delete-rules}
|
${delete-rules}
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user