From 7597938a1eb39c6ef68966c6d60f23732c9cf3ed Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Sat, 22 Nov 2025 15:54:03 +0100 Subject: [PATCH] init flake --- .gitignore | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 52 +++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 .gitignore create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fef1ed0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,103 @@ +# Created by https://www.toptal.com/developers/gitignore/api/linux,windows,macos,vim,direnv +# Edit at https://www.toptal.com/developers/gitignore?templates=linux,windows,macos,vim,direnv,nix + +### direnv ### +.direnv +.envrc + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +#!! ERROR: nix is undefined. Use list command to see defined gitignore types !!# + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/linux,windows,macos,vim,direnv,nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5139eab --- /dev/null +++ b/flake.nix @@ -0,0 +1,52 @@ +{ + description = "Matrix server for CCCB"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + agenix = { + url = "github:ryantm/agenix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + }; + outputs = {self, nixpkgs, agenix}: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in + { + formatter.${system} = pkgs.nixfmt-tree; + devShells.${system}.default = pkgs.mkShell { + packages = [ + (agenix.packages.${system}.default) + pkgs.age + ]; + }; + nixosConfigurtions."matrix" = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + agenix.nixosModules.default + { environment.systemPackages = [(agenix.packages.${system}.default)]; } + { + age.secrets = { + pushover_app_token = { + file = ./secrets/pushover_app_token.age; + mode = "440"; + owner = "root"; + group = "root"; + }; + pushover_user_key = { + file = ./secrets/pushover_user_key.age; + mode = "440"; + owner = "root"; + group = "root"; + }; + }; + } + ./configuration.nix + ./services/synapse.nix + ]; + }; + }; +} +