├── .envrc ├── .stylua.toml ├── hosts ├── x86_64-darwin │ └── readme.md ├── x86_64-linux │ ├── swan │ │ ├── root.nix │ │ └── cloudflared-swan.age │ ├── arrow │ │ └── default.nix │ ├── tempest │ │ └── cloudflared-tempest.age │ └── hydra │ │ └── default.nix ├── aarch64-darwin │ └── lookingglass │ │ └── default.nix └── aarch64-linux │ └── flame │ └── cloudflared-flame.age ├── templates ├── poetry │ ├── .flake8 │ ├── .gitignore │ └── flake.nix ├── python │ ├── .flake8 │ ├── .gitignore │ └── flake.nix ├── haskell │ ├── cabal.project │ ├── app │ │ └── Main.hs │ ├── bench │ │ └── Main.hs │ ├── src │ │ └── Lib.hs │ ├── test │ │ └── Spec.hs │ ├── .hlint.yaml │ ├── .gitignore │ └── hie.yaml ├── README.md ├── default.nix ├── default │ └── flake.nix └── rust │ └── flake.nix ├── deploy ├── aws │ ├── outputs.tf │ ├── main.tf │ └── variables.tf └── oracle │ └── outputs.tf ├── platforms ├── home-manager │ ├── modules │ │ ├── nmasur │ │ │ ├── presets │ │ │ │ ├── services │ │ │ │ │ ├── hammerspoon │ │ │ │ │ │ ├── .stylua.toml │ │ │ │ │ │ ├── init.lua │ │ │ │ │ │ └── Spoons │ │ │ │ │ │ │ └── DismissAlerts.spoon │ │ │ │ │ │ │ └── init.lua │ │ │ │ │ ├── gnupg.nix │ │ │ │ │ ├── dunst.nix │ │ │ │ │ ├── mbsync │ │ │ │ │ │ └── mailpass.age │ │ │ │ │ ├── keybase.nix │ │ │ │ │ └── loadkey.nix │ │ │ │ ├── programs │ │ │ │ │ ├── rofi │ │ │ │ │ │ ├── themes │ │ │ │ │ │ │ ├── launcher.rasi │ │ │ │ │ │ │ ├── power.rasi │ │ │ │ │ │ │ ├── brightness.rasi │ │ │ │ │ │ │ └── prompt.rasi │ │ │ │ │ │ ├── pulse-sink.sh │ │ │ │ │ │ └── rofi-prompt.sh │ │ │ │ │ ├── notes │ │ │ │ │ │ ├── syncnotes.fish │ │ │ │ │ │ └── note.fish │ │ │ │ │ ├── git │ │ │ │ │ │ └── fish │ │ │ │ │ │ │ ├── commandline-git-commits.fish │ │ │ │ │ │ │ ├── git-show-fuzzy.fish │ │ │ │ │ │ │ ├── git-commits.fish │ │ │ │ │ │ │ ├── uncommitted.fish │ │ │ │ │ │ │ ├── git-fuzzy-branch.fish │ │ │ │ │ │ │ ├── git-history.fish │ │ │ │ │ │ │ ├── git-add-fuzzy.fish │ │ │ │ │ │ │ └── git.fish │ │ │ │ │ ├── fzf │ │ │ │ │ │ └── fish │ │ │ │ │ │ │ └── fcd.fish │ │ │ │ │ ├── feishin.nix │ │ │ │ │ ├── fd.nix │ │ │ │ │ ├── lua.nix │ │ │ │ │ ├── calibre.nix │ │ │ │ │ ├── bash.nix │ │ │ │ │ ├── aws-ssh │ │ │ │ │ │ └── aws-ssh.nix │ │ │ │ │ ├── haskell.nix │ │ │ │ │ ├── bat.nix │ │ │ │ │ ├── xclip.nix │ │ │ │ │ ├── notmuch.nix │ │ │ │ │ ├── weather.nix │ │ │ │ │ ├── direnv.nix │ │ │ │ │ ├── doas.nix │ │ │ │ │ ├── wine.nix │ │ │ │ │ ├── fish-darwin.nix │ │ │ │ │ ├── prettyping.nix │ │ │ │ │ ├── python.nix │ │ │ │ │ ├── terraform.nix │ │ │ │ │ ├── cargo.nix │ │ │ │ │ ├── noti.nix │ │ │ │ │ ├── zoxide.nix │ │ │ │ │ ├── obsidian.nix │ │ │ │ │ ├── himalaya.nix │ │ │ │ │ ├── discord.nix │ │ │ │ │ ├── kitty-darwin.nix │ │ │ │ │ ├── kubectl.nix │ │ │ │ │ ├── chawan.nix │ │ │ │ │ ├── ripgrep.nix │ │ │ │ │ ├── nsxiv.nix │ │ │ │ │ ├── zathura.nix │ │ │ │ │ ├── yt-dlp.nix │ │ │ │ │ ├── mpv.nix │ │ │ │ │ ├── nix-index.nix │ │ │ │ │ ├── jujutsu.nix │ │ │ │ │ ├── zed-editor.nix │ │ │ │ │ ├── nautilus.nix │ │ │ │ │ ├── calendar.nix │ │ │ │ │ ├── atuin.nix │ │ │ │ │ └── _1password.nix │ │ │ │ ├── fonts.nix │ │ │ │ └── gtk.nix │ │ │ ├── profiles │ │ │ │ ├── linux-gaming.nix │ │ │ │ ├── developer.nix │ │ │ │ ├── experimental.nix │ │ │ │ ├── linux-base.nix │ │ │ │ ├── common.nix │ │ │ │ └── darwin-base.nix │ │ │ └── settings.nix │ │ └── nixpkgs.nix │ └── theme.nix ├── windows │ ├── utc-time.reg │ ├── autohotkey │ │ ├── RemapCaps.ahk │ │ └── RemapCapsCtrlEscapeV2.ahk │ ├── windows-programs.md │ └── caps-lock-ctrl.reg ├── nix-darwin │ └── modules │ │ ├── secrets.nix │ │ └── nmasur │ │ ├── settings.nix │ │ ├── profiles │ │ ├── gaming.nix │ │ ├── extra.nix │ │ ├── work.nix │ │ └── base.nix │ │ └── presets │ │ ├── programs │ │ ├── fish.nix │ │ └── homebrew.nix │ │ └── services │ │ ├── user.nix │ │ └── hammerspoon.nix ├── nixos │ └── modules │ │ ├── nmasur │ │ ├── presets │ │ │ ├── services │ │ │ │ ├── nix-daemon.nix │ │ │ │ ├── logind.nix │ │ │ │ ├── openssh-aws.nix │ │ │ │ ├── empty-trash.nix │ │ │ │ ├── journald.nix │ │ │ │ ├── avahi.nix │ │ │ │ ├── pipewire.nix │ │ │ │ ├── redshift.nix │ │ │ │ ├── samba.nix │ │ │ │ ├── grafana │ │ │ │ │ └── mailpass-grafana.age │ │ │ │ ├── postgresql.nix │ │ │ │ ├── uptime-kuma.nix │ │ │ │ ├── metrics │ │ │ │ │ └── prometheus.age │ │ │ │ ├── arr │ │ │ │ │ ├── lidarr-api-key.age │ │ │ │ │ ├── prowlarr-api-key.age │ │ │ │ │ ├── radarr-api-key.age │ │ │ │ │ ├── readarr-api-key.age │ │ │ │ │ ├── sabnzbd-api-key.age │ │ │ │ │ ├── sonarr-api-key.age │ │ │ │ │ └── slskd.age │ │ │ │ ├── influxdb2 │ │ │ │ │ ├── influxdb2-token.age │ │ │ │ │ └── influxdb2-password.age │ │ │ │ ├── nextcloud │ │ │ │ │ └── nextcloud.age │ │ │ │ ├── paperless │ │ │ │ │ └── paperless.age │ │ │ │ ├── restic │ │ │ │ │ ├── restic.age │ │ │ │ │ └── s3-glacier.age │ │ │ │ ├── cloudflare │ │ │ │ │ ├── cloudflare-api.age │ │ │ │ │ └── letsencrypt-key.age │ │ │ │ ├── wireguard │ │ │ │ │ └── wireguard.age │ │ │ │ ├── litestream │ │ │ │ │ └── backup.age │ │ │ │ ├── actualbudget │ │ │ │ │ ├── actualbudget-password.age │ │ │ │ │ └── actualbudget-budget-id.age │ │ │ │ ├── gitea-runner-local │ │ │ │ │ └── gitea-runner-token.age │ │ │ │ ├── mathesar │ │ │ │ │ ├── mathesar-postgres.age │ │ │ │ │ └── mathesar.age │ │ │ │ ├── notes-git-sync.nix │ │ │ │ ├── audiobookshelf.nix │ │ │ │ ├── kanata.nix │ │ │ │ ├── mealie.nix │ │ │ │ ├── vaultwarden │ │ │ │ │ └── vaultwarden.age │ │ │ │ ├── ntfy-sh.nix │ │ │ │ ├── thelounge.nix │ │ │ │ ├── karakeep.nix │ │ │ │ ├── n8n.nix │ │ │ │ ├── navidrome │ │ │ │ │ ├── navidrome-integrations.age │ │ │ │ │ └── navidrome.nix │ │ │ │ ├── filebrowser.nix │ │ │ │ ├── grub.nix │ │ │ │ └── openssh.nix │ │ │ ├── programs │ │ │ │ ├── slsk-batchdl.nix │ │ │ │ ├── nautilus.nix │ │ │ │ ├── doas.nix │ │ │ │ ├── msmtp │ │ │ │ │ └── mailpass-system.age │ │ │ │ ├── dwarf-fortress.nix │ │ │ │ └── steam.nix │ │ │ ├── vm.nix │ │ │ └── zfs.nix │ │ ├── profiles │ │ │ ├── no-mitigations.nix │ │ │ ├── latest.nix │ │ │ ├── gaming.nix │ │ │ ├── server.nix │ │ │ ├── wsl.nix │ │ │ ├── shared-media.nix │ │ │ └── nas.nix │ │ └── settings.nix │ │ ├── nixpkgs.nix │ │ └── services │ │ ├── identity.nix │ │ └── betterlockscreen.nix └── generators │ └── aws │ └── default.nix ├── docs ├── README.md ├── restore-calibre.md └── zfs.md ├── misc ├── password.sha512 ├── README.md ├── public-keys └── libratbag-profile ├── pkgs ├── tools │ ├── misc │ │ ├── ip-check │ │ │ ├── ip.fish │ │ │ └── package.nix │ │ ├── readme │ │ │ └── package.nix │ │ ├── ocr │ │ │ └── package.nix │ │ ├── jqr │ │ │ ├── package.nix │ │ │ └── jqr.sh │ │ ├── format-root │ │ │ ├── package.nix │ │ │ └── format-root.sh │ │ ├── dotfiles-devshell │ │ │ └── package.nix │ │ ├── terraform-init │ │ │ └── package.nix │ │ ├── docker-cleanup │ │ │ ├── package.nix │ │ │ └── docker-cleanup.sh │ │ ├── aws-ec2 │ │ │ ├── package.nix │ │ │ └── aws-ec2.sh │ │ ├── loadkey │ │ │ └── package.nix │ │ ├── rebuild │ │ │ └── package.nix │ │ ├── encrypt-secret │ │ │ └── package.nix │ │ ├── osc │ │ │ └── package.nix │ │ ├── gh-collaborators │ │ │ └── package.nix │ │ ├── reencrypt-secrets │ │ │ └── package.nix │ │ └── default │ │ │ └── package.nix │ └── text │ │ ├── ren-find │ │ └── package.nix │ │ └── rep-grep │ │ └── package.nix ├── applications │ ├── editors │ │ └── neovim │ │ │ └── nmasur │ │ │ └── neovim │ │ │ ├── config │ │ │ ├── gitsigns.nix │ │ │ ├── kubernetes.lua │ │ │ ├── statusline.nix │ │ │ ├── align.nix │ │ │ ├── github.lua │ │ │ ├── lsp.lua │ │ │ ├── toggleterm.nix │ │ │ ├── bufferline.nix │ │ │ ├── telescope.nix │ │ │ ├── toggleterm.lua │ │ │ ├── gitsigns.lua │ │ │ └── colors.nix │ │ │ ├── plugin │ │ │ └── after │ │ │ │ └── queries │ │ │ │ └── nix │ │ │ │ └── injections.scm │ │ │ └── lua │ │ │ └── settings.lua │ └── misc │ │ └── volnoti │ │ └── package.nix ├── prometheus-actual-exporter │ └── tsconfig.patch ├── development │ └── tools │ │ └── parsing │ │ └── tree-sitter │ │ └── grammars │ │ ├── tree-sitter-ini │ │ └── package.nix │ │ ├── tree-sitter-rasi │ │ └── package.nix │ │ ├── tree-sitter-vimdoc │ │ └── package.nix │ │ └── tree-sitter-puppet │ │ └── package.nix ├── misc │ ├── wallpapers │ │ └── package.nix │ └── bypass-paywalls-clean │ │ └── package.nix ├── caddy │ └── package.nix └── slsk-batchdl │ └── package.nix ├── .gitignore ├── colorscheme ├── README.md ├── nord │ └── default.nix ├── everforest │ └── default.nix └── gruvbox │ └── default.nix ├── overlays ├── README.md ├── stable.nix ├── unstable.nix ├── mpv-scripts.nix ├── nextcloud-apps.nix └── pkgs.nix ├── .github └── workflows │ └── check.yml └── LICENSE /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | -------------------------------------------------------------------------------- /hosts/x86_64-darwin/readme.md: -------------------------------------------------------------------------------- 1 | # No x86 Darwin Hosts Currently 2 | -------------------------------------------------------------------------------- /templates/poetry/.flake8: -------------------------------------------------------------------------------- 1 | max-line-length = 88 2 | extend-ignore = E203 3 | -------------------------------------------------------------------------------- /templates/poetry/.gitignore: -------------------------------------------------------------------------------- 1 | .direnv 2 | result 3 | *.pyc 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /templates/python/.flake8: -------------------------------------------------------------------------------- 1 | max-line-length = 88 2 | extend-ignore = E203 3 | -------------------------------------------------------------------------------- /templates/python/.gitignore: -------------------------------------------------------------------------------- 1 | .direnv 2 | result 3 | *.pyc 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /deploy/aws/outputs.tf: -------------------------------------------------------------------------------- 1 | output "host_ip" { 2 | value = aws_instance.instance.public_ip 3 | } 4 | -------------------------------------------------------------------------------- /templates/haskell/cabal.project: -------------------------------------------------------------------------------- 1 | packages: 2 | ./ 3 | 4 | package hello 5 | tests: True 6 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/hammerspoon/.stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | -------------------------------------------------------------------------------- /templates/haskell/app/Main.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "this is my app" 5 | -------------------------------------------------------------------------------- /templates/haskell/bench/Main.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "heyyyyyyyyyyyyyyyyyyyy" 5 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | Reference documents for some of the more complicated services and maintenance 4 | tasks. 5 | -------------------------------------------------------------------------------- /misc/password.sha512: -------------------------------------------------------------------------------- 1 | $6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF. 2 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/themes/launcher.rasi: -------------------------------------------------------------------------------- 1 | #entry { 2 | placeholder: "Launch Program"; 3 | } 4 | -------------------------------------------------------------------------------- /pkgs/tools/misc/ip-check/ip.fish: -------------------------------------------------------------------------------- 1 | if count $argv >/dev/null 2 | curl ipinfo.io/$argv 3 | else 4 | curl checkip.amazonaws.com 5 | end 6 | -------------------------------------------------------------------------------- /templates/haskell/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc, 3 | ) 4 | where 5 | 6 | someFunc :: IO () 7 | someFunc = putStrLn "this is a lib" 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.bak 3 | *.db 4 | *.qcow2 5 | **/.direnv/** 6 | result 7 | private/** 8 | templates/**/flake.lock 9 | !private/**.age 10 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/themes/power.rasi: -------------------------------------------------------------------------------- 1 | @import "common.rasi" 2 | 3 | #window { 4 | width: 980px; 5 | height: 230px; 6 | } 7 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/themes/brightness.rasi: -------------------------------------------------------------------------------- 1 | @import "common.rasi" 2 | 3 | #window { 4 | width: 605px; 5 | height: 230px; 6 | } 7 | -------------------------------------------------------------------------------- /pkgs/tools/misc/readme/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellScriptBin "readme" '' 4 | ${pkgs.glow}/bin/glow --pager ${builtins.toString ../../../../README.md} 5 | '' 6 | -------------------------------------------------------------------------------- /templates/README.md: -------------------------------------------------------------------------------- 1 | # Templates 2 | 3 | These are new flakes that can be generated quickly using: 4 | 5 | ``` 6 | nix flake init -t github:nmasur/dotfiles#mytemplate 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /templates/haskell/test/Spec.hs: -------------------------------------------------------------------------------- 1 | import Test.Hspec 2 | 3 | main :: IO () 4 | main = 5 | hspec $ 6 | describe "hello-test" $ 7 | it "works" $ 8 | 2 + 2 `shouldBe` (4 :: Int) 9 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/notes/syncnotes.fish: -------------------------------------------------------------------------------- 1 | set current_dir $PWD 2 | cd $NOTES_PATH 3 | git pull 4 | git add -A 5 | git commit -m autosync 6 | git push 7 | cd $current_dir 8 | -------------------------------------------------------------------------------- /pkgs/tools/misc/ocr/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, writeShellApplication }: 2 | 3 | writeShellApplication { 4 | name = "ocr"; 5 | runtimeInputs = [ pkgs.tesseract ]; 6 | text = builtins.readFile ./ocr.sh; 7 | } 8 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/commandline-git-commits.fish: -------------------------------------------------------------------------------- 1 | set commit (git-commits) 2 | if [ $commit ] 3 | commandline -i "$commit" 4 | else 5 | commandline -i HEAD 6 | end 7 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/gitsigns.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | plugins = [ pkgs.vimPlugins.gitsigns-nvim ]; 4 | setup.gitsigns = { }; 5 | lua = builtins.readFile ./gitsigns.lua; 6 | } 7 | -------------------------------------------------------------------------------- /pkgs/tools/misc/jqr/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellApplication { 4 | name = "jqr"; 5 | runtimeInputs = [ 6 | pkgs.jq 7 | pkgs.fzf 8 | ]; 9 | text = builtins.readFile ./jqr.sh; 10 | } 11 | -------------------------------------------------------------------------------- /colorscheme/README.md: -------------------------------------------------------------------------------- 1 | # Colorschemes 2 | 3 | Color information for different themes is found here. The colors are sourced 4 | and used with [base16](https://github.com/chriskempson/base16) format 5 | consistently across the system. 6 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/kubernetes.lua: -------------------------------------------------------------------------------- 1 | local k9s = require("toggleterm.terminal").Terminal:new({ cmd = "k9s" }) 2 | function K9S_TOGGLE() 3 | k9s:toggle() 4 | end 5 | 6 | vim.keymap.set("n", "9", K9S_TOGGLE) 7 | -------------------------------------------------------------------------------- /overlays/README.md: -------------------------------------------------------------------------------- 1 | # Overlays 2 | 3 | These are pinned commits, patches, or new packages for programs in Nixpkgs used 4 | by this flake configuration. 5 | 6 | Some of them introduce new functionality, while others could be patching 7 | temporary issues. 8 | -------------------------------------------------------------------------------- /pkgs/tools/misc/format-root/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellApplication { 4 | name = "format-root"; 5 | runtimeInputs = [ 6 | pkgs.gum 7 | pkgs.disko 8 | ]; 9 | text = builtins.readFile ./format-root.sh; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/tools/misc/dotfiles-devshell/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.mkShell { 4 | name = "dotfiles-devshell"; 5 | buildInputs = with pkgs; [ 6 | git 7 | stylua 8 | nixfmt-rfc-style 9 | shfmt 10 | shellcheck 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git-show-fuzzy.fish: -------------------------------------------------------------------------------- 1 | set commitline (git log \ 2 | --pretty="format:%C(auto)%ar %h%d %s" \ 3 | | fzf \ 4 | ) 5 | and set commit (echo $commitline | cut -d" " -f4 ) 6 | and git show $commit 7 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/notes/note.fish: -------------------------------------------------------------------------------- 1 | if test -n "$filename" 2 | vim "$NOTES_PATH/$filename.md" 3 | else 4 | set file (ls $NOTES_PATH | fzf) 5 | if [ $status -eq 0 ] 6 | vim "$NOTES_PATH/$file" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /pkgs/tools/misc/ip-check/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | pkgs.writers.writeFishBin "ip-check" { 4 | makeWrapperArgs = [ 5 | "--prefix" 6 | "PATH" 7 | ":" 8 | "${lib.makeBinPath [ pkgs.curl ]}" 9 | ]; 10 | } (builtins.readFile ./ip.fish) 11 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/statusline.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | plugins = [ pkgs.vimPlugins.lualine-nvim ]; 4 | setup.lualine = { 5 | options = { 6 | theme = "base16"; 7 | icons_enabled = true; 8 | }; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/tools/misc/terraform-init/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellApplication { 4 | name = "terraform-init"; 5 | runtimeInputs = [ 6 | pkgs.gawk 7 | pkgs.git 8 | pkgs.terraform 9 | ]; 10 | text = builtins.readFile ./terraform-init.sh; 11 | } 12 | -------------------------------------------------------------------------------- /templates/haskell/.hlint.yaml: -------------------------------------------------------------------------------- 1 | # template-haskell example hlint file 2 | 3 | # Generalise map to fmap, ++ to <>. Off by default 4 | - group: 5 | name: generalise 6 | enabled: true 7 | 8 | - ignore: 9 | name: Use section 10 | 11 | - ignore: 12 | name: Use infix 13 | -------------------------------------------------------------------------------- /pkgs/tools/misc/docker-cleanup/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellApplication { 4 | name = "docker-cleanup"; 5 | runtimeInputs = [ 6 | pkgs.docker-client 7 | pkgs.gawk 8 | pkgs.gnugrep 9 | ]; 10 | text = builtins.readFile ./docker-cleanup.sh; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/tools/misc/aws-ec2/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellApplication { 4 | name = "aws-ec2"; 5 | runtimeInputs = [ 6 | pkgs.awscli2 7 | pkgs.jq 8 | pkgs.fzf 9 | pkgs.ssm-session-manager-plugin 10 | ]; 11 | text = builtins.readFile ./aws-ec2.sh; 12 | } 13 | -------------------------------------------------------------------------------- /deploy/aws/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | region = "us-east-1" 4 | dynamodb_table = "terraform-state-lock" 5 | } 6 | required_version = ">= 1.0.0" 7 | required_providers { 8 | aws = { 9 | source = "hashicorp/aws" 10 | version = "5.42.0" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /deploy/aws/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ec2_size" { 2 | type = string 3 | description = "Size of instance to launch" 4 | default = "t3a.small" # 2 GB RAM ($14/mo) 5 | } 6 | 7 | variable "images_bucket" { 8 | description = "Name of the bucket in which to store the NixOS VM images." 9 | type = string 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/plugin/after/queries/nix/injections.scm: -------------------------------------------------------------------------------- 1 | expression: (apply_expression 2 | function: (apply_expression 3 | function: (select_expression 4 | attrpath: (attrpath) @writeshell (#match? @writeshell "^writeShell.*$") 5 | ) 6 | ) 7 | (indented_string_expression) @bash 8 | ) 9 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/fzf/fish/fcd.fish: -------------------------------------------------------------------------------- 1 | if test -z $directory 2 | set directory "$HOME" 3 | end 4 | if ! test -d $directory 5 | echo "Directory not found: $directory" 6 | return 1 7 | end 8 | set jump (fd -t d . $directory | fzf) 9 | and cd $jump $argv 10 | and commandline -f execute 11 | -------------------------------------------------------------------------------- /platforms/windows/utc-time.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | ; Changes registry to expect UTC from the hardware clock 4 | ; More info here: https://wiki.archlinux.org/title/System_time#UTC_in_Microsoft_Windows 5 | 6 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] 7 | "RealTimeIsUniversal"=dword:00000001 -------------------------------------------------------------------------------- /pkgs/tools/misc/loadkey/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellScriptBin "loadkey" '' 4 | printf "\nEnter the seed phrase for your SSH key...\n" 5 | printf "\nThen press ^D when complete.\n\n" 6 | mkdir -p ~/.ssh/ 7 | ${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519 8 | printf "\n\nContinuing activation.\n\n" 9 | '' 10 | -------------------------------------------------------------------------------- /pkgs/prometheus-actual-exporter/tsconfig.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tsconfig.json b/tsconfig.json 2 | index 5106135..3a340f6 100644 3 | --- a/tsconfig.json 4 | +++ b/tsconfig.json 5 | @@ -8,5 +8,6 @@ 6 | "skipLibCheck": true, 7 | "lib": ["es2020"], 8 | "outDir": "./dist" 9 | - } 10 | + }, 11 | + "include": ["src/**/*", "app.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git-commits.fish: -------------------------------------------------------------------------------- 1 | set commitline (git log \ 2 | --pretty="format:%C(auto)%ar %h%d %s" \ 3 | | fzf \ 4 | --height 50% \ 5 | --preview 'git show --color=always (echo {} | cut -d" " -f4)' \ 6 | ) 7 | and set commit (echo $commitline | cut -d" " -f4) 8 | and echo $commit 9 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/hammerspoon/init.lua: -------------------------------------------------------------------------------- 1 | hs.ipc.cliInstall() -- Install Hammerspoon CLI program 2 | hs.loadSpoon("ControlEscape"):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon 3 | hs.loadSpoon("Launcher"):init() 4 | hs.loadSpoon("DismissAlerts"):init() 5 | hs.loadSpoon("MoveWindow"):init() 6 | -------------------------------------------------------------------------------- /platforms/windows/autohotkey/RemapCaps.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ; #Warn ; Enable warnings to assist with detecting common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | Capslock::Esc 6 | -------------------------------------------------------------------------------- /platforms/windows/windows-programs.md: -------------------------------------------------------------------------------- 1 | # Windows Programs 2 | 3 | - Monitorian (monitor brightness) 4 | - Firefox 5 | - Alacritty 6 | - Mullvad 7 | - Keybase (dokan) 8 | - qBittorrent 9 | - 1Password 10 | - Authy Desktop 11 | - Autohotkey 12 | - 7zip 13 | - Audacity 14 | - Calibre 15 | - Discord 16 | - Git 17 | - Netflix 18 | - Obsidian 19 | - Realtek HD Audio 20 | - AMD Software 21 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/secrets.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | { 8 | 9 | options = { 10 | 11 | identityFile = lib.mkOption { 12 | type = lib.types.path; 13 | description = "Path containing decryption identity."; 14 | default = "/Users/${config.nmasur.settings.username}/.ssh/id_ed25519"; 15 | }; 16 | 17 | }; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/settings.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | { 4 | options.nmasur.settings = { 5 | username = lib.mkOption { 6 | type = lib.types.str; 7 | description = "Primary username for the system"; 8 | }; 9 | fullName = lib.mkOption { 10 | type = lib.types.str; 11 | description = "Human readable name of the user"; 12 | }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /templates/haskell/.gitignore: -------------------------------------------------------------------------------- 1 | ### Nix ### 2 | result 3 | 4 | ### Haskell ### 5 | dist 6 | dist-* 7 | cabal-dev 8 | *.o 9 | *.hi 10 | *.hie 11 | *.chi 12 | *.chs.h 13 | *.dyn_o 14 | *.dyn_hi 15 | .hpc 16 | .hsenv 17 | .cabal-sandbox/ 18 | cabal.sandbox.config 19 | *.prof 20 | *.aux 21 | *.hp 22 | *.eventlog 23 | .stack-work/ 24 | cabal.project.local 25 | cabal.project.local~ 26 | .HTF/ 27 | .ghc.environment.* 28 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/feishin.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.feishin; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.feishin.enable = lib.mkEnableOption "Feishin music player"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | home.packages = [ pkgs.feishin ]; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/uncommitted.fish: -------------------------------------------------------------------------------- 1 | echo "Searching git repos..." >&2 2 | find "$HOME/dev" -type d -name '.git' | while read dir 3 | set fullPath (dirname "$dir") 4 | set relativePath (echo "$fullPath" | cut -d'/' -f5-) 5 | if test -n (echo (git -C "$fullPath" status -s)) 6 | echo "$relativePath" 7 | git -C "$fullPath" status -s 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /platforms/windows/caps-lock-ctrl.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | ; Changes registry to map Caps Lock key to Ctrl key 4 | ; More info here: https://www.autohotkey.com/boards/viewtopic.php?p=468638#p468638 5 | ; And here: https://superuser.com/a/949533 6 | 7 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] 8 | "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 9 | -------------------------------------------------------------------------------- /overlays/stable.nix: -------------------------------------------------------------------------------- 1 | # Include stable packages 2 | # Adapted from https://github.com/PsychoLlama/dotfiles/blob/dd41f8c60fdc85868dbd7d88cf933348b497dcf0/lib/overlays/latest-packages.nix 3 | 4 | inputs: _final: prev: { 5 | # Provides `pkgs.stable`. 6 | stable = import inputs.nixpkgs-stable { 7 | inherit (prev) system config; 8 | overlays = [ 9 | # inputs.self.overlays.vim-plugins 10 | ]; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /overlays/unstable.nix: -------------------------------------------------------------------------------- 1 | # Include unstable packages 2 | # Adapted from https://github.com/PsychoLlama/dotfiles/blob/dd41f8c60fdc85868dbd7d88cf933348b497dcf0/lib/overlays/latest-packages.nix 3 | 4 | inputs: _final: prev: { 5 | # Provides `pkgs.unstable`. 6 | unstable = import inputs.nixpkgs { 7 | inherit (prev) system config; 8 | overlays = [ 9 | # inputs.self.overlays.vim-plugins 10 | ]; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/align.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | 4 | # Plugin for aligning text programmatically 5 | 6 | plugins = [ pkgs.vimPlugins.tabular ]; 7 | lua = '' 8 | -- Align 9 | vim.keymap.set("", "ta", ":Tabularize /") 10 | vim.keymap.set("", "t#", ":Tabularize /#") 11 | vim.keymap.set("", "tl", ":Tabularize /---") 12 | ''; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ini/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, fetchFromGitHub }: 2 | 3 | pkgs.tree-sitter.buildGrammar { 4 | language = "ini"; 5 | version = "1.3.0"; 6 | src = fetchFromGitHub { 7 | owner = "justinmk"; 8 | repo = "tree-sitter-ini"; 9 | rev = "32b31863f222bf22eb43b07d4e9be8017e36fb31"; 10 | sha256 = "sha256-kWCaOIC81GP5EHCqzPZP9EUgYy39CZ6/8TVS6soB6Wo="; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rasi/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, fetchFromGitHub }: 2 | 3 | pkgs.tree-sitter.buildGrammar { 4 | language = "rasi"; 5 | version = "0.1.2"; 6 | src = fetchFromGitHub { 7 | owner = "Fymyte"; 8 | repo = "tree-sitter-rasi"; 9 | rev = "6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa"; 10 | sha256 = "sha256-sPrIVgGGaBaXeqHNxjcdJ/S2FvxyV6rD9UPKU/tpspw="; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/tools/misc/rebuild/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellScriptBin "rebuild" '' 4 | echo ${pkgs.stdenv.hostPlatform.system} 5 | SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"} 6 | if [ "$SYSTEM" == "darwin" ]; then 7 | sudo darwin-rebuild switch --flake ${builtins.toString ../../../../.} 8 | else 9 | doas nixos-rebuild switch --flake ${builtins.toString ../../../../.} 10 | fi 11 | '' 12 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/nix-daemon.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.nix-daemon; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.nix-daemon.enable = lib.mkEnableOption "Nix daemon"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nix.gc.dates = "09:03"; # Run every morning (but before upgrade) 18 | 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /misc/README.md: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | 3 | These files contain important data sourced by the configuration, or simply 4 | information to store for safekeeping later. 5 | 6 | --- 7 | 8 | Creating hashed password for [password.sha512](./password.sha512): 9 | 10 | ``` 11 | mkpasswd -m sha-512 12 | ``` 13 | 14 | --- 15 | 16 | Getting key for [public-keys](./public-keys): 17 | 18 | ``` 19 | ssh-keyscan -t ed25519 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-vimdoc/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, fetchFromGitHub }: 2 | 3 | pkgs.tree-sitter.buildGrammar { 4 | language = "vimdoc"; 5 | version = "3.0.0"; 6 | src = fetchFromGitHub { 7 | owner = "neovim"; 8 | repo = "tree-sitter-vimdoc"; 9 | rev = "d2e4b5c172a109966c2ce0378f73df6cede39400"; 10 | sha256 = "sha256-Vrl4/cZL+TWlUMEeWZoHCAWhvlefcl3ajGcwyTNKOhI="; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/misc/wallpapers/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.stdenv.mkDerivation { 4 | pname = "wallpapers"; 5 | version = "0.1"; 6 | src = pkgs.fetchFromGitLab { 7 | owner = "exorcist365"; 8 | repo = "wallpapers"; 9 | rev = "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc"; 10 | sha256 = "sha256-1c1uDz37MhksWC75myv6jao5q2mIzD8X8I+TykXXmWg="; 11 | }; 12 | installPhase = '' 13 | cp -r $src/ $out/ 14 | ''; 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-puppet/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, fetchFromGitHub }: 2 | 3 | pkgs.tree-sitter.buildGrammar { 4 | language = "puppet"; 5 | version = "1.3.0"; 6 | src = fetchFromGitHub { 7 | owner = "tree-sitter-grammars"; 8 | repo = "tree-sitter-puppet"; 9 | rev = "15f192929b7d317f5914de2b4accd37b349182a6"; 10 | sha256 = "sha256-bO5g5AdhzpB13yHklpAndUHIX7Rvd7OMjH0Ds2ATA6Q="; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/tools/text/ren-find/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | pkgs.rustPlatform.buildRustPackage { 3 | pname = "ren-find"; 4 | version = "0.0.7"; 5 | src = pkgs.fetchFromGitHub { 6 | owner = "robenkleene"; 7 | repo = "ren-find"; 8 | rev = "50c40172e354caffee48932266edd7c7a76a20fd"; 9 | sha256 = "sha256-zVIt6Xp+Mvym6gySvHIZJt1QgzKVP/wbTGTubWk6kzI="; 10 | }; 11 | cargoHash = "sha256-lSeO/GaJPZ8zosOIJRXVIEuPXaBg1GBvKBIuXtu1xZg="; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/tools/text/rep-grep/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | pkgs.rustPlatform.buildRustPackage { 3 | pname = "rep-grep"; 4 | version = "0.0.7"; 5 | src = pkgs.fetchFromGitHub { 6 | owner = "robenkleene"; 7 | repo = "rep-grep"; 8 | rev = "2a24f95170aa14b5182b2287125664a62f8688ef"; 9 | sha256 = "sha256-gBxrbGCy6JEHnmgJmcm8sgtEvCAqra8/gPGsfCEfLqg="; 10 | }; 11 | cargoHash = "sha256-t4tfQaFq4EV4ZWeU+IestSFiSAIeVQslTZhLbpKVoO4="; 12 | } 13 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/no-mitigations.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.no-mitigations; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.no-mitigations.enable = lib.mkEnableOption "remove Kernel CPU mitigations"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # WARNING: This is not secure 18 | boot.kernelParams = [ "mitigations=off" ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/slsk-batchdl.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.slsk-batchdl; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.slsk-batchdl.enable = lib.mkEnableOption "slsk downloader"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | environment.systemPackages = [ 18 | pkgs.nmasur.slsk-batchdl 19 | ]; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/tools/misc/encrypt-secret/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellScriptBin "encrypt-secret" '' 4 | printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2 5 | read -p "Secret: " secret 6 | printf "\nEncrypting...\n\n" 1>&2 7 | tmpfile=$(mktemp) 8 | echo "''${secret}" > ''${tmpfile} 9 | ${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../../../../misc/public-keys} $tmpfile 10 | rm $tmpfile 11 | '' 12 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git-fuzzy-branch.fish: -------------------------------------------------------------------------------- 1 | set -l current (git rev-parse --abbrev-ref HEAD | tr -d '\n') 2 | set -l branch (git branch \ 3 | --format "%(refname:short)" \ 4 | | fzf \ 5 | --height 50% \ 6 | --header="On $current, $header" \ 7 | --preview-window right:70% \ 8 | --preview 'git log {} --color=always --pretty="format:%C(auto)%ar %h%d %s"' \ 9 | ) 10 | and echo $branch 11 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/fd.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.fd; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.fd.enable = lib.mkEnableOption "fd file search tool"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | home.packages = [ pkgs.fd ]; 18 | xdg.configFile."fd/ignore".text = config.nmasur.presets.programs.ripgrep.ignorePatterns; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/lua.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.lua; 10 | in 11 | { 12 | 13 | options.nmasur.presets.programs.lua.enable = lib.mkEnableOption "Lua programming language."; 14 | 15 | config = lib.mkIf cfg.enable { 16 | home.packages = [ 17 | pkgs.stylua # Lua formatter 18 | pkgs.sumneko-lua-language-server # Lua LSP 19 | ]; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /platforms/windows/autohotkey/RemapCapsCtrlEscapeV2.ahk: -------------------------------------------------------------------------------- 1 | #Requires AutoHotkey v2.0 2 | #SingleInstance 3 | 4 | ih := InputHook("B L1 T1", "{Esc}") 5 | 6 | *Ctrl:: 7 | { 8 | ih.Start() 9 | reason := ih.Wait() 10 | if (reason = "Stopped") { 11 | Send "{Esc}" 12 | } else if (reason = "Max") { 13 | Send "{Blind}{Ctrl down}" ih.Input 14 | } 15 | } 16 | 17 | *Ctrl up:: 18 | { 19 | if (ih.InProgress) { 20 | ih.Stop() 21 | } else { 22 | Send "{Ctrl up}" 23 | } 24 | } -------------------------------------------------------------------------------- /templates/haskell/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | multi: 3 | # - path: "ignore/" 4 | # config: {cradle: {none: }} 5 | 6 | - path: "src" 7 | config: {cradle: {cabal: {component: "lib:hello"}}} 8 | 9 | - path: "app" 10 | config: {cradle: {cabal: {component: "hello:hello-exe"}}} 11 | 12 | - path: "test" 13 | config: {cradle: {cabal: {component: "hello:hello-test"}}} 14 | 15 | - path: "bench" 16 | config: {cradle: {cabal: {component: "hello:hello-bench"}}} 17 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/calibre.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.calibre; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.calibre.enable = lib.mkEnableOption "Calibre e-book manager"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | home.packages = [ pkgs.calibre ]; 18 | home.sessionVariables = { 19 | CALIBRE_USE_DARK_PALETTE = 1; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /misc/public-keys: -------------------------------------------------------------------------------- 1 | # Scan hosts: ssh-keyscan -t ed25519 2 | 3 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal 4 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVknmPi7sG6ES0G0jcsvebzKGWWaMfJTYgvOue6EULI flame 5 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9mwXlZnIALt9SnH3FOZvdgHLM5ZqwYUERXBbM7Rwh6 swan 6 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC3yHivgEXr2ecwe58h9bkhwTYivf3GwL8xenQKMeiUb tempest 7 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICmGHIWBZzRx35/yFgnPJSHN2+35WJ30G9c5tDhPsCrl arrow 8 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/bash.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.bash; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.bash.enable = lib.mkEnableOption "Bash shell"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | programs.bash = { 18 | enable = true; 19 | shellAliases = config.programs.fish.shellAliases; 20 | initExtra = ""; 21 | profileExtra = ""; 22 | }; 23 | 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/linux-gaming.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.linux-gaming; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.linux-gaming.enable = lib.mkEnableOption "Linux gaming home"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | nmasur.presets.programs = { 19 | wine.enable = lib.mkDefault true; 20 | }; 21 | 22 | home.packages = [ 23 | pkgs.heroic 24 | ]; 25 | 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git-history.fish: -------------------------------------------------------------------------------- 1 | if not count $argv >/dev/null 2 | echo "Must provide filename." 3 | return 1 4 | end 5 | set commitline ( git log \ 6 | --follow \ 7 | --pretty="format:%C(auto)%ar %h%d %s" \ 8 | -- ./$argv \ 9 | | fzf \ 10 | --height 100% \ 11 | --preview "git diff --color=always (echo {} | cut -d' ' -f4)^1..(echo {} | cut -d' ' -f4) -- ./$argv" \ 12 | ) 13 | and set commit (echo $commitline | cut -d" " -f4) 14 | and echo $commit 15 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/profiles/gaming.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.gaming; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.gaming.enable = lib.mkEnableOption "gaming config for macOS"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nmasur.profiles.base.enable = lib.mkDefault true; 18 | 19 | homebrew.casks = [ 20 | "steam" # Not packaged for Nixon macOS 21 | "epic-games" # Not packaged for Nix 22 | ]; 23 | 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/logind.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | cfg = config.nmasur.presets.services.logind; 5 | in 6 | { 7 | 8 | options.nmasur.presets.services.logind.enable = lib.mkEnableOption "Logind power key management"; 9 | 10 | config = lib.mkIf cfg.enable { 11 | 12 | # Use power button to sleep instead of poweroff 13 | services.logind.settings.Login.HandlePowerKey = "suspend"; 14 | services.logind.settings.Login.HandlePowerKeyLongPress = "poweroff"; 15 | 16 | }; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/aws-ssh/aws-ssh.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | cfg = config.nmasur.presets.programs.aws-ssh; 5 | in 6 | 7 | { 8 | options.nmasur.presets.programs.aws-ssh.enable = lib.mkEnableOption "AWS SSH tools"; 9 | 10 | config = lib.mkIf cfg.enable { 11 | 12 | # Ignore wine directories in searches 13 | home.file.".ssh/aws-ssm-ssh-proxy-command.sh" = { 14 | text = builtins.readFile ./aws-ssm-ssh-proxy-command.sh; 15 | executable = true; 16 | }; 17 | 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /overlays/mpv-scripts.nix: -------------------------------------------------------------------------------- 1 | inputs: _final: prev: { 2 | 3 | mpvScripts = prev.mpvScripts // { 4 | # Delete current file after quitting 5 | mpv-delete-file = prev.stdenv.mkDerivation rec { 6 | pname = "mpv-delete-file"; 7 | version = "0.1"; # made-up 8 | src = inputs.zenyd-mpv-scripts + "/delete_file.lua"; 9 | dontBuild = true; 10 | dontUnpack = true; 11 | installPhase = "install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua"; 12 | passthru.scriptName = "delete_file.lua"; 13 | }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/hammerspoon/Spoons/DismissAlerts.spoon/init.lua: -------------------------------------------------------------------------------- 1 | --- === Dismiss Alerts === 2 | 3 | local obj = {} 4 | obj.__index = obj 5 | 6 | -- Metadata 7 | obj.name = "DismissAlerts" 8 | obj.version = "0.1" 9 | obj.license = "MIT - https://opensource.org/licenses/MIT" 10 | 11 | function obj:init() 12 | hs.hotkey.bind({ "cmd", "alt", "ctrl" }, "k", function() 13 | hs.osascript.applescriptFromFile("Spoons/DismissAlerts.spoon/close_notifications.applescript") 14 | end) 15 | end 16 | 17 | return obj 18 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/haskell.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | let 3 | cfg = config.nmasur.presets.programs.haskell; 4 | in 5 | { 6 | 7 | options.nmasur.presets.programs.haskell.enable = 8 | lib.mkEnableOption "Haskell programming language config."; 9 | 10 | config = lib.mkIf cfg.enable { 11 | 12 | # Binary Cache for Haskell.nix 13 | nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; 14 | nix.settings.substituters = [ "https://cache.iog.io" ]; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/developer.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.developer; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.developer.enable = lib.mkEnableOption "Developer tools"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | home.packages = [ 19 | pkgs.pgcli # Postgres client with autocomplete 20 | ]; 21 | 22 | nmasur.presets = { 23 | programs.cargo.enable = lib.mkDefault true; 24 | }; 25 | 26 | }; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/latest.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.latest; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.latest.enable = lib.mkEnableOption "keeping machine up-to-date"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Use latest released Linux kernel by default 19 | boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; 20 | 21 | nmasur.presets.services.nix-autoupgrade.enable = lib.mkDefault true; 22 | 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/tools/misc/osc/package.nix: -------------------------------------------------------------------------------- 1 | # Clipboard over SSH 2 | 3 | { 4 | buildGoModule, 5 | fetchFromGitHub, 6 | ... 7 | }: 8 | 9 | buildGoModule { 10 | pname = "osc"; 11 | version = "v0.4.7"; 12 | src = fetchFromGitHub { 13 | owner = "theimpostor"; 14 | repo = "osc"; 15 | rev = "c8e1e2f42a5d5fb628eaa48e889bde578deb8d33"; 16 | sha256 = "sha256-MfEBbYT99tEtlOMmdl3iq2d07KYsN1tu5tDRFW3676g="; 17 | }; 18 | 19 | vendorHash = "sha256-POtQWIjPObsfa3YZ1dLZgedZFUcc4HeTWjU20AucoKc="; 20 | 21 | ldflags = [ 22 | "-s" 23 | "-w" 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/bat.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.bat; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.bat.enable = lib.mkEnableOption "Bat text pager"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | programs.bat = { 17 | enable = true; # cat replacement 18 | config = { 19 | theme = config.theme.colors.batTheme; 20 | pager = "less -R"; # Don't auto-exit if one screen 21 | }; 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/xclip.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.xclip; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.xclip.enable = lib.mkEnableOption "xclip keyboard"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | home.packages = [ pkgs.xclip ]; 19 | 20 | programs.fish.shellAliases = { 21 | pbcopy = "xclip -selection clipboard -in"; 22 | pbpaste = "xclip -selection clipboard -out"; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/notmuch.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | cfg = config.nmasur.presets.programs.notmuch; 5 | in 6 | 7 | { 8 | 9 | options.nmasur.presets.programs.notmuch.enable = lib.mkEnableOption "Notmuch mail indexing"; 10 | 11 | config = lib.mkIf cfg.enable { 12 | # Better local mail search 13 | programs.notmuch = { 14 | enable = true; 15 | new.ignore = [ 16 | ".mbsyncstate.lock" 17 | ".mbsyncstate.journal" 18 | ".mbsyncstate.new" 19 | ]; 20 | }; 21 | 22 | }; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /colorscheme/nord/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | name = "nord"; 3 | author = "arcticicestudio"; 4 | dark = { 5 | base00 = "#2E3440"; 6 | base01 = "#3B4252"; 7 | base02 = "#434C5E"; 8 | base03 = "#4C566A"; 9 | base04 = "#D8DEE9"; 10 | base05 = "#E5E9F0"; 11 | base06 = "#ECEFF4"; 12 | base07 = "#8FBCBB"; 13 | base08 = "#88C0D0"; 14 | base09 = "#81A1C1"; 15 | base0A = "#5E81AC"; 16 | base0B = "#BF616A"; 17 | base0C = "#D08770"; 18 | base0D = "#EBCB8B"; 19 | base0E = "#A3BE8C"; 20 | base0F = "#B48EAD"; 21 | batTheme = "nord"; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /docs/restore-calibre.md: -------------------------------------------------------------------------------- 1 | # Restoring Calibre From Backup 2 | 3 | The `metadata.db` holds the library and `app.db` and `gdrive.db` contain the 4 | web/account information. 5 | 6 | Place books directories in `/data/books/`. 7 | 8 | Place `metadata.db` in `/var/lib/calibre-web-db/`. 9 | 10 | Symlink `metadata.db` to the library: 11 | 12 | ``` 13 | sudo ln -s /var/lib/calibre-web-db/metadata.db /data/books/metadata.db 14 | ``` 15 | 16 | Place `app.db` and `gdrive.db` in `/var/lib/calibre-web/`. 17 | 18 | Restart Calibre: 19 | 20 | ``` 21 | sudo systemctl restart calibre-web.service 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/weather.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.weather; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.weather.enable = lib.mkEnableOption "Weather CLI tools"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | # Used in abbreviations and aliases 18 | home.packages = [ pkgs.curl ]; 19 | programs.fish.shellAbbrs = { 20 | 21 | weather = "curl wttr.in/$WEATHER_CITY"; 22 | moon = "curl wttr.in/Moon"; 23 | 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /templates/default.nix: -------------------------------------------------------------------------------- 1 | # Return a list of all templates 2 | 3 | { lib, ... }: 4 | 5 | lib.pipe (lib.filesystem.listFilesRecursive ./.) [ 6 | # Get only files ending in flake.nix 7 | (builtins.filter (name: lib.hasSuffix "flake.nix" name)) 8 | # Import each template function 9 | (map (file: rec { 10 | name = builtins.baseNameOf (builtins.dirOf file); 11 | value = { 12 | path = builtins.dirOf file; 13 | description = "${name} template"; 14 | }; 15 | })) 16 | # Convert to an attrset of template name -> template path and description 17 | (builtins.listToAttrs) 18 | ] 19 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/openssh-aws.nix: -------------------------------------------------------------------------------- 1 | # SSHD settings for AWS machines 2 | 3 | { 4 | config, 5 | lib, 6 | ... 7 | }: 8 | 9 | let 10 | cfg = config.nmasur.presets.services.openssh-aws; 11 | in 12 | { 13 | 14 | options.nmasur.presets.services.openssh-aws = { 15 | enable = lib.mkEnableOption "OpenSSH on AWS VMs"; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | services.openssh = { 20 | settings = { 21 | # AWS settings require this 22 | PermitRootLogin = lib.mkForce "prohibit-password"; 23 | }; 24 | }; 25 | 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/direnv.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.direnv; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.direnv.enable = lib.mkEnableOption "Direnv project-level shells"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | # Enables quickly entering Nix shells when changing directories 17 | programs.direnv = { 18 | enable = true; 19 | nix-direnv.enable = true; 20 | config = { 21 | global.hide_env_diff = true; 22 | }; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/settings.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | hostnames, 4 | ... 5 | }: 6 | 7 | { 8 | options.nmasur.settings = { 9 | username = lib.mkOption { 10 | type = lib.types.str; 11 | description = "Primary username for the system"; 12 | }; 13 | fullName = lib.mkOption { 14 | type = lib.types.str; 15 | description = "Human readable name of the user"; 16 | }; 17 | hostnames = lib.mkOption { 18 | type = lib.types.attrsOf lib.types.str; 19 | description = "Map of service names to FQDNs"; 20 | default = hostnames; 21 | }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/doas.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.doas; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.doas.enable = lib.mkEnableOption "doas sudo alternative"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # Alias sudo to doas for convenience 18 | programs.fish.shellAliases = { 19 | sudo = "doas"; 20 | }; 21 | 22 | # Disable overriding our sudo alias with a TERMINFO alias 23 | programs.kitty.settings.shell_integration = "no-sudo"; 24 | }; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/wine.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | cfg = config.nmasur.presets.programs.wine; 5 | in 6 | 7 | { 8 | options.nmasur.presets.programs.wine.enable = lib.mkEnableOption "Wine settings"; 9 | 10 | config = lib.mkIf cfg.enable { 11 | 12 | # Ignore wine directories in searches 13 | home.file = 14 | let 15 | ignorePatterns = '' 16 | .wine/ 17 | drive_c/''; 18 | in 19 | { 20 | ".rgignore".text = ignorePatterns; 21 | ".fdignore".text = ignorePatterns; 22 | }; 23 | 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/github.lua: -------------------------------------------------------------------------------- 1 | -- Keymap to open file in GitHub web 2 | vim.keymap.set("n", "gr", ":!gh browse %", { silent = true }) 3 | 4 | -- Pop a terminal to watch the current run 5 | local gitwatch = require("toggleterm.terminal").Terminal:new({ 6 | cmd = "fish --interactive --init-command 'gh run watch'", 7 | hidden = true, 8 | direction = "float", 9 | }) 10 | 11 | -- Set a toggle for this terminal 12 | function GITWATCH_TOGGLE() 13 | gitwatch:toggle() 14 | end 15 | 16 | -- Keymap to toggle the run 17 | vim.keymap.set("n", "W", GITWATCH_TOGGLE) 18 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/lsp.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "gd", vim.lsp.buf.definition) 2 | vim.keymap.set("n", "gT", vim.lsp.buf.type_definition) 3 | vim.keymap.set("n", "gi", vim.lsp.buf.implementation) 4 | vim.keymap.set("n", "gh", vim.lsp.buf.hover) 5 | -- vim.keymap.set("n", "gr", telescope.lsp_references) 6 | vim.keymap.set("n", "R", vim.lsp.buf.rename) 7 | vim.keymap.set("n", "]e", vim.diagnostic.goto_next) 8 | vim.keymap.set("n", "[e", vim.diagnostic.goto_prev) 9 | vim.keymap.set("n", "de", vim.diagnostic.open_float) 10 | vim.keymap.set("n", "E", vim.lsp.buf.code_action) 11 | -------------------------------------------------------------------------------- /pkgs/caddy/package.nix: -------------------------------------------------------------------------------- 1 | # Caddy with Cloudflare DNS 2 | 3 | { 4 | pkgs, 5 | fetchFromGitHub, 6 | ... 7 | }: 8 | 9 | # Maintain a static version so that the plugin hash doesn't keep breaking 10 | (pkgs.caddy.overrideAttrs rec { 11 | version = "2.10.2"; 12 | src = fetchFromGitHub { 13 | owner = "caddyserver"; 14 | repo = "caddy"; 15 | tag = "v${version}"; 16 | hash = "sha256-KvikafRYPFZ0xCXqDdji1rxlkThEDEOHycK8GP5e8vk="; 17 | }; 18 | }).withPlugins 19 | { 20 | plugins = [ "github.com/caddy-dns/cloudflare@v0.2.1" ]; 21 | hash = "sha256-iRzpN9awuEFsc7hqKzOMNiCFFEv833xhd4LM+VFQedI="; 22 | } 23 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/fish-darwin.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.fish-darwin; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.fish-darwin.enable = lib.mkEnableOption { 15 | description = "Fish macOS options"; 16 | default = config.nmasur.presets.programs.fish && pkgs.stdenv.isDarwin; 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | programs.fish.shellAbbrs = { 21 | # Shortcut to edit hosts file 22 | hosts = "sudo nvim /etc/hosts"; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git-add-fuzzy.fish: -------------------------------------------------------------------------------- 1 | set gitfile (git status -s \ 2 | | fzf \ 3 | --height 50% \ 4 | -m \ 5 | --preview-window right:70% \ 6 | --layout reverse \ 7 | --preview 'set -l IFS; set gd (git diff --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2)); if test "$gd"; echo "$gd"; else; bat --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2); end') 8 | and for gf in $gitfile 9 | set gf (echo $gf \ 10 | | awk '{$1=$1};1' \ 11 | | cut -d' ' -f2 \ 12 | ) 13 | and git add $gf 14 | end 15 | -------------------------------------------------------------------------------- /deploy/oracle/outputs.tf: -------------------------------------------------------------------------------- 1 | output "host_ip" { 2 | description = "The public IP address of the launched instance." 3 | value = oci_core_instance.my_compute_instance.public_ip 4 | } 5 | 6 | output "instance_id" { 7 | description = "The OCID of the launched instance." 8 | value = oci_core_instance.my_compute_instance.id 9 | } 10 | 11 | output "vpc_ocid" { 12 | description = "The OCID of the created VCN." 13 | value = oci_core_vcn.my_vpc.id 14 | } 15 | 16 | output "subnet_ocid" { 17 | description = "The OCID of the created public subnet." 18 | value = oci_core_subnet.my_public_subnet.id 19 | } 20 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/prettyping.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.prettyping; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.prettyping.enable = 15 | lib.mkEnableOption "Prettyping server ping tool"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | programs.fish.functions = { 19 | ping = { 20 | description = "Improved ping"; 21 | argumentNames = "target"; 22 | body = "${pkgs.prettyping}/bin/prettyping --nolegend $target"; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Check Build 2 | 3 | on: 4 | workflow_dispatch: # allows manual triggering 5 | 6 | jobs: 7 | check: 8 | name: Check 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout Repository 12 | uses: actions/checkout@v3 13 | - name: Install Nix 14 | uses: DeterminateSystems/nix-installer-action@v11 15 | - name: Check Nixpkgs Inputs 16 | uses: DeterminateSystems/flake-checker-action@v7 17 | - name: Add Nix Cache 18 | uses: DeterminateSystems/magic-nix-cache-action@v6 19 | - name: Check the Flake 20 | run: nix flake check 21 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/python.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.python; 10 | in 11 | { 12 | 13 | options.nmasur.presets.programs.python.enable = lib.mkEnableOption "Python programming language."; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | home.packages = [ 18 | pkgs.pyright # Python language server 19 | pkgs.black # Python formatter 20 | pkgs.python310Packages.flake8 # Python linter 21 | ]; 22 | 23 | programs.fish.shellAbbrs = { 24 | py = "python3"; 25 | }; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/presets/programs/fish.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.fish; 10 | inherit (config.nmasur.settings) username; 11 | in 12 | 13 | { 14 | 15 | options.nmasur.presets.programs.fish.enable = lib.mkEnableOption "Fish shell"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | programs.fish.enable = true; 19 | 20 | environment.shells = [ pkgs.fish ]; 21 | 22 | users.users.${username}.shell = pkgs.fish; 23 | 24 | # Speeds up fish launch time on macOS 25 | programs.fish.useBabelfish = true; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/terraform.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.terraform; 10 | in 11 | { 12 | 13 | options.nmasur.presets.programs.terraform.enable = 14 | lib.mkEnableOption "Terraform infrastructure management"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | allowUnfreePackages = [ "terraform" ]; 19 | 20 | programs.fish.shellAbbrs = { 21 | te = "terraform"; 22 | }; 23 | 24 | home.packages = with pkgs; [ 25 | terraform 26 | terraform-ls 27 | tflint 28 | ]; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/empty-trash.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.services.empty-trash; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.empty-trash.enable = lib.mkEnableOption "automatically empty trash"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Delete Trash files older than 1 week 19 | systemd.user.services.empty-trash = { 20 | description = "Empty Trash on a regular basis"; 21 | wantedBy = [ "default.target" ]; 22 | script = "${pkgs.trash-cli}/bin/trash-empty 7"; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/tools/misc/gh-collaborators/package.nix: -------------------------------------------------------------------------------- 1 | { buildGoModule, fetchFromGitHub }: 2 | 3 | buildGoModule rec { 4 | pname = "gh-collaborators"; 5 | version = "v3.0.0"; 6 | src = fetchFromGitHub { 7 | owner = "katiem0"; 8 | repo = "gh-collaborators"; 9 | rev = "bf412dde50605e48af86f291c2ac8714f2c1b228"; 10 | sha256 = "sha256-SGmP/8Fvf2rcYkwscMOFG01Y0VJGb/TXrNZtLacurxA="; 11 | }; 12 | 13 | vendorHash = "sha256-9qmvG2q9t1Zj8yhKFyA99IaJ90R/gRVdQVjdliVKLRE"; 14 | 15 | ldflags = [ 16 | "-s" 17 | "-w" 18 | "-X github.com/katiem0/gh-collaborators/cmd.Version=${version}" 19 | # "-X main.Version=${version}" 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/nautilus.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.nautilus; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.nautilus.enable = lib.mkEnableOption "Nautilus file manager"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | environment.systemPackages = [ pkgs.nautilus ]; 19 | 20 | # Quick preview with spacebar 21 | services.gnome.sushi.enable = true; 22 | 23 | # Allow client browsing Samba and virtual filesystem shares 24 | services.gvfs = { 25 | enable = true; 26 | }; 27 | 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/presets/services/user.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (config.nmasur.settings) username; 9 | cfg = config.nmasur.presets.services.user; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.user.enable = lib.mkEnableOption "macoS user settings"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | users.users."${username}" = { 18 | # macOS user 19 | home = "/Users/${username}"; 20 | uid = 502; 21 | # shell = pkgs.fish; # Default shell 22 | }; 23 | # This might fix the shell issues 24 | users.knownUsers = [ username ]; 25 | 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/profiles/extra.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.extra; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.extra.enable = lib.mkEnableOption "extra config for macOS"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nmasur.profiles.base.enable = lib.mkDefault true; 18 | 19 | homebrew.casks = [ 20 | "keybase" # GUI on Nix not available for macOS 21 | ]; 22 | 23 | nix.linux-builder = { 24 | enable = true; 25 | systems = [ 26 | "x86_64-linux" 27 | "aarch64-linux" 28 | ]; 29 | }; 30 | 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/cargo.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.cargo; 10 | in 11 | { 12 | 13 | options.nmasur.presets.programs.cargo.enable = lib.mkEnableOption "Cargo for programming language."; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | programs.fish.shellAbbrs = { 18 | ca = "cargo"; 19 | }; 20 | 21 | home.packages = with pkgs; [ 22 | gcc 23 | rustc 24 | cargo 25 | cargo-watch 26 | clippy 27 | rustfmt 28 | pkg-config 29 | openssl 30 | rust-analyzer 31 | ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/noti.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.noti; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.noti.enable = lib.mkEnableOption "Noti CLI notifications"; 15 | 16 | config = lib.mkIf (cfg.enable && (pkgs.stdenv.isDarwin || config.services.dunst.enable)) { 17 | home.packages = [ pkgs.noti ]; 18 | programs.fish.shellAbbrs = { 19 | # Add noti for ghpr in Darwin 20 | ghpr = lib.mkForce "gh pr create && sleep 3 && noti gh run watch"; 21 | grw = lib.mkForce "noti gh run watch"; 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /templates/default/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Basic project"; 3 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 4 | outputs = 5 | { nixpkgs }: 6 | let 7 | forAllSystems = nixpkgs.lib.genAttrs [ 8 | "x86_64-linux" 9 | "x86_64-darwin" 10 | "aarch64-linux" 11 | "aarch64-darwin" 12 | ]; 13 | in 14 | { 15 | devShells = forAllSystems ( 16 | system: 17 | let 18 | pkgs = import nixpkgs { inherit system; }; 19 | in 20 | { 21 | default = pkgs.mkShell { buildInputs = with pkgs; [ nixfmt-rfc-style ]; }; 22 | } 23 | ); 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/toggleterm.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | dsl, 4 | config, 5 | ... 6 | }: 7 | { 8 | 9 | # Toggleterm provides a floating terminal inside the editor for quick access 10 | 11 | plugins = [ pkgs.vimPlugins.toggleterm-nvim ]; 12 | 13 | use.toggleterm.setup = dsl.callWith { 14 | open_mapping = dsl.rawLua "[[]]"; 15 | hide_numbers = true; 16 | direction = "float"; 17 | }; 18 | 19 | lua = '' 20 | ${builtins.readFile ./toggleterm.lua} 21 | ${if config.enableGithub then (builtins.readFile ./github.lua) else ""} 22 | ${if config.enableKubernetes then (builtins.readFile ./kubernetes.lua) else ""} 23 | ''; 24 | } 25 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/zoxide.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.zoxide; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.zoxide.enable = lib.mkEnableOption "zoxide smart cd replacement"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | programs.zoxide = { 18 | enable = true; 19 | enableFishIntegration = true; 20 | enableBashIntegration = true; 21 | options = [ "--no-cmd" ]; # Disables key mapping 22 | }; 23 | 24 | programs.fish.shellAliases = { 25 | cd = "__zoxide_z"; 26 | cdi = "__zoxide_zi"; 27 | }; 28 | 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/obsidian.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.obsidian; 10 | in 11 | { 12 | 13 | options = { 14 | nmasur.presets.programs.obsidian = { 15 | enable = lib.mkEnableOption "Obsidian markdown wiki"; 16 | }; 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | allowUnfreePackages = [ "obsidian" ]; 21 | home.packages = with pkgs; [ obsidian ]; 22 | 23 | # Broken on 2023-12-11 24 | # https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8 25 | # allowInsecurePackages = [ "electron-36.9.5" ]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/journald.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.journald; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.journald.enable = lib.mkEnableOption "journald configuration"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | # How long to keep journalctl entries 17 | # This helps to make sure log disk usage doesn't grow too unwieldy 18 | services.journald.extraConfig = '' 19 | SystemMaxUse=4G 20 | SystemKeepFree=10G 21 | SystemMaxFileSize=128M 22 | SystemMaxFiles=500 23 | MaxFileSec=1month 24 | MaxRetentionSec=2month 25 | ''; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/home-manager/theme.nix: -------------------------------------------------------------------------------- 1 | { lib, colorscheme, ... }: 2 | 3 | { 4 | 5 | options.theme = { 6 | name = lib.mkOption { 7 | type = lib.types.nullOr lib.types.str; 8 | description = "Color palette name (fallback when individual colors aren't specified)"; 9 | default = "gruvbox"; 10 | }; 11 | colors = lib.mkOption { 12 | type = lib.types.attrs; 13 | description = "Base16 color scheme."; 14 | default = colorscheme.gruvbox.dark; 15 | }; 16 | mode = lib.mkOption { 17 | type = lib.types.enum [ 18 | "light" 19 | "dark" 20 | ]; 21 | description = "Light or dark mode"; 22 | default = "dark"; 23 | }; 24 | }; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/vm.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.vm; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.vm.enable = lib.mkEnableOption "VM-specific settings for testing"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # Settings for testing in a VM 18 | virtualisation.vmVariant = { 19 | home-manager.users."noah".programs.nix-index.enable = false; 20 | nmasur.presets.services.openssh.enable = true; 21 | virtualisation.forwardPorts = [ 22 | { 23 | from = "host"; 24 | host.port = 2222; 25 | guest.port = 22; 26 | } 27 | ]; 28 | }; 29 | 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/settings.nix: -------------------------------------------------------------------------------- 1 | { lib, hostnames, ... }: 2 | 3 | { 4 | options.nmasur.settings = { 5 | username = lib.mkOption { 6 | type = lib.types.str; 7 | description = "Primary username for the system"; 8 | }; 9 | fullName = lib.mkOption { 10 | type = lib.types.str; 11 | description = "Human readable name of the user"; 12 | }; 13 | host = lib.mkOption { 14 | type = lib.types.str; 15 | description = "Name of the host of this deployment"; 16 | }; 17 | hostnames = lib.mkOption { 18 | type = lib.types.attrsOf lib.types.str; 19 | description = "Map of service names to FQDNs"; 20 | default = hostnames; 21 | }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/himalaya.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.himalaya; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.himalaya.enable = lib.mkEnableOption "Himalaya email CLI"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | programs.himalaya = { 18 | enable = true; 19 | }; 20 | accounts.email.accounts.home.himalaya = { 21 | enable = true; 22 | settings = { 23 | downloads-dir = config.xdg.userDirs.download; 24 | smtp-insecure = true; 25 | }; 26 | }; 27 | 28 | programs.fish.shellAbbrs = { 29 | hi = "himalaya"; 30 | }; 31 | 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/profiles/work.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.work; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.work.enable = lib.mkEnableOption "work machine"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nmasur.profiles.base.enable = lib.mkDefault true; 18 | 19 | homebrew.casks = [ 20 | "1password" # 1Password will not launch from Nix on macOS 21 | # "gitify" # Git notifications in menu bar (downgrade manually from 4.6.1) 22 | # "logitech-g-hub" # Mouse and keyboard management 23 | "logitune" # Logitech webcam firmware 24 | "meetingbar" # Show meetings in menu bar 25 | ]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/discord.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.discord; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.discord.enable = lib.mkEnableOption "Discord chat"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | allowUnfreePackages = [ "discord" ]; 18 | home.packages = [ pkgs.discord ]; 19 | xdg.configFile."discord/settings.json".text = builtins.toJSON { 20 | BACKGROUND_COLOR = "#202225"; 21 | IS_MAXIMIZED = false; 22 | IS_MINIMIZED = false; 23 | OPEN_ON_STARTUP = false; 24 | MINIMIZE_TO_TRAY = false; 25 | SKIP_HOST_UPDATE = true; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /pkgs/tools/misc/docker-cleanup/docker-cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Stop all containers 4 | if [ "$(docker ps -a -q)" ]; then 5 | echo "Stopping docker containers..." 6 | docker stop "$(docker ps -a -q)" 7 | else 8 | echo "No running docker containers." 9 | fi 10 | 11 | # Remove all stopped containers 12 | if [ "$(docker ps -a -q)" ]; then 13 | echo "Removing docker containers..." 14 | docker rm "$(docker ps -a -q)" 15 | else 16 | echo "No stopped docker containers." 17 | fi 18 | 19 | # Remove all untagged images 20 | if docker images | grep -q "^"; then 21 | docker rmi "$(docker images | grep "^" | awk '{print $3}')" 22 | else 23 | echo "No untagged docker images." 24 | fi 25 | 26 | echo "Cleaned up docker." 27 | -------------------------------------------------------------------------------- /pkgs/misc/bypass-paywalls-clean/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | # Based on: 4 | # https://git.sr.ht/~rycee/nur-expressions/tree/master/item/pkgs/firefox-addons/default.nix#L34 5 | 6 | pkgs.stdenv.mkDerivation rec { 7 | pname = "bypass-paywalls-clean"; 8 | version = "4.1.1.4"; 9 | src = builtins.fetchGit { 10 | url = "https://git.masu.rs/noah/bpc-uploads.git"; 11 | ref = "main"; 12 | rev = "9166b13355721b047878f259e04c2e9b476b4210"; 13 | }; 14 | preferLocalBuild = true; 15 | allowSubstitutes = true; 16 | buildCommand = '' 17 | dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" 18 | mkdir -p "$dst" 19 | install -v -m644 "${src}/bypass_paywalls_clean-${version}.xpi" "$dst/magnolia@12.34.xpi" 20 | ''; 21 | } 22 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/presets/services/hammerspoon.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.hammerspoon; 9 | inherit (config.nmasur.settings) username; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.hammerspoon.enable = 15 | lib.mkEnableOption "Hammerspoon macOS automation"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | 19 | homebrew.casks = [ "hammerspoon" ]; 20 | 21 | system.activationScripts.postActivation.text = '' 22 | defaults write org.hammerspoon.Hammerspoon MJConfigFile "${ 23 | config.home-manager.users.${username}.xdg.configHome 24 | }/hammerspoon/init.lua" 25 | sudo killall Dock 26 | ''; 27 | 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/avahi.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.avahi; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.avahi.enable = lib.mkEnableOption "Avahi DNS service discovery"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # DNS service discovery 18 | services.avahi = { 19 | enable = true; 20 | domainName = "local"; 21 | ipv6 = false; # Should work either way 22 | # Resolve local hostnames using Avahi DNS 23 | nssmdns4 = true; 24 | publish = { 25 | enable = true; 26 | addresses = true; 27 | domain = true; 28 | workstation = true; 29 | }; 30 | }; 31 | 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/kitty-darwin.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.kitty-darwin; 9 | in 10 | { 11 | 12 | options.nmasur.presets.programs.kitty-darwin.enable = lib.mkEnableOption "Kitty terminal for macOS"; 13 | 14 | # MacOS-specific settings for Kitty 15 | config = lib.mkIf cfg.enable { 16 | programs.kitty = { 17 | enable = true; 18 | font.size = lib.mkForce 20; 19 | settings = { 20 | shell = "/run/current-system/sw/bin/fish"; 21 | macos_traditional_fullscreen = true; 22 | macos_quit_when_last_window_closed = true; 23 | disable_ligatures = "always"; 24 | macos_option_as_alt = true; 25 | }; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /misc/libratbag-profile: -------------------------------------------------------------------------------- 1 | Profile 1: (active) 2 | Name: n/a 3 | Report Rate: 1000Hz 4 | Resolutions: 5 | 0: 400dpi (active) (default) 6 | 1: 800dpi 7 | 2: 1600dpi 8 | 3: 2400dpi 9 | 4: 0dpi 10 | Button: 0 is mapped to 'button 1' 11 | Button: 1 is mapped to 'button 2' 12 | Button: 2 is mapped to 'button 3' 13 | Button: 3 is mapped to 'button 4' 14 | Button: 4 is mapped to 'button 5' 15 | Button: 5 is mapped to macro '↕F11' 16 | Button: 6 is mapped to macro '↕VOLUMEDOWN' 17 | Button: 7 is mapped to macro '↕VOLUMEUP' 18 | Button: 8 is mapped to 'unknown' 19 | Button: 9 is mapped to 'wheel-right' 20 | Button: 10 is mapped to 'wheel-left' 21 | LED: 0, depth: monochrome, mode: on, color: 000000 22 | LED: 1, depth: monochrome, mode: on, color: 000000 23 | LED: 2, depth: monochrome, mode: on, color: 000000 24 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/gaming.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.gaming; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.gaming.enable = lib.mkEnableOption "gaming options"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Enable graphics acceleration 19 | hardware.graphics = { 20 | enable = lib.mkDefault true; 21 | enable32Bit = lib.mkDefault true; 22 | }; 23 | 24 | # Enable gamemode which can be executed on a per-game basis 25 | programs.gamemode.enable = lib.mkDefault true; 26 | 27 | environment.systemPackages = with pkgs; [ moonlight-qt ]; 28 | 29 | nmasur.presets.programs = { 30 | steam.enable = lib.mkDefault true; 31 | }; 32 | 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/tools/misc/reencrypt-secrets/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | # nix run github:nmasur/dotfiles#reencrypt-secrets ./private 4 | 5 | pkgs.writeShellScriptBin "reencrypt-secrets" '' 6 | if [ $# -eq 0 ]; then 7 | echo "Must provide directory to reencrypt." 8 | exit 1 9 | fi 10 | encrypted=$1 11 | find "''${1}" -type f -name "*.age" | while IFS= read -r encryptedfile; do 12 | tmpfile=$(mktemp) 13 | echo "Decrypting ''${encryptedfile}..." 14 | ${pkgs.age}/bin/age --decrypt \ 15 | --identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile 16 | echo "Encrypting ''${encryptedfile}..." 17 | ${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../../../../misc/public-keys} $tmpfile > $encryptedfile 18 | rm $tmpfile 19 | done 20 | echo "Finished." 21 | '' 22 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/kubectl.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.kubectl; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.kubectl.enable = lib.mkEnableOption "Kubernetes CLI tools"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | home.packages = with pkgs; [ 19 | kubectl # Basic Kubernetes queries 20 | kubernetes-helm # Helm CLI 21 | fluxcd # Bootstrap clusters with Flux 22 | kustomize # Kustomize CLI (for Flux) 23 | ]; 24 | 25 | programs.fish.shellAbbrs = { 26 | k = "kubectl"; 27 | pods = "kubectl get pods -A"; 28 | nodes = "kubectl get nodes"; 29 | deploys = "kubectl get deployments -A"; 30 | }; 31 | 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/pipewire.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.services.pipewire; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.pipewire.enable = lib.mkEnableOption "Pipewire audio system"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Enable PipeWire 19 | services.pipewire = { 20 | enable = true; 21 | pulse.enable = true; 22 | }; 23 | 24 | # Provides audio source with background noise filtered 25 | programs.noisetorch.enable = true; 26 | 27 | # These aren't necessary, but helpful for the user 28 | environment.systemPackages = with pkgs; [ 29 | pamixer # Audio control 30 | nmasur.volnoti # Volume notifications 31 | ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/chawan.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.chawan; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.chawan.enable = lib.mkEnableOption "chawan TUI web browser"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | programs.chawan = { 19 | enable = true; 20 | settings = { 21 | external.copy-cmd = if pkgs.stdenv.isLinux then "xclip -selection clipboard -in" else "pbcopy"; 22 | }; 23 | }; 24 | 25 | # Set Chawan as the default app for manual pages 26 | home.sessionVariables = { 27 | MANPAGER = "${lib.getExe pkgs.chawan} -T text/x-ansi"; 28 | }; 29 | 30 | programs.fish.shellAbbrs.man = "mancha"; 31 | 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/gnupg.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.services.gnupg; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.gnupg.enable = lib.mkEnableOption "GPG encryption tools"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | programs.gpg.enable = true; 18 | services.gpg-agent = { 19 | enable = true; 20 | defaultCacheTtl = 86400; # Resets when used 21 | defaultCacheTtlSsh = 86400; # Resets when used 22 | maxCacheTtl = 34560000; # Can never reset 23 | maxCacheTtlSsh = 34560000; # Can never reset 24 | pinentryFlavor = "tty"; 25 | }; 26 | home = lib.mkIf config.nmasur.profiles.linux-gui.enable { packages = with pkgs; [ pinentry ]; }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/server.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.server; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.server.enable = lib.mkEnableOption "server configuration"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | networking.firewall.allowPing = lib.mkDefault true; 18 | 19 | nmasur.presets.services = { 20 | openssh.enable = lib.mkDefault true; 21 | restic.enable = lib.mkDefault true; 22 | }; 23 | 24 | # Implement a simple fail2ban service for sshd 25 | services.sshguard.enable = lib.mkDefault true; 26 | 27 | # Servers need a bootloader or they won't start 28 | boot.loader.systemd-boot.enable = lib.mkDefault true; 29 | boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/tools/misc/format-root/format-root.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | DISK=$1 6 | 7 | if [ -z "${DISK}" ]; then 8 | gum style --width 50 --margin "1 2" --padding "2 4" \ 9 | --foreground "#fb4934" \ 10 | "Missing required parameter." \ 11 | "Usage: format-root -- " \ 12 | "Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1" 13 | echo "(exiting)" 14 | exit 1 15 | fi 16 | 17 | disko \ 18 | --mode create \ 19 | --dry-run \ 20 | --flake "path:$(pwd)#root" \ 21 | --arg disk \""/dev/${DISK}"\" 22 | 23 | gum confirm \ 24 | "This will ERASE ALL DATA on the disk /dev/${DISK}. Are you sure you want to continue?" \ 25 | --default=false 26 | 27 | disko \ 28 | --mode create \ 29 | --flake "path:$(pwd)#root" \ 30 | --arg disk "/dev/${DISK}" 31 | -------------------------------------------------------------------------------- /pkgs/tools/misc/jqr/jqr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Adapted from: https://gist.github.com/reegnz/b9e40993d410b75c2d866441add2cb55 4 | 5 | if [[ -z $1 ]] || [[ $1 == "-" ]]; then 6 | input=$(mktemp) 7 | trap 'rm -f $input' EXIT 8 | cat /dev/stdin >"$input" 9 | else 10 | input=$1 11 | fi 12 | 13 | # TODO: make available on non-macOS 14 | 15 | echo '' | 16 | fzf --phony \ 17 | --height 100% \ 18 | --preview-window='up:80%' \ 19 | --query '.' \ 20 | --print-query \ 21 | --header $'CTRL-O: jq output\nCTRL-Y: copy output\nALT-Y: copy query' \ 22 | --preview "jq --color-output -r {q} $input" \ 23 | --bind "ctrl-o:execute(jq -r {q} $input)+clear-query+accept" \ 24 | --bind "alt-y:execute(echo {q} | pbcopy)" \ 25 | --bind "ctrl-y:execute(jq -r {q} $input | pbcopy)" 26 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/pulse-sink.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Credit: https://gist.github.com/Nervengift/844a597104631c36513c 4 | 5 | sink=$( 6 | ponymix -t sink list | 7 | awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' | 8 | rofi \ 9 | -dmenu \ 10 | -p 'pulseaudio sink:' \ 11 | -width 100 \ 12 | -hover-select \ 13 | -me-select-entry '' \ 14 | -me-accept-entry MousePrimary \ 15 | -theme-str 'inputbar { enabled: false; }' | 16 | grep -Po '[0-9]+(?=:)' 17 | ) && 18 | ponymix set-default -d "$sink" && 19 | for input in $(ponymix list -t sink-input | grep -Po '[0-9]+(?=:)'); do 20 | echo "$input -> $sink" 21 | ponymix -t sink-input -d "$input" move "$sink" 22 | done 23 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/ripgrep.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.ripgrep; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.ripgrep = { 15 | enable = lib.mkEnableOption "Ripgrep search tool"; 16 | ignorePatterns = lib.mkOption { 17 | type = lib.types.lines; 18 | description = "Patterns to ignore with ripgrep"; 19 | default = '' 20 | !.env* 21 | !.github/ 22 | !.gitignore 23 | !*.tfvars 24 | .terraform/ 25 | .target/ 26 | /Library/ 27 | ''; 28 | }; 29 | }; 30 | 31 | config = lib.mkIf cfg.enable { 32 | home.packages = [ pkgs.ripgrep ]; 33 | 34 | home.file = { 35 | ".rgignore".text = cfg.ignorePatterns; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/themes/prompt.rasi: -------------------------------------------------------------------------------- 1 | /** 2 | * This theme is intended for a 2 items option menu with a headerbar. 3 | * https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/themes/prompt.rasi 4 | */ 5 | @import "common.rasi" 6 | * { 7 | font: @prompt-text-font; 8 | } 9 | #window { 10 | height: @prompt-window-height; 11 | width: @prompt-window-width; 12 | children: [ inputbar, horibox ]; 13 | border: @prompt-window-border; 14 | } 15 | #inputbar { 16 | enabled: false; 17 | } 18 | #prompt { 19 | padding: @prompt-prompt-padding; 20 | margin: @prompt-prompt-margin; 21 | } 22 | #listview { 23 | padding: @prompt-listview-padding; 24 | spacing: @option-5-listview-spacing; 25 | lines: 2; 26 | } 27 | #element { 28 | font: @prompt-text-font; 29 | padding: @prompt-element-padding; 30 | } 31 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/redshift.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.redshift; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.redshift.enable = lib.mkEnableOption "Redshift light adjuster"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # Reduce blue light at night 18 | services.redshift = { 19 | enable = true; 20 | brightness = { 21 | day = "1.0"; 22 | night = "1.0"; 23 | }; 24 | }; 25 | 26 | # Service to determine location for time zone 27 | # This is required for redshift which depends on the location provider 28 | services.geoclue2.enable = true; 29 | services.geoclue2.enableWifi = false; # Breaks when it can't connect 30 | location = { 31 | provider = "geoclue2"; 32 | }; 33 | 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/samba.nix: -------------------------------------------------------------------------------- 1 | # Samba is a Windows-compatible file-sharing service. 2 | 3 | { config, lib, ... }: 4 | 5 | let 6 | cfg = config.nmasur.presets.services.samba; 7 | in 8 | { 9 | 10 | options.nmasur.presets.services.samba.enable = lib.mkEnableOption "Samba network filesharing"; 11 | 12 | config = { 13 | 14 | services.samba = lib.mkIf cfg.enable { 15 | enable = true; 16 | openFirewall = true; 17 | settings.data = { 18 | path = "/data"; 19 | browseable = "yes"; 20 | "read only" = "no"; 21 | "guest ok" = "no"; 22 | comment = "NAS"; 23 | }; 24 | }; 25 | 26 | # Allows Windows clients to discover server 27 | services.samba-wsdd.enable = true; 28 | networking.firewall.allowedTCPPorts = [ 5357 ]; 29 | networking.firewall.allowedUDPPorts = [ 3702 ]; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/lua/settings.lua: -------------------------------------------------------------------------------- 1 | -- =========================================================================== 2 | -- Settings 3 | -- =========================================================================== 4 | 5 | vim.filetype.add({ 6 | pattern = { 7 | [".*%.tfvars"] = "terraform", 8 | [".*%.tf"] = "terraform", 9 | [".*%.rasi"] = "rasi", 10 | }, 11 | }) 12 | 13 | vim.api.nvim_create_autocmd("FileType", { 14 | pattern = "mail", 15 | callback = function() 16 | vim.o.wrapmargin = 79 -- Wrap text automatically 17 | end, 18 | }) 19 | 20 | vim.api.nvim_create_autocmd("FileType", { 21 | pattern = "markdown", 22 | command = "TableModeEnable", 23 | }) 24 | 25 | vim.api.nvim_create_autocmd("FileType", { 26 | pattern = "terraform", 27 | callback = function() 28 | vim.bo.commentstring = "# %s" 29 | end, 30 | }) 31 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/nsxiv.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.nsxiv; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.nsxiv.enable = lib.mkEnableOption "Neo Simple X Image Viewer"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | home.packages = with pkgs; [ 18 | nsxiv # Image viewer 19 | ]; 20 | 21 | # Set default program for opening images 22 | xdg.mimeApps = { 23 | associations.added = { 24 | "image/jpeg" = [ "nsxiv.desktop" ]; 25 | "image/png" = [ "nsxiv.desktop" ]; 26 | "image/*" = [ "nsxiv.desktop" ]; 27 | }; 28 | defaultApplications = { 29 | "image/jpeg" = [ "nsxiv.desktop" ]; 30 | "image/png" = [ "nsxiv.desktop" ]; 31 | "image/*" = [ "nsxiv.desktop" ]; 32 | }; 33 | }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /templates/rust/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Basic Rust project"; 3 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 4 | outputs = 5 | { self, nixpkgs }: 6 | let 7 | forAllSystems = nixpkgs.lib.genAttrs [ 8 | "x86_64-linux" 9 | "x86_64-darwin" 10 | "aarch64-linux" 11 | "aarch64-darwin" 12 | ]; 13 | in 14 | { 15 | devShells = forAllSystems ( 16 | system: 17 | let 18 | pkgs = import nixpkgs { inherit system; }; 19 | in 20 | { 21 | default = pkgs.mkShell { 22 | buildInputs = with pkgs; [ 23 | gcc 24 | rustc 25 | cargo 26 | cargo-watch 27 | clippy 28 | rustfmt 29 | pkg-config 30 | openssl 31 | ]; 32 | }; 33 | } 34 | ); 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/zathura.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.zathura; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.zathura.enable = lib.mkEnableOption "Zathura PDF viewer"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | home.packages = with pkgs; [ 18 | zathura # PDF viewer 19 | ]; 20 | # Set default program for opening PDFs 21 | xdg.mimeApps = { 22 | associations.added = { 23 | "application/pdf" = [ "pwmt.zathura-cb.desktop" ]; 24 | }; 25 | associations.removed = { 26 | "application/pdf" = [ 27 | "mupdf.desktop" 28 | "wine-extension-pdf.desktop" 29 | ]; 30 | }; 31 | defaultApplications = { 32 | "application/pdf" = [ "pwmt.zathura-cb.desktop" ]; 33 | }; 34 | }; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/experimental.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.experimental; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.experimental.enable = lib.mkEnableOption "experimental tools"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | nmasur.presets.programs = { 19 | zed-editor.enable = lib.mkDefault true; 20 | }; 21 | 22 | home.packages = [ 23 | 24 | # Charm tools 25 | 26 | pkgs.glow # Markdown previews 27 | pkgs.skate # Key-value store 28 | pkgs.charm # Manage account and filesystem 29 | pkgs.pop # Send emails from a TUI 30 | 31 | pkgs.crush # AI LLM Agent 32 | pkgs.gemini-cli # AI LLM Agent 33 | 34 | ]; 35 | 36 | programs.gh-dash.enable = lib.mkDefault true; 37 | programs.himalaya.enable = lib.mkDefault true; 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/yt-dlp.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.yt-dlp; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.yt-dlp.enable = lib.mkEnableOption "yt-dlp media downloader"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | programs.yt-dlp = { 17 | enable = true; 18 | extraConfig = ""; 19 | settings = { 20 | no-continue = true; # Always re-download each fragment 21 | no-overwrites = true; # Don't overwrite existing files 22 | download-archive = "archive.log"; # Log of archives 23 | embed-metadata = true; 24 | embed-thumbnail = true; 25 | embed-subs = true; 26 | sub-langs = "en.*"; 27 | concurrent-fragments = 4; # Parallel download chunks 28 | }; 29 | }; 30 | 31 | programs.fish.shellAbbrs.yt = "yt-dlp"; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nixpkgs.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | { 3 | 4 | options = { 5 | allowUnfreePackages = lib.mkOption { 6 | type = lib.types.listOf lib.types.str; 7 | description = "List of unfree packages to allow."; 8 | default = [ ]; 9 | }; 10 | allowInsecurePackages = lib.mkOption { 11 | type = lib.types.listOf lib.types.str; 12 | description = "List of insecure packages to allow."; 13 | default = [ ]; 14 | }; 15 | }; 16 | 17 | config = { 18 | 19 | # # Allow specified unfree packages (identified elsewhere) 20 | # # Retrieves package object based on string name 21 | # nixpkgs.config.allowUnfreePredicate = 22 | # pkg: builtins.elem (lib.getName pkg) config.allowUnfreePackages; 23 | # 24 | # # Allow specified insecure packages (identified elsewhere) 25 | # nixpkgs.config.permittedInsecurePackages = config.allowInsecurePackages; 26 | 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/doas.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.doas; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.doas.enable = lib.mkEnableOption "doas sudo alternative"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | security = { 18 | 19 | # Remove sudo 20 | sudo.enable = false; 21 | 22 | # Add doas 23 | doas = { 24 | enable = true; 25 | 26 | # No password required for trusted users 27 | wheelNeedsPassword = false; 28 | 29 | # Pass environment variables from user to root 30 | # Also requires specifying that we are removing password here 31 | extraRules = [ 32 | { 33 | groups = [ "wheel" ]; 34 | noPass = true; 35 | keepEnv = true; 36 | } 37 | ]; 38 | }; 39 | }; 40 | 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nixpkgs.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | { 3 | 4 | options = { 5 | allowUnfreePackages = lib.mkOption { 6 | type = lib.types.listOf lib.types.str; 7 | description = "List of unfree packages to allow."; 8 | default = [ ]; 9 | }; 10 | allowInsecurePackages = lib.mkOption { 11 | type = lib.types.listOf lib.types.str; 12 | description = "List of insecure packages to allow."; 13 | default = [ ]; 14 | }; 15 | }; 16 | 17 | config = { 18 | 19 | # # Allow specified unfree packages (identified elsewhere) 20 | # # Retrieves package object based on string name 21 | # nixpkgs.config.allowUnfreePredicate = 22 | # pkg: builtins.elem (lib.getName pkg) config.allowUnfreePackages; 23 | # 24 | # # Allow specified insecure packages (identified elsewhere) 25 | # nixpkgs.config.permittedInsecurePackages = config.allowInsecurePackages; 26 | 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /overlays/nextcloud-apps.nix: -------------------------------------------------------------------------------- 1 | inputs: _final: prev: { 2 | 3 | nextcloudApps = { 4 | news = prev.fetchNextcloudApp { 5 | url = inputs.nextcloud-news.outPath; 6 | sha256 = inputs.nextcloud-news.narHash; 7 | license = "agpl3Plus"; 8 | unpack = true; 9 | }; 10 | external = prev.fetchNextcloudApp { 11 | url = inputs.nextcloud-external.outPath; 12 | sha256 = inputs.nextcloud-external.narHash; 13 | license = "agpl3Plus"; 14 | unpack = true; 15 | }; 16 | cookbook = prev.fetchNextcloudApp { 17 | url = inputs.nextcloud-cookbook.outPath; 18 | sha256 = inputs.nextcloud-cookbook.narHash; 19 | license = "agpl3Plus"; 20 | unpack = true; 21 | }; 22 | snappymail = prev.fetchNextcloudApp { 23 | url = inputs.nextcloud-snappymail.outPath; 24 | sha256 = inputs.nextcloud-snappymail.narHash; 25 | license = "agpl3Plus"; 26 | unpack = true; 27 | }; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/dunst.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.dunst; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.dunst.enable = lib.mkEnableOption "Dunst notification system"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | services.dunst = { 17 | enable = false; 18 | settings = { 19 | global = { 20 | width = 300; 21 | height = 200; 22 | offset = "30x50"; 23 | origin = "top-right"; 24 | transparency = 0; 25 | padding = 20; 26 | horizontal_padding = 20; 27 | frame_color = config.theme.colors.base03; 28 | }; 29 | 30 | urgency_normal = { 31 | background = config.theme.colors.base00; 32 | foreground = config.theme.colors.base05; 33 | timeout = 10; 34 | }; 35 | }; 36 | }; 37 | 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/mpv.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.mpv; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.mpv.enable = lib.mkEnableOption "mpv video player"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | # Video player 18 | programs.mpv = { 19 | enable = true; 20 | bindings = { }; 21 | config = { 22 | image-display-duration = 2; # For cycling through images 23 | hwdec = "auto-safe"; # Attempt to use GPU decoding for video 24 | }; 25 | scripts = [ 26 | 27 | # Automatically load playlist entries before and after current file 28 | pkgs.mpvScripts.autoload 29 | 30 | # Delete current file after quitting 31 | pkgs.mpvScripts.mpv-delete-file 32 | ]; 33 | }; 34 | 35 | programs.fish.shellAbbrs = { 36 | mpvs = "mpv --shuffle=yes"; 37 | }; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /overlays/pkgs.nix: -------------------------------------------------------------------------------- 1 | _inputs: _final: prev: 2 | 3 | let 4 | listToAttrsByPnameOrName = 5 | list: 6 | builtins.listToAttrs ( 7 | map (v: { 8 | name = v."pname" or v."name"; 9 | value = v; 10 | }) list 11 | ); 12 | lib = prev.lib; 13 | # [ package1/package.nix package2/package.nix package2/hello.sh ] 14 | packages = lib.pipe (lib.filesystem.listFilesRecursive ../pkgs) [ 15 | # Get only files called package.nix 16 | # [ package1/package.nix package2/package.nix ] 17 | (builtins.filter (name: lib.hasSuffix "package.nix" name)) 18 | 19 | # Apply callPackage to create a derivation 20 | # Must use final.callPackage to avoid infinite recursion 21 | # [ package1.drv package2.drv ] 22 | (builtins.map (name: prev.callPackage name { })) 23 | 24 | # Convert the list to an attrset 25 | # { package1 = package1.drv, package2 = package2.drv } 26 | listToAttrsByPnameOrName 27 | ]; 28 | in 29 | 30 | { 31 | nmasur = packages; 32 | } 33 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/nix-index.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.nix-index; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.nix-index.enable = 15 | lib.mkEnableOption "nix-index caching for command line"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | 19 | # Provides "command-not-found" options 20 | programs.nix-index = { 21 | enable = true; 22 | enableFishIntegration = true; 23 | }; 24 | 25 | # Create nix-index if doesn't exist 26 | home.activation.createNixIndex = 27 | let 28 | cacheDir = "${config.xdg.cacheHome}/nix-index"; 29 | in 30 | lib.mkIf config.programs.nix-index.enable ( 31 | config.lib.dag.entryAfter [ "writeBoundary" ] '' 32 | if [ ! -d ${cacheDir} ]; then 33 | run ${pkgs.nix-index}/bin/nix-index -f ${pkgs.path} 34 | fi 35 | '' 36 | ); 37 | 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/bufferline.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | 4 | # Shows buffers in a VSCode-style tab layout 5 | 6 | plugins = [ 7 | pkgs.vimPlugins.bufferline-nvim 8 | pkgs.vimPlugins.vim-bbye # Better closing of buffers 9 | pkgs.vimPlugins.snipe-nvim # Jump between open buffers 10 | ]; 11 | setup.bufferline = { 12 | options = { 13 | diagnostics = "nvim_lsp"; 14 | always_show_bufferline = false; 15 | separator_style = "slant"; 16 | offsets = [ { filetype = "NvimTree"; } ]; 17 | }; 18 | }; 19 | setup.snipe = { }; 20 | lua = '' 21 | -- Move buffers 22 | vim.keymap.set("n", "L", ":BufferLineCycleNext", { silent = true }) 23 | vim.keymap.set("n", "H", ":BufferLineCyclePrev", { silent = true }) 24 | 25 | -- Kill buffer 26 | vim.keymap.set("n", "x", " :Bdelete", { silent = true }) 27 | 28 | -- Jump to buffer 29 | vim.keymap.set("n", "gb", require("snipe").open_buffer_menu, { silent = true }) ''; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/tools/misc/aws-ec2/aws-ec2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Retrieve list of AWS instances 4 | # Use enter to jump into their sessions with SSM 5 | 6 | # Specify AWS_PROFILE and AWS_REGION before running this script 7 | 8 | aws ec2 describe-instances \ 9 | --filters "Name=instance-state-name,Values=running" | 10 | jq -r \ 11 | '.Reservations[] 12 | | .Instances[] 13 | | .InstanceId + " - " + 14 | (.PrivateIpAddress // "n/a") + " - " + 15 | (.PublicIpAddress // "n/a") + " - " + 16 | (.Tags // [] | from_entries | .Name // "n/a")' | 17 | fzf \ 18 | --height 100% \ 19 | --layout reverse \ 20 | --header $'Press Enter to start SSM session\nInstance ID - Private IP - Public IP - Name' \ 21 | --preview "aws ec2 describe-instances --instance-ids \"\$(echo {} | cut -d' ' -f1)\" | jq -r '.Reservations[].Instances[0]'" \ 22 | --bind "enter:become(aws ssm start-session --document-name 'AWS-StartInteractiveCommand' --parameters '{\"command\": [\"bash\"]}' --target \$(echo {} | cut -d' ' -f1))" 23 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/wsl.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | inherit (config.nmasur.settings) username; 5 | cfg = config.nmasur.profiles.wsl; 6 | in 7 | 8 | { 9 | options.nmasur.profiles.wsl.enable = lib.mkEnableOption "WSL settings"; 10 | 11 | config = lib.mkIf cfg.enable { 12 | 13 | wsl = { 14 | enable = true; 15 | wslConf.automount.root = lib.mkDefault "/mnt"; 16 | defaultUser = lib.mkDefault username; 17 | startMenuLaunchers = lib.mkDefault true; 18 | wslConf.network.generateResolvConf = lib.mkDefault true; # Turn off if it breaks VPN 19 | interop.includePath = lib.mkDefault false; # Including Windows PATH will slow down Neovim command mode 20 | }; 21 | 22 | # # Replace config directory with our repo, since it sources from config on 23 | # # every launch 24 | # system.activationScripts.configDir.text = '' 25 | # rm -rf /etc/nixos 26 | # ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos 27 | # ''; 28 | 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /docs/zfs.md: -------------------------------------------------------------------------------- 1 | # ZFS 2 | 3 | Swan runs its root on ext4. The ZFS drives are managed imperatively (this 4 | [disko configuration](../disks/zfs.nix) is an unused work-in-progress). 5 | 6 | The basic ZFS settings are managed [here](../modules/nixos/hardware/zfs.nix). 7 | 8 | ## Creating a New Dataset 9 | 10 | ``` 11 | sudo zfs create tank/mydataset 12 | sudo zfs set compression=zstd tank/myzstddataset 13 | sudo zfs set mountpoint=/data/mydataset tank/mydataset 14 | ``` 15 | 16 | ## Maintenance 17 | 18 | ### Get Status 19 | 20 | ``` 21 | sudo zpool status 22 | ``` 23 | 24 | ### Replace Disk 25 | 26 | ``` 27 | sudo zdb 28 | sudo zpool status -g # Show by GUID 29 | sudo zpool offline tank 30 | sudo zpool status 31 | # Remove old disk, insert new disk 32 | sudo zdb 33 | sudo zpool replace tank /dev/disk/by-id/ 34 | sudo zpool status 35 | ``` 36 | 37 | ## Initial Setup 38 | 39 | ``` 40 | sudo zpool create tank raidz1 sda sdb sdc 41 | sudo zpool set ashift=12 tank 42 | sudo zpool set autoexpand=on tank 43 | sudo zpool set compression=on tank 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /pkgs/slsk-batchdl/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | buildDotnetModule, 4 | fetchFromGitHub, 5 | dotnetCorePackages, 6 | }: 7 | 8 | buildDotnetModule rec { 9 | pname = "slsk-batchdl"; 10 | version = "2.4.7"; 11 | 12 | src = fetchFromGitHub { 13 | owner = "fiso64"; 14 | repo = "slsk-batchdl"; 15 | rev = "v${version}"; 16 | sha256 = "sha256-P7V7YJUA1bkfp13Glb1Q+NJ7iTya/xgO1TM88z1Nddc="; 17 | }; 18 | 19 | projectFile = "slsk-batchdl/slsk-batchdl.csproj"; 20 | nugetDeps = ./nuget-deps.nix; 21 | 22 | dotnet-sdk = dotnetCorePackages.sdk_8_0; 23 | dotnet-runtime = dotnetCorePackages.runtime_8_0; 24 | 25 | # Patch the project file to use .NET 8 26 | postPatch = '' 27 | substituteInPlace slsk-batchdl/slsk-batchdl.csproj \ 28 | --replace-fail "net6.0" "net8.0" 29 | ''; 30 | 31 | doCheck = false; 32 | 33 | meta = with lib; { 34 | description = "A batch downloader for Soulseek"; 35 | homepage = "https://github.com/fiso64/slsk-batchdl"; 36 | platforms = platforms.linux; 37 | mainProgram = "slsk-batchdl"; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /platforms/nixos/modules/services/identity.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | cfg = config.services.wait-for-identity; 5 | in 6 | { 7 | 8 | options.services.wait-for-identity = { 9 | enable = lib.mkEnableOption "Wait for identity file oneshot"; 10 | identityFile = lib.mkOption { 11 | type = lib.types.path; 12 | default = config.identityFile; 13 | }; 14 | }; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Wait for secret to be placed on the machine 19 | systemd.services.wait-for-identity = { 20 | description = "Wait until identity file exists on the machine"; 21 | wantedBy = [ "multi-user.target" ]; 22 | serviceConfig = { 23 | Type = "oneshot"; 24 | RemainAfterExit = true; 25 | }; 26 | script = '' 27 | for i in $(seq 1 10); do 28 | if [ -f ${builtins.toString cfg.identityFile} ]; then 29 | echo "Identity file found." 30 | exit 0 31 | fi 32 | sleep 6 33 | done 34 | ''; 35 | }; 36 | 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/msmtp/mailpass-system.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBHZTF6 3 | RlExdGpEOXVodFV0R1FEeis0b1FJM0l3dGxnVjFQRm1jNjZXMmpFCmVWdmVtaE4v 4 | T3JaMkpocHlNYXVlai9jeEsvWXJJQUVPcUtKS3N2ZVUzajgKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIGVtT24vYWlkWldsOUNSNVk5UEsvRWZEb2pvK01ndk5NeE5FbzVj 6 | bEhta1EKc09ZUUZseEllcndOUzYyS2paZ205SmtSUUg1UVRKVDJLY1pXcHZkdlNr 7 | QQotPiBzc2gtZWQyNTUxOSBuanZYNUEgd1Nnbk9GVWFNZDRsd1VpVm9WOHpUaFp0 8 | ckdJR3N2UEFUbGMySGNTem5nYwp1OTVtVWg0dlZlL3h3Ty9ZQnA5NTJ4Y1ZVZHU3 9 | R0d4V0R5OHFZcDQ2TnZvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSB6OEt2SWl2cXFN 10 | ek5iMWNrcllVZ0o2K0Z0clI2QXlUdE1tWDE2NW8xdDNzClltWjhKaHNOWFpjSmFG 11 | WFRZVktvR2E4UUFEMVFkTzVuR3lMVDdRVGs4Y00KLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IE55VWFKVlFKK3RCalg3RDFwQTBIaWpvay9iTW9RRXV3SVgrUXhtZHV5MDAK 13 | RFEzMGtUZmRIQTlyRHcvSDBnbGlsRDBXVHh3amY4bzM0QmE0aU8vbnpnTQotLS0g 14 | Q2NxNlBWT0ZmMm1MNnJvaUl5dGlUQUt2aStrdkRXRWZ6TDVOdzU0VHFDVQqTaee+ 15 | qfaK5T6tjcv7LawzcztJbdKCqFecw/BEAicpyrkGmOfr1J5PmOxOFM/Rkk2HpLuP 16 | -----END AGE ENCRYPTED FILE----- 17 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/grafana/mailpass-grafana.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBQeWZS 3 | Wkg1TDBxZmVQS09CTE1VVzMxTHh4dnAzSlpHQkhDVU0ycm9DaHlRCnd6QXVLREx1 4 | T2xpaTlnL1V1OUJaQ1U0UWxOZnFZTlMxSHU0dGVReUFsdXcKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHp5ZCtUeWhzVWNBRXdkRkJCdERhQkxTb2I1UFhUYjlCeVcxWWN2 6 | bmJYeE0KYlJFdzJuRTNqWHJUVUJWWnI0dVVFUEQrYnZlb2NZZmNVbHltL3BrdU9E 7 | cwotPiBzc2gtZWQyNTUxOSBuanZYNUEgM0RVMGxqcFZ0RjJ5Y3VXWEZKaGlSL0tS 8 | M2VCbmNPY0t4K0M1Z1Mwb2lRTQpvSmRnM09Lb3ZpcnNDemk1SUR0cTVaczNwZnFa 9 | S2p0cStmZm0vVVJVamdvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAvR2RaVUZQeUZo 10 | TGRsdWh3aGtET0hrdEliRHB3YmFvU0dad2FtNndYcngwCjdZNStmTFZIZGRRUDhM 11 | cDVVdVR3MkZXeFJPRGlUYXdsVDVTY0Jxc0lGRlUKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDB4NTd2US92UmJtUEc2dUJ1RW85VlB4TVlVNXYyMUZRdzdraWtUMVR4UzAK 13 | TE5idjJFR3JlS1pLdXpjcEgwdFFkSng2YW1jUlBTbDZRSmNMRWhteSsxdwotLS0g 14 | NWZ3WXVuWm5wSy8veTFsazM0OEJFcjRYTTM1SUpBNlRJMmxHZHFVYVpuUQrvQ8GS 15 | sSz17HKJKfkSR1yPs9uAK8JleCgGmqemt0KTzT3beutowD6fCBYZl8nPzTsQc5J5 16 | -----END AGE ENCRYPTED FILE----- 17 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/telescope.nix: -------------------------------------------------------------------------------- 1 | { pkgs, dsl, ... }: 2 | { 3 | 4 | # Telescope is a fuzzy finder that can work with different sub-plugins 5 | 6 | plugins = [ 7 | pkgs.vimPlugins.telescope-nvim 8 | pkgs.vimPlugins.project-nvim 9 | pkgs.vimPlugins.telescope-fzy-native-nvim 10 | pkgs.vimPlugins.telescope-file-browser-nvim 11 | pkgs.vimPlugins.telescope-zoxide 12 | ]; 13 | 14 | setup.telescope = { 15 | defaults = { 16 | mappings = { 17 | i = { 18 | "['']" = dsl.rawLua "require('telescope.actions').close"; 19 | "['']" = "which_key"; 20 | }; 21 | }; 22 | }; 23 | pickers = { 24 | find_files = { 25 | theme = "ivy"; 26 | }; 27 | oldfiles = { 28 | theme = "ivy"; 29 | }; 30 | buffers = { 31 | theme = "dropdown"; 32 | }; 33 | }; 34 | extensions = { 35 | fzy_native = { }; 36 | zoxide = { }; 37 | }; 38 | }; 39 | 40 | setup.project_nvim = { }; 41 | 42 | lua = builtins.readFile ./telescope.lua; 43 | } 44 | -------------------------------------------------------------------------------- /templates/python/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Python pip flake"; 3 | 4 | inputs.pypi-deps-db = { 5 | url = "github:DavHau/pypi-deps-db/b8c61fb930c9a9f95057b717bc7c701196f2ee4e"; 6 | flake = false; 7 | }; 8 | inputs.mach-nix = { 9 | # url = "github:DavHau/mach-nix/3.5.0"; 10 | url = "github:DavHau/mach-nix/8d903072c7b5426d90bc42a008242c76590af916"; 11 | inputs.pypi-deps-db.follows = "pypi-deps-db"; 12 | }; 13 | 14 | outputs = 15 | { nixpkgs, mach-nix, ... }: 16 | let 17 | supportedSystems = [ 18 | "x86_64-linux" 19 | "x86_64-darwin" 20 | "aarch64-darwin" 21 | ]; 22 | forAllSystems = 23 | f: nixpkgs.lib.genAttrs supportedSystems (system: f system (import nixpkgs { inherit system; })); 24 | in 25 | rec { 26 | defaultApp = forAllSystems ( 27 | system: _pkgs: 28 | mach-nix.lib."${system}".mkPython { requirements = builtins.readFile ./requirements.txt; } 29 | ); 30 | devShell = forAllSystems (system: pkgs: pkgs.mkShell { buildInputs = [ defaultApp."${system}" ]; }); 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/postgresql.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (config.nmasur.settings) username; 10 | cfg = config.nmasur.presets.services.postgresql; 11 | in 12 | { 13 | 14 | options.nmasur.presets.services.postgresql.enable = lib.mkEnableOption "Postgresql database"; 15 | config = lib.mkIf cfg.enable { 16 | services.postgresql = { 17 | enable = true; 18 | package = pkgs.postgresql_15; 19 | settings = { }; 20 | authentication = '' 21 | local all postgres peer map=root 22 | local all admin peer map=admin 23 | ''; 24 | identMap = '' 25 | root postgres postgres 26 | root root postgres 27 | admin ${username} admin 28 | ''; 29 | ensureUsers = [ 30 | { 31 | name = "admin"; 32 | ensureClauses = { 33 | createdb = true; 34 | createrole = true; 35 | login = true; 36 | }; 37 | } 38 | ]; 39 | }; 40 | }; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/uptime-kuma.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | inherit (config.nmasur.settings) hostnames; 5 | cfg = config.nmasur.presets.services.uptime-kuma; 6 | in 7 | 8 | { 9 | 10 | options.nmasur.presets.services.uptime-kuma.enable = lib.mkEnableOption "Uptime-kuma ping monitor"; 11 | 12 | config = lib.mkIf cfg.enable { 13 | 14 | services.uptime-kuma = { 15 | enable = true; 16 | settings = { 17 | PORT = "3033"; 18 | }; 19 | }; 20 | 21 | # Allow web traffic to Caddy 22 | nmasur.presets.services.caddy.routes = [ 23 | { 24 | match = [ { host = [ hostnames.status ]; } ]; 25 | handle = [ 26 | { 27 | handler = "reverse_proxy"; 28 | upstreams = [ 29 | { dial = "localhost:${config.services.uptime-kuma.settings.PORT}"; } 30 | ]; 31 | } 32 | ]; 33 | } 34 | ]; 35 | 36 | # Configure Cloudflare DNS to point to this machine 37 | services.cloudflare-dyndns.domains = [ hostnames.status ]; 38 | 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hosts/x86_64-linux/swan/root.nix: -------------------------------------------------------------------------------- 1 | { disk, ... }: 2 | { 3 | disk = { 4 | boot = { 5 | type = "disk"; 6 | device = disk; 7 | content = { 8 | type = "gpt"; 9 | partitions = { 10 | # Boot partition 11 | ESP = rec { 12 | size = "512MiB"; 13 | type = "EF00"; 14 | label = "boot"; 15 | device = "/dev/disk/by-label/${label}"; 16 | content = { 17 | type = "filesystem"; 18 | format = "vfat"; 19 | mountpoint = "/boot"; 20 | extraArgs = [ "-n ${label}" ]; 21 | }; 22 | }; 23 | # Root partition ext4 24 | root = rec { 25 | size = "100%"; 26 | label = "nixos"; 27 | device = "/dev/disk/by-label/${label}"; 28 | content = { 29 | type = "filesystem"; 30 | format = "ext4"; 31 | mountpoint = "/"; 32 | extraArgs = [ "-L ${label}" ]; 33 | }; 34 | }; 35 | }; 36 | }; 37 | }; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/metrics/prometheus.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBLekNB 3 | R0R0ekUzWTBxUlhLaDBkZWlER2NRd1RCSHFBaUwrZW1wUTJJaGdzCnFObW85eFRM 4 | REgxR1NHdWMwWXdYRmZvYStTekQzcTdJZDkxamlWd1NEdzAKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFZzaUZMYmJScE42RWJuMytIYWM4RU14eXFMVXNNczVXMlF3OVBu 6 | di9oVmMKOXZLemtGMGNVUmU5YTcxdTk5Wmk4TDJpMUlVSDdwK2VwMmdCZmtINWV0 7 | MAotPiBzc2gtZWQyNTUxOSBuanZYNUEgazhZcHZ0OVkzQ01vQnlDWmMvTEdpZWJn 8 | VVRCWXZ6enNPL3BySHRkY3gwQQpnNHRpbEZuY3pGd2R5L2hXY3FIeXpneE9nSEhM 9 | MU9UWVlScCtVSWhNY3FrCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBMTDkzcUF5WXdN 10 | NTFnOUgzOEpoN3p1Uys2b2JMZVhnWThrNEFaT0N2RlFRCkhzd29qdEJLYWlyN3U5 11 | R3dnVHJZenIvTStoeGZXYkF1TGVkcVN2Y25acTQKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDh5czJHQUpvc0k1eFNRZDE3ZXdha0pzY3UwNzZsT2NIUUFieG1JSEk5MkkK 13 | SktlZDQwcm5ZYVZkOG1ybFU1RGY0bGdqSlVIRHQvaVdoQUN2MTNMNFVFMAotLS0g 14 | U0thOXRDNXFyRmJnZE9ydWRwMnZ6VGxIZDV3SW5yUEFEUkcyNUZNWFZxNAqpA6on 15 | uxWUMT9texQBeGLhj7tQ3QDzCKA4plpWncjvAgjcL/LzJOv90FeHV37UHY9cDo84 16 | KZleCZs7L3thj4um 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/lidarr-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBjUGJG 3 | dDZiN3RkMzV2WlFUd3Vsam5IV3ZqajN2VFVvdUFiNFVIdVZRZzE0CkplWlBrRndG 4 | SEIxa0pGaFAzWmFEOGlIUTM2K2I0VWUyQ1pKbVcvd1I5UDAKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFRuVXp3dTNHaDhWNTVmN2tLd1FXaUttT1VqL2I1dktWaW45VnN2 6 | TlVZd2MKYlpEdWFJNmRtNWcxMDVndExIY21icjY2c252QmJnekorNnFnZHRCcHQr 7 | dwotPiBzc2gtZWQyNTUxOSBuanZYNUEgd3hZNDZwWDg0UnFlNndqazFNNDB0bkxx 8 | RTVTamR1Nk51VkREVVlRTjEybwpGVXJEUFFuYXpEQzRHeWJqRTMrUUpIYmhtT2NY 9 | SUQyeGwrYjBKdW9ucThjCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBVdFB6ZndMb3Zx 10 | dTV5L2Z1Nk9rQVRHWkozcG01cW9zZUFTUW5HaDV1TWtvCnE4MUtTV0laalIwbVNJ 11 | NlU0K0JJcGMyN3ZSVXpVU1BteDVIVU9BYU9ZeG8KLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IGhCbWhHbG9WWU9CR3RkTVEyNUE1akM3Q0hGZEx1cURSRitIbi9vZXRMZ3cK 13 | clR6bjljTU9FS0UzdC9seDlad1E1aHZ5QXNiQmRWWDc5L0NQSkRsVUYyNAotLS0g 14 | ZEMwTE83MWxYMUYzWVdiSXNxM1BoOEJNMzJHS3o4M1NzWXMyQWZwR3dDVQpp8Lb0 15 | E1vJN/UjSubXuFGT9NqLCYhc2n20m4v6sM7h4HYRh10pngyxapyN9DvUvY0maPpm 16 | S9afVD6V/XjxOUZ2lA== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/prowlarr-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyAzMUNW 3 | QnV3SGtMcmVOUG05YnloWWNnUUE2aXMxZXF4S21yTm5ZY3hsVjNRCjlhckw2MXoy 4 | OE9YV0xGNDhpQVlQV2k0UVQ4eEFLZXhwSHBxRXpDRnozVGsKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIEE0MEhRMExPR2tralRvZ2hDNjRLUzB3VG1HMkNEemV2ZTlrbWdW 6 | SGY3WGcKZ0J2MUtHdnduNFJ1YVpCd01OT1ZhRVJyd3dWRmNGQWN4VmUvdS94R2dX 7 | OAotPiBzc2gtZWQyNTUxOSBuanZYNUEgU3RhNjBleFJHQUhnUjNZYVo2dmdISm5B 8 | M2x6UkVRa0xMUTZybGlER2xCZwphaWFOOFowaUhXeVcyamlCclBhM3JZZlh2ZmRI 9 | RlB6Q2tySkwwM0lyL3dJCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBnODdnZXVCSHl4 10 | Y2JkdXJidmtqWVdQdWJTZEZjS2puMmM2UzFtcmdTZHlvCmdPSkFDWTFwdmNyc2xH 11 | R0hxRXZkNTZ5b1dvaFgxdjVUWFc1aFpuWTYza2MKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IFB2WVlaZ0YxenR5SDIvOEhza2c5THVldUw2dXplR0t3N1h2ZmY3NlJYZzQK 13 | Q0RwRlFGTVRuSzE1QVlSRWg5cHRYMElLZVlDM3NaOUVQTEl0U0VuM1VCSQotLS0g 14 | a05hV3haWlE5QkFnMHQvWEowcEU1RExIMGdUWjQvUkFmaHFVdnJnT0g1RQrkp3VL 15 | 7YRcvkng6dO+swKzNUhPbJtYJqGtAtxo6I2v9nQl7Zc8X1vcJiaic4xaYNYfRFPS 16 | oAd3/SnRi+sghHuTWw== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/radarr-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBzV2Jx 3 | ZG5JL3oxc3Vqcmo1VE9GQ21yeGpINWJNZTYxcFpNTXJQQ0hDZFNnCk4zMkNNdmFs 4 | LzFPUzFQUTYzQ2lEcUpkSlBsUFpvQUdOSmZocnVZeFlKbDgKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFJHWGpmNTNFbkdDNEE1YVpBRWowOUIwYmRIVFYxSFFaUDVBblY2 6 | NWxMMlkKOFh6WXVwM2lRaU5CZm5JMDN4eThoRUNkWUExcnpmRnpUa0pmUTcxWUo5 7 | UQotPiBzc2gtZWQyNTUxOSBuanZYNUEgRFhsWklkVmpXWTl1ZS9XVHN2dStDTXZw 8 | bzlpUktIdW5rLzdnOFM0N0pBNApvNmxUK3d2aWt5ZXdQeUhWdHFpclQrVENOaDdx 9 | RTdBdHVDSnFPVkh2ellRCi0+IHNzaC1lZDI1NTE5IENxSU9VQSA4M2J4cTVnVWtq 10 | RzBsRlR1YWhwVkF6L2wrcC9vNzdaYzVoQk8wTXVmRXowCnJkc3dyNnN3UTZyZG1q 11 | Z2xtUzhRT3ozZHhCeXJPVUdETkhoa3lpY1QweTAKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IG1VdTd3aDkwclpZY0hBOVdiY3pIai9MSjc2ZStjb0NMaWx5RWpxR2F3elUK 13 | RE1sRFBJZ0ZNSE5QN293anNXWldiZm9jV2w5SVpxU2VuTXMwTndJU0Z1RQotLS0g 14 | dzBMKzZRYU9BQ0YvWGpLMHZLQ0YrZGJZRGZOcGNmcnJ2RGJmMit4c0NHZwrMord1 15 | EhzFVq3Hrt+3l2vfY90fSkP+X0yQqC5m5A7F/jA7xBzBr3WGQ/DKYsxT1e/bZv2g 16 | cTLB74cM0mVm5iGHDQ== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/readarr-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBRRXo3 3 | ZmpER1kyWC9JUld3WVVTS0owb1RRZFhzNHRtT0dickJhbnQ1UWxRCjBIR3JxbGho 4 | c2h0bk8vV2lta2NzcXl0OXZYTzJ0ZkhNV3lPTVl0ZjQ0b00KLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHlMWW4zNnJCTGNwcFRxOTQrTldzRFlENGd1TG4yRFJSQlhnSHVL 6 | TGlWdzAKMlZ4L0thbFZQWjZ0c3pJaE1XNmRtZmNKVTIxeTkwMFFGYWxKZTRMV3h0 7 | VQotPiBzc2gtZWQyNTUxOSBuanZYNUEgbm5pVE0zYzNQTW15c01DRk1HeDRLVlRW 8 | aGpkVUFHdG13THNDL1JlbEUyawp6SWQ5Nm1veDdwbCtDbjZPUkhQU0hkRXE1b1RY 9 | ZkxHY0ZqMFdvcGJ6WitvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBWeE1LaU5TRkpK 10 | bElLQWNidHZQeTF6Yk80ZzVlL005RTEyZzlDR2dTSGg0CkdZK2VDSGtMTE43VWRY 11 | ZnA0cDRKc016OVYvZGpDcDFad3o5YmpoOGhVNGsKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDBEV3pWVEI3QjFRUnRjK0VPZFF6U09iTHljOE9jZ1lka1lpbU9BSEtOeFUK 13 | RlF0WEFBMElzU1pOdDBEenUrWEhsaFkrTWpUc0gzb1hVRjVpUGpyc25FcwotLS0g 14 | aXhPbUtHWXc4MXJ4bUtZOWlkdVNOMmo1N1U2NXlxdU5VVXltZXh5aDRyWQoCjoWs 15 | rOf41MK9789YHLzXMZNbMoWt9tHGfOGZKOyPhYFq/j2d88ZLtzEHAuHKvQ561ffK 16 | Si0uTiTcTCyhCr/rsQ== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/sabnzbd-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBITUVj 3 | MjN5MGljc0ZEdEdPSGdNSWZZS1VDdnp6d0dIci9GeXI0TXhUZ3lrCm5ZbjZtN1BO 4 | ZUkzQy9ZbGp2S3Nxd1ljanBQemlwdVdDMXZOYkp0UFBVTDAKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIG9VSStaM2RTdUF4Q2VkQ3h5S0JHeWYwdndiQmlyNytWTXplMkdE 6 | MXpqeWsKaWhMOE5DS2RnS0VneUJHWUc3Ylhpb2ZFazJGdkJIdkxxalhVdU4wR2N4 7 | awotPiBzc2gtZWQyNTUxOSBuanZYNUEgaHMwWWZQVDdRai90S3U0SE95TW5JODcv 8 | Y2Jqb0hZZC91dExCSWFCT3AxbwpzbTk3SW43OVVmY1ExemkwcXMxdUx4UWRtek1O 9 | cVJuQ3JmWHNFSUxwRXo0Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBBUVRZeHZnNm1a 10 | OGsyK0JXbWF1RXBxUkQzRkZ1R0s1bzRNa1BHTWhOblc0Clo0VngzYTg1elNRY3Fj 11 | UEJ4cnp2MkV3ckM4R0loU3VuTGtuSEgzamNsY2sKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IHZIOUNFME1TbDhsUDNobUdwV2RRMXQ3cDFCeEg2WTArQTlSMmYxN1liZ1EK 13 | SXVWOGI3ejRwNUtDeUE4SDh6SGhzYWNHdiswaUFQZGd4L0VPZStQaFA4TQotLS0g 14 | R09RR0hEeWJmb1N3SjBUemhnOGQyeTN4K3ppaFJ2MDFGR2VqNmYraHZaVQrsfqps 15 | BUEbuwbRJOooVEMyJmUjNavhK09fgxHyyaiDVpEsTdg3dQ6sQYIV/Envmad8An+a 16 | Cn8oklYFq/UxoMHHbA== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/sonarr-api-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyA0Wkc3 3 | cFMyN1lLanQzNm9WR0JPS2RCYjJpbndER3BmUTZOcmVOem1DWkZzCnY5S1Yyamt6 4 | ZkFUem5vT1JQYWRmTHZMREVTb3hHQ20xdUpQK2dqcjJtRmMKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFRrUWorNVRaYkhHaWpheXZZSmRaM0d6U0tDNjgvcE5IMWk5SEhX 6 | MzhZa0kKVEkxWlZhNytJMEdKampWY0l3NzQ2aUdNOU5rV1Zjb3FHTVovdXRpdlB4 7 | dwotPiBzc2gtZWQyNTUxOSBuanZYNUEgVkxtNFFoWUlaM25GVDJGMzBiWEt6Lzlj 8 | NFdka1dUd0ZJNzMwTTl4emdqZwo3Y0FTbzZxcUNpOTl0R09JOUVkWXVIMkFndFg0 9 | NXFKR0lZQVhCZFRBL0lJCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBJWDZ0aFBtRUxr 10 | dXNRaVVxOWFacmE0allBcmJleFNFOXhNNlFZL1FDUVJJCmkzeStQSGN4STdTSFJG 11 | eWVnRFhEL3UzNHJzWngwWWZIV25NbzZOK3pOeDgKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IG13N1RWYzFzcUxkSnJCb3duSEQ0UnpnK2U2VmZlZlBFMjFqa2Y3Q2sySHcK 13 | a3RURU51bGRzZllyOVpCT1RQSVpFSnB3K3RFZGJQMDNKN0wySko0OVBPcwotLS0g 14 | eEluUUZwanRWWS8rTk1jcEpSU3Q1L05ja0lLNklhM2hHNUdBeG0rSjU5YwqEOyo/ 15 | YSIlWzZ13Vm64tqg6ksRnEuaSwUSQro0R8zRy8MNlPcX0IKtZV3H4wnvZBRIScWd 16 | Mng3c8Wq4p3/ip+/mw== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/influxdb2/influxdb2-token.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBBWHpP 3 | ZmxVTFpQOVhXdVRvTjZuVGlRVUpHRzk4ZTd0VTdDaUcyalJid0ZjCmtWcERqSW1k 4 | Q3ozaEQvT0Rja1VvT3NoRWxFeWxqbzFtMEdUVkJEcURGMGMKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIDZvWHpFRWVFVTRTSUlzcm1Ca1JNbFhNQWNISkkyTXp2SVFRVmpt 6 | Q0JxUXcKYThwazdBekZFdUc2aVRaSUVjUmFxWjF4NXpCSm5rME1yeUJDUUdEZXAw 7 | YwotPiBzc2gtZWQyNTUxOSBuanZYNUEga1ZZRVRSQTJpVnhzekpVQU00MlB0TzQ3 8 | QzBnSUZaVTIxS1Z3R1UzWm9RTQpEeHlyQm4zSWhYODYxalZXakdVZWJBeTFwVzEr 9 | S2NVODFBTm95bnI3ZjJjCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBMbVVWamlEVU4w 10 | WHNWbVQ0OXBnY2ZSL005bUVuekNWTTgwd1pLditoZ3dNCmFtWk1PaXZ3c1g4eExX 11 | dndXUXJqWC9lU3dVVjRqZWFVUWxyZTFiVmxpQ3MKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IGdOZHRHMkVqeWtzYldIMTRwb2w5M2lrc0FiOUdmT25kWWJ3U3dLZFpEUWcK 13 | UEFWMndhaDFBUzZrMHl6eUtNMXhIQ2RBQjQwTG5pQnIxZE03L3BpcUNBSQotLS0g 14 | dXVZNWdJY2hMaHNqdHVEYzRXNlpzOVA3ZnRyaWV2SVNJaG5FL2FPVjN3QQrunATj 15 | 0/HE6CeyvFHIYDazDseUaebDS+A/CaYPpOo+3OvMRXFwbZ7KzAzZCdT1iNLWOc3E 16 | Im2nMI/yWSLo2n5f 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/nextcloud/nextcloud.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBsdUI0 3 | QldaMXhRVm05U2ZsUU9oM0NSblI2SkZJbkIyaUhxeFI1NVREcjJjClBUZXJrb1pY 4 | elZ6MlIyajZWNmlZbzVmUVlqWlN4bm52SVYzZVlRMTRBNnMKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHE0ZVZwampWazJXaHVCaTJXT09qNytGYTlGaTdIL1Fla1NPeUpl 6 | cGFVRWMKUXoydG5JRjdqek1KUW5xWUNMVTJlRXJvclk0UEZDem92bHBKK010bG00 7 | UQotPiBzc2gtZWQyNTUxOSBuanZYNUEgR1pCc3dnU1VYbHhMNjZ4UWJxSDdSOVcz 8 | NEpaUkhET0YvNERpWWcvZ3prVQovV2tkV3lseEtFKzBJVkFhcHFxeUNsMmxoY0NN 9 | QnpmczJIdnJZaHNDOUh3Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSA1MGRhUXlyMzRa 10 | bVk2NHhCRjVISk93cmVETmdPYTl6a2VNTU9WaXdhdTE4CjVMZ1kvbkZKdE5rS2tO 11 | Uk1kOHZIOW9VMUJMdzRmaSt6SkloempxbnhqSG8KLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IGc0L2FwZUVtT1ZXa0pUUXlCQlhBSE9ZZzRXb0pqaGVjQzErVXFVT0dWbFkK 13 | UVB3NHdRRGNIeGF2VWlEelhLSldscGx5bVRMV0tYMWl6elc0bk10V253RQotLS0g 14 | RFc5VlZWTGdPRFZGb0tjVkJZT3JRR21tanYyWjZuQXFxOUNNMVpVRE5CSQokZtMc 15 | lJ0v6JloSS2bIMNpyozZHI0k1LGiLODjUO9YgvFp9wo5j9SXFf1t3Uv7I+Nco96l 16 | Uzybvbj7Ay2VCvj82qE= 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/paperless/paperless.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBTZG1N 3 | ckt3NjgwOThhZXRRanp3UGpvQ0xST0pmenY0Nm5lT05TZ2VkVjBnCnlCODlFeDZE 4 | R08xdStEbm1vdmY3dkVVczN4SVE1cE4ra2srdlJEZk5FbjQKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIERlQ0NtU3BhZ0l6NVdtakFkc1V6anFlWTN2cXczSk1WZlFQWTJm 6 | UmRKSEEKWU9LeVp6TkRDU1FHNjErM3RVa043ZWk0Q3hRMTB4b2VYNjNUK0IwVnFa 7 | dwotPiBzc2gtZWQyNTUxOSBuanZYNUEgU3VkRXJlWWFRS2dvWGo0RFdXd0Zra0J3 8 | MnNtNEU0OVNodjlJckdyQnVSbwo5RFR4QnlDSmd1WnBwbExKY0tOVU55WVFPWTFv 9 | b3hnaWxHcjVoYzRHaDRBCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAxREZKZklHQ2x1 10 | REFHaUtTNFM2aTFsa1Z3TDN0SlU4djVUcW9TY3c2aHlzCkpFWld2Mi9nMFJ0YVpZ 11 | NXJreE5zOFVDYVZ0elNESVJCekt0VmlhRDFJV2MKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IEgwTkJyeUh3YlZwYi9hSnJraFBDWWRqVlkySFFmR2hBWVJ1MG52dWpPR2cK 13 | YVgyRVU2RzBhQVJ3MTZTOEwwbWk3QzhFRlZMa2hzZ29HeW0rVU5aN0x2MAotLS0g 14 | bE43VGhIcjVNenNkVW4xV1N2Zmd0L0JnNUJoOTlya0lWU2NPckNPODdsQQpDcV5M 15 | ZQ3ZxOePeO2P5AqZuTEQk9QUZzEKnWt+aB296b8dU4rpjpKL+Btr7e9cPLs1S3ay 16 | fpnky8e+TsczGBEEkrcQ 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/git/fish/git.fish: -------------------------------------------------------------------------------- 1 | if contains f $argv 2 | switch $argv[1] 3 | case checkout 4 | git-checkout-fuzzy 5 | case add 6 | git-add-fuzzy 7 | case show 8 | git-show-fuzzy 9 | case merge 10 | git-merge-fuzzy 11 | case branch 12 | if test "$argv[2]" = -d 13 | git-delete-fuzzy 14 | else if test "$argv[2]" = -D 15 | git-force-delete-fuzzy 16 | else 17 | echo "Not a fuzzy option." 18 | return 1 19 | end 20 | case reset 21 | set commit (git-commits) 22 | and if test "$argv[2]" = --hard 23 | git reset --hard $commit 24 | else 25 | git reset $commit 26 | end 27 | case "*" 28 | echo "No fuzzy option." 29 | return 1 30 | end 31 | else 32 | if count $argv >/dev/null 33 | command git $argv 34 | else 35 | command git status -sb 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.jujutsu; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.jujutsu.enable = lib.mkEnableOption "Jujutsu version control"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | programs.jujutsu = { 18 | enable = true; 19 | 20 | # https://github.com/martinvonz/jj/blob/main/docs/config.md 21 | settings = { 22 | user = { 23 | name = config.programs.git.settings.user.name; 24 | email = config.programs.git.settings.user.email; 25 | }; 26 | ui.paginate = "never"; 27 | 28 | # Automatically snapshot when files change 29 | fsmonitor.backend = "watchman"; 30 | fsmonitor.watchman.register-snapshot-trigger = true; 31 | }; 32 | }; 33 | 34 | home.packages = [ 35 | # Required for the fsmonitor to auto-snapshot 36 | pkgs.watchman 37 | 38 | # Required to be on path to work in Zellij 39 | pkgs.jjui 40 | ]; 41 | 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/mbsync/mailpass.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBuM3E3 3 | UnNtNUlmTGtIdm9zZGlha1B5ZVkrQjBuTStKTmlPcmFCNVM0eGlzCk1tWGJOdWtm 4 | TVBRMFNNRkN4TVBtVWJyUk9wZlJ2eXpHSWtLK21rc3JIYkEKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIDB3c1dHdnNTSEhva2FsT2pNL3JUVXVmTGRrVzIwWk1UdFFVaGxH 6 | MWVad2MKaUJyaUdDek45eHFEdWFsMks1VjlsTlRhWEdmNEFaUmdjNXpocS9vVWVa 7 | NAotPiBzc2gtZWQyNTUxOSBuanZYNUEgRFZ1bVVCeVZTWEFqNFk5bmVBSmk0Sis2 8 | TDNuZVFhTWRBSXFrWmJlQ3ZrZwpMWTlSL3hkZGNNQjFXRTFTTmJzMlBaVHJhekpD 9 | aGdCaDJtNkxEbWgzSXdVCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBXZGIxaEFvZXpx 10 | Vm5CZHAwRFZFWnZIZ1h4eVh4RmNoRzh3OHN0dFhOV2xVClNXaDJxbFhlbHJmeThM 11 | TjgyTlEwaThwZ3NhOWNQYXV4WFZHMGR0cGxGV1EKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDFyK0xxREdzWk8zWkNYQUUzUUw4RmE0Vm5WQjljdmxTeTh2VktUc1NuMVkK 13 | YTRUK0hlTVltcFVXWDlDVklKRVMrRjdYUWQ4ME9YcXJBcWY1RUU0MS9pRQotLS0g 14 | ZzNjRmVHSTByTS8vNTlRbDdYR2tFNHF6RCtiajNLY2o3eDZpdFFoRkdibwqeS82J 15 | r4vWQBK8WvTxQb1sQdIU9/0NNX/JqbAxWiaUnzk6ilzf0leovTZkJF0JchWyW1ya 16 | HiVoD5lVamGzGA6jRw== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/influxdb2/influxdb2-password.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBkaUhZ 3 | NHE3L2gwaU8rVjlkR0JOL0d4YVdYVHdnSkJzUERTM1NyRlNmV1FnCldOTkd1Z1Jj 4 | clVxNGZzZDExdDNTMWZIQ0pKbzE2UXNpb3BhbmxuZ0FNMEUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHZ3NXc5WDVwQXY1ODRzamQrY2JaK051WXJwYWtDYmhkOXpPWGZS 6 | RHY4ek0KdGQ3QjhnRVRVUHNUaHNxa0I3NVFXUFZ0WjlUZXFNTnM1MGYrTXZVSGkw 7 | SQotPiBzc2gtZWQyNTUxOSBuanZYNUEga3V5MmQyMkdCYjN0cUlkRWNlTXh4ZFRW 8 | aURLK2cySk9wbmo4MGFaUHNSOAo2NFdadi9ENmZ3a3hBeUdGeVNGRkU5Y3drWXZo 9 | eEFKdEVHVk9palA2cTBVCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAxazl3UkNTcFI0 10 | MDJHQTdwZ01BdEh3czZWaWszcnZ5dmsxSjNteDluTEVRCmZidGJiT0xuWmdpQm5u 11 | TEpCTlF4QVVBVzFMQnRteUZ0cStZc0tRMHFMVkUKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDhicExSMnVtNUl4L0Q3ZGlpQVF1eXlzOVZpMlR2TnVadk5XU1loK3NXQTAK 13 | bktxWkFqTitQaFdCdEtvRHNDZ21lMzl0ckliT0JsMkErdnVKWmVmeGF6YwotLS0g 14 | VStoT1QwdmF6ZGNpbjdmeXA5bFNhWUFxamx1SXRiYVkvNGQvYkVEb29kVQoNyF4F 15 | azoWnxojKxAIC2qBM80EdVCvcRdhKm4iSzyWYMt06cb6IrEutOzC+FCx37A6KKVU 16 | tNYcXpGcJX2ge805 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/zed-editor.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.zed-editor; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.zed-editor.enable = lib.mkEnableOption "Zed text editor"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | programs.zed-editor = { 18 | enable = true; 19 | 20 | extensions = [ 21 | "nix" 22 | "rust" 23 | ]; 24 | 25 | extraPackages = [ pkgs.nixd ]; 26 | 27 | installRemoteServer = false; 28 | 29 | userKeymaps = [ 30 | { 31 | context = "Workspace"; 32 | bindings = { 33 | ctrl-shift-t = "workspace::NewTerminal"; 34 | }; 35 | } 36 | ]; 37 | 38 | userSettings = { 39 | features = { 40 | copilot = false; 41 | }; 42 | telemetry = { 43 | metrics = false; 44 | }; 45 | vim_mode = true; 46 | ui_font_size = 16; 47 | buffer_font_size = 16; 48 | }; 49 | 50 | }; 51 | 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/restic/restic.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyAvWi9T 3 | NnFzUnlKUGord21NUy9OT1NDRjhIbFB6MUc3TzgwVzY3OHpFSlN3CmhuNFY1L1FB 4 | VFBHY1lNNjFYdFZyeHoxZUZyTFdpVHhqM1JqMUM3YWljVUUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFI4aGU5Z2NUeGNSNmEzNFk0anBBbUw0NUtHTE55WmgxOUN0T1p1 6 | QUZyR2cKeTNack0vMVVsNTFMbmFSUXdUUkw2MTlnSzhRajVSWXJvZmV2QjlFcUZY 7 | QQotPiBzc2gtZWQyNTUxOSBuanZYNUEgc01kWFdYS3BBay96Uzd5cG1MMlNMNXhQ 8 | NTV4NVpvc2lLZkpLWkhZZlRrVQo0SXJhWUVMVUtYb1hEOEtJUnJoY2t0OUlpQVY2 9 | UUZYdHpBcWRvUU0yRHlvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSB2NTZHWUd2c3o1 10 | c0NKTThaMkgyeG54Nmw1dHZBQkZoYmJkOTZNcnVyMUJVCldzQ1NHNk8vTGRMNHlM 11 | eU0yYmltMkhlUjY2NWxhdHQ2N3BMUjdzTk9PMFkKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IHh3OEEzTmIrQXhtSTE2REFUV1loVE5vNTRUbEJmNEE4YmhBckRmZGpwVXMK 13 | OEo5RXdwU1JuY3FPQnJNQ1hMdHJxcE4xVnVVWVVLREROYjNsZkN3ZzV2cwotLS0g 14 | aXMrandHZTJzME95VFRuUDRzWDQ5Z3N5RGxVOUUxQ1FGNGpvN3Y4SllSNApAOIi/ 15 | 0iP9cccbkUqLZJicpIlKAP+QsYM8Bfb/wYyaQPnh4vlKqil4LpQEfFW+/J82DIti 16 | 8o/ddK8YDlLg3lwyiZ2dUm3O87jA7KEgd/g= 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/keybase.nix: -------------------------------------------------------------------------------- 1 | # Keybase is an encrypted communications tool with a synchronized encrypted 2 | # filestore that can be mounted onto a machine's filesystem. 3 | 4 | { 5 | config, 6 | pkgs, 7 | lib, 8 | ... 9 | }: 10 | 11 | let 12 | cfg = config.nmasur.presets.services.keybase; 13 | in 14 | 15 | { 16 | 17 | options.nmasur.presets.services.keybase.enable = lib.mkEnableOption "Keybase encryption tool"; 18 | 19 | config = lib.mkIf cfg.enable { 20 | 21 | services.keybase.enable = true; 22 | services.kbfs = { 23 | enable = true; 24 | mountPoint = "keybase"; 25 | }; 26 | 27 | home.packages = [ (lib.mkIf config.nmasur.profiles.linux-gui.enable pkgs.keybase-gui) ]; 28 | home.file = 29 | let 30 | ignorePatterns = '' 31 | keybase/ 32 | kbfs/''; 33 | in 34 | { 35 | ".rgignore".text = ignorePatterns; 36 | ".fdignore".text = ignorePatterns; 37 | }; 38 | # Ignore in zoxide 39 | home.sessionVariables = { 40 | _ZO_EXCLUDE_DIRS = "$HOME/keybase/*"; 41 | }; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/cloudflare/cloudflare-api.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBKNXVz 3 | RCtWVURFT2JmbUk1dXdWQjJuSVBoamVGaHZUWDNJL1pyREZyTFN3CnVpTnRKSDR5 4 | U0N3QWZ6L3hpcEVEampWSUlDTVFvWmRuWEFKVUE0bmVDZ0UKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIGJ2czRsU2RWN2RaMnc5NEZNbEhxWTNTdkEydWpjd1NVQ0k2RHFC 6 | anVubU0KQkhxL1kwSGt3N21OSVJwcHJCM2p0TnlOQVJ5c2VTejJoL2ZZUGk4REtL 7 | bwotPiBzc2gtZWQyNTUxOSBuanZYNUEgaXFJR3IrVHVNQVhjNFFmN1d3ZHhZS04r 8 | K0FGRXppQkE4MHZhVUI5SHBWRQpxbDdqc2RYZmo0ejBOYUFCcGtrbXVZbDBJVVRJ 9 | Q2ZlQlFtYmQ4Z3dqcGIwCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBzNlQxNGxDRlNz 10 | amVMWjI2WFhIYTFIMDQxY1NDRXYvWU9LaUFQMVZMZjMwCm15a3lPVkkyMnZoOGx0 11 | bTdYbWtZWGQzTVBJb2g4WmM5Z25tcHhKWDNZencKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IG1VWm1JRUUwUWhnWVMvdjdmaUZNN1F1eExXRU1xaXpzY2VFMTE3SWE3dzQK 13 | SWN5b3llVU5WSk1HNW1Wc1dvVm82a1NyQVQ4NmhjRExuQzB2UGpPSGFDcwotLS0g 14 | ZkdtZ1o4KzlveDBCdkx4eFc2RGNjUjFrb1ZyZXdjZHpLVWtkN2ZaenlKOArVhdOP 15 | 2ifpmAQNOfBbQyY9UPhxPxrF7jnZ8B5jumaip8QJuh6xEYkF17tSEzTPVf6ER9wr 16 | OrND9IR2kbZVFAxb3/uUD9I3jegJ 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/wireguard/wireguard.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBVeThD 3 | cTRyOVBqeDBEajZKYzNvVkhRR3FzMVNBbGFqZG1xTktpaXpBd2hzCk9ZVTlnanZa 4 | aVN1V255U0NzOEFCUDduMU5oNDByVWd4SWtPMkFsdHdZZ1EKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIG1TTy8vWFBFd21LYnZWKzhnT2dPREIvL2JvK2R3c0hSTXFOdlVx 6 | WmlrMW8KVk9ubmxsNHRvSjBTNEtKRU10RytHWnRwT1ZIWS9meVc0dkhlTkxrY3NR 7 | QQotPiBzc2gtZWQyNTUxOSBuanZYNUEgZW1tc2xRNEtaam5tZ1VYRjNyV0xBbkRX 8 | M0FuWW9SUTR3Um0yUzlBeFhFUQpWNzRpeGlTQ0FpbTI3MmROcEJmMWZ0dmlnZEFp 9 | TmNrUGxOSzZIQnA1TTFzCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBpYzJFQ2h6OU5M 10 | M2FPYnJLaU9IU2tEMzhrMkJWdS9XTU42d0NrbkVIOFNvCjNPcktPc0YyeDJHeHBx 11 | bnRVU1VQZjNPSTdrOVNZcTVXK01IK2Y4QWVRakkKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IERHK0pYT3A1ckJ6SmF0MHkzbGFjV2Q5YmN6cFJxOHZHVDN0RktualBVakkK 13 | SnpIMzRrMmdKVllzN1dVTTRSWklpZEJrTkprSGJhVk9teHFsam5MSStnTQotLS0g 14 | TjFuK2JVc2xobzd3Z2ZHQXp6bkFkNXBaOGhwWEZmeXVLSmJNOGUxeUxMawrUo1I0 15 | jkaYDLQjS//eqsWaBc94CtnsSkWaUroAExyWob3U5VHaby90E9HpJ5IV+8fvVqxc 16 | LDXJF3bAnnAvqKNsWG+daUqDWhdv717Tbw== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Noah Masur 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/litestream/backup.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBDNTh4 3 | dERZY3Q1cyt6d2RwODR3aWd0dUx6UUR6WWUxUERFV3Zwb1lVU0MwClZZTzY1bXd4 4 | dnVMS2haWnA3dURhZFgyWFR0c0J1SGhvUEZ3OFJtTmJObzgKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFNMSWJZSCtzTTBlbm4zd0hJWXJSYWdJcUd3RGY1ZkZWTmJPZGtz 6 | Ym0yUVEKWnFtSDVNZDNNd0FBUURmN1ZJbnJjNlNIdVduM1hSRmlGNlVVMWliOUE0 7 | SQotPiBzc2gtZWQyNTUxOSBuanZYNUEgVEVlTkFidE1UWnh2NGJibDR6dkh6aEZY 8 | eElpWE81UUNQcHlVc0JXU2RqUQpneC9ueFFVTldVZzhjN3NrK05IcXhrY1BHempF 9 | R0p2RVA3bi9XN2dVaXprCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBlR2RlN0dsQkNZ 10 | R2Ixd0YwdnE0dkhIa1RucUlOWTBLMlJRMVVuOUoreUZJClcwWDdwZVlrSkZWZ1BT 11 | WjBWK2RNUDFKdXNibVJUQlVhdGs1Yk9IdC92UDAKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IGNDM1RiVWtWU1FsaG1tQVVkeGtyYlJzZldHUkZnelozVFVQcG1XQ1hSVmsK 13 | MFRMS2dNL01VY3pJVWtCWlZmM21BcFZvM1c1djdCcUxCcnQzYTJuV3FDdwotLS0g 14 | MU5LTzREZ2p0dW1RMWhsWExHb1FtRUJlL0pUdFpKRThpWnVTYS8zbVdIRQrUKXp+ 15 | 0HWMPJHIieCvle5qXgzr4iMUL9VxH9ydVl6gkOLM/r7DO36kVkgqr4whSsk8mihY 16 | boq66cjj1dUVij2fMD3zf62n948EQnPZHIBwnDS05eOW4A== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/actualbudget/actualbudget-password.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBQY3lv 3 | SG9kNkN1S3RZdE80cWJTd0k0UkdiNmZXT085Um9Vd0FGYWpObHc0CnQvVjF4L0xu 4 | ajNvQkFueVREaWxLWFhyNGkvL2ZlOHdEYXdTRkowbk9WUUUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIE5aT3ZlMDJjNkJaZmFDV3ZKSHo5UEhnTlM5dHk1R0dYSXFNOWxJ 6 | OThEaGcKcmNsMVUxaTI1b0FtbFdtMzlVYVZxcnllVmlwaDRuUkR4d3BNbm12eU5x 7 | OAotPiBzc2gtZWQyNTUxOSBuanZYNUEgR3BmQk5Nd0E3RC9UQ1ZoWmxTNlhubjVZ 8 | Vi8xL3V3YTNqUVh2ZVZrRkNtawpLaWhxY1FQajJZeGJzakd3ZDhrbmd4T2JNVlUy 9 | dzFOMGcwRmJML3hPTzRBCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBDNTQzZ0syVHNS 10 | TTJPUm9OMUcyNTY5VGZkNEVESmt2eVQrSzJlUEgwS0E4ClRqbk9FTGZNRG9zSHlC 11 | UXQyN0N1WDN4MHNrNFgrUjdQQUc4aU8xajRVdkEKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IHpiaEsvbCtwMlkyMWpJMS9XWExudDRpaE4xMmQ4eXIzU2RaTGd3TUg3eHMK 13 | anpIV01KVDdvZGI5M1dmME1KaC9jcFkrVlN4TmlXN21tUnhIYnlEMEdHcwotLS0g 14 | dy9LeGpiNkowQkNwOFNFeHUveGRveDRhajVtNEU3SWE0MEhOYTl6ZHM0QQq/Dg+2 15 | OrqL8yCAai3J8djSktSmhAc/jdbEnHVdl3943Enyrn+Zz2HcUe96RySrleCt+QxL 16 | Dezprhehi7jK7KmIAGOspicA0e/4GQ8txsb2fQ== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/gitea-runner-local/gitea-runner-token.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBiVDgy 3 | QmFNcGNSeWx4bS9VVHdocFVFUndkQ2g0ZU9LdEdaTU5Mc1JGZ1I0CkExek1Pd1Ry 4 | Z3RGR3JIdXdJNHNyYTlJeEIrR1NVa3JTbjBzZmFDZk5YL00KLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHUxN1BvTFJwby9mUC82QzFRMGNwaEovcnRJVE9YU2doM2djazVw 6 | K2oveTAKaldCZ0haUlNoK1BtK0NQR3VyTmNDbmlKSnBlZGNSazlFYzRsV2xWNHNI 7 | OAotPiBzc2gtZWQyNTUxOSBuanZYNUEgaVFUbnZ4eU83K0JlRXozSW5Yekc4MVlF 8 | QmdlbEV4NHpWN3BwdVVUZFhCQQpkVExtZlhKeHlVZzNtZU9vQmlNRGhqQTl3WVIz 9 | cnYxMkFiT3pBZEo5Z1B3Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBGaE1YdmRaSFNK 10 | L25uSVp2SjNhME1PUVFNeVJDNDFBSnZKeVE5NGxHcEZnCmJjS0czOHA0bTIyVTMv 11 | SHY0blBLY3d5Y29vR2RiM3JHOVlIb01LSzNTSzQKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IGdWRUYxbjJySXdHK2UvdnlPaWNMcTZuUklacnNwY2dKNTh0MklYYit1bTAK 13 | Uk1OMExEOC9DMTZRbHNOZ2R4aWI1dVppNHZGenh4dStCYzV2bjlQamVlTQotLS0g 14 | cUJud2k1SmxoUWxnUEJsdnNFQVlJZG9qSjVQWXA0ZWQwK09Uci9QNnh2awqOJikC 15 | R8H3k0kHUew/tr0Oi8ASuS15La6bb6NxIpC/7edoNf996pxToLeHy8fOJlnPKSEb 16 | hw+GvqIsP+6F7BD3rCOh2d+1ZbIHjcOkX94u 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/mathesar/mathesar-postgres.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyA2SUsv 3 | d1R3Slo3UDhDUWNiTDcybU9mTzhycDNKVCtteHhwRXU4M0x5UVF3CkUvZHdISzE4 4 | NU9qdy9sUGxTeTJxY2huWS9zVnRzd2o0UFpxc0FjT2lDTGMKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIG1SM3gxRzJ5RllOTXhHZC9sc1Z6U1VCc3ptTWZRYzNJQ1g4ZjRI 6 | d3U3RVUKekNYc0VpSUw4TVJsSGNYNElxUUcwS25oczVUWnNlUTd2SXlvYlEvcE01 7 | ZwotPiBzc2gtZWQyNTUxOSBuanZYNUEgc0JUZlkyY0dKWjhzVlMwTi8zS1VrVGt1 8 | UGJzeURtbEZ3ZWpncWZNK2x5SQpJdVNSV2NLdHBEVThtWVBhUm1GSEEvV2s0bGZB 9 | WFJTK0xIa01ucHBxcm1jCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBrRitXVzdvRmgz 10 | VW5HMHpBRStuTnRDZmlCdVRra09JNE85Wkl4bkJJWkFzCkZUeTRWK0VmL21VRlpW 11 | SWg5dnJ4UGw4aXZteUxyaXZUaGpxQkdQL0hXK0kKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IE4xSlZYbmFWZlhCQ3RibFN5Z3gzMDN5cXNDQzA4UnViUk9IclBTdE4valkK 13 | MGx3Nkhac3NEZGh2SExUMU94NExiRlMvRndobUlJdmhBWU1CM0diL0V3ZwotLS0g 14 | SDhvSzRFUFdGN0ZLUm9hWWV2T2tHMVdvTHlWOEZWTkZjLzd0VE12SU9kNAp2wHsq 15 | uKxlrH9xXj17Zd3FAjRlSMjjVVOYZOVyiPMWY7MD7V5XVY0hCPnKpzX4RyYeTfqf 16 | 3W2LaWecMcRtTdRLOyCqVC+1DXtCAL/DqxIWcu3Q+zDQog== 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/mathesar/mathesar.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBJZjI5 3 | Y0pMd01IdVJIa2RtU3BrajNGblczeUdkWUgxdFliQmJGK2RDclhVCjVlbmRpV1Bj 4 | K1hMTm1HZ0pnYm05YmZ0Tm9UZjVoQ3FMM2dhVkRtV1FBZWsKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIGxzbXA2NVRXbGxsY05hU0ZGWlU2MTNGVGozN2dycnBaNUZ4Ykxx 6 | UjB0d3MKcUdRampFeTdGek9FaHVrV3Y1ay8rMGh6M2NRZjVpUHdWYVJYZENmOGty 7 | RQotPiBzc2gtZWQyNTUxOSBuanZYNUEgamdMKzRnRldKYW9sYzJGWmR2TjRYVlRZ 8 | SXhKT3BrNC9XdHhpUVFQSXVROApoM3BUajhmR01VeDR1MHJhMnJFUkxCOW9DckZF 9 | TkhMd1BYODMrVm5PSGFJCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAzbVJsT2pBTENF 10 | eGUrOEdHakZzb3ExMGwyMW91TEZORmpxdUJJMUJlZEJFClV2UlFlNVBxSmlaMnNs 11 | MTlFNzVOSjVqMVp5a1dwUVJqR3ZPRkdnY0w5dXMKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDcrZzhhWjh4UFVSM1loTTV1UXp2NDF1cGlLUWZ2bTN0NHJiOFhESFdJQWcK 13 | UFZzT2hmSTFlR0VNenVobktDN2xaZElwTWFZVklscFAvQmQyZjJiTU4wawotLS0g 14 | UW8vRlpmcGV1SmR1blZRK3c0eVpGeUlZMEc5eGlRcVpnbXI5UkNUelJEYwo8Na+w 15 | XzVV1/LPzA3kl0yDvF2b0nn1TmR903ralFbjmT2Rv/HNDVyVklIz1Jycaje8W8uV 16 | vZGGicSNIIZbGLEYT9fMUzY1KPoU6LUx0mgGUK2PZssHmG9mbW/Jx3R6 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/notes-git-sync.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (config.nmasur.settings) username; 10 | cfg = config.nmasur.presets.services.notes-git-sync; 11 | in 12 | 13 | { 14 | options.nmasur.presets.services.notes-git-sync.enable = lib.mkEnableOption "Sync notes to folder"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Sync notes for Nextcloud automatically 19 | systemd.user.timers.refresh-notes = { 20 | Timer = { 21 | OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes 22 | Unit = "refresh-notes.service"; 23 | }; 24 | }; 25 | systemd.user.services.refresh-notes = { 26 | Unit.Description = "Get latest notes."; 27 | Service = { 28 | Type = "oneshot"; 29 | ExecStartPre = "${lib.getExe pkgs.git} -C /data/git/notes reset --hard master"; 30 | ExecStart = "${lib.getExe pkgs.git} -C /data/git/notes pull"; 31 | WorkingDirectory = config.home-manager.users.${username}.home.homeDirectory; 32 | Environment = "PATH=${pkgs.openssh}/bin"; 33 | }; 34 | }; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /hosts/aarch64-darwin/lookingglass/default.nix: -------------------------------------------------------------------------------- 1 | # The Looking Glass 2 | # System configuration for my work Macbook 3 | 4 | rec { 5 | networking.hostName = "NYCM-NMASUR2"; 6 | networking.computerName = "NYCM-NMASUR2"; 7 | 8 | nmasur.settings = { 9 | username = "Noah.Masur"; 10 | fullName = "Noah Masur"; 11 | }; 12 | 13 | nmasur.profiles = { 14 | base.enable = true; 15 | work.enable = true; 16 | extra.enable = true; 17 | gaming.enable = true; 18 | }; 19 | 20 | home-manager.users."Noah.Masur" = { 21 | nmasur.settings = { 22 | username = nmasur.settings.username; 23 | fullName = nmasur.settings.fullName; 24 | host = "lookingglass"; 25 | }; 26 | nmasur.profiles = { 27 | common.enable = true; 28 | darwin-base.enable = true; 29 | power-user.enable = true; 30 | work.enable = true; 31 | experimental.enable = true; 32 | }; 33 | nmasur.presets.programs.git-work.work = { 34 | name = "Noah-Masur_1701"; 35 | email = "${nmasur.settings.username}@take2games.com"; 36 | }; 37 | home.stateVersion = "23.05"; 38 | }; 39 | 40 | system.stateVersion = 5; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/toggleterm.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("t", "", "") --- Exit terminal mode 2 | 3 | -- Only set these keymaps for toggleterm 4 | vim.api.nvim_create_autocmd("TermOpen", { 5 | pattern = "term://*toggleterm#*", 6 | callback = function() 7 | -- vim.keymap.set("t", "", "") --- Exit terminal mode 8 | vim.keymap.set("t", "", "h") 9 | vim.keymap.set("t", "", "j") 10 | vim.keymap.set("t", "", "k") 11 | vim.keymap.set("t", "", "l") 12 | end, 13 | }) 14 | 15 | -- These are all the different types of terminals we can trigger 16 | 17 | local terminal = require("toggleterm.terminal").Terminal 18 | 19 | local basicterminal = terminal:new() 20 | function TERM_TOGGLE() 21 | basicterminal:toggle() 22 | end 23 | 24 | local nixpkgs = terminal:new({ cmd = "nix repl --expr 'import {}'" }) 25 | function NIXPKGS_TOGGLE() 26 | nixpkgs:toggle() 27 | end 28 | 29 | vim.keymap.set("n", "t", TERM_TOGGLE) 30 | vim.keymap.set("n", "P", NIXPKGS_TOGGLE) 31 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/actualbudget/actualbudget-budget-id.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyA0VjJk 3 | a2c0Q1pVcEVCdjd3OE1xZ2s2a29YdjdWTUZkK1hnMFNwVTRVMVFVCkhpY2tjQmFz 4 | K3dzVEgrcnBuRlgyZzYwWGtiQzh6RjNtNmNUb2FSVCsxMTAKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFM3cVpTaVFYK1NEYitaSEtLUE5yVDhXTGNHSnN3UjdROTVDeXND 6 | VjFUQjAKYnF6RWtjaFZNM1cxSTJUV0p4UExoenhicGpESEk0R2Q0VncrUldwSndi 7 | UQotPiBzc2gtZWQyNTUxOSBuanZYNUEgOTltRmlNNFQzTWpsVVdHUXBqS1lKRldJ 8 | dW9kVHJqZFRrQWFTK2ZDMi8zZwpTUlRqZUkzSWlibGhMVzRwQmdldVREeGpsRTRr 9 | L1FUZHowdVprNlEvVVJ3Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBjeUZRdmtENUQw 10 | Ukoxb3NNYU5JeE1OSVBGcWhPZS9mY1BEb0tVbnB3bVdNCnRHRXhpd0dEbWZuNEg0 11 | a1BMdk5yc2x6Y0EzQXo1U1hwZnJuUzJ1ckt1VDAKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IExJeHhnTlgrSXpVYkxWdnZldlR4Q1JzZE9PWFowbWJSQ1pTbkp3YWFoUzgK 13 | L1ErSnZ3cWVXeVU0TThPaFVsVjBTdHh1YlQ3cTduQ2xIejZScEJSZGp6MAotLS0g 14 | SFJpT2JlSktBaFZhdjlyOWRhLzJiT21OditjczZJcU9iMFJMUzhNdzVZMAp0yAab 15 | 89wcmBqmuQLoFYRs/Tj+UvWa4UaXvNFGZM9zIH8WEJDxO+QviDL1NETOuI4T9X1q 16 | JYa7c4PAwV8KgMkdKpHVJ3sN1+Kg82UXXSCTjpRHa33OBZTC 17 | -----END AGE ENCRYPTED FILE----- 18 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | hostnames, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.services.audiobookshelf; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.services.audiobookshelf.enable = 15 | lib.mkEnableOption "Audiobookshelf e-book and audiobook manager"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | 19 | services.audiobookshelf = { 20 | enable = true; 21 | 22 | # This is the default /var/lib/audiobookshelf 23 | dataDir = "audiobookshelf"; 24 | }; 25 | 26 | # Allow web traffic to Caddy 27 | nmasur.presets.services.caddy.routes = [ 28 | { 29 | match = [ { host = [ hostnames.audiobooks ]; } ]; 30 | handle = [ 31 | { 32 | handler = "reverse_proxy"; 33 | upstreams = [ { dial = "localhost:${builtins.toString config.services.audiobookshelf.port}"; } ]; 34 | } 35 | ]; 36 | } 37 | ]; 38 | 39 | # Configure Cloudflare DNS to point to this machine 40 | services.cloudflare-dyndns.domains = [ hostnames.audiobooks ]; 41 | 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/kanata.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.kanata; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.kanata.enable = lib.mkEnableOption "Kanata keyboard manager"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # Swap Caps-Lock with Escape when pressed or LCtrl when held/combined with others 18 | # Inspired by: https://www.youtube.com/watch?v=XuQVbZ0wENE 19 | services.kanata = { 20 | enable = true; 21 | keyboards.default = { 22 | devices = [ 23 | "/dev/input/by-id/usb-Logitech_Logitech_G710_Keyboard-event-kbd" 24 | "/dev/input/by-id/usb-Logitech_Logitech_G710_Keyboard-if01-event-kbd" 25 | ]; 26 | extraDefCfg = "process-unmapped-keys yes"; 27 | config = '' 28 | (defsrc 29 | caps 30 | ) 31 | (defalias 32 | escctrl (tap-hold-press 200 200 esc lctrl) 33 | ) 34 | (deflayer base 35 | @escctrl 36 | ) 37 | ''; 38 | }; 39 | }; 40 | 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/services/loadkey.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.services.loadkey; 10 | in 11 | { 12 | 13 | options.nmasur.presets.services.loadkey.enable = 14 | lib.mkEnableOption "Load the private key as an SSH file"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | home.activation = { 19 | 20 | # Always load the key if it doesn't exist 21 | loadkey = config.lib.dag.entryAfter [ "writeBoundary" ] '' 22 | if [ ! -d ~/.ssh ]; then 23 | run mkdir --parents $VERBOSE_ARG ~/.ssh/ 24 | fi 25 | # But only load if using interactive mode 26 | if [[ $- == *i* ]]; then 27 | if [ ! -f ~/.ssh/id_ed25519 ]; then 28 | printf "\nEnter the seed phrase for your SSH key...\n" 29 | printf "\nThen press ^D when complete.\n\n" 30 | mkdir -p ~/.ssh/ 31 | ${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519 32 | printf "\n\nContinuing activation.\n\n" 33 | fi 34 | fi 35 | ''; 36 | }; 37 | 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/mealie.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | inherit (config.nmasur.settings) hostnames; 5 | cfg = config.nmasur.presets.services.mealie; 6 | in 7 | 8 | { 9 | 10 | options.nmasur.presets.services.mealie.enable = lib.mkEnableOption "mealie recipe manager"; 11 | config = lib.mkIf cfg.enable { 12 | 13 | services.mealie = { 14 | enable = true; 15 | port = 9099; 16 | database.createLocally = true; 17 | listenAddress = "127.0.0.1"; 18 | }; 19 | 20 | nmasur.presets.services.caddy.routes = [ 21 | { 22 | match = [ { host = [ hostnames.recipes ]; } ]; 23 | handle = [ 24 | { 25 | handler = "reverse_proxy"; 26 | upstreams = [ { dial = "localhost:${builtins.toString config.services.mealie.port}"; } ]; 27 | } 28 | ]; 29 | } 30 | ]; 31 | 32 | # Configure Cloudflare DNS to point to this machine 33 | services.cloudflare-dyndns.domains = [ hostnames.recipes ]; 34 | 35 | # Point localhost to the local domain 36 | networking.hosts."127.0.0.1" = [ hostnames.recipes ]; 37 | 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hosts/x86_64-linux/arrow/default.nix: -------------------------------------------------------------------------------- 1 | # The Arrow 2 | # System configuration for temporary VM 3 | 4 | rec { 5 | # Hardware 6 | networking.hostName = "arrow"; 7 | 8 | nmasur.settings = { 9 | username = "noah"; 10 | fullName = "Noah Masur"; 11 | }; 12 | 13 | nmasur.profiles = { 14 | base.enable = true; 15 | server.enable = true; 16 | }; 17 | 18 | home-manager.users."noah" = { 19 | nmasur.settings = { 20 | username = nmasur.settings.username; 21 | fullName = nmasur.settings.fullName; 22 | host = networking.hostName; 23 | }; 24 | nmasur.profiles = { 25 | common.enable = true; 26 | linux-base.enable = true; 27 | }; 28 | home.stateVersion = "23.05"; 29 | }; 30 | 31 | system.stateVersion = "23.05"; 32 | 33 | # These filesystems are ignored by nixos-generators 34 | 35 | # This is the root filesystem containing NixOS 36 | fileSystems."/" = { 37 | device = "/dev/disk/by-label/nixos"; 38 | fsType = "ext4"; 39 | }; 40 | 41 | # This is the boot filesystem for Grub 42 | fileSystems."/boot" = { 43 | device = "/dev/disk/by-label/boot"; 44 | fsType = "vfat"; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/nautilus.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.nautilus; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.nautilus.enable = 15 | lib.mkEnableOption "Nautilus file manager for Linux"; 16 | 17 | config = lib.mkIf cfg.enable { 18 | 19 | # Quick button for launching nautilus 20 | xsession.windowManager.i3.config.keybindings = { 21 | "${config.xsession.windowManager.i3.config.modifier}+n" = 22 | "exec --no-startup-id ${pkgs.nautilus}/bin/nautilus"; 23 | }; 24 | 25 | # Generates a QR code and previews it with sushi 26 | programs.fish.functions = { 27 | qr = { 28 | body = "${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.sushi}/bin/sushi /tmp/qr.png"; 29 | }; 30 | }; 31 | 32 | # Set Nautilus as default for opening directories 33 | xdg.mimeApps = { 34 | associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ]; 35 | defaultApplications."inode/directory" = lib.mkBefore [ "org.gnome.Nautilus.desktop" ]; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/vaultwarden/vaultwarden.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyB5OVNh 3 | dTZiYVp1U2FkaUhXTUxSYkpEZDBuYnNXS1AySW12bTlHdjJ1N0hzClVrTXpOVUhF 4 | b3lTU3I0cmVKdFEwNXBxTHJmeHA2Yi9wY2RYVkdVbnA4VncKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIE9qYmV0RHB0TkJOOGRwN0ZFbnhCMmRMK1BrRWR2UmJFWm5yNVFR 6 | RmtuRkUKZ0pQUW5lVGdvd1psSS9FT2pRSDZqYWcxOTgwd05MT1M5dmIxRG13YVUw 7 | WQotPiBzc2gtZWQyNTUxOSBuanZYNUEgbEdsdHA4S2tmV3hVcWdUeEpVT05hT0Fj 8 | cmZucnQ1bjdzbWRQbSt4TU1IdworNk8vOGtNWEllWnJNOHlGT1ErUlV1akxjNGRz 9 | YmdjRU9tM2FaSXd3ODA0Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBuYWdKMXFWeHNj 10 | OFhOK3ZCSTdtRlpxMnBPV0lGNTNXL3owOTZhYmJXL25BClJYNG1iVlg5dXRjN0Q1 11 | WmlPSE5xRFV6QXIvbWw3SnNWTVVSMmZpZW5wTzQKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IG9pT2R5YU1keGxCdElyY0ZlQmUxVTZ1bnI1MFZySVp0c0lBU3ZTWEZoRTQK 13 | ZGZUd2YrUy8rM2ZsREVrMTJUNUlvRWg5UlVoSm5lZU5UM2ZzRXVmTkR5UQotLS0g 14 | aURwdHRFcVZJM0RrQ0NsLzFQTUNSWjVCU24rNHIxOXVBVmxaSmU3d0FUVQrNuXSX 15 | L9650Q0UWOdVd6wvXK0AAoV3pGosvteaHEpbPyhWUHEGd244dgXLFJA9SQuzBKQn 16 | 156UisDqjoUzqYl2f0+82CJOzaD44je/7QBWIgAQ5iok3iBC8PSlAvAo/5X5UgBI 17 | HDXtJNPi1jfU 18 | -----END AGE ENCRYPTED FILE----- 19 | -------------------------------------------------------------------------------- /platforms/generators/aws/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.aws; 10 | in 11 | { 12 | 13 | options.aws.enable = lib.mkEnableOption "AWS EC2"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nmasur.presets.services.openssh-aws.enable = lib.mkDefault true; 18 | 19 | # Make sure disk size is large enough 20 | # https://github.com/nix-community/nixos-generators/issues/150 21 | virtualisation.diskSize = lib.mkDefault (16 * 1024); # In MB 22 | 23 | boot.kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_6_6; 24 | boot.loader.systemd-boot.enable = lib.mkForce false; 25 | boot.loader.efi.canTouchEfiVariables = lib.mkForce false; # Default, conflicts with tempest 26 | services.amazon-ssm-agent.enable = lib.mkDefault true; 27 | users.users.ssm-user.extraGroups = [ "wheel" ]; 28 | services.udisks2.enable = lib.mkForce false; # Off by default already; conflicts with gvfs for nautilus 29 | boot.loader.grub.device = lib.mkForce "/dev/xvda"; # Default, conflicts with tempest 30 | boot.loader.grub.efiSupport = lib.mkForce false; # Default, conflicts with tempest 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/restic/s3-glacier.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBuQTZM 3 | TTg0ai9yNi9Ia3pFNW0vb3JQczZtVEVyNkFNVzBlUVpVd3ZBbndrCklqdS8zeGky 4 | WEN0YW5xck5sSXpXeFZCbHY0NHhDMU5SeGlaYmN4Szc0b1EKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIGJVZTZBdERTNUt6d0sxeGVOcnRtNmdCSlRKWUNjRHByMkZucUlz 6 | Nm5FMTQKbHFtNnM4ZCtzdFNTa214ZVRkaFdmZnFYOCs1Z25YTDVVKzloYUVHVlg1 7 | cwotPiBzc2gtZWQyNTUxOSBuanZYNUEgOXFwSzByaUdidFRWbE5seFNEVDYxRWtq 8 | OXZURnEzVWphM0VoVnJvSURoUQpGbEt4YmcraDZOcXRTQUF1ekw4RTRCN2JRR1NK 9 | QlRQaGRZd1RIMWNiRWpjCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBzTTVsbnVjWUxt 10 | L0hyM21RS2w2a2NIY2xvSmZ0OUdDWGFVcG5IYlNhUFNzClY1bmdNUkRYR2QyYVFW 11 | VHF3enZqUlZqUWlvZlI2aHZrREdwZGUwdzdXUHMKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDN4cThQRjdvTWJ2S2FaMjZ0RHlDeElDc1BuU0JDSzlpcFdzT2ZhLzA1QmcK 13 | TjlFMkgzOFhKbkdvUWt2SGhaUUJXdjBxK2hUeE1sSzBsNWJyNG8rUlZRbwotLS0g 14 | SGw4VmpCMktjQ0ZpUExnWUtsOHhHS0tZckoxeTdtZXMyVXpWT09Ea1NUMAoRRzA+ 15 | 0rbfJ+eVeccDaulmqh+Wv3T1/+SQQJYD5trume3vSzXgRxJYeXR/BespsDzWJ3yg 16 | McHYNvEK76stD3vopKvpDU3Nk861xp++SavJtrIVKon6YJl6a6Ox+GxhrNk0+5f9 17 | xgDWhIHwzHLPvyseYNjRFy8GsYaP2tT9TGMrQHFTAKeuvA== 18 | -----END AGE ENCRYPTED FILE----- 19 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/dwarf-fortress.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.dwarf-fortress; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.dwarf-fortress.enable = lib.mkEnableOption "Dwarf Fortress"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | allowUnfreePackages = [ 18 | "dwarf-fortress" 19 | "phoebus-theme" 20 | ]; 21 | environment.systemPackages = 22 | let 23 | dfDesktopItem = pkgs.makeDesktopItem { 24 | name = "dwarf-fortress"; 25 | desktopName = "Dwarf Fortress"; 26 | exec = "${pkgs.dwarf-fortress-packages.dwarf-fortress-full}/bin/dfhack"; 27 | terminal = false; 28 | }; 29 | dtDesktopItem = pkgs.makeDesktopItem { 30 | name = "dwarftherapist"; 31 | desktopName = "Dwarf Therapist"; 32 | exec = "${pkgs.dwarf-fortress-packages.dwarf-fortress-full}/bin/dwarftherapist"; 33 | terminal = false; 34 | }; 35 | in 36 | [ 37 | pkgs.dwarf-fortress-packages.dwarf-fortress-full 38 | dfDesktopItem 39 | dtDesktopItem 40 | ]; 41 | 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /pkgs/tools/misc/default/package.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | pkgs.writeShellScriptBin "default" '' 4 | ${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options" 5 | ${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.' 6 | echo "" 7 | echo "" 8 | ${pkgs.gum}/bin/gum format --type=template -- \ 9 | ' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \ 10 | ' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \ 11 | ' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \ 12 | ' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \ 13 | ' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \ 14 | ' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \ 15 | ' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' 16 | echo "" 17 | echo "" 18 | '' 19 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/programs/steam.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.steam; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.steam.enable = lib.mkEnableOption "Steam game client"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | hardware.steam-hardware.enable = true; 18 | allowUnfreePackages = [ 19 | "steam" 20 | "steam-original" 21 | "steamcmd" 22 | "steam-run" 23 | "steam-unwrapped" 24 | ]; 25 | 26 | programs.steam = { 27 | enable = true; 28 | remotePlay.openFirewall = true; 29 | extraCompatPackages = [ pkgs.proton-ge-bin ]; 30 | gamescopeSession.enable = true; 31 | }; 32 | 33 | environment.systemPackages = with pkgs; [ 34 | 35 | # Enable terminal interaction 36 | steamcmd 37 | steam-tui 38 | 39 | # Overlay with performance monitoring 40 | mangohud 41 | ]; 42 | 43 | # Seems like NetworkManager can help speed up Steam launch 44 | # https://www.reddit.com/r/archlinux/comments/qguhco/steam_startup_time_arch_1451_seconds_fedora_34/hi8opet/ 45 | networking.networkmanager.enable = true; 46 | 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/shared-media.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (config.nmasur.settings) username; 9 | cfg = config.nmasur.profiles.shared-media; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.shared-media.enable = lib.mkEnableOption "shared media groups"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Create a shared group for many services 19 | users.groups.shared = { }; 20 | 21 | # Give the human user access to the shared group 22 | users.users.${username}.extraGroups = [ config.users.groups.shared.name ]; 23 | 24 | services = { 25 | audiobookshelf.group = "shared"; 26 | bazarr.group = "shared"; 27 | jellyfin.group = "shared"; 28 | lidarr.group = "shared"; 29 | radarr.group = "shared"; 30 | readarr.group = "shared"; 31 | sabnzbd.group = "shared"; 32 | slskd.group = "shared"; 33 | sonarr.group = "shared"; 34 | immich.group = "shared"; 35 | calibre-web.group = "shared"; 36 | }; 37 | 38 | # Fix issue where Jellyfin-created directories don't allow access for media group 39 | systemd.services.jellyfin.serviceConfig.UMask = lib.mkForce "0007"; 40 | 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /colorscheme/everforest/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | name = "everforest"; # dark, hard 3 | author = "Sainnhe Park"; 4 | dark = { 5 | base00 = "#2b3339"; # Default Background 6 | base01 = "#323c41"; # Lighter Background 7 | base02 = "#503946"; # Selection Background 8 | base03 = "#868d80"; # Comments, Invisibles, Line Highlighting 9 | base04 = "#d3c6aa"; # Dark Foreground (Used for status bars) 10 | base05 = "#d3c6aa"; # Default Foreground, Caret, Delimiters, Operators 11 | base06 = "#e9e8d2"; # Light Foreground (Not often used) 12 | base07 = "#fff9e8"; # Light Background (Not often used) 13 | base08 = "#7fbbb3"; # Variables, XML Tags, Markup Link Text, ... 14 | base09 = "#d699b6"; # Integers, Boolean, Constants, ... 15 | base0A = "#83c092"; # Classes, Markup Bold, Search Text Background 16 | base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted 17 | base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ... 18 | base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings 19 | base0E = "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed 20 | base0F = "#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ... 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/rofi/rofi-prompt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Credit: https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/scripts/rofi-prompt 4 | 5 | # Rofi powered menu to prompt a message and get a yes/no answer. 6 | # Uses: rofi 7 | 8 | yes='Confirm' 9 | no='Cancel' 10 | query='Are you sure?' 11 | 12 | while [ $# -ne 0 ]; do 13 | case "$1" in 14 | -y | --yes) 15 | [ -n "$2" ] && yes="$2" || yes='' 16 | shift 17 | ;; 18 | 19 | -n | --no) 20 | [ -n "$2" ] && no="$2" || no='' 21 | shift 22 | ;; 23 | 24 | -q | --query) 25 | [ -n "$2" ] && query="$2" 26 | shift 27 | ;; 28 | esac 29 | shift 30 | done 31 | 32 | chosen=$(printf '%s;%s\n' "$yes" "$no" | 33 | rofi -theme-str '@import "prompt.rasi"' \ 34 | -hover-select \ 35 | -me-select-entry "" \ 36 | -me-accept-entry MousePrimary \ 37 | -p "$query" \ 38 | -dmenu \ 39 | -sep ';' \ 40 | -a 0 \ 41 | -u 1 \ 42 | -selected-row 1) 43 | 44 | case "$chosen" in 45 | "$yes") return 0 ;; 46 | *) return 1 ;; 47 | esac 48 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/presets/programs/homebrew.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.homebrew; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.homebrew.enable = 14 | lib.mkEnableOption "Homebrew macOS package manager"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | # Requires Homebrew to be installed 18 | system.activationScripts.preActivation.text = '' 19 | if ! xcode-select --version 2>/dev/null; then 20 | $DRY_RUN_CMD xcode-select --install 21 | fi 22 | if ! /opt/homebrew/bin/brew --version 2>/dev/null; then 23 | $DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 24 | fi 25 | ''; 26 | 27 | homebrew = { 28 | enable = true; 29 | onActivation = { 30 | autoUpdate = false; # Don't update during rebuild 31 | cleanup = "zap"; # Uninstall all programs not declared 32 | upgrade = true; 33 | }; 34 | global = { 35 | brewfile = true; # Run brew bundle from anywhere 36 | lockfiles = false; # Don't save lockfile (since running from anywhere) 37 | }; 38 | }; 39 | 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/fonts.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.fonts; 10 | in 11 | { 12 | 13 | options.nmasur.presets.fonts.enable = lib.mkEnableOption "Font configuration"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | home.packages = [ 18 | pkgs.nerd-fonts.victor-mono # Used for Vim and Terminal 19 | pkgs.nerd-fonts.hack # For Polybar, Rofi 20 | ]; 21 | fonts.fontconfig = { 22 | enable = true; 23 | defaultFonts.monospace = [ "Victor Mono" ]; 24 | }; 25 | 26 | xsession.windowManager.i3.config.fonts = { 27 | names = [ "pango:Victor Mono" ]; 28 | # style = "Regular"; 29 | # size = 11.0; 30 | }; 31 | services.polybar.config."bar/main".font-0 = "Hack Nerd Font:size=10;2"; 32 | programs.rofi.font = "Hack Nerd Font 14"; 33 | programs.alacritty.settings.font.normal.family = "VictorMono"; 34 | programs.kitty.font.name = "VictorMono Nerd Font Mono"; 35 | nmasur.presets.programs.wezterm.font = "VictorMono Nerd Font Mono"; 36 | programs.ghostty.settings.font-family = "VictorMono Nerd Font Mono"; 37 | services.dunst.settings.global.font = "Hack Nerd Font 14"; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/gitsigns.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("", "", "", { silent = true }) 2 | vim.g.mapleader = " " 3 | vim.g.maplocalleader = " " 4 | 5 | local gitsigns = require("gitsigns") 6 | vim.keymap.set("n", "gB", gitsigns.blame_line) 7 | vim.keymap.set("n", "gp", gitsigns.preview_hunk) 8 | vim.keymap.set("v", "gp", gitsigns.preview_hunk) 9 | vim.keymap.set("n", "gd", gitsigns.diffthis) 10 | vim.keymap.set("v", "gd", gitsigns.diffthis) 11 | vim.keymap.set("n", "rgf", gitsigns.reset_buffer) 12 | vim.keymap.set("v", "hs", gitsigns.stage_hunk) 13 | vim.keymap.set("n", "hr", gitsigns.reset_hunk) 14 | vim.keymap.set("v", "hr", gitsigns.reset_hunk) 15 | 16 | -- Navigation 17 | vim.keymap.set("n", "]g", function() 18 | if vim.wo.diff then 19 | return "]g" 20 | end 21 | vim.schedule(function() 22 | gitsigns.next_hunk() 23 | end) 24 | return "" 25 | end, { expr = true }) 26 | 27 | vim.keymap.set("n", "[g", function() 28 | if vim.wo.diff then 29 | return "[g" 30 | end 31 | vim.schedule(function() 32 | gitsigns.prev_hunk() 33 | end) 34 | return "" 35 | end, { expr = true }) 36 | -------------------------------------------------------------------------------- /hosts/x86_64-linux/swan/cloudflared-swan.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBuU1BO 3 | ZGdOVFRTekN3SFRhQWYwcWt6OHpLZXM0aENsQ3d1VWpxYUhXN3k4CnNwNWpQcU90 4 | elR0eWVyMWFUUkhORFRQeVdsdTErWUgzNW9mN1BWS2szbUUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIDRRS0VESG5NNWpxbm1DTjBkY2ExR3I3aE1PUTNVTXBFZ2wwVC9j 6 | WDIrMTgKaXkwWk1xRWp6Z3c3NFZZS0cybHFqcUVRczNMZ05tSmxPNjBlVmRHK2h3 7 | SQotPiBzc2gtZWQyNTUxOSBuanZYNUEgYWI1SkhBZ0Jrb3hzbDRwcnRMeHhGSlpB 8 | aWt5ZmRxaGhmbXFDQWdNamxRbwpXMWo0TjZhbHM3ejFYNVU5WlkxWTJSbVBPOEhr 9 | MUt3akxMU3QzN3Z4M0lFCi0+IHNzaC1lZDI1NTE5IENxSU9VQSA1dmdFRE1QSU55 10 | WUVuOU9OTHJjM0RxVWhmTlEvdk1mNU1iUEwyNlFqRFZvCldleVNGQ1RZdU1tU2J2 11 | dWxGZlVkaDBWNEZRUFNBcEIvTEdkODdDS25GdGsKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IG5SbVpVZldPSkJXYm9BZ3B6OXZXMlB4T2Z5RHptR1pqbVRVUS9LVEZyUzgK 13 | ZlVTZWlUQ2VoWVNuOGE5Wk5vZGdVVldzbUZKRERyUFN0eVJ4TWpmL2gwcwotLS0g 14 | MlJmTlVkdHhHQ25JWm0xVmdjVDFYM1lHaE9WdnJSVkVMMnNwV0c4eXc0QQpYTchD 15 | DCiEm4rOav4/IwK26gSgi2B4qq4RETyAbF4oa87cvFM8zVXo7W8nF+eWzeWGNZrc 16 | yRFfOYf4gtlNCVLc+UAapvM1rKuw1IOQeJLAwGCHygXKWY7zSXdT2ERACXESvCCz 17 | b7W62NVx0Pc4mAAQB3QU995HFVFuHLa939PPPlkgxqepNWCKrmUFl/qjRpOoVrV6 18 | GwRgIo36PhcfZVCswyVXgcc4M3CCG5ZuWInuuljqTB70OzBVkKCaUeiRaRIZJg== 19 | -----END AGE ENCRYPTED FILE----- 20 | -------------------------------------------------------------------------------- /pkgs/applications/editors/neovim/nmasur/neovim/config/colors.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | { 8 | 9 | # Sets Neovim colors based on Nix colorscheme 10 | 11 | options.colors = lib.mkOption { 12 | type = lib.types.nullOr (lib.types.attrsOf lib.types.str); 13 | description = "Attrset of base16 colorscheme key value pairs."; 14 | default = { 15 | # Nord 16 | base00 = "#2E3440"; 17 | base01 = "#3B4252"; 18 | base02 = "#434C5E"; 19 | base03 = "#4C566A"; 20 | base04 = "#D8DEE9"; 21 | base05 = "#E5E9F0"; 22 | base06 = "#ECEFF4"; 23 | base07 = "#8FBCBB"; 24 | base08 = "#88C0D0"; 25 | base09 = "#81A1C1"; 26 | base0A = "#5E81AC"; 27 | base0B = "#BF616A"; 28 | base0C = "#D08770"; 29 | base0D = "#EBCB8B"; 30 | base0E = "#A3BE8C"; 31 | base0F = "#B48EAD"; 32 | }; 33 | }; 34 | 35 | config = lib.mkIf (config.colors != null) { 36 | plugins = [ pkgs.vimPlugins.base16-nvim ]; 37 | setup.base16-colorscheme = config.colors; 38 | 39 | # Telescope isn't working, shut off for now 40 | lua = '' 41 | require('base16-colorscheme').with_config { 42 | telescope = false, 43 | } 44 | ''; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/ntfy-sh.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | let 4 | inherit (config.nmasur.settings) hostnames; 5 | cfg = config.nmasur.presets.services.ntfy-sh; 6 | in 7 | 8 | { 9 | options.nmasur.presets.services.ntfy-sh.enable = lib.mkEnableOption "ntfy notification service"; 10 | 11 | config = lib.mkIf cfg.enable { 12 | services.ntfy-sh = { 13 | enable = true; 14 | settings = { 15 | base-url = "https://${hostnames.notifications}"; 16 | upstream-base-url = "https://ntfy.sh"; 17 | listen-http = ":8333"; 18 | behind-proxy = true; 19 | auth-default-access = "deny-all"; 20 | auth-file = "/var/lib/ntfy-sh/user.db"; 21 | }; 22 | }; 23 | 24 | nmasur.presets.services.caddy.routes = [ 25 | { 26 | match = [ { host = [ hostnames.notifications ]; } ]; 27 | handle = [ 28 | { 29 | handler = "reverse_proxy"; 30 | upstreams = [ { dial = "localhost${config.services.ntfy-sh.settings.listen-http}"; } ]; 31 | } 32 | ]; 33 | } 34 | ]; 35 | 36 | # Configure Cloudflare DNS to point to this machine 37 | services.cloudflare-dyndns.domains = [ hostnames.notifications ]; 38 | 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /hosts/aarch64-linux/flame/cloudflared-flame.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBYY0c1 3 | bldPMVdwRGhia0xzNm1mSGQ0eVVZZzFLMWVUdFhYVW1KY3QwTERJCm1UUDBqN1Jr 4 | VjRlSjROTFZEQ3UrME81Y2FyRkxjZHFvUFN1eEZNa2cwWkUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFM4ZURETk0yQ1NKN3owaDB5S3djeThtWkphS0xUaVd2MnBlS244 6 | d0V5bUUKKzE5UzZYUlpwTy9ydFQ3L2NmWFZBMEZCWWppYlFZQzhTVFhUc3BBRlpR 7 | dwotPiBzc2gtZWQyNTUxOSBuanZYNUEgbS9HaVFFRjU4VzMvSVZ1SlExZ1BBNWxK 8 | RVRESEVmeWxyMW5Pclk5UU4xOApaZ0hHMnlsb1BuMThsTG82d1k1Rm94VEFMcTBH 9 | TFoxRWpRSXJWQUJVWGN3Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBOK1AvRW5nNUlK 10 | NnB1UDhKdmFibTEwV2JhOGxKRGg1SnlMdytXaVQ1eW1NCnVIcjNnclVMSEJ3eDVk 11 | eExnY1EvbWg1OW4xR3FydDlzeUdLQW11UGRmclkKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IHNxbDlpSkpPdEZVRGhwV3NKdTNJV0NTeUZoVVg3b0ZlRWdqelNaTDRWamMK 13 | N1czMXlEcWZzQ1g0dkxBTnNUQjdTdnZMUE9VRGphTjB4SjJyemJiU2w5NAotLS0g 14 | VlgyN24vMGl3a2N6ZGs1SjhOZmttWEl3WEFOK29EOUlkZ0N3blBBcHZQOArP/uJx 15 | SBFvBV0rLzRbo/8nhhizuT2TtKsJSJDIsFJxAOtF8ZwIbYwauBt1tJudtJaXgbv5 16 | JIk53sS3lelOwH11yx0aGcBNCR2UwpuYn1IwoW0qrt3ugi8rmQPRG8c8gSyNn2u7 17 | PnAj/NdAjieLGGLltwdq2wJhkbv800WmKx5sGgPNT1AdBS1b84h5ipQFnFf3Fi0N 18 | FJa9/j5qc7JtWEy4ecU6D03zcZD+CTCoN8SIW4+fldos1u7N2v2X5/YUw7T6jQ== 19 | -----END AGE ENCRYPTED FILE----- 20 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/thelounge.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | let 3 | inherit (config.nmasur.settings) hostnames; 4 | cfg = config.nmasur.presets.services.thelounge; 5 | in 6 | { 7 | 8 | options.nmasur.presets.services.thelounge.enable = lib.mkEnableOption "TheLounge IRC chat service"; 9 | 10 | config = lib.mkIf cfg.enable { 11 | 12 | services.thelounge = { 13 | enable = true; 14 | public = false; 15 | port = 9000; 16 | extraConfig = { 17 | reverseProxy = true; 18 | maxHistory = 10000; 19 | }; 20 | }; 21 | 22 | # Adding new users: 23 | # nix shell nixpkgs#thelounge 24 | # sudo su - thelounge -s /bin/sh -c "thelounge add myuser" 25 | 26 | # Allow web traffic to Caddy 27 | nmasur.presets.services.caddy.routes = [ 28 | { 29 | match = [ { host = [ hostnames.irc ]; } ]; 30 | handle = [ 31 | { 32 | handler = "reverse_proxy"; 33 | upstreams = [ { dial = "localhost:${builtins.toString config.services.thelounge.port}"; } ]; 34 | } 35 | ]; 36 | } 37 | ]; 38 | 39 | # Configure Cloudflare DNS to point to this machine 40 | services.cloudflare-dyndns.domains = [ hostnames.irc ]; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /hosts/x86_64-linux/tempest/cloudflared-tempest.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBMMDZj 3 | dkdOSTc1bHgybjAwcUVHUXFhY0I0NE45K1B5SEh4NGN4T0tpREhjCnViQzVXTVk3 4 | dzB5ZEY5d1hvcHVDSXVubElOdEVQQ0Fja2dnL0ZnVG4wNEUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHRiVkNzRCs4V3EvL2szNG8zSlRYSVloRlVsSTk3a0hnSFMyUzRN 6 | K0lyMzQKWDhIOTVzMGJkaGpVQmNtS0pPQnNTSjRmK1dYck1SUFd5VnVvYnJSWkhs 7 | YwotPiBzc2gtZWQyNTUxOSBuanZYNUEgUy9kWmxsc0p2L0pFWDlPMGlzeVBHNjJ2 8 | a05ycmZtbUJrOXRBVVgxVjVtZwo4RVM3Sms2M2krdjU0K1ZHREhhRkdMcENTbTJr 9 | UEh6cWcvOGNIRUNJZUFvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSA5d0FwTWJzZEpJ 10 | UEJaZi91YXZOOFhGVlVVekEvSVRnK3Y2VFdhL216SVZrCkRURE9OYnIvSGVtMWNl 11 | MWFGSTEwUVBITTlnaWVXc1hpMFpqdFdMcFY2NHMKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDhkUk9KTE1UMysvajY3WEx5MFdLeEdlVnBmSUx6TTlnYWdqaWorYm0rRGMK 13 | SlhaRFNLaTZHVkpRR3U5eE5JOTBPWWM3OTFka1ZWSHJMaFFhZG1CSzNVTQotLS0g 14 | THNSTmNzK3JvbVN5S3RaVlQwdDRiOWFkVGZ3WUtyT2IyMWtPSVNtajF5YwoCUWHU 15 | KSe09W6BaVEW2x0ieBXN6KkL4FNPAP8zCom8fNVjyjAZpxd2t0kisJjJ45xg8eG4 16 | x9sj+hG9EsWIFvVpnF7LUIEXcRMjvRlNXED8HmYR0qzUhc89VQ9N4EoQPJYN1dME 17 | kxAzH8p5HBidxfJLpACaG5QHGb97chJXTDrT+ZKt+hPfZ16OhsKBj2s0gvHbcCQH 18 | sdqQT4+FlJshDiRiauTmqF/umnCnzl4+H4Xe8kLVrZxDOAv1iwuTX8zcaNOFNw== 19 | -----END AGE ENCRYPTED FILE----- 20 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/arr/slskd.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBmaUlP 3 | QTFSRGlKbTVFalppZm9XczhOT2dKTkJpTDVDYTNGZWM2N05NTlRjCjVmUDdBb2VW 4 | M1BVMVlNdnoxWUNOTmkraVdhR3ZRTFJpTjMxT1duYS9HV3cKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIFdzczRSbDgyM3ZGN2tzV1VOeTFsQUtlY00xRWNTaTU5UmxLamFm 6 | NDVkQVEKa3ZkUmx2RnNjSGUwWGh2ZzVqK3JwckMwdy9LMmRBeGZ3Vk5wUHFMYUc3 7 | RQotPiBzc2gtZWQyNTUxOSBuanZYNUEgR3lvZ054YkRaNzg5ZDZBK2NrSElndC9P 8 | YnFUUm83c25hYVdSU2dMSytrWQp4ZWthazZLcVFiMUpoUWp1VEZvZjhlSGxSc0ZO 9 | blJnelkvNlc3aDVTOGQ0Ci0+IHNzaC1lZDI1NTE5IENxSU9VQSBUTHNNTUhwaHJT 10 | aUlxTGwzdHhaRytzc3VpVldMb29WNGQyTUN1VXVOZmhzCnYzWjZzZ055YTJtVE1x 11 | UTB4VjgwMzZzNmg2dVJrUVgxNnNSTXpqbURHaUkKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IFhvR3orWEI0dXVqdGZlbGZyb3FaZ0JGeGdvbE1RSEQwVHNMTU5MLy91WGMK 13 | eldiMlJGeGNJY01OeElBZVNCaTIrMlhibEFZd3pReE5JMWJyMk00Nm9xZwotLS0g 14 | SGpVUzFtMjdHRFlCMmJqMjJJcGl1Z3Z4ZWJXaE9leTVQL016aFAyT3BoRQoM3TpF 15 | 3xJOKidMRbB6bqccVENPZ3Truxk7xMC99xvAL9Z0BmjxzV23Z2Fl58xOSx+p7IdE 16 | HWIfSrfhHqhJwanTSeFTYCGEak/e2bljgP3t2j1jNuTJAyUgRWwJg92nOIVX/Q7m 17 | AbhM0tSWdRD7jipqKFt6vvem+QGH0NhenSTZHdKr5gasqHVP7/10MZGSueqwj/Jm 18 | Q3S1ToPvVyoH8DrXlsMX37Qwxn0fVmLIdOrhEhHPLxxRrwkf7bA6Zpk/gSMT 19 | -----END AGE ENCRYPTED FILE----- 20 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/linux-base.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.linux-base; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.linux-base.enable = lib.mkEnableOption "Base Linux home-manager config"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | # Allow Nix to manage the default applications list 18 | xdg.mimeApps.enable = lib.mkDefault true; 19 | 20 | # Set directories for application defaults 21 | xdg.userDirs = { 22 | enable = lib.mkDefault true; 23 | createDirectories = lib.mkDefault true; 24 | documents = lib.mkDefault "$HOME/documents"; 25 | download = lib.mkDefault "$HOME/downloads"; 26 | music = lib.mkDefault "$HOME/media/music"; 27 | pictures = lib.mkDefault "$HOME/media/images"; 28 | videos = lib.mkDefault "$HOME/media/videos"; 29 | desktop = lib.mkDefault "$HOME/other/desktop"; 30 | publicShare = lib.mkDefault "$HOME/other/public"; 31 | templates = lib.mkDefault "$HOME/other/templates"; 32 | extraConfig = { 33 | XDG_DEV_DIR = lib.mkDefault "$HOME/dev"; 34 | }; 35 | }; 36 | 37 | nmasur.presets.programs = { 38 | doas.enable = lib.mkDefault true; 39 | }; 40 | 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/gtk.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.gtk; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.gtk = { 15 | enable = lib.mkEnableOption "Gnome GTK settings"; 16 | theme = { 17 | name = lib.mkOption { 18 | type = lib.types.str; 19 | default = "Adwaita-dark"; 20 | }; 21 | package = lib.mkPackageOption pkgs "gnome-themes-extra" { }; 22 | }; 23 | }; 24 | 25 | config = lib.mkIf cfg.enable { 26 | # Cursor 27 | home.pointerCursor = { 28 | name = "Adwaita"; 29 | package = pkgs.adwaita-icon-theme; 30 | size = 24; 31 | gtk.enable = true; 32 | x11.enable = true; 33 | }; 34 | 35 | # Enable num lock on login 36 | xsession.numlock.enable = true; 37 | 38 | # Dark theme 39 | gtk = { 40 | enable = true; 41 | theme = { 42 | name = cfg.theme.name; 43 | package = cfg.theme.package; 44 | }; 45 | gtk3.extraConfig = { 46 | gtk-application-prefer-dark-theme = config.theme.mode == "dark"; 47 | }; 48 | gtk4.extraConfig = { 49 | gtk-application-prefer-dark-theme = config.theme.mode == "dark"; 50 | }; 51 | }; 52 | 53 | }; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/karakeep.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.karakeep; 9 | inherit (config.nmasur.settings) hostnames; 10 | in 11 | 12 | { 13 | options.nmasur.presets.services.karakeep.enable = lib.mkEnableOption "Karakeep bookmark manager"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | services.karakeep = { 17 | enable = true; 18 | meilisearch.enable = true; 19 | extraEnvironment = { 20 | PORT = "5599"; 21 | DISABLE_SIGNUPS = "true"; 22 | DISABLE_NEW_RELEASE_CHECK = "true"; 23 | CRAWLER_FULL_PAGE_SCREENSHOT = "true"; 24 | CRAWLER_FULL_PAGE_ARCHIVE = "true"; 25 | }; 26 | }; 27 | 28 | nmasur.presets.services.caddy.routes = [ 29 | { 30 | match = [ { host = [ hostnames.bookmarks ]; } ]; 31 | handle = [ 32 | { 33 | handler = "reverse_proxy"; 34 | upstreams = [ 35 | { dial = "localhost:${config.services.karakeep.extraEnvironment.PORT}"; } 36 | ]; 37 | } 38 | ]; 39 | } 40 | ]; 41 | 42 | # Configure Cloudflare DNS to point to this machine 43 | services.cloudflare-dyndns.domains = [ hostnames.bookmarks ]; 44 | 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /hosts/x86_64-linux/hydra/default.nix: -------------------------------------------------------------------------------- 1 | # The Hydra 2 | # System configuration for WSL 3 | 4 | rec { 5 | # Hardware 6 | networking.hostName = "hydra"; 7 | 8 | nmasur.settings = { 9 | username = "noah"; 10 | fullName = "Noah Masur"; 11 | }; 12 | 13 | nmasur.profiles = { 14 | base.enable = true; 15 | wsl.enable = true; 16 | }; 17 | 18 | home-manager.users."noah" = { 19 | nmasur.settings = { 20 | username = nmasur.settings.username; 21 | fullName = nmasur.settings.fullName; 22 | host = networking.hostName; 23 | }; 24 | nmasur.profiles = { 25 | common.enable = true; 26 | linux-base.enable = true; 27 | power-user.enable = true; 28 | }; 29 | home.stateVersion = "23.05"; 30 | }; 31 | 32 | system.stateVersion = "23.05"; 33 | 34 | # This is the root filesystem containing NixOS 35 | fileSystems."/" = { 36 | device = "/dev/disk/by-label/nixos"; 37 | fsType = "ext4"; 38 | }; 39 | 40 | # This is the boot filesystem for Grub 41 | fileSystems."/boot" = { 42 | device = "/dev/disk/by-label/boot"; 43 | fsType = "vfat"; 44 | }; 45 | 46 | # Not sure what's necessary but too afraid to remove anything 47 | boot.initrd.availableKernelModules = [ 48 | "xhci_pci" 49 | "ahci" 50 | "nvme" 51 | "usb_storage" 52 | "sd_mod" 53 | ]; 54 | } 55 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/n8n.nix: -------------------------------------------------------------------------------- 1 | # n8n is an automation integration tool for connecting data from services 2 | # together with triggers. 3 | 4 | { config, lib, ... }: 5 | let 6 | inherit (config.nmasur.settings) hostnames; 7 | cfg = config.nmasur.presets.services.n8n; 8 | in 9 | 10 | { 11 | 12 | options.nmasur.presets.services.n8n.enable = lib.mkEnableOption "n8n low-code automation tool"; 13 | 14 | config = lib.mkIf cfg.enable { 15 | 16 | allowUnfreePackages = [ "n8n" ]; 17 | 18 | services.n8n = { 19 | enable = true; 20 | environment = { 21 | N8N_LISTEN_ADDRESS = "127.0.0.1"; 22 | N8N_PORT = 5678; 23 | N8N_EDITOR_BASE_URL = "https://${hostnames.n8n}"; 24 | }; 25 | }; 26 | 27 | # Configure Cloudflare DNS to point to this machine 28 | services.cloudflare-dyndns.domains = [ hostnames.n8n ]; 29 | 30 | # Allow web traffic to Caddy 31 | nmasur.presets.services.caddy.routes = [ 32 | { 33 | match = [ { host = [ hostnames.n8n ]; } ]; 34 | handle = [ 35 | { 36 | handler = "reverse_proxy"; 37 | upstreams = [ 38 | { dial = "localhost:${builtins.toString config.services.n8n.environment.N8N_PORT}"; } 39 | ]; 40 | } 41 | ]; 42 | } 43 | ]; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/navidrome/navidrome-integrations.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBwVzM0 3 | bElnSVdUTjFBT1BEWEJrUDRXMHNIVVVLbEJLNFFVcFZHcUlVcDNJCllmTWpNWDJz 4 | ckVyMGV2T1VUbnZHejNqOGdBdEh6TEU2MnNPeTM1aVFlaDgKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIE1DR1BjdlZ5eUxQZlBaTXNUN2ZhcjRMSk1IcXlEMWRxRHBzL29o 6 | YWl5Z28KREU0YUcwZ3JrZDFNN3FBUWJDUnVoRjlSQ0x0aDVEWWhBZnVGR3pGbFBO 7 | SQotPiBzc2gtZWQyNTUxOSBuanZYNUEganNXRDBESFM0MGN4WjlQSmgxNlRMU2tD 8 | YW5LS05PNEpIakFjQW1yV3VsWQp0d0VCdUdyY1VLd0RIcmQ0RkQ5QkE5bWZhZnBk 9 | REIwYW5rMFl2VysxVjQwCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBnYm1TYU5rQkFH 10 | UDVrQ0NkVTBmV3A3ektyVWt4Y3E4V2ZwUS9KZFpkcjFBCmZtd3FBSnN4K2o4QTFE 11 | cEFCRHRiWjlZeDBQZFdVNmt6UkZQM3BDMlhCdkUKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IFJoaFp1azcvbllXdUxLSVhkclh6cmgrL1psOUlqNUZjRkNvZTNIdVp4eGcK 13 | VWczN01seXhueEprQ3lVeE9Eazg2MGRjK0ZkMkpSQ3FoMFU2QURLZ0EzMAotLS0g 14 | eng3TnlPeVI5L2FCWWpVM29iRGM2Ynpnck1yZlJSbExZL1NrME5qV3Y5RQoUmoxB 15 | ehmbWdeYxoPQ+lNcQn6U84J2hsdB6PvEwDMLlCwwSeMJD8lJfH5MBzp4Mok2aFpM 16 | WPdgVtWdo5AOqOJWv8iU4HJpvcNQCiUfCKjG4DpdS1xcZcgEj1RIxPjB1z2if49s 17 | Vcnxe1My6ZGCu99AD9U2haJb40ZyjRotHhmDZ6TYZU277qaoWwGnDG/ZgRortN3W 18 | I4iS4bfn+KUflctnir5cRxcLFRDj9+ut+USHBO0hTCldckTEGFnlG8En0EjR4emH 19 | QNhp5oz9jJK6p+mjnJFPGXOPTVnrsRkjAfQAsUZa8DdKJw== 20 | -----END AGE ENCRYPTED FILE----- 21 | -------------------------------------------------------------------------------- /platforms/nix-darwin/modules/nmasur/profiles/base.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.base; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.base.enable = lib.mkEnableOption "base macOS config"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | system.primaryUser = config.nmasur.settings.username; 18 | 19 | nmasur.presets = { 20 | programs = { 21 | fish.enable = lib.mkDefault true; 22 | homebrew.enable = lib.mkDefault true; 23 | }; 24 | services = { 25 | dock.enable = lib.mkDefault true; 26 | finder.enable = lib.mkDefault true; 27 | hammerspoon.enable = lib.mkDefault true; 28 | menubar.enable = lib.mkDefault true; 29 | nix.enable = lib.mkDefault true; 30 | settings.enable = lib.mkDefault true; 31 | user.enable = lib.mkDefault true; 32 | }; 33 | }; 34 | 35 | homebrew.brews = [ 36 | "trash" # Delete files and folders to trash instead of rm 37 | ]; 38 | homebrew.casks = [ 39 | "scroll-reverser" # Different scroll style for mouse vs. trackpad 40 | "notunes" # Don't launch Apple Music with the play button 41 | "topnotch" # Darkens the menu bar to complete black 42 | "ghostty" # Terminal application (not buildable on Nix on macOS) 43 | ]; 44 | 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/filebrowser.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | let 7 | inherit (config.nmasur.settings) hostnames; 8 | cfg = config.nmasur.presets.services.filebrowser; 9 | in 10 | { 11 | 12 | options.nmasur.presets.services.filebrowser.enable = lib.mkEnableOption "Filebrowser private files"; 13 | 14 | config = lib.mkIf cfg.enable { 15 | 16 | nmasur.services.filebrowser = { 17 | enable = true; 18 | # Generate password: htpasswd -nBC 10 "" | tr -d ':\n' 19 | passwordHash = "$2y$10$ze1cMob0k6pnXRjLowYfZOVZWg4G.dsPtH3TohbUeEbI0sdkG9.za"; 20 | # settings = { 21 | # database = "/var/lib/filebrowser/filebrowser.db"; 22 | # port = 8020; 23 | # address = "localhost"; 24 | # log = "stdout"; 25 | # "auth.method" = "json"; 26 | # }; 27 | }; 28 | 29 | nmasur.presets.services.caddy.routes = [ 30 | { 31 | match = [ { host = [ hostnames.files ]; } ]; 32 | handle = [ 33 | { 34 | handler = "reverse_proxy"; 35 | upstreams = [ 36 | { dial = "localhost:8020"; } 37 | ]; 38 | } 39 | ]; 40 | } 41 | ]; 42 | 43 | # Configure Cloudflare DNS to point to this machine 44 | services.cloudflare-dyndns.domains = [ hostnames.files ]; 45 | 46 | }; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/common.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.common; 10 | in 11 | { 12 | options.nmasur.profiles.common.enable = lib.mkEnableOption "Common home-manager config"; 13 | 14 | config = lib.mkIf cfg.enable { 15 | 16 | home.username = config.nmasur.settings.username; 17 | home.homeDirectory = 18 | if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}"; 19 | 20 | home.packages = [ 21 | pkgs.dig # DNS lookup 22 | pkgs.fd # find 23 | pkgs.htop # Show system processes 24 | pkgs.killall # Force quit 25 | pkgs.inetutils # Includes telnet, whois 26 | pkgs.jq # JSON manipulation 27 | pkgs.rsync # Copy folders 28 | pkgs.ripgrep # grep 29 | pkgs.sd # sed 30 | pkgs.unzip # Extract zips 31 | ]; 32 | 33 | nmasur.presets = { 34 | programs = { 35 | bat.enable = lib.mkDefault true; 36 | chawan.enable = lib.mkDefault true; 37 | fd.enable = lib.mkDefault true; 38 | ripgrep.enable = lib.mkDefault true; 39 | starship.enable = lib.mkDefault true; 40 | nixpkgs.enable = lib.mkDefault true; 41 | }; 42 | services = { 43 | loadkey.enable = lib.mkDefault true; 44 | }; 45 | }; 46 | 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /colorscheme/gruvbox/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | name = "gruvbox"; # Dark, Medium 3 | author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)"; 4 | dark = { 5 | base00 = "#282828"; # ---- 6 | base01 = "#3c3836"; # --- 7 | base02 = "#504945"; # -- 8 | base03 = "#665c54"; # - 9 | base04 = "#bdae93"; # + 10 | base05 = "#d5c4a1"; # ++ 11 | base06 = "#ebdbb2"; # +++ 12 | base07 = "#fbf1c7"; # ++++ 13 | base08 = "#fb4934"; # red 14 | base09 = "#fe8019"; # orange 15 | base0A = "#fabd2f"; # yellow 16 | base0B = "#b8bb26"; # green 17 | base0C = "#8ec07c"; # aqua/cyan 18 | base0D = "#83a598"; # blue 19 | base0E = "#d3869b"; # purple 20 | base0F = "#d65d0e"; # brown 21 | batTheme = "gruvbox-dark"; 22 | }; 23 | light = { 24 | base00 = "#fbf1c7"; # ---- 25 | base01 = "#ebdbb2"; # --- 26 | base02 = "#d5c4a1"; # -- 27 | base03 = "#bdae93"; # - 28 | base04 = "#665c54"; # + 29 | base05 = "#504945"; # ++ 30 | base06 = "#3c3836"; # +++ 31 | base07 = "#282828"; # ++++ 32 | base08 = "#9d0006"; # red 33 | base09 = "#af3a03"; # orange 34 | base0A = "#b57614"; # yellow 35 | base0B = "#79740e"; # green 36 | base0C = "#427b58"; # aqua/cyan 37 | base0D = "#076678"; # blue 38 | base0E = "#8f3f71"; # purple 39 | base0F = "#d65d0e"; # brown 40 | batTheme = "gruvbox-light"; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /templates/poetry/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Python project flake"; 3 | inputs = { 4 | nixpkgs.url = "github:NixOS/nixpkgs"; 5 | poetry2nix.url = "github:nix-community/poetry2nix"; 6 | }; 7 | outputs = 8 | { nixpkgs, poetry2nix, ... }: 9 | let 10 | projectDir = ./.; 11 | supportedSystems = [ 12 | "x86_64-linux" 13 | "x86_64-darwin" 14 | "aarch64-linux" 15 | "aarch64-darwin" 16 | ]; 17 | forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 18 | in 19 | { 20 | packages = forAllSystems ( 21 | system: 22 | let 23 | pkgs = import nixpkgs { 24 | inherit system; 25 | overlays = [ poetry2nix.overlays.default ]; 26 | }; 27 | in 28 | { 29 | default = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; }; 30 | } 31 | ); 32 | devShells = forAllSystems ( 33 | system: 34 | let 35 | pkgs = import nixpkgs { 36 | inherit system; 37 | overlays = [ poetry2nix.overlays.default ]; 38 | }; 39 | in 40 | { 41 | default = pkgs.mkShell { 42 | buildInputs = [ 43 | (pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; }) 44 | pkgs.poetry 45 | ]; 46 | }; 47 | } 48 | ); 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/cloudflare/letsencrypt-key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBCc2hS 3 | RUw4Y200allVODI0QTYxdXlHSHRiS1pWWHg5SW9tZ0tGVmc2ajJZCitXeEd0dk9K 4 | MmRkZlRYd253RWFzNXpUR0xuTXI2dWVhNFZpQnNlU0VFdEUKLT4gc3NoLWVkMjU1 5 | MTkgWXlTVU1RIHNScVkwd1RmVGhNcFVSRTlxQzlvSUc2cGxNWUc0YVJ5RjRydk9J 6 | RG1peDQKVU5iN1ZmWEJyOXBiNWdiRFlnNFFKR09vaFB4SWZWK0x3VWJwMDZtYlBj 7 | MAotPiBzc2gtZWQyNTUxOSBuanZYNUEgSXR5OEk5cWZHUEZ3WmFCUTVFeTBnTG5h 8 | cmNxVWFLV2JhUTRBaUJGWERncwpYMFBIN0kySXdjOE5YcS85bXRCRnRsK3NyMHY4 9 | N0JKelFyeHB6T1dEZ2VnCi0+IHNzaC1lZDI1NTE5IENxSU9VQSAyQVJYRXJ1cFVl 10 | dldaa0Qydlc3MzlFYnN5YUx0amdWZm5PcWovRm1MaVg0CkJsSFZRdGJIZzA1T0Ny 11 | bUNnL0Zxa05ubHluSVBUenVCZTZpYlA5UUFEMDQKLT4gc3NoLWVkMjU1MTkgejFP 12 | Y1p3IDFPQU5HZm5mRFl5NnNLVHUvdUlmTEtyS0djNWZaMWg5VDl1ZldNTkVWbXMK 13 | RkVBTzNUa0d6c3NJUHQrazdKWXNZY3NIRzRndGdRNjFjMXZCSEhIQnIyYwotLS0g 14 | VzNOa3dXS0hrMWxNUlJ4UzAxNlkzSXM4RWc1RGFzQjFyb1dGZXFnL3RCVQoq002V 15 | S5MQqBjKKOacO4OWgn5KpmU2D7zJWJjNMxH80L6HFNoyOj4wNa+8TA0Q7MTn3bKN 16 | YvAuwbDAGjjDt8vZFKOiZB0xAex+H7A1MVvuGIA8xQa6iNBMwj7nWTLif5pCbVk+ 17 | 9aAAprcJVDJx4TeFXlNF6XtcQ3J8abwi6TDqNFpfwwBb/wruyzutgvlOiz1XSBX0 18 | xlCGckq/BCnItLURIb7zhqRMqk/JODPjOKArmP86nCq25Wm+W5JQ8ViQ7LHJyoFj 19 | zbiwabqeBJZgqoVdVMj8Glz+91RVodn6f9VwQcHINgHxmkd6j2z75AmWZecwD2ic 20 | pUMnikqIMI0B3zW5H38t2cJv+aIMTl7lH5Hf1P5jEn3NPw== 21 | -----END AGE ENCRYPTED FILE----- 22 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/calendar.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs.calendar; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs.calendar = { 15 | enable = lib.mkEnableOption "Calendar application"; 16 | username = lib.mkOption { 17 | type = lib.types.str; 18 | description = "Username for the calendar service backend"; 19 | default = config.nmasur.settings.username; 20 | }; 21 | hostname = lib.mkOption { 22 | type = lib.types.str; 23 | description = "Hostname for the calendar service backend"; 24 | }; 25 | url = lib.mkOption { 26 | type = lib.types.str; 27 | description = "Username for the calendar service backend"; 28 | default = "https://${cfg.hostname}/remote.php/dav/principals/users/${cfg.username}"; 29 | }; 30 | }; 31 | 32 | config = lib.mkIf cfg.enable { 33 | 34 | accounts.calendar.accounts.default = { 35 | basePath = "other/calendars"; # Where to save calendars in ~ directory 36 | name = "personal"; 37 | local.type = "filesystem"; 38 | primary = true; 39 | remote = { 40 | passwordCommand = [ "" ]; 41 | type = "caldav"; 42 | url = cfg.url; 43 | userName = cfg.username; 44 | }; 45 | }; 46 | 47 | home.packages = [ pkgs.gnome-calendar ]; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/atuin.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.programs.atuin; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.programs.atuin.enable = lib.mkEnableOption "Atuin shell history sync"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | programs.atuin = { 17 | enable = true; 18 | daemon.enable = true; 19 | flags = [ 20 | "--disable-up-arrow" 21 | "--disable-ctrl-r" 22 | ]; 23 | settings = { 24 | auto_sync = true; 25 | update_check = false; 26 | sync_address = "https://api.atuin.sh"; 27 | search_mode = "fuzzy"; 28 | filter_mode = "host"; # global, host, session, directory 29 | search_mode_shell_up_key_binding = "fuzzy"; 30 | filter_mode_shell_up_key_binding = "session"; 31 | style = "compact"; # or auto,full 32 | show_help = true; 33 | history_filter = [ ]; 34 | secrets_filter = true; 35 | enter_accept = false; 36 | keymap_mode = "vim-normal"; 37 | records = true; # Sync v2 38 | }; 39 | }; 40 | 41 | nmasur.presets.programs.fish.fish_user_key_bindings = # fish 42 | '' 43 | # Ctrl-h 44 | bind -M insert \ch '_atuin_search --filter-mode global' 45 | bind -M default \ch '_atuin_search --filter-mode global' 46 | ''; 47 | 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/profiles/darwin-base.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.profiles.darwin-base; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.profiles.darwin-base.enable = lib.mkEnableOption "Base macOS home-manager config"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | nmasur.presets = { 19 | fonts.enable = lib.mkDefault true; 20 | services.hammerspoon.enable = lib.mkDefault true; 21 | programs.nixpkgs-darwin.enable = lib.mkDefault true; 22 | programs.mpv.enable = lib.mkDefault true; 23 | }; 24 | 25 | home.homeDirectory = lib.mkForce "/Users/${config.home.username}"; 26 | 27 | # Default shell setting doesn't work 28 | home.sessionVariables = { 29 | SHELL = "${pkgs.fish}/bin/fish"; 30 | }; 31 | 32 | # Used for aerc 33 | xdg.enable = lib.mkDefault pkgs.stdenv.isDarwin; 34 | 35 | programs.fish.shellAbbrs.t = "trash"; 36 | 37 | # Add homebrew paths to CLI path 38 | home.sessionPath = [ 39 | "/opt/homebrew/bin/" 40 | "/opt/homebrew/opt/trash/bin" 41 | ]; 42 | 43 | home.packages = [ 44 | pkgs.noti # Create notifications programmatically 45 | pkgs.ice-bar # Menu bar hiding 46 | ]; 47 | }; 48 | 49 | # Fix for: 'Error: HOME is set to "/var/root" but we expect "/var/empty"' 50 | # home-manager.users.root.home.homeDirectory = lib.mkForce "/var/root"; 51 | } 52 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/zfs.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.zfs; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.zfs.enable = lib.mkEnableOption "ZFS file system"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | 18 | # Only use compatible Linux kernel, since ZFS can be behind 19 | boot.kernelPackages = pkgs.linuxPackages; # Defaults to latest LTS 20 | boot.kernelParams = [ "nohibernate" ]; # ZFS does not work with hibernation 21 | boot.supportedFilesystems = [ "zfs" ]; 22 | services.prometheus.exporters.zfs.enable = true; 23 | nmasur.presets.services.prometheus-exporters.scrapeTargets = [ 24 | "127.0.0.1:${builtins.toString config.services.prometheus.exporters.zfs.port}" 25 | ]; 26 | 27 | zramSwap.enable = true; 28 | swapDevices = [ 29 | { 30 | device = "/swapfile"; 31 | size = 4 * 1024; # 4 GB 32 | } 33 | ]; 34 | 35 | boot.zfs = { 36 | # Automatically load the ZFS pool on boot 37 | extraPools = [ "tank" ]; 38 | # Only try to decrypt datasets with keyfiles 39 | requestEncryptionCredentials = [ 40 | "tank/archive" 41 | "tank/generic" 42 | "tank/nextcloud" 43 | "tank/generic/git" 44 | "tank/images" 45 | ]; 46 | # If password is requested and fails, continue to boot eventually 47 | passwordTimeout = 300; 48 | }; 49 | 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/profiles/nas.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.profiles.nas; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.profiles.nas.enable = lib.mkEnableOption "NAS (storage device) configuration"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | nmasur.presets = { 18 | zfs.enable = lib.mkDefault true; 19 | programs = { 20 | msmtp.enable = lib.mkDefault true; 21 | slsk-batchdl.enable = lib.mkDefault true; 22 | }; 23 | services = { 24 | arrs.enable = lib.mkDefault true; 25 | audiobookshelf.enable = lib.mkDefault true; 26 | bind.enable = lib.mkDefault true; 27 | caddy.enable = lib.mkDefault true; 28 | calibre-web.enable = lib.mkDefault true; 29 | cloudflared.enable = lib.mkDefault true; 30 | cloudflare.enable = lib.mkDefault true; 31 | filebrowser.enable = lib.mkDefault true; 32 | immich.enable = lib.mkDefault true; 33 | jellyfin.enable = lib.mkDefault true; 34 | litestream.enable = lib.mkDefault true; 35 | navidrome.enable = lib.mkDefault true; 36 | nextcloud.enable = lib.mkDefault true; 37 | nix-autoupgrade.enable = lib.mkDefault false; # Off by default for NAS 38 | paperless.enable = lib.mkDefault true; 39 | postgresql.enable = lib.mkDefault true; 40 | samba.enable = lib.mkDefault true; 41 | }; 42 | }; 43 | 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /platforms/home-manager/modules/nmasur/presets/programs/_1password.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | cfg = config.nmasur.presets.programs._1password; 10 | in 11 | 12 | { 13 | 14 | options.nmasur.presets.programs._1password.enable = lib.mkEnableOption "1Password password manager"; 15 | 16 | config = lib.mkIf cfg.enable { 17 | allowUnfreePackages = [ 18 | "1password" 19 | "_1password-gui" 20 | "1password-cli" 21 | "onepassword-password-manager" # Firefox extension 22 | ]; 23 | home.packages = [ 24 | pkgs._1password-cli 25 | ] ++ (if pkgs.stdenv.isLinux then [ pkgs._1password-gui ] else [ ]); 26 | 27 | # Firefox extension 28 | programs.firefox.profiles.default.extensions.packages = [ 29 | pkgs.nur.repos.rycee.firefox-addons.onepassword-password-manager 30 | ]; 31 | }; 32 | 33 | # # https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app 34 | # # On Mac, does not apply: https://1password.community/discussion/142794/app-and-browser-integration 35 | # # However, the button doesn't work either: 36 | # # https://1password.community/discussion/140735/extending-support-for-trusted-web-browsers 37 | # environment.etc."1password/custom_allowed_browsers".text = '' 38 | # ${ 39 | # config.home-manager.users.${config.user}.programs.firefox.package 40 | # }/Applications/Firefox.app/Contents/MacOS/firefox 41 | # firefox 42 | # ''; 43 | } 44 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/grub.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.nmasur.presets.services.grub; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.grub.enable = lib.mkEnableOption "Grub bootloader"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | boot.loader = { 18 | grub = { 19 | enable = true; 20 | 21 | # Not sure what this does, but it involves the UEFI/BIOS 22 | efiSupport = true; 23 | 24 | # Check for other OSes and make them available 25 | useOSProber = true; 26 | 27 | # Attempt to display GRUB on widescreen monitor 28 | gfxmodeEfi = "1920x1080"; 29 | 30 | # Limit the total number of configurations to rollback 31 | configurationLimit = 25; 32 | 33 | # Install GRUB onto the boot disk 34 | # device = config.fileSystems."/boot".device; 35 | 36 | # Don't install GRUB, required for UEFI? 37 | device = "nodev"; 38 | 39 | # Display menu indefinitely if holding shift key 40 | extraConfig = '' 41 | if keystatus --shift ; then 42 | set timeout=-1 43 | else 44 | set timeout=3 45 | fi 46 | ''; 47 | }; 48 | 49 | # Always display menu indefinitely; default is 5 seconds 50 | # timeout = null; 51 | 52 | # Allows GRUB to interact with the UEFI/BIOS I guess 53 | efi.canTouchEfiVariables = true; 54 | }; 55 | }; 56 | } 57 | -------------------------------------------------------------------------------- /pkgs/applications/misc/volnoti/package.nix: -------------------------------------------------------------------------------- 1 | # Fix: Volnoti error: 'volnoti' has been removed due to lack of maintenance upstream. 2 | 3 | { pkgs, lib, ... }: 4 | pkgs.stdenv.mkDerivation { 5 | pname = "volnoti"; 6 | version = "2013-09-23"; 7 | src = pkgs.fetchFromGitHub { 8 | owner = "davidbrazdil"; 9 | repo = "volnoti"; 10 | rev = "4af7c8e54ecc499097121909f02ecb42a8a60d24"; 11 | sha256 = "155lb7w563dkdkdn4752hl0zjhgnq3j4cvs9z98nb25k1xpmpki7"; 12 | }; 13 | patches = [ 14 | # Fix dbus interface headers. See 15 | # https://github.com/davidbrazdil/volnoti/pull/10 16 | (pkgs.fetchpatch { 17 | url = "https://github.com/davidbrazdil/volnoti/commit/623ad8ea5c3ac8720d00a2ced4b6163aae38c119.patch"; 18 | sha256 = "046zfdjmvhb7jrsgh04vfgi35sgy1zkrhd3bzdby3nvds1wslfam"; 19 | }) 20 | ]; 21 | nativeBuildInputs = with pkgs; [ 22 | pkg-config 23 | autoreconfHook 24 | wrapGAppsHook3 25 | ]; 26 | buildInputs = with pkgs; [ 27 | dbus 28 | gdk-pixbuf 29 | glib 30 | xorg.libX11 31 | gtk2 32 | dbus-glib 33 | librsvg 34 | ]; 35 | meta = with lib; { 36 | description = "Lightweight volume notification for Linux"; 37 | homepage = "https://github.com/davidbrazdil/volnoti"; 38 | license = licenses.gpl3; 39 | platforms = platforms.linux; 40 | maintainers = [ ]; 41 | # Broken by https://github.com/nix-community/home-manager/pull/5725/commits/98bf8de65dc1ed12c6443b18f6f24d36e9c438d6 42 | mainProgram = "volnoti"; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /platforms/nixos/modules/services/betterlockscreen.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (config.nmasur.settings) username; 10 | cfg = config.services.betterlockscreen; 11 | # Disable Dunst so that it's not attempting to reach a non-existent dunst service 12 | betterlockscreen = pkgs.betterlockscreen.override { withDunst = cfg.dunst.enable; }; 13 | in 14 | 15 | { 16 | 17 | options.services.betterlockscreen = { 18 | enable = lib.mkEnableOption "Betterlockscreen X server display lock"; 19 | dunst.enable = lib.mkEnableOption "Dunst integration"; 20 | }; 21 | 22 | config = lib.mkIf cfg.enable { 23 | 24 | programs.i3lock.enable = true; # Required for unlocking to work 25 | 26 | # Ref: https://github.com/betterlockscreen/betterlockscreen/blob/next/system/betterlockscreen%40.service 27 | systemd.services.lock = { 28 | enable = true; 29 | description = "Lock the screen on resume from suspend"; 30 | before = [ 31 | "sleep.target" 32 | "suspend.target" 33 | ]; 34 | serviceConfig = { 35 | User = username; 36 | Type = "simple"; 37 | Environment = "DISPLAY=:0"; 38 | TimeoutSec = "infinity"; 39 | ExecStart = "${lib.getExe betterlockscreen} --lock --display 1 --blur 0.5 --span"; 40 | ExecStartPost = "${lib.getExe' pkgs.coreutils-full "sleep"} 1"; 41 | }; 42 | wantedBy = [ 43 | "sleep.target" 44 | "suspend.target" 45 | ]; 46 | }; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/openssh.nix: -------------------------------------------------------------------------------- 1 | # SSHD service for allowing SSH access to my machines. 2 | 3 | { 4 | config, 5 | lib, 6 | ... 7 | }: 8 | 9 | let 10 | inherit (config.nmasur.settings) username; 11 | cfg = config.nmasur.presets.services.openssh; 12 | in 13 | { 14 | 15 | options.nmasur.presets.services.openssh = { 16 | enable = lib.mkEnableOption "OpenSSH remote access service"; 17 | publicKeys = lib.mkOption { 18 | type = lib.types.nullOr (lib.types.listOf lib.types.str); 19 | description = "Public SSH keys authorized for this system."; 20 | default = [ 21 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal" 22 | ]; 23 | }; 24 | # permitRootLogin = lib.mkOption { 25 | # type = lib.types.str; 26 | # description = "Root login settings."; 27 | # default = "no"; 28 | # }; 29 | }; 30 | 31 | config = lib.mkIf cfg.enable { 32 | services.openssh = { 33 | enable = true; 34 | ports = [ 22 ]; 35 | allowSFTP = true; 36 | settings = { 37 | GatewayPorts = "no"; 38 | X11Forwarding = false; 39 | PasswordAuthentication = false; 40 | PermitRootLogin = "no"; 41 | }; 42 | }; 43 | 44 | users.users.${username}.openssh.authorizedKeys.keys = lib.mkIf ( 45 | cfg.publicKeys != null 46 | ) cfg.publicKeys; 47 | 48 | # Add terminfo for SSH from popular terminal emulators 49 | environment.enableAllTerminfo = true; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /platforms/nixos/modules/nmasur/presets/services/navidrome/navidrome.nix: -------------------------------------------------------------------------------- 1 | # Navidrome is a self-hosted music streaming service. This means I can play 2 | # files from my server to devices. 3 | 4 | { config, lib, ... }: 5 | 6 | let 7 | inherit (config.nmasur.settings) hostnames; 8 | cfg = config.nmasur.presets.services.navidrome; 9 | in 10 | 11 | { 12 | 13 | options.nmasur.presets.services.navidrome.enable = lib.mkEnableOption "Navidrome music streaming"; 14 | 15 | config = lib.mkIf cfg.enable { 16 | 17 | secrets.navidrome-integrations = { 18 | source = ./navidrome-integrations.age; 19 | dest = "/var/private/navidrome-integrations"; 20 | }; 21 | 22 | services.navidrome = { 23 | enable = true; 24 | settings = { 25 | MusicFolder = "/data/audio/music"; 26 | EnableInsightsCollector = false; 27 | }; 28 | environmentFile = config.secrets.navidrome-integrations.dest; 29 | }; 30 | 31 | # Configure Cloudflare DNS to point to this machine 32 | services.cloudflare-dyndns.domains = [ hostnames.navidrome ]; 33 | 34 | # Allow web traffic to Caddy 35 | nmasur.presets.services.caddy.routes = [ 36 | { 37 | match = [ { host = [ hostnames.navidrome ]; } ]; 38 | handle = [ 39 | { 40 | handler = "reverse_proxy"; 41 | upstreams = [ 42 | { dial = "localhost:${builtins.toString config.services.navidrome.settings.Port}"; } 43 | ]; 44 | } 45 | ]; 46 | } 47 | ]; 48 | }; 49 | } 50 | --------------------------------------------------------------------------------