Compare commits
5 Commits
7db7c7fbd3
...
zitadel
Author | SHA1 | Date | |
---|---|---|---|
ec51278987
|
|||
1250683996
|
|||
bbb7548659
|
|||
8216088c46
|
|||
d05d353ee7
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2025 by Jordan Holt <jordan@vimium.com>
|
Copyright (C) 2023 by Jordan Holt <jordan@vimium.com>
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted.
|
purpose with or without fee is hereby granted.
|
||||||
|
@ -6,8 +6,8 @@ System and user configuration for NixOS-based systems.
|
|||||||
|-|-|
|
|-|-|
|
||||||
| **Shell:** | zsh |
|
| **Shell:** | zsh |
|
||||||
| **DE:** | GNOME |
|
| **DE:** | GNOME |
|
||||||
| **Theme:** | Adwaita |
|
| **Theme:** | adwaita |
|
||||||
| **Terminal:** | Ptyxis |
|
| **Terminal:** | Console |
|
||||||
|
|
||||||
## Provisioning a new host
|
## Provisioning a new host
|
||||||
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used
|
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used
|
||||||
@ -52,3 +52,4 @@ tailscale up --login-server https://headscale.vimium.net
|
|||||||
then visit the URL, SSH onto `vps1` and run `headscale --user mesh nodes register --key <key>`.
|
then visit the URL, SSH onto `vps1` and run `headscale --user mesh nodes register --key <key>`.
|
||||||
|
|
||||||
The new node can optionally be given a friendly name with `headscale node rename -i <index> <hostname>`.
|
The new node can optionally be given a friendly name with `headscale node rename -i <index> <hostname>`.
|
||||||
|
|
||||||
|
290
flake.lock
generated
290
flake.lock
generated
@ -8,11 +8,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736955230,
|
"lastModified": 1723293904,
|
||||||
"narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=",
|
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c",
|
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -66,11 +66,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727447169,
|
"lastModified": 1718194053,
|
||||||
"narHash": "sha256-3KyjMPUKHkiWhwR91J1YchF6zb6gvckCAY1jOE+ne0U=",
|
"narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
|
||||||
"owner": "serokell",
|
"owner": "serokell",
|
||||||
"repo": "deploy-rs",
|
"repo": "deploy-rs",
|
||||||
"rev": "aa07eb05537d4cd025e2310397a6adcedfe72c76",
|
"rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -87,11 +87,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735644329,
|
"lastModified": 1722113426,
|
||||||
"narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
|
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "devshell",
|
"repo": "devshell",
|
||||||
"rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
|
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -107,11 +107,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739841949,
|
"lastModified": 1723080788,
|
||||||
"narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
|
"narHash": "sha256-C5LbM5VMdcolt9zHeLQ0bYMRjUL+N+AL5pK7/tVTdes=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
|
"rev": "ffc1f95f6c28e1c6d1e587b51a2147027a3e45ed",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -123,11 +123,11 @@
|
|||||||
"firefox-gnome-theme": {
|
"firefox-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739223196,
|
"lastModified": 1723137499,
|
||||||
"narHash": "sha256-vAxN2f3rvl5q62gQQjZGVSvF93nAsOxntuFz+e/655w=",
|
"narHash": "sha256-MOE9NeU2i6Ws1GhGmppMnjOHkNLl2MQMJmGhaMzdoJM=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "firefox-gnome-theme",
|
"repo": "firefox-gnome-theme",
|
||||||
"rev": "a89108e6272426f4eddd93ba17d0ea101c34fb21",
|
"rev": "fb5b578a4f49ae8705e5fea0419242ed1b8dba70",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -170,12 +170,12 @@
|
|||||||
},
|
},
|
||||||
"flake-compat_3": {
|
"flake-compat_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733328505,
|
"lastModified": 1696426674,
|
||||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
"revCount": 69,
|
"revCount": 57,
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz"
|
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@ -206,11 +206,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738453229,
|
"lastModified": 1722555600,
|
||||||
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
|
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
|
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -219,42 +219,25 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_3"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": "flake-compat_4",
|
||||||
"nixvim",
|
|
||||||
"flake-compat"
|
|
||||||
],
|
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": [
|
||||||
|
"nixvim",
|
||||||
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737465171,
|
"lastModified": 1722857853,
|
||||||
"narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=",
|
"narHash": "sha256-3Zx53oz/MSIyevuWO/SumxABkrIvojnB7g9cimxkhiE=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
|
"rev": "06939f6b7ec4d4f465bf3132a05367cccbbf64da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -302,27 +285,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -351,16 +313,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739757849,
|
"lastModified": 1720042825,
|
||||||
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
|
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
|
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-24.11",
|
"ref": "release-24.05",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -373,48 +335,20 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739570999,
|
"lastModified": 1720042825,
|
||||||
"narHash": "sha256-eCc0/Q4bPpe4/AS+uzIrHLJcR6BxPQ69q2kD0/Qe6rU=",
|
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "254d47082e23dbf72fdeca1da6fe1da420f478d8",
|
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-24.11",
|
"ref": "release-24.05",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ixx": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"nixvim",
|
|
||||||
"nuschtosSearch",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixvim",
|
|
||||||
"nuschtosSearch",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1729958008,
|
|
||||||
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
|
|
||||||
"owner": "NuschtOS",
|
|
||||||
"repo": "ixx",
|
|
||||||
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NuschtOS",
|
|
||||||
"ref": "v0.0.6",
|
|
||||||
"repo": "ixx",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"kvlibadwaita": {
|
"kvlibadwaita": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -439,27 +373,26 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739553546,
|
"lastModified": 1722924007,
|
||||||
"narHash": "sha256-L4ou3xfOr17EAe836djRoQ7auVkYOREMtiQa82wVGqU=",
|
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "353846417f985e74fdc060555f17939e4472ea2c",
|
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"ref": "nix-darwin-24.11",
|
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740089251,
|
"lastModified": 1723310128,
|
||||||
"narHash": "sha256-Y78mDBWoO8CLLTjQfPfII+KXFb6lAmF9GrLbyVBsIMM=",
|
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "18e9f9753e9ae261bcc7d3abe15745686991fd30",
|
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -475,18 +408,20 @@
|
|||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-24_11": "nixpkgs-24_11"
|
"nixpkgs-24_05": "nixpkgs-24_05",
|
||||||
|
"utils": "utils_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739121270,
|
"lastModified": 1718084203,
|
||||||
"narHash": "sha256-EmJhpy9U8sVlepl2QPjG019VfG67HcucsQNItTqW6cA=",
|
"narHash": "sha256-Cx1xoVfSMv1XDLgKg08CUd1EoTYWB45VmB9XIQzhmzI=",
|
||||||
"owner": "simple-nixos-mailserver",
|
"owner": "simple-nixos-mailserver",
|
||||||
"repo": "nixos-mailserver",
|
"repo": "nixos-mailserver",
|
||||||
"rev": "8c1c4640b878c692dd3d8055e8cdea0a2bbd8cf3",
|
"rev": "29916981e7b3b5782dc5085ad18490113f8ff63b",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "simple-nixos-mailserver",
|
"owner": "simple-nixos-mailserver",
|
||||||
|
"ref": "nixos-24.05",
|
||||||
"repo": "nixos-mailserver",
|
"repo": "nixos-mailserver",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
}
|
}
|
||||||
@ -507,28 +442,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-24_11": {
|
"nixpkgs-24_05": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734083684,
|
"lastModified": 1717144377,
|
||||||
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
|
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
|
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-24.11",
|
"ref": "nixos-24.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739866667,
|
"lastModified": 1723175592,
|
||||||
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
|
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -555,16 +490,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739923778,
|
"lastModified": 1723282977,
|
||||||
"narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=",
|
"narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1",
|
"rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-24.11",
|
"ref": "nixos-24.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -579,47 +514,23 @@
|
|||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nuschtosSearch": "nuschtosSearch",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739623149,
|
"lastModified": 1722925293,
|
||||||
"narHash": "sha256-9hyreNdQtQaFzWAx38CHiKHFQ8vAc/J2/kXeT7Nwy6s=",
|
"narHash": "sha256-saXm5dd/e3PMsYTEcp1Qbzifm3KsZtNFkrWjmLhXHGE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "6b2c62b91a10a773e705f55e8b34a19c8b1f3728",
|
"rev": "170df9814c3e41d5a4d6e3339e611801b1f02ce2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "nixos-24.11",
|
"ref": "nixos-24.05",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nuschtosSearch": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"ixx": "ixx",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixvim",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1738508923,
|
|
||||||
"narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=",
|
|
||||||
"owner": "NuschtOS",
|
|
||||||
"repo": "search",
|
|
||||||
"rev": "86e2038290859006e05ca7201425ea5b5de4aecb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NuschtOS",
|
|
||||||
"repo": "search",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plasma-manager": {
|
"plasma-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": [
|
"home-manager": [
|
||||||
@ -630,11 +541,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739557722,
|
"lastModified": 1723232379,
|
||||||
"narHash": "sha256-XikzLpPUDYiNyJ4w2SfRShdbSkIgE3btYdxCGInmtc4=",
|
"narHash": "sha256-F4Y3f9305aHGWKqAd3s2GyNRONdpDBuNuK4TCSdaHz8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "plasma-manager",
|
"repo": "plasma-manager",
|
||||||
"rev": "1f3e1f38dedbbb8aad77e184fb54ec518e2d9522",
|
"rev": "22bea90404c5ff6457913a03c1a54a3caa5b1c57",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -643,28 +554,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat_4",
|
|
||||||
"gitignore": "gitignore_2",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1737465171,
|
|
||||||
"narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
@ -680,7 +569,6 @@
|
|||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
|
||||||
"secrets": "secrets",
|
"secrets": "secrets",
|
||||||
"thunderbird-gnome-theme": "thunderbird-gnome-theme"
|
"thunderbird-gnome-theme": "thunderbird-gnome-theme"
|
||||||
}
|
}
|
||||||
@ -688,11 +576,11 @@
|
|||||||
"secrets": {
|
"secrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730732927,
|
"lastModified": 1723385164,
|
||||||
"narHash": "sha256-t3MTEgi6O7DMxMjdi3xcTAztLDQmEtqQ+oU+ZbWz2AI=",
|
"narHash": "sha256-/z4nBwpHsGWl1gmGv7FQQgoOcPwUaVzL7rfjI5nTOLg=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "4ae2ac777c38f60a29384b70c456f41847cdf1b5",
|
"rev": "b47efe67031e12a2d5560b94fdb4de7dca3df80c",
|
||||||
"revCount": 28,
|
"revCount": 24,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
||||||
},
|
},
|
||||||
@ -749,11 +637,11 @@
|
|||||||
"thunderbird-gnome-theme": {
|
"thunderbird-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732643121,
|
"lastModified": 1721874544,
|
||||||
"narHash": "sha256-i0Uo5EN45rlGuR85hvPet43zW/thOQTwHypVg9shTHU=",
|
"narHash": "sha256-BHW9jlx92CsHY84FT0ce5Vxl0KFheLhNn2vndcIf7no=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "thunderbird-gnome-theme",
|
"repo": "thunderbird-gnome-theme",
|
||||||
"rev": "1994e7ec0649053e2a0811973245758d41e33f5f",
|
"rev": "628fcccb7788e3e0ad34f67114f563c87ac8c1dc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -770,11 +658,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738953846,
|
"lastModified": 1722330636,
|
||||||
"narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=",
|
"narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "4f09b473c936d41582dd744e19f34ec27592c5fd",
|
"rev": "768acdb06968e53aa1ee8de207fd955335c754b7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -800,6 +688,24 @@
|
|||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
86
flake.nix
86
flake.nix
@ -2,7 +2,7 @@
|
|||||||
description = "NixOS system configuration";
|
description = "NixOS system configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||||
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||||
# nixpkgs-master.url = "nixpkgs";
|
# nixpkgs-master.url = "nixpkgs";
|
||||||
agenix.url = "github:ryantm/agenix";
|
agenix.url = "github:ryantm/agenix";
|
||||||
@ -12,7 +12,7 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-24.11";
|
url = "github:nix-community/home-manager/release-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
firefox-gnome-theme = {
|
firefox-gnome-theme = {
|
||||||
@ -29,11 +29,11 @@
|
|||||||
};
|
};
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
nixos-mailserver = {
|
nixos-mailserver = {
|
||||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixvim = {
|
nixvim = {
|
||||||
url = "github:nix-community/nixvim/nixos-24.11";
|
url = "github:nix-community/nixvim/nixos-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
plasma-manager = {
|
plasma-manager = {
|
||||||
@ -41,10 +41,6 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.home-manager.follows = "home-manager";
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
pre-commit-hooks = {
|
|
||||||
url = "github:cachix/git-hooks.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
secrets = {
|
secrets = {
|
||||||
url = "git+ssh://git@git.vimium.com/jordan/nix-secrets.git";
|
url = "git+ssh://git@git.vimium.com/jordan/nix-secrets.git";
|
||||||
flake = false;
|
flake = false;
|
||||||
@ -55,12 +51,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = inputs @ { self, nixpkgs, ... }:
|
||||||
inputs@{ self, nixpkgs, ... }:
|
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
domain = "mesh.vimium.net";
|
domain = "mesh.vimium.net";
|
||||||
|
forEverySystem = lib.getAttrs lib.systems.flakeExposed;
|
||||||
forEachSystem = lib.genAttrs [
|
forEachSystem = lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
@ -70,11 +66,7 @@
|
|||||||
|
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "root";
|
user = "root";
|
||||||
path =
|
path = inputs.deploy-rs.lib.${self.nixosConfigurations.${hostName}.config.system.build.toplevel.system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||||
inputs.deploy-rs.lib.${
|
|
||||||
self.nixosConfigurations.${hostName}.config.system.build.toplevel.system
|
|
||||||
}.activate.nixos
|
|
||||||
self.nixosConfigurations.${hostName};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@ -84,19 +76,16 @@
|
|||||||
directory = ./overlays;
|
directory = ./overlays;
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages = forEachSystem (
|
legacyPackages = forEachSystem (system:
|
||||||
system:
|
|
||||||
lib.packagesFromDirectoryRecursive {
|
lib.packagesFromDirectoryRecursive {
|
||||||
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
|
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
|
||||||
directory = ./pkgs;
|
directory = ./pkgs;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
nixosConfigurations = lib.pipe ./hosts [
|
nixosConfigurations = lib.pipe ./hosts [
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
(lib.filterAttrs (name: value: value == "directory"))
|
(lib.filterAttrs (name: value: value == "directory"))
|
||||||
(lib.mapAttrs (
|
(lib.mapAttrs (name: value:
|
||||||
name: value:
|
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
specialArgs = { inherit self; };
|
specialArgs = { inherit self; };
|
||||||
|
|
||||||
@ -109,57 +98,24 @@
|
|||||||
}
|
}
|
||||||
./hosts/${name}
|
./hosts/${name}
|
||||||
];
|
];
|
||||||
}
|
}))
|
||||||
))
|
|
||||||
];
|
];
|
||||||
|
|
||||||
checks =
|
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
||||||
builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib
|
buildInputs = [
|
||||||
// (forEachSystem (system: {
|
inputs.agenix.packages.x86_64-linux.agenix
|
||||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
inputs.deploy-rs.packages.x86_64-linux.deploy-rs
|
||||||
src = ./.;
|
];
|
||||||
hooks = {
|
};
|
||||||
check-case-conflicts.enable = true;
|
|
||||||
check-executables-have-shebangs.enable = true;
|
|
||||||
check-merge-conflicts.enable = true;
|
|
||||||
deadnix = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
noLambdaArg = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
detect-private-keys.enable = true;
|
|
||||||
end-of-file-fixer.enable = true;
|
|
||||||
fix-byte-order-marker.enable = true;
|
|
||||||
mixed-line-endings.enable = true;
|
|
||||||
nixfmt-rfc-style.enable = true;
|
|
||||||
trim-trailing-whitespace.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
|
|
||||||
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
|
||||||
|
|
||||||
devShells = forEachSystem (system: {
|
|
||||||
default = nixpkgs.legacyPackages.${system}.mkShell {
|
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
||||||
buildInputs = [
|
|
||||||
inputs.agenix.packages.${system}.agenix
|
|
||||||
inputs.deploy-rs.packages.${system}.deploy-rs
|
|
||||||
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
magicRollback = true;
|
magicRollback = true;
|
||||||
autoRollback = true;
|
autoRollback = true;
|
||||||
sshUser = "root";
|
sshUser = "root";
|
||||||
nodes = lib.genAttrs [
|
nodes = lib.genAttrs [ "mail" "pi" "skycam" "vps1" ] mkDeployNode;
|
||||||
"mail"
|
|
||||||
# "pi"
|
|
||||||
# "skycam"
|
|
||||||
"vps1"
|
|
||||||
] mkDeployNode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -22,22 +22,29 @@
|
|||||||
users.extraGroups.vboxusers.members = [ "jordan" ];
|
users.extraGroups.vboxusers.members = [ "jordan" ];
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
programs = {
|
desktop = {
|
||||||
dev = {
|
apps = {
|
||||||
node.enable = true;
|
qbittorrent.enable = true;
|
||||||
|
thunderbird.enable = true;
|
||||||
};
|
};
|
||||||
firefox.enable = true;
|
browsers = {
|
||||||
git.enable = true;
|
firefox.enable = true;
|
||||||
gpg.enable = true;
|
};
|
||||||
graphics = {
|
media.graphics = {
|
||||||
raster.enable = true;
|
raster.enable = true;
|
||||||
vector.enable = true;
|
vector.enable = true;
|
||||||
};
|
};
|
||||||
libreoffice.enable = true;
|
office.libreoffice.enable = true;
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
qbittorrent.enable = true;
|
|
||||||
thunderbird.enable = true;
|
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
@ -49,6 +56,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
shell = {
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,14 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ehci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
{
|
{ config, pkgs, self, ... }:
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
self.inputs.agenix.nixosModules.age
|
self.inputs.agenix.nixosModules.age
|
||||||
self.inputs.home-manager.nixosModule
|
self.inputs.home-manager.nixosModule
|
||||||
../modules/home-manager
|
../modules
|
||||||
../modules/nixos
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
self.inputs.agenix.overlays.default
|
self.inputs.agenix.overlays.default
|
||||||
(import ../overlays/default.nix)
|
(import ../overlays/default.nix)
|
||||||
(final: prev: {
|
(
|
||||||
unstable = import self.inputs.nixpkgs-unstable { system = final.system; };
|
final: prev: {
|
||||||
})
|
unstable = import self.inputs.nixpkgs-unstable { system = final.system; };
|
||||||
|
}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
@ -57,7 +54,7 @@
|
|||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixVersions.stable;
|
package = pkgs.nixFlakes;
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
'';
|
'';
|
||||||
@ -68,10 +65,7 @@
|
|||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
maxJobs = 6;
|
maxJobs = 6;
|
||||||
speedFactor = 1;
|
speedFactor = 1;
|
||||||
supportedFeatures = [
|
supportedFeatures = [ "big-parallel" "benchmark" ];
|
||||||
"big-parallel"
|
|
||||||
"benchmark"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -6,12 +6,13 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ../overlays/gnome.nix)
|
(import ../overlays/gnome)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
services.openssh.startWhenNeeded = true;
|
services.openssh.startWhenNeeded = true;
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
@ -48,19 +49,12 @@
|
|||||||
|
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs; [
|
||||||
noto-fonts
|
noto-fonts
|
||||||
(nerdfonts.override {
|
(nerdfonts.override { fonts = [ "BigBlueTerminal" "ComicShannsMono" "Terminus" "UbuntuMono" ]; })
|
||||||
fonts = [
|
|
||||||
"BigBlueTerminal"
|
|
||||||
"ComicShannsMono"
|
|
||||||
"Terminus"
|
|
||||||
"UbuntuMono"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
system.desktop.gnome.enable = true;
|
desktop.gnome.enable = true;
|
||||||
services.tailscale.enable = true;
|
networking.tailscale.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -25,18 +25,24 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
programs = {
|
desktop = {
|
||||||
dev = {
|
apps.qbittorrent.enable = true;
|
||||||
node.enable = true;
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
};
|
};
|
||||||
firefox.enable = true;
|
};
|
||||||
git.enable = true;
|
dev = {
|
||||||
gpg.enable = true;
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
qbittorrent.enable = true;
|
|
||||||
};
|
};
|
||||||
shell = {
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,19 +6,12 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
"ehci_pci"
|
initrd.kernelModules = [ ];
|
||||||
"ahci"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"sdhci_pci"
|
|
||||||
];
|
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernel.sysctl = {
|
kernelModules = [ ];
|
||||||
"kernel.nmi_watchdog" = 0;
|
|
||||||
"vm.laptop_mode" = 5;
|
|
||||||
};
|
|
||||||
kernelParams = [ "elevator=none" ];
|
kernelParams = [ "elevator=none" ];
|
||||||
|
extraModulePackages = [ ];
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -21,21 +21,22 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.moonlight-qt
|
|
||||||
];
|
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
programs = {
|
desktop = {
|
||||||
dev = {
|
apps.qbittorrent.enable = true;
|
||||||
node.enable = true;
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
};
|
};
|
||||||
firefox.enable = true;
|
};
|
||||||
git.enable = true;
|
dev = {
|
||||||
gpg.enable = true;
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
qbittorrent.enable = true;
|
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
@ -47,6 +48,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
shell = {
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,15 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "zfs" ];
|
||||||
"ehci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"sr_mod"
|
|
||||||
"zfs"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
|
@ -15,7 +15,7 @@ index d5a8182cf..be722c43a 100644
|
|||||||
@@ -449,6 +449,63 @@ static void setup_graphics(struct boot_params *boot_params)
|
@@ -449,6 +449,63 @@ static void setup_graphics(struct boot_params *boot_params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+typedef struct {
|
+typedef struct {
|
||||||
+ u64 version;
|
+ u64 version;
|
||||||
+ void (*set_os_version) (const char *os_version);
|
+ void (*set_os_version) (const char *os_version);
|
||||||
@ -73,13 +73,13 @@ index d5a8182cf..be722c43a 100644
|
|||||||
+
|
+
|
||||||
+ return status;
|
+ return status;
|
||||||
+}
|
+}
|
||||||
|
|
||||||
static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
|
static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
|
||||||
{
|
{
|
||||||
@@ -951,6 +1008,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
|
@@ -951,6 +1008,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
|
||||||
|
|
||||||
setup_unaccepted_memory();
|
setup_unaccepted_memory();
|
||||||
|
|
||||||
+ apple_set_os();
|
+ apple_set_os();
|
||||||
+
|
+
|
||||||
status = exit_boot(boot_params, handle);
|
status = exit_boot(boot_params, handle);
|
||||||
@ -97,5 +97,6 @@ index d59b0947f..81158014f 100644
|
|||||||
#define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f)
|
#define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f)
|
||||||
#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
|
#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
|
||||||
#define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
|
#define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
|
||||||
--
|
--
|
||||||
2.42.0
|
2.42.0
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -36,7 +30,7 @@
|
|||||||
videoDrivers = [ "nvidia" ];
|
videoDrivers = [ "nvidia" ];
|
||||||
};
|
};
|
||||||
displayManager = {
|
displayManager = {
|
||||||
defaultSession = if config.modules.system.desktop.kde.enable then "plasmax11" else "gnome-xorg";
|
defaultSession = if config.modules.desktop.kde.enable then "plasmax11" else "gnome-xorg";
|
||||||
sddm.wayland.enable = lib.mkForce false;
|
sddm.wayland.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -44,25 +38,27 @@
|
|||||||
# Workaround for label rendering bug in GTK4 with nvidia 470 driver
|
# Workaround for label rendering bug in GTK4 with nvidia 470 driver
|
||||||
environment.sessionVariables.GSK_RENDERER = "gl";
|
environment.sessionVariables.GSK_RENDERER = "gl";
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.moonlight-qt
|
|
||||||
];
|
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
programs = {
|
desktop = {
|
||||||
dev = {
|
browsers = {
|
||||||
node.enable = true;
|
firefox.enable = true;
|
||||||
};
|
};
|
||||||
firefox.enable = true;
|
media.recording = {
|
||||||
git.enable = true;
|
|
||||||
gpg.enable = true;
|
|
||||||
neovim.enable = true;
|
|
||||||
pass.enable = true;
|
|
||||||
recording = {
|
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
shell = {
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
@ -123,3 +123,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -12,22 +6,8 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
kernelModules = [ "applesmc" "kvm-intel" "wl" ];
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
kernel.sysctl = {
|
|
||||||
"kernel.nmi_watchdog" = 0;
|
|
||||||
"vm.laptop_mode" = 5;
|
|
||||||
};
|
|
||||||
kernelModules = [
|
|
||||||
"applesmc"
|
|
||||||
"kvm-intel"
|
|
||||||
"wl"
|
|
||||||
];
|
|
||||||
extraModulePackages = [
|
extraModulePackages = [
|
||||||
config.boot.kernelPackages.broadcom_sta
|
config.boot.kernelPackages.broadcom_sta
|
||||||
config.boot.kernelPackages.nvidiaPackages.legacy_470
|
config.boot.kernelPackages.nvidiaPackages.legacy_470
|
||||||
@ -45,12 +25,14 @@
|
|||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
};
|
};
|
||||||
graphics = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
libvdpau-va-gl
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
enable32Bit = true;
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,3 +43,4 @@ See [Graham Christensen's article](https://grahamc.com/blog/nixos-on-zfs/#datase
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `library.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `library.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -16,13 +16,10 @@
|
|||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostId = "d24ae953";
|
hostId = "d24ae953";
|
||||||
hosts = {
|
|
||||||
"100.64.0.1" = [ "auth.vimium.com" ];
|
|
||||||
};
|
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -74,14 +71,12 @@
|
|||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
{
|
{
|
||||||
job_name = "node";
|
job_name = "node";
|
||||||
static_configs = [
|
static_configs = [{
|
||||||
{
|
targets = [
|
||||||
targets = [
|
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
];
|
||||||
];
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -95,8 +90,8 @@
|
|||||||
];
|
];
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type="simple";
|
||||||
ExecStart = pkgs.lib.mkForce ''
|
ExecStart=pkgs.lib.mkForce ''
|
||||||
${pkgs.openssh}/bin/ssh \
|
${pkgs.openssh}/bin/ssh \
|
||||||
-NT \
|
-NT \
|
||||||
-o ExitOnForwardFailure=yes \
|
-o ExitOnForwardFailure=yes \
|
||||||
@ -106,83 +101,78 @@
|
|||||||
-R localhost:8000:localhost:8000 \
|
-R localhost:8000:localhost:8000 \
|
||||||
jellyfin@vps1.mesh.vimium.net
|
jellyfin@vps1.mesh.vimium.net
|
||||||
'';
|
'';
|
||||||
Restart = "always";
|
Restart="always";
|
||||||
RestartSec = 20;
|
RestartSec=20;
|
||||||
};
|
};
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx =
|
services.nginx = let
|
||||||
let
|
proxyConfig = ''
|
||||||
proxyConfig = ''
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
proxy_set_header Range $http_range;
|
proxy_set_header Range $http_range;
|
||||||
proxy_set_header If-Range $http_if_range;
|
proxy_set_header If-Range $http_if_range;
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
'';
|
'';
|
||||||
in
|
in {
|
||||||
{
|
enable = true;
|
||||||
enable = true;
|
package = pkgs.openresty;
|
||||||
package = pkgs.openresty;
|
recommendedGzipSettings = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedOptimisation = true;
|
||||||
recommendedOptimisation = true;
|
recommendedTlsSettings = true;
|
||||||
recommendedTlsSettings = true;
|
clientMaxBodySize = "2G";
|
||||||
clientMaxBodySize = "2G";
|
virtualHosts = {
|
||||||
virtualHosts = {
|
"library.mesh.vimium.net" = {
|
||||||
"library.mesh.vimium.net" = {
|
locations."/" = {
|
||||||
locations."/" = {
|
root = "/mnt/library";
|
||||||
root = "/mnt/library";
|
extraConfig = ''
|
||||||
extraConfig = ''
|
autoindex on;
|
||||||
autoindex on;
|
'';
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
"jellyfin.vimium.com" = {
|
};
|
||||||
default = true;
|
"jellyfin.vimium.com" = {
|
||||||
listen = [
|
default = true;
|
||||||
{
|
listen = [
|
||||||
addr = "127.0.0.1";
|
{
|
||||||
port = 8000;
|
addr = "127.0.0.1";
|
||||||
}
|
port = 8000;
|
||||||
];
|
}
|
||||||
locations."/" = {
|
];
|
||||||
proxyPass = "http://localhost:8096";
|
locations."/" = {
|
||||||
extraConfig = proxyConfig;
|
proxyPass = "http://localhost:8096";
|
||||||
};
|
extraConfig = proxyConfig;
|
||||||
locations."/metrics" = {
|
};
|
||||||
return = "404";
|
locations."/metrics" = {
|
||||||
};
|
return = "404";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
vaapiVdpau
|
vaapiVdpau
|
||||||
];
|
];
|
||||||
|
driSupport = true;
|
||||||
};
|
};
|
||||||
users.users.jellyfin.extraGroups = [
|
users.users.jellyfin.extraGroups = [ "video" "render" ];
|
||||||
"video"
|
|
||||||
"render"
|
|
||||||
];
|
|
||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.unstable.jellyfin;
|
|
||||||
cacheDir = "/var/cache/jellyfin";
|
cacheDir = "/var/cache/jellyfin";
|
||||||
dataDir = "/var/lib/jellyfin";
|
dataDir = "/var/lib/jellyfin";
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
podman.enable = true;
|
podman.enable = true;
|
||||||
programs = {
|
security = {
|
||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
};
|
};
|
||||||
shell = {
|
shell = {
|
||||||
@ -202,3 +192,4 @@
|
|||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,13 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
@ -76,3 +65,4 @@
|
|||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,3 +15,4 @@ NVMe | `/dev/sda1` (ext4, NixOS Root)
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `mail.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `mail.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -19,7 +15,7 @@
|
|||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -10,12 +7,7 @@
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
"ata_piix"
|
|
||||||
"uhci_hcd"
|
|
||||||
"xen_blkfront"
|
|
||||||
"vmw_pvscsi"
|
|
||||||
];
|
|
||||||
kernelModules = [ "nvme" ];
|
kernelModules = [ "nvme" ];
|
||||||
};
|
};
|
||||||
loader.grub = {
|
loader.grub = {
|
||||||
@ -27,3 +19,4 @@
|
|||||||
|
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -26,10 +26,7 @@
|
|||||||
networking = {
|
networking = {
|
||||||
hostId = "c5e68d78";
|
hostId = "c5e68d78";
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
firewall.trustedInterfaces = [
|
firewall.trustedInterfaces = [ "lxdbr0" "virbr0" ]; # Work around https://github.com/NixOS/nixpkgs/issues/263359
|
||||||
"lxdbr0"
|
|
||||||
"virbr0"
|
|
||||||
]; # Work around https://github.com/NixOS/nixpkgs/issues/263359
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
@ -47,50 +44,50 @@
|
|||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"odyssey.mesh.vimium.net" = {
|
"odyssey.mesh.vimium.net" = {
|
||||||
locations."/".proxyPass =
|
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
|
||||||
"http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.unstable.sunshine;
|
|
||||||
capSysAdmin = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
programs = {
|
desktop = {
|
||||||
dev = {
|
apps.qbittorrent.enable = true;
|
||||||
node.enable = true;
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
};
|
};
|
||||||
emulators = {
|
gaming = {
|
||||||
gamecube.enable = true;
|
emulators = {
|
||||||
ps2.enable = true;
|
gamecube.enable = true;
|
||||||
ps3.enable = true;
|
ps2.enable = true;
|
||||||
psp.enable = true;
|
ps3.enable = true;
|
||||||
wii.enable = true;
|
psp.enable = true;
|
||||||
xbox.enable = true;
|
wii.enable = true;
|
||||||
|
xbox.enable = true;
|
||||||
|
};
|
||||||
|
lutris.enable = true;
|
||||||
};
|
};
|
||||||
firefox.enable = true;
|
media.graphics = {
|
||||||
git.enable = true;
|
|
||||||
gpg.enable = true;
|
|
||||||
graphics = {
|
|
||||||
modeling.enable = true;
|
modeling.enable = true;
|
||||||
raster.enable = true;
|
raster.enable = true;
|
||||||
vector.enable = true;
|
vector.enable = true;
|
||||||
};
|
};
|
||||||
libreoffice.enable = true;
|
media.recording = {
|
||||||
lutris.enable = true;
|
|
||||||
pass.enable = true;
|
|
||||||
neovim.enable = true;
|
|
||||||
qbittorrent.enable = true;
|
|
||||||
recording = {
|
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
video.enable = true;
|
video.enable = true;
|
||||||
};
|
};
|
||||||
|
office.libreoffice.enable = true;
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
};
|
};
|
||||||
hardware.presonus-studio.enable = true;
|
hardware.presonus-studio.enable = true;
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -108,6 +105,7 @@
|
|||||||
gitea-runner.enable = true;
|
gitea-runner.enable = true;
|
||||||
};
|
};
|
||||||
shell = {
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -12,14 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ehci_pci"
|
|
||||||
"nvme"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
@ -32,7 +19,6 @@
|
|||||||
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
nvidia = {
|
nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
open = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -104,6 +100,8 @@
|
|||||||
|
|
||||||
networking.hostId = "731d1660";
|
networking.hostId = "731d1660";
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -112,8 +110,113 @@
|
|||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
age.secrets."files/services/home-assistant/secrets.yaml" = {
|
||||||
|
file = "${self.inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
|
||||||
|
path = "${config.services.home-assistant.configDir}/secrets.yaml";
|
||||||
|
owner = "hass";
|
||||||
|
group = "hass";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
extraComponents = [
|
||||||
|
"api"
|
||||||
|
"alert"
|
||||||
|
"auth"
|
||||||
|
"backup"
|
||||||
|
"command_line"
|
||||||
|
"default_config"
|
||||||
|
"homekit_controller"
|
||||||
|
"homekit"
|
||||||
|
"http"
|
||||||
|
"icloud"
|
||||||
|
"jellyfin"
|
||||||
|
"metoffice"
|
||||||
|
"mqtt"
|
||||||
|
"onkyo"
|
||||||
|
"ping"
|
||||||
|
"proximity"
|
||||||
|
"radio_browser"
|
||||||
|
"scrape"
|
||||||
|
"sensor"
|
||||||
|
"system_health"
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
default_config = {};
|
||||||
|
backup = {};
|
||||||
|
homeassistant = {
|
||||||
|
name = "Home";
|
||||||
|
latitude = "!secret latitude";
|
||||||
|
longitude = "!secret longitude";
|
||||||
|
country = "GB";
|
||||||
|
temperature_unit = "C";
|
||||||
|
time_zone = config.time.timeZone;
|
||||||
|
unit_system = "metric";
|
||||||
|
};
|
||||||
|
mqtt = { };
|
||||||
|
scene = "!include scenes.yaml";
|
||||||
|
automation = "!include automations.yaml";
|
||||||
|
system_health = { };
|
||||||
|
recorder = {
|
||||||
|
purge_keep_days = 365;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mosquitto = {
|
||||||
|
enable = true;
|
||||||
|
listeners = [{
|
||||||
|
acl = [ "pattern readwrite #" ];
|
||||||
|
omitPasswordAuth = true;
|
||||||
|
port = 1883;
|
||||||
|
settings = {
|
||||||
|
allow_anonymous = true;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets."files/services/zigbee2mqtt/secret.yaml" = {
|
||||||
|
file = "${self.inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
|
||||||
|
path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml";
|
||||||
|
owner = "zigbee2mqtt";
|
||||||
|
group = "zigbee2mqtt";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.zigbee2mqtt = {
|
||||||
|
package = pkgs.unstable.zigbee2mqtt;
|
||||||
|
enable = true;
|
||||||
|
dataDir = "/var/lib/zigbee2mqtt";
|
||||||
|
settings = {
|
||||||
|
homeassistant = lib.optionalAttrs config.services.home-assistant.enable {
|
||||||
|
discovery_topic = "homeassistant";
|
||||||
|
status_topic = "hass/status";
|
||||||
|
legacy_entity_attributes = true;
|
||||||
|
legacy_triggers = true;
|
||||||
|
};
|
||||||
|
availability = true;
|
||||||
|
frontend = true;
|
||||||
|
device_options = {
|
||||||
|
retain = true;
|
||||||
|
};
|
||||||
|
serial = {
|
||||||
|
port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0";
|
||||||
|
};
|
||||||
|
advanced = {
|
||||||
|
channel = 20;
|
||||||
|
network_key = "!secret.yaml network_key";
|
||||||
|
pan_id = 13001;
|
||||||
|
ext_pan_id = [ 79 1 73 47 250 136 124 222 ];
|
||||||
|
transmit_power = 20;
|
||||||
|
};
|
||||||
|
mqtt = {
|
||||||
|
version = 5;
|
||||||
|
server = "mqtt://localhost:1883";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
system = {
|
networking = {
|
||||||
wireless = {
|
wireless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = [ "wlan0" ];
|
interfaces = [ "wlan0" ];
|
||||||
@ -122,20 +225,21 @@
|
|||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
directories = [
|
||||||
|
"/var/lib/mosquitto"
|
||||||
|
"/var/lib/zigbee2mqtt"
|
||||||
|
];
|
||||||
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
home-assistant.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Connection to ONKYO HT-R990
|
# Connection to ONKYO HT-R990
|
||||||
networking.interfaces.end0 = {
|
networking.interfaces.end0 = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [{
|
||||||
{
|
address = "172.16.0.1";
|
||||||
address = "172.16.0.1";
|
prefixLength = 30;
|
||||||
prefixLength = 30;
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
@ -146,3 +250,4 @@
|
|||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,80 +6,17 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages =
|
|
||||||
let
|
|
||||||
version = "6.1.73";
|
|
||||||
tag = "stable_20240124";
|
|
||||||
srcHash = "sha256-P4ExzxWqZj+9FZr9U2tmh7rfs/3+iHEv0m74PCoXVuM=";
|
|
||||||
in
|
|
||||||
pkgs.linuxPackagesFor (
|
|
||||||
pkgs.linux_rpi4.override {
|
|
||||||
argsOverride = {
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "raspberrypi";
|
|
||||||
repo = "linux";
|
|
||||||
rev = tag;
|
|
||||||
hash = srcHash;
|
|
||||||
};
|
|
||||||
version = version;
|
|
||||||
modDirVersion = version;
|
|
||||||
structuredExtraConfig = { };
|
|
||||||
kernelPatches = [
|
|
||||||
{
|
|
||||||
name = "drm-rp1-depends-on-instead-of-select-MFD_RP1.patch";
|
|
||||||
patch = pkgs.fetchpatch {
|
|
||||||
url = "https://github.com/peat-psuwit/rpi-linux/commit/6de0bb51929cd3ad4fa27b2a421a2af12e6468f5.patch";
|
|
||||||
hash = "sha256-9pHcbgWTiztu48SBaLPVroUnxnXMKeCGt5vEo9V8WGw=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "iommu-bcm2712-don-t-allow-building-as-module.patch";
|
|
||||||
patch = pkgs.fetchpatch {
|
|
||||||
url = "https://github.com/peat-psuwit/rpi-linux/commit/693a5e69bddbcbe1d1b796ebc7581c3597685b1b.patch";
|
|
||||||
hash = "sha256-8BYYQDM5By8cTk48ASYKJhGVQnZBIK4PXtV70UtfS+A=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# Stop ZFS kernel being built
|
# Stop ZFS kernel being built
|
||||||
supportedFilesystems = lib.mkForce [
|
supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ];
|
||||||
"btrfs"
|
|
||||||
"cifs"
|
|
||||||
"f2fs"
|
|
||||||
"jfs"
|
|
||||||
"ntfs"
|
|
||||||
"reiserfs"
|
|
||||||
"vfat"
|
|
||||||
"xfs"
|
|
||||||
];
|
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Fix missing modules
|
# Fix missing modules
|
||||||
# https://github.com/NixOS/nixpkgs/issues/154163
|
# https://github.com/NixOS/nixpkgs/issues/154163
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: super: {
|
||||||
makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; });
|
makeModulesClosure = x:
|
||||||
})
|
super.makeModulesClosure (x // { allowMissing = true; });
|
||||||
(final: prev: {
|
|
||||||
raspberrypifw =
|
|
||||||
let
|
|
||||||
version = "1.20240529";
|
|
||||||
srcHash = "sha256-KsCo7ZG6vKstxRyFljZtbQvnDSqiAPdUza32xTY/tlA=";
|
|
||||||
in
|
|
||||||
pkgs.raspberrypifw.override {
|
|
||||||
argsOverride = {
|
|
||||||
src = prev.fetchFromGitHub {
|
|
||||||
owner = "raspberrypi";
|
|
||||||
repo = "firmware";
|
|
||||||
rev = "${version}";
|
|
||||||
hash = srcHash;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -96,3 +28,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -56,7 +54,7 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
modules.services.tailscale = {
|
modules.networking.tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
restrictSSH = false;
|
restrictSSH = false;
|
||||||
};
|
};
|
||||||
|
@ -26,3 +26,4 @@ To generate a compressed SD card image for Skycam, run:
|
|||||||
|
|
||||||
Once a card is imaged, the existing SSH host keys should be copied to
|
Once a card is imaged, the existing SSH host keys should be copied to
|
||||||
`/etc/ssh` manually to enable secret decryption.
|
`/etc/ssh` manually to enable secret decryption.
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -27,36 +21,27 @@
|
|||||||
# From https://github.com/Electrostasy/dots/blob/3b81723feece67610a252ce754912f6769f0cd34/hosts/phobos/klipper.nix#L43-L65
|
# From https://github.com/Electrostasy/dots/blob/3b81723feece67610a252ce754912f6769f0cd34/hosts/phobos/klipper.nix#L43-L65
|
||||||
overlays =
|
overlays =
|
||||||
let
|
let
|
||||||
mkCompatibleDtsFile =
|
mkCompatibleDtsFile = dtbo:
|
||||||
dtbo:
|
|
||||||
let
|
let
|
||||||
drv =
|
drv = pkgs.runCommand "fix-dts" { nativeBuildInputs = with pkgs; [ dtc gnused ]; } ''
|
||||||
pkgs.runCommand "fix-dts"
|
mkdir "$out"
|
||||||
{
|
dtc -I dtb -O dts ${dtbo} | sed -e 's/bcm2835/bcm2711/' > $out/overlay.dts
|
||||||
nativeBuildInputs = with pkgs; [
|
'';
|
||||||
dtc
|
|
||||||
gnused
|
|
||||||
];
|
|
||||||
}
|
|
||||||
''
|
|
||||||
mkdir "$out"
|
|
||||||
dtc -I dtb -O dts ${dtbo} | sed -e 's/bcm2835/bcm2711/' > $out/overlay.dts
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
"${drv}/overlay.dts";
|
"${drv}/overlay.dts";
|
||||||
|
|
||||||
inherit (config.boot.kernelPackages) kernel;
|
inherit (config.boot.kernelPackages) kernel;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
name = "imx708.dtbo";
|
name = "imx708.dtbo";
|
||||||
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/imx708.dtbo";
|
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/imx708.dtbo";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "vc4-kms-v3d-pi4.dtbo";
|
name = "vc4-kms-v3d-pi4.dtbo";
|
||||||
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/vc4-kms-v3d-pi4.dtbo";
|
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/vc4-kms-v3d-pi4.dtbo";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
firmware = with pkgs; [
|
firmware = with pkgs; [
|
||||||
firmwareLinuxNonfree
|
firmwareLinuxNonfree
|
||||||
@ -70,7 +55,7 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ./../../overlays/libcamera.nix)
|
(import ./../../overlays/libcamera)
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
@ -98,10 +83,9 @@
|
|||||||
ConditionPathExists = "/sys/bus/i2c/drivers/imx708/10-001a/video4linux";
|
ConditionPathExists = "/sys/bus/i2c/drivers/imx708/10-001a/video4linux";
|
||||||
};
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = ''
|
ExecStart = ''${pkgs.libcamera}/bin/libcamerify ${pkgs.unstable.ustreamer}/bin/ustreamer \
|
||||||
${pkgs.libcamera}/bin/libcamerify ${pkgs.unstable.ustreamer}/bin/ustreamer \
|
--host=0.0.0.0 \
|
||||||
--host=0.0.0.0 \
|
--resolution=4608x2592
|
||||||
--resolution=4608x2592
|
|
||||||
'';
|
'';
|
||||||
DynamicUser = "yes";
|
DynamicUser = "yes";
|
||||||
SupplementaryGroups = [ "video" ];
|
SupplementaryGroups = [ "video" ];
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{
|
{ config, lib, modulesPath, ... }:
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -15,17 +11,14 @@
|
|||||||
"cma=512M"
|
"cma=512M"
|
||||||
"panic=0"
|
"panic=0"
|
||||||
];
|
];
|
||||||
supportedFilesystems = lib.mkForce [
|
supportedFilesystems = lib.mkForce [ "f2fs" "vfat" "xfs" ];
|
||||||
"f2fs"
|
|
||||||
"vfat"
|
|
||||||
"xfs"
|
|
||||||
];
|
|
||||||
tmp.cleanOnBoot = false;
|
tmp.cleanOnBoot = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: super: {
|
(final: super: {
|
||||||
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
|
makeModulesClosure = x:
|
||||||
|
super.makeModulesClosure (x // { allowMissing = true; });
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -37,3 +30,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,3 +15,4 @@ NVMe | `/dev/sda1` (ext4, NixOS Root)
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `vps1.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `vps1.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -18,7 +13,7 @@
|
|||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -42,53 +37,96 @@
|
|||||||
groups = {
|
groups = {
|
||||||
jellyfin = { };
|
jellyfin = { };
|
||||||
};
|
};
|
||||||
extraGroups.acme.members = [
|
|
||||||
"kanidm"
|
|
||||||
"nginx"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||||
|
|
||||||
security.acme.certs."auth.vimium.com" = {
|
services.postgresql = {
|
||||||
postRun = "systemctl restart kanidm.service";
|
ensureUsers = [
|
||||||
group = "acme";
|
{
|
||||||
|
name = "zitadel";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
ensureClauses = {
|
||||||
|
superuser = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
ensureDatabases = [ "zitadel" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.kanidm =
|
age.secrets."files/services/zitadel/masterkey" = {
|
||||||
let
|
file = "${self.inputs.secrets}/files/services/zitadel/masterkey.age";
|
||||||
baseDomain = "vimium.com";
|
owner = "zitadel";
|
||||||
domain = "auth.${baseDomain}";
|
group = "zitadel";
|
||||||
uri = "https://${domain}";
|
};
|
||||||
in
|
|
||||||
{
|
|
||||||
package = pkgs.unstable.kanidm;
|
|
||||||
enableClient = true;
|
|
||||||
enableServer = true;
|
|
||||||
clientSettings = {
|
|
||||||
inherit uri;
|
|
||||||
};
|
|
||||||
serverSettings = {
|
|
||||||
bindaddress = "127.0.0.1:3013";
|
|
||||||
ldapbindaddress = "100.64.0.1:636";
|
|
||||||
domain = baseDomain;
|
|
||||||
origin = uri;
|
|
||||||
tls_chain = "${config.security.acme.certs.${domain}.directory}/full.pem";
|
|
||||||
tls_key = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
systemd.services.zitadel = {
|
||||||
"auth.vimium.com" = {
|
requires = [ "postgresql.service" ];
|
||||||
useACMEHost = "auth.vimium.com";
|
after = [ "postgresql.service" ];
|
||||||
forceSSL = true;
|
};
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "https://127.0.0.1:3013";
|
services.zitadel = {
|
||||||
|
enable = true;
|
||||||
|
masterKeyFile = config.age.secrets."files/services/zitadel/masterkey".path;
|
||||||
|
settings = {
|
||||||
|
Database.postgres = {
|
||||||
|
Host = "/run/postgresql";
|
||||||
|
Port = 5432;
|
||||||
|
Database = "zitadel";
|
||||||
|
User = {
|
||||||
|
Username = "zitadel";
|
||||||
|
SSL.Mode = "disable";
|
||||||
|
};
|
||||||
|
Admin = {
|
||||||
|
ExistingDatabase = "zitadel";
|
||||||
|
Username = "zitadel";
|
||||||
|
SSL.Mode = "disable";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
ExternalDomain = "id.vimium.com";
|
||||||
|
ExternalPort = 443;
|
||||||
|
ExternalSecure = true;
|
||||||
|
Machine = {
|
||||||
|
Identification = {
|
||||||
|
Hostname.Enabled = true;
|
||||||
|
PrivateIp.Enabled = false;
|
||||||
|
Webhook.Enabled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Port = 8081;
|
||||||
|
WebAuthNName = "Vimium";
|
||||||
|
};
|
||||||
|
steps.FirstInstance = {
|
||||||
|
InstanceName = "Vimium";
|
||||||
|
Org.Name = "Vimium";
|
||||||
|
Org.Human = {
|
||||||
|
UserName = "jordan@vimium.com";
|
||||||
|
FirstName = "Jordan";
|
||||||
|
LastName = "Holt";
|
||||||
|
Email = {
|
||||||
|
Address = "jordan@vimium.com";
|
||||||
|
Verified = true;
|
||||||
|
};
|
||||||
|
Password = "Password1!";
|
||||||
|
PasswordChangeRequired = true;
|
||||||
|
};
|
||||||
|
LoginPolicy.AllowRegister = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."id.vimium.com" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
extraConfig = ''
|
||||||
|
grpc_pass grpc://localhost:${builtins.toString config.services.zitadel.settings.Port};
|
||||||
|
grpc_set_header Host $host:$server_port;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = rec {
|
modules = rec {
|
||||||
|
databases.postgresql.enable = true;
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -112,11 +150,10 @@
|
|||||||
signal = true;
|
signal = true;
|
||||||
whatsapp = true;
|
whatsapp = true;
|
||||||
};
|
};
|
||||||
usePostgresql = services.postgresql.enable;
|
usePostgresql = databases.postgresql.enable;
|
||||||
};
|
};
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
photoprism.enable = true;
|
photoprism.enable = true;
|
||||||
postgresql.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -10,12 +7,7 @@
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
"ata_piix"
|
|
||||||
"uhci_hcd"
|
|
||||||
"xen_blkfront"
|
|
||||||
"vmw_pvscsi"
|
|
||||||
];
|
|
||||||
kernelModules = [ "nvme" ];
|
kernelModules = [ "nvme" ];
|
||||||
};
|
};
|
||||||
loader.grub.device = "/dev/sda";
|
loader.grub.device = "/dev/sda";
|
||||||
@ -31,3 +23,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,10 +5,9 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.postgresql;
|
cfg = config.modules.databases.postgresql;
|
||||||
in
|
in {
|
||||||
{
|
options.modules.databases.postgresql = {
|
||||||
options.modules.services.postgresql = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -18,6 +17,7 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableJIT = true;
|
||||||
initdbArgs = [
|
initdbArgs = [
|
||||||
"--allow-group-access"
|
"--allow-group-access"
|
||||||
"--encoding=UTF8"
|
"--encoding=UTF8"
|
52
modules/default.nix
Normal file
52
modules/default.nix
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./options.nix
|
||||||
|
./podman.nix
|
||||||
|
./databases/postgresql.nix
|
||||||
|
./desktop/gnome.nix
|
||||||
|
./desktop/forensics.nix
|
||||||
|
./desktop/hyprland.nix
|
||||||
|
./desktop/kde.nix
|
||||||
|
./desktop/mimeapps.nix
|
||||||
|
./desktop/apps/qbittorrent.nix
|
||||||
|
./desktop/apps/slack.nix
|
||||||
|
./desktop/apps/thunderbird.nix
|
||||||
|
./desktop/apps/zoom.nix
|
||||||
|
./desktop/browsers/brave.nix
|
||||||
|
./desktop/browsers/firefox.nix
|
||||||
|
./desktop/gaming/emulators.nix
|
||||||
|
./desktop/gaming/lutris.nix
|
||||||
|
./desktop/gaming/steam.nix
|
||||||
|
./desktop/media/graphics.nix
|
||||||
|
./desktop/media/recording.nix
|
||||||
|
./desktop/office/libreoffice.nix
|
||||||
|
./dev/cc.nix
|
||||||
|
./dev/java.nix
|
||||||
|
./dev/lua.nix
|
||||||
|
./dev/node.nix
|
||||||
|
./dev/python.nix
|
||||||
|
./dev/rust.nix
|
||||||
|
./dev/scala.nix
|
||||||
|
./dev/shell.nix
|
||||||
|
./dev/zig.nix
|
||||||
|
./editors/neovim
|
||||||
|
./editors/vscode.nix
|
||||||
|
./hardware/presonus-studio.nix
|
||||||
|
./networking/tailscale.nix
|
||||||
|
./networking/wireless.nix
|
||||||
|
./security/gpg.nix
|
||||||
|
./security/pass.nix
|
||||||
|
./services/borgmatic
|
||||||
|
./services/chrony
|
||||||
|
./services/coturn
|
||||||
|
./services/gitea
|
||||||
|
./services/gitea-runner
|
||||||
|
./services/headscale
|
||||||
|
./services/mail
|
||||||
|
./services/matrix
|
||||||
|
./services/nginx
|
||||||
|
./services/photoprism
|
||||||
|
./shell/git
|
||||||
|
./shell/zsh
|
||||||
|
];
|
||||||
|
}
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.apps.qbittorrent;
|
||||||
cfg = config.modules.programs.qbittorrent;
|
in {
|
||||||
in
|
options.modules.desktop.apps.qbittorrent = {
|
||||||
{
|
|
||||||
options.modules.programs.qbittorrent = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.apps.slack;
|
||||||
cfg = config.modules.programs.slack;
|
in {
|
||||||
in
|
options.modules.desktop.apps.slack = {
|
||||||
{
|
|
||||||
options.modules.programs.slack = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,24 +1,16 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.apps.thunderbird;
|
||||||
cfg = config.modules.programs.thunderbird;
|
in {
|
||||||
in
|
options.modules.desktop.apps.thunderbird = {
|
||||||
{
|
|
||||||
options.modules.programs.thunderbird = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.file.".thunderbird/Default/chrome/thunderbird-gnome-theme".source =
|
home.file.".thunderbird/Default/chrome/thunderbird-gnome-theme".source = self.inputs.thunderbird-gnome-theme;
|
||||||
self.inputs.thunderbird-gnome-theme;
|
|
||||||
|
|
||||||
home.programs.thunderbird = {
|
home.programs.thunderbird = {
|
||||||
enable = true;
|
enable = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.apps.zoom;
|
||||||
cfg = config.modules.programs.zoom;
|
in {
|
||||||
in
|
options.modules.desktop.apps.zoom = {
|
||||||
{
|
|
||||||
options.modules.programs.zoom = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.browsers.brave;
|
||||||
cfg = config.modules.programs.brave;
|
in {
|
||||||
in
|
options.modules.desktop.browsers.brave = {
|
||||||
{
|
|
||||||
options.modules.programs.brave = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.browsers.firefox;
|
||||||
cfg = config.modules.programs.firefox;
|
in {
|
||||||
in
|
options.modules.desktop.browsers.firefox = {
|
||||||
{
|
|
||||||
options.modules.programs.firefox = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -17,8 +10,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.file.".mozilla/firefox/Default/chrome/firefox-gnome-theme".source =
|
home.file.".mozilla/firefox/Default/chrome/firefox-gnome-theme".source = self.inputs.firefox-gnome-theme;
|
||||||
self.inputs.firefox-gnome-theme;
|
|
||||||
|
|
||||||
home.programs.firefox = {
|
home.programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.forensics;
|
||||||
cfg = config.modules.programs.forensics;
|
in {
|
||||||
in
|
options.modules.desktop.forensics = {
|
||||||
{
|
|
||||||
options.modules.programs.forensics = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,24 +1,17 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.gaming.emulators;
|
||||||
cfg = config.modules.programs.emulators;
|
in {
|
||||||
in
|
options.modules.desktop.gaming.emulators = {
|
||||||
{
|
ds.enable = lib.mkOption {
|
||||||
options.modules.programs.emulators = {
|
|
||||||
ds.enable = lib.mkOption {
|
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
gb.enable = lib.mkOption {
|
gb.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
gba.enable = lib.mkOption {
|
gba.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
@ -26,35 +19,35 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
ps1.enable = lib.mkOption {
|
ps1.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
ps2.enable = lib.mkOption {
|
ps2.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
ps3.enable = lib.mkOption {
|
ps3.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
psp.enable = lib.mkOption {
|
psp.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
snes.enable = lib.mkOption {
|
snes.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
switch.enable = lib.mkOption {
|
switch.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
wii.enable = lib.mkOption {
|
wii.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
xbox.enable = lib.mkOption {
|
xbox.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
@ -67,9 +60,14 @@ in
|
|||||||
(lib.mkIf cfg.ps3.enable rpcs3)
|
(lib.mkIf cfg.ps3.enable rpcs3)
|
||||||
(lib.mkIf cfg.psp.enable unstable.ppsspp)
|
(lib.mkIf cfg.psp.enable unstable.ppsspp)
|
||||||
(lib.mkIf cfg.ds.enable desmume)
|
(lib.mkIf cfg.ds.enable desmume)
|
||||||
(lib.mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) higan)
|
(lib.mkIf (cfg.gba.enable ||
|
||||||
|
cfg.gb.enable ||
|
||||||
|
cfg.snes.enable)
|
||||||
|
higan)
|
||||||
(lib.mkIf cfg.switch.enable yuzuPackages.mainline)
|
(lib.mkIf cfg.switch.enable yuzuPackages.mainline)
|
||||||
(lib.mkIf (cfg.wii.enable || cfg.gamecube.enable) dolphin-emu)
|
(lib.mkIf (cfg.wii.enable ||
|
||||||
|
cfg.gamecube.enable)
|
||||||
|
dolphin-emu)
|
||||||
(lib.mkIf cfg.xbox.enable unstable.xemu)
|
(lib.mkIf cfg.xbox.enable unstable.xemu)
|
||||||
];
|
];
|
||||||
};
|
};
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.gaming.lutris;
|
||||||
cfg = config.modules.programs.lutris;
|
in {
|
||||||
in
|
options.modules.desktop.gaming.lutris = {
|
||||||
{
|
|
||||||
options.modules.programs.lutris = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -28,9 +21,10 @@ in
|
|||||||
vulkan-tools
|
vulkan-tools
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true;
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -1,14 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.gaming.steam;
|
||||||
cfg = config.modules.programs.steam;
|
in {
|
||||||
in
|
options.modules.desktop.gaming.steam = {
|
||||||
{
|
|
||||||
options.modules.programs.steam = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,16 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.gnome;
|
||||||
cfg = config.modules.system.desktop.gnome;
|
in {
|
||||||
in
|
options.modules.desktop.gnome = {
|
||||||
{
|
|
||||||
options.modules.system.desktop.gnome = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -32,11 +24,6 @@ in
|
|||||||
"io/github/celluloid-player/celluloid" = {
|
"io/github/celluloid-player/celluloid" = {
|
||||||
draggable-video-area-enable = true;
|
draggable-video-area-enable = true;
|
||||||
};
|
};
|
||||||
"org/gnome/Console" = {
|
|
||||||
font-scale = 1.4;
|
|
||||||
use-system-font = false;
|
|
||||||
custom-font = "ComicShannsMono Nerd Font 10";
|
|
||||||
};
|
|
||||||
"org/gnome/desktop/interface" = {
|
"org/gnome/desktop/interface" = {
|
||||||
color-scheme = "prefer-dark";
|
color-scheme = "prefer-dark";
|
||||||
cursor-theme = "Adwaita";
|
cursor-theme = "Adwaita";
|
||||||
@ -74,11 +61,6 @@ in
|
|||||||
edge-tiling = true;
|
edge-tiling = true;
|
||||||
experimental-features = [ "scale-monitor-framebuffer" ];
|
experimental-features = [ "scale-monitor-framebuffer" ];
|
||||||
};
|
};
|
||||||
"org/gnome/Ptyxis" = {
|
|
||||||
use-system-font = false;
|
|
||||||
font-name = "ComicShannsMono Nerd Font 11";
|
|
||||||
audible-bell = false;
|
|
||||||
};
|
|
||||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||||
volume-up = [
|
volume-up = [
|
||||||
"<Shift>F12"
|
"<Shift>F12"
|
||||||
@ -95,6 +77,7 @@ in
|
|||||||
"appindicatorsupport@rgcjonas.gmail.com"
|
"appindicatorsupport@rgcjonas.gmail.com"
|
||||||
# "arcmenu@arcmenu.com"
|
# "arcmenu@arcmenu.com"
|
||||||
"blur-my-shell@aunetx"
|
"blur-my-shell@aunetx"
|
||||||
|
# "browser-tabs@com.github.harshadgavali"
|
||||||
"burn-my-windows@schneegans.github.com"
|
"burn-my-windows@schneegans.github.com"
|
||||||
"clipboard-indicator@tudmotu.com"
|
"clipboard-indicator@tudmotu.com"
|
||||||
"CoverflowAltTab@palatis.blogspot.com"
|
"CoverflowAltTab@palatis.blogspot.com"
|
||||||
@ -106,13 +89,14 @@ in
|
|||||||
# "forge@jmmaranan.com"
|
# "forge@jmmaranan.com"
|
||||||
"gsconnect@andyholmes.github.io"
|
"gsconnect@andyholmes.github.io"
|
||||||
# "gSnap@micahosborne"
|
# "gSnap@micahosborne"
|
||||||
"hidetopbar@mathieu.bidon.ca"
|
# "hidetopbar@mathieu.bidon.ca"
|
||||||
"just-perfection-desktop@just-perfection"
|
"just-perfection-desktop@just-perfection"
|
||||||
# "mediacontrols@cliffniff.github.com"
|
# "mediacontrols@cliffniff.github.com"
|
||||||
# "mousefollowsfocus@matthes.biz"
|
# "mousefollowsfocus@matthes.biz"
|
||||||
# "pano@elhan.io"
|
# "pano@elhan.io"
|
||||||
# "paperwm@hedning:matrix.org"
|
# "paperwm@hedning:matrix.org"
|
||||||
"pip-on-top@rafostar.github.com"
|
"pip-on-top@rafostar.github.com"
|
||||||
|
# "rounded-window-corners@yilozt"
|
||||||
# "search-light@icedman.github.com"
|
# "search-light@icedman.github.com"
|
||||||
# "smart-auto-move@khimaros.com"
|
# "smart-auto-move@khimaros.com"
|
||||||
"space-bar@luchrioh"
|
"space-bar@luchrioh"
|
||||||
@ -126,7 +110,6 @@ in
|
|||||||
favorite-apps = [
|
favorite-apps = [
|
||||||
"firefox.desktop"
|
"firefox.desktop"
|
||||||
"org.gnome.Nautilus.desktop"
|
"org.gnome.Nautilus.desktop"
|
||||||
"org.gnome.Ptyxis.desktop"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"org/gnome/shell/extensions/blur-my-shell/panel" = {
|
"org/gnome/shell/extensions/blur-my-shell/panel" = {
|
||||||
@ -200,6 +183,11 @@ in
|
|||||||
outer-gaps = 8;
|
outer-gaps = 8;
|
||||||
enable-blur-snap-assistant = true;
|
enable-blur-snap-assistant = true;
|
||||||
};
|
};
|
||||||
|
"org/gnome/Console" = {
|
||||||
|
font-scale = 1.4;
|
||||||
|
use-system-font = false;
|
||||||
|
custom-font = "ComicShannsMono Nerd Font 10";
|
||||||
|
};
|
||||||
"org/gtk/settings/file-chooser" = {
|
"org/gtk/settings/file-chooser" = {
|
||||||
show-hidden = true;
|
show-hidden = true;
|
||||||
sort-directories-first = true;
|
sort-directories-first = true;
|
||||||
@ -216,47 +204,38 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
home.configFile = {
|
home.configFile = {
|
||||||
"Kvantum/kvantum.kvconfig".text = lib.generators.toINI { } {
|
"Kvantum/kvantum.kvconfig".text = lib.generators.toINI {} {
|
||||||
General.theme = "KvLibadwaitaDark";
|
General.theme = "KvLibadwaitaDark";
|
||||||
};
|
};
|
||||||
"Kvantum/KvLibadwaita".source = "${self.inputs.kvlibadwaita}/src/KvLibadwaita";
|
"Kvantum/KvLibadwaita".source = "${self.inputs.kvlibadwaita}/src/KvLibadwaita";
|
||||||
};
|
};
|
||||||
|
|
||||||
user.packages =
|
user.packages = with pkgs; [
|
||||||
with pkgs;
|
authenticator
|
||||||
[
|
# bottles
|
||||||
authenticator
|
# bustle
|
||||||
# bottles
|
celluloid
|
||||||
# bustle
|
# d-spy
|
||||||
celluloid
|
# drawing
|
||||||
# d-spy
|
# fragments
|
||||||
# drawing
|
gnome.dconf-editor
|
||||||
# fragments
|
gnome.ghex
|
||||||
dconf-editor
|
# gnome-builder
|
||||||
ghex
|
gnome-decoder
|
||||||
# gnome-builder
|
gnome-firmware
|
||||||
gnome-decoder
|
gnome-frog
|
||||||
gnome-firmware
|
# gnome-obfuscate
|
||||||
gnome-frog
|
gnome-podcasts
|
||||||
# gnome-obfuscate
|
identity
|
||||||
gnome-podcasts
|
mission-center
|
||||||
identity
|
mousam
|
||||||
# mission-center
|
newsflash
|
||||||
mousam
|
# schemes
|
||||||
newsflash
|
shortwave
|
||||||
ptyxis
|
sysprof
|
||||||
# schemes
|
] ++ (if config.virtualisation.podman.enable then [
|
||||||
shortwave
|
pods
|
||||||
sysprof
|
] else []);
|
||||||
]
|
|
||||||
++ (
|
|
||||||
if config.virtualisation.podman.enable then
|
|
||||||
[
|
|
||||||
pods
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[ ]
|
|
||||||
);
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs.unstable; [
|
environment.systemPackages = with pkgs.unstable; [
|
||||||
adw-gtk3
|
adw-gtk3
|
||||||
@ -271,6 +250,7 @@ in
|
|||||||
gnomeExtensions.appindicator
|
gnomeExtensions.appindicator
|
||||||
gnomeExtensions.arcmenu
|
gnomeExtensions.arcmenu
|
||||||
gnomeExtensions.blur-my-shell
|
gnomeExtensions.blur-my-shell
|
||||||
|
gnomeExtensions.browser-tabs
|
||||||
gnomeExtensions.burn-my-windows
|
gnomeExtensions.burn-my-windows
|
||||||
gnomeExtensions.clipboard-indicator
|
gnomeExtensions.clipboard-indicator
|
||||||
gnomeExtensions.coverflow-alt-tab
|
gnomeExtensions.coverflow-alt-tab
|
||||||
@ -286,9 +266,10 @@ in
|
|||||||
gnomeExtensions.just-perfection
|
gnomeExtensions.just-perfection
|
||||||
gnomeExtensions.media-controls
|
gnomeExtensions.media-controls
|
||||||
gnomeExtensions.mouse-follows-focus
|
gnomeExtensions.mouse-follows-focus
|
||||||
# gnomeExtensions.pano (disabled due to: https://github.com/NixOS/nixpkgs/issues/369438)
|
gnomeExtensions.pano
|
||||||
gnomeExtensions.paperwm
|
gnomeExtensions.paperwm
|
||||||
gnomeExtensions.pip-on-top
|
gnomeExtensions.pip-on-top
|
||||||
|
gnomeExtensions.rounded-window-corners
|
||||||
gnomeExtensions.search-light
|
gnomeExtensions.search-light
|
||||||
gnomeExtensions.smart-auto-move
|
gnomeExtensions.smart-auto-move
|
||||||
gnomeExtensions.space-bar
|
gnomeExtensions.space-bar
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.hyprland;
|
||||||
cfg = config.modules.system.desktop.hyprland;
|
in {
|
||||||
in
|
options.modules.desktop.hyprland = {
|
||||||
{
|
|
||||||
options.modules.system.desktop.hyprland = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.kde;
|
||||||
cfg = config.modules.system.desktop.kde;
|
in {
|
||||||
in
|
options.modules.desktop.kde = {
|
||||||
{
|
|
||||||
options.modules.system.desktop.kde = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,24 +1,17 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop.media.graphics;
|
||||||
cfg = config.modules.programs.graphics;
|
in {
|
||||||
in
|
options.modules.desktop.media.graphics = {
|
||||||
{
|
|
||||||
options.modules.programs.graphics = {
|
|
||||||
modeling.enable = lib.mkOption {
|
modeling.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
raster.enable = lib.mkOption {
|
raster.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
vector.enable = lib.mkOption {
|
vector.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
28
modules/desktop/media/recording.nix
Normal file
28
modules/desktop/media/recording.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.media.recording;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.media.recording = {
|
||||||
|
audio.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
video.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
user.packages = with pkgs;
|
||||||
|
(if cfg.audio.enable then [
|
||||||
|
ardour
|
||||||
|
audacity
|
||||||
|
] else []) ++
|
||||||
|
(if cfg.video.enable then [
|
||||||
|
handbrake
|
||||||
|
mkvtoolnix
|
||||||
|
obs-studio
|
||||||
|
] else []);
|
||||||
|
};
|
||||||
|
}
|
@ -1,16 +1,11 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.system.desktop.mimeapps;
|
cfg = config.modules.desktop.mimeapps;
|
||||||
avApp = "io.github.celluloid_player.Celluloid.desktop";
|
avApp = "io.github.celluloid_player.Celluloid.desktop";
|
||||||
imageApp = "org.gnome.eog.desktop";
|
imageApp = "org.gnome.eog.desktop";
|
||||||
in
|
in {
|
||||||
{
|
options.modules.desktop.mimeapps = {
|
||||||
options.modules.system.desktop.mimeapps = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
38
modules/desktop/office/libreoffice.nix
Normal file
38
modules/desktop/office/libreoffice.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.office.libreoffice;
|
||||||
|
# libreoffice-gtk4 = pkgs.libreoffice.override {
|
||||||
|
# extraMakeWrapperArgs = [
|
||||||
|
# "--set SAL_USE_VCLPLUGIN gtk4"
|
||||||
|
# ];
|
||||||
|
# unwrapped = pkgs.libreoffice-unwrapped.overrideAttrs (oldAttrs: {
|
||||||
|
# buildInputs = oldAttrs.buildInputs ++ [
|
||||||
|
# pkgs.gtk4
|
||||||
|
# ];
|
||||||
|
# configureFlags = oldAttrs.configureFlags ++ [
|
||||||
|
# "--disable-werror"
|
||||||
|
# "--enable-gtk4"
|
||||||
|
# ];
|
||||||
|
# passthru = oldAttrs.passthru // {
|
||||||
|
# inherit (pkgs) gtk4;
|
||||||
|
# };
|
||||||
|
# });
|
||||||
|
# };
|
||||||
|
in {
|
||||||
|
options.modules.desktop.office.libreoffice = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
(if config.modules.desktop.kde.enable == true then libreoffice-qt else libreoffice)
|
||||||
|
hunspell
|
||||||
|
hunspellDicts.en-gb-large
|
||||||
|
hunspellDicts.en-us-large
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.cc;
|
||||||
cfg = config.modules.programs.dev.cc;
|
in {
|
||||||
in
|
options.modules.dev.cc = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.cc = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.java;
|
||||||
cfg = config.modules.programs.dev.java;
|
in {
|
||||||
in
|
options.modules.dev.java = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.java = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.lua;
|
||||||
cfg = config.modules.programs.dev.lua;
|
in {
|
||||||
in
|
options.modules.dev.lua = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.lua = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
17
modules/dev/node.nix
Normal file
17
modules/dev/node.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.node;
|
||||||
|
in {
|
||||||
|
options.modules.dev.node = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
nodejs_latest
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.python;
|
||||||
cfg = config.modules.programs.dev.python;
|
in {
|
||||||
in
|
options.modules.dev.python = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.python = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.rust;
|
||||||
cfg = config.modules.programs.dev.rust;
|
in {
|
||||||
in
|
options.modules.dev.rust = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.rust = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.scala;
|
||||||
cfg = config.modules.programs.dev.scala;
|
in {
|
||||||
in
|
options.modules.dev.scala = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.scala = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.shell;
|
||||||
cfg = config.modules.programs.dev.shell;
|
in {
|
||||||
in
|
options.modules.dev.shell = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.shell = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev.zig;
|
||||||
cfg = config.modules.programs.dev.zig;
|
in {
|
||||||
in
|
options.modules.dev.zig = {
|
||||||
{
|
|
||||||
options.modules.programs.dev.zig = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,14 +1,9 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.programs.neovim;
|
cfg = config.modules.editors.neovim;
|
||||||
in
|
in {
|
||||||
{
|
options.modules.editors.neovim = {
|
||||||
options.modules.programs.neovim = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -16,7 +11,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.programs.nixvim.config = {
|
home.programs.nixvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
|
|
||||||
@ -64,15 +59,15 @@ in
|
|||||||
eslint.enable = true;
|
eslint.enable = true;
|
||||||
gopls.enable = true;
|
gopls.enable = true;
|
||||||
html.enable = true;
|
html.enable = true;
|
||||||
lua_ls.enable = true;
|
lua-ls.enable = true;
|
||||||
pylsp.enable = true;
|
pylsp.enable = true;
|
||||||
nixd.enable = true;
|
nixd.enable = true;
|
||||||
rust_analyzer = {
|
rust-analyzer = {
|
||||||
enable = true;
|
enable = true;
|
||||||
installCargo = true;
|
installCargo = true;
|
||||||
installRustc = true;
|
installRustc = true;
|
||||||
};
|
};
|
||||||
ts_ls.enable = true;
|
tsserver.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -113,7 +108,7 @@ in
|
|||||||
nixvimInjections = true;
|
nixvimInjections = true;
|
||||||
|
|
||||||
folding = true;
|
folding = true;
|
||||||
settings.indent.enable = true;
|
indent = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins.treesitter-refactor = {
|
plugins.treesitter-refactor = {
|
||||||
@ -126,8 +121,6 @@ in
|
|||||||
|
|
||||||
plugins.undotree.enable = true;
|
plugins.undotree.enable = true;
|
||||||
|
|
||||||
plugins.web-devicons.enable = true;
|
|
||||||
|
|
||||||
# plugins.gitsigns.enable = true;
|
# plugins.gitsigns.enable = true;
|
||||||
# plugins.gitgutter.enable = true;
|
# plugins.gitgutter.enable = true;
|
||||||
# plugins.goyo.enable = true;
|
# plugins.goyo.enable = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.editors.vscode;
|
||||||
cfg = config.modules.programs.vscode;
|
in {
|
||||||
in
|
options.modules.editors.vscode = {
|
||||||
{
|
|
||||||
options.modules.programs.vscode = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -15,16 +15,16 @@ index ab5fed9f55b6..da50a4782414 100644
|
|||||||
--- a/sound/usb/format.c
|
--- a/sound/usb/format.c
|
||||||
+++ b/sound/usb/format.c
|
+++ b/sound/usb/format.c
|
||||||
@@ -378,8 +378,8 @@ static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip,
|
@@ -378,8 +378,8 @@ static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip,
|
||||||
|
|
||||||
for (rate = min; rate <= max; rate += res) {
|
for (rate = min; rate <= max; rate += res) {
|
||||||
|
|
||||||
- /* Filter out invalid rates on Presonus Studio 1810c */
|
- /* Filter out invalid rates on Presonus Studio 1810c */
|
||||||
- if (chip->usb_id == USB_ID(0x194f, 0x010c) &&
|
- if (chip->usb_id == USB_ID(0x194f, 0x010c) &&
|
||||||
+ /* Filter out invalid rates on Presonus Studio 1824c */
|
+ /* Filter out invalid rates on Presonus Studio 1824c */
|
||||||
+ if (chip->usb_id == USB_ID(0x194f, 0x010d) &&
|
+ if (chip->usb_id == USB_ID(0x194f, 0x010d) &&
|
||||||
!s1810c_valid_sample_rate(fp, rate))
|
!s1810c_valid_sample_rate(fp, rate))
|
||||||
goto skip_rate;
|
goto skip_rate;
|
||||||
|
|
||||||
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
|
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
|
||||||
index 898bc3baca7b..c3135459c38c 100644
|
index 898bc3baca7b..c3135459c38c 100644
|
||||||
--- a/sound/usb/mixer_quirks.c
|
--- a/sound/usb/mixer_quirks.c
|
||||||
@ -32,7 +32,7 @@ index 898bc3baca7b..c3135459c38c 100644
|
|||||||
@@ -3445,7 +3445,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
|
@@ -3445,7 +3445,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
|
||||||
err = snd_rme_controls_create(mixer);
|
err = snd_rme_controls_create(mixer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
- case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
|
- case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
|
||||||
+ case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
|
+ case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
|
||||||
err = snd_sc1810_init_mixer(mixer);
|
err = snd_sc1810_init_mixer(mixer);
|
||||||
@ -44,7 +44,7 @@ index fac4bbc6b275..5bc2e66d452c 100644
|
|||||||
+++ b/sound/usb/mixer_s1810c.c
|
+++ b/sound/usb/mixer_s1810c.c
|
||||||
@@ -552,7 +552,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
|
@@ -552,7 +552,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dev_info(&dev->dev,
|
dev_info(&dev->dev,
|
||||||
- "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
|
- "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
|
||||||
+ "Presonus Studio 1824c, device_setup: %u\n", chip->setup);
|
+ "Presonus Studio 1824c, device_setup: %u\n", chip->setup);
|
||||||
@ -64,7 +64,8 @@ index ab2b938502eb..b86832edaaa0 100644
|
|||||||
+ /* presonus studio 1824c: skip altsets incompatible with device_setup */
|
+ /* presonus studio 1824c: skip altsets incompatible with device_setup */
|
||||||
+ if (chip->usb_id == USB_ID(0x194f, 0x010d))
|
+ if (chip->usb_id == USB_ID(0x194f, 0x010d))
|
||||||
return s1810c_skip_setting_quirk(chip, iface, altno);
|
return s1810c_skip_setting_quirk(chip, iface, altno);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
2.42.0
|
2.42.0
|
||||||
|
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.hardware.presonus-studio;
|
cfg = config.modules.hardware.presonus-studio;
|
||||||
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
||||||
@ -18,8 +13,7 @@ let
|
|||||||
"channelmix.upmix-method" = "psd";
|
"channelmix.upmix-method" = "psd";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.hardware.presonus-studio = {
|
options.modules.hardware.presonus-studio = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -73,23 +67,11 @@ in
|
|||||||
"capture.props" = {
|
"capture.props" = {
|
||||||
"node.name" = "Genelec_Speakers";
|
"node.name" = "Genelec_Speakers";
|
||||||
"media.class" = "Audio/Sink";
|
"media.class" = "Audio/Sink";
|
||||||
"audio.position" = [
|
"audio.position" = [ "FL" "FR" "SL" "SR" "LFE" ];
|
||||||
"FL"
|
|
||||||
"FR"
|
|
||||||
"SL"
|
|
||||||
"SR"
|
|
||||||
"LFE"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
"playback.props" = {
|
"playback.props" = {
|
||||||
"node.name" = "playback.Genelec_Speakers";
|
"node.name" = "playback.Genelec_Speakers";
|
||||||
"audio.position" = [
|
"audio.position" = [ "AUX0" "AUX1" "AUX3" "AUX4" "AUX5" ];
|
||||||
"AUX0"
|
|
||||||
"AUX1"
|
|
||||||
"AUX3"
|
|
||||||
"AUX4"
|
|
||||||
"AUX5"
|
|
||||||
];
|
|
||||||
"target.object" = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output";
|
"target.object" = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output";
|
||||||
"stream.dont-remix" = true;
|
"stream.dont-remix" = true;
|
||||||
"node.passive" = true;
|
"node.passive" = true;
|
||||||
@ -103,4 +85,4 @@ in
|
|||||||
client-rt."40-upmix" = upmixConfig;
|
client-rt."40-upmix" = upmixConfig;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -1,17 +1,8 @@
|
|||||||
{
|
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
kernel ? pkgs.linuxPackages_latest.kernel,
|
|
||||||
}:
|
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
pname = "snd-usb-audio";
|
pname = "snd-usb-audio";
|
||||||
inherit (kernel)
|
inherit (kernel) src version postPatch nativeBuildInputs;
|
||||||
src
|
|
||||||
version
|
|
||||||
postPatch
|
|
||||||
nativeBuildInputs
|
|
||||||
;
|
|
||||||
|
|
||||||
kernel_dev = kernel.dev;
|
kernel_dev = kernel.dev;
|
||||||
kernelVersion = kernel.modDirVersion;
|
kernelVersion = kernel.modDirVersion;
|
||||||
@ -42,3 +33,4 @@ pkgs.stdenv.mkDerivation {
|
|||||||
license = lib.licenses.gpl2;
|
license = lib.licenses.gpl2;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [
|
|
||||||
./options.nix
|
|
||||||
./programs/brave.nix
|
|
||||||
./programs/dev/cc.nix
|
|
||||||
./programs/dev/java.nix
|
|
||||||
./programs/dev/lua.nix
|
|
||||||
./programs/dev/node.nix
|
|
||||||
./programs/dev/python.nix
|
|
||||||
./programs/dev/rust.nix
|
|
||||||
./programs/dev/scala.nix
|
|
||||||
./programs/dev/shell.nix
|
|
||||||
./programs/dev/zig.nix
|
|
||||||
./programs/emulators.nix
|
|
||||||
./programs/firefox.nix
|
|
||||||
./programs/forensics.nix
|
|
||||||
./programs/git
|
|
||||||
./programs/gpg.nix
|
|
||||||
./programs/graphics.nix
|
|
||||||
./programs/libreoffice.nix
|
|
||||||
./programs/lutris.nix
|
|
||||||
./programs/neovim.nix
|
|
||||||
./programs/pass.nix
|
|
||||||
./programs/qbittorrent.nix
|
|
||||||
./programs/recording.nix
|
|
||||||
./programs/slack.nix
|
|
||||||
./programs/steam.nix
|
|
||||||
./programs/thunderbird.nix
|
|
||||||
./programs/vscode.nix
|
|
||||||
./programs/zoom.nix
|
|
||||||
./shell/zsh
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,137 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
options = with types; {
|
|
||||||
user = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
home = {
|
|
||||||
configFile = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "Files to place in $XDG_CONFIG_HOME";
|
|
||||||
};
|
|
||||||
dataFile = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "Files to place in $XDG_DATA_HOME";
|
|
||||||
};
|
|
||||||
file = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "Files to place directly in $HOME";
|
|
||||||
};
|
|
||||||
packages = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "User-level installed packages";
|
|
||||||
};
|
|
||||||
programs = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "Programs managed directly from home-manager";
|
|
||||||
};
|
|
||||||
services = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "Services managed directly from home-manager";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
dconf.settings = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = { };
|
|
||||||
description = "dconf settings to enable";
|
|
||||||
};
|
|
||||||
|
|
||||||
env = mkOption {
|
|
||||||
type = attrsOf (oneOf [
|
|
||||||
str
|
|
||||||
path
|
|
||||||
(listOf (either str path))
|
|
||||||
]);
|
|
||||||
apply = mapAttrs (
|
|
||||||
n: v: if isList v then concatMapStringsSep ":" (x: toString x) v else (toString v)
|
|
||||||
);
|
|
||||||
default = { };
|
|
||||||
description = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age";
|
|
||||||
user =
|
|
||||||
let
|
|
||||||
user = builtins.getEnv "USER";
|
|
||||||
name =
|
|
||||||
if
|
|
||||||
elem user [
|
|
||||||
""
|
|
||||||
"root"
|
|
||||||
]
|
|
||||||
then
|
|
||||||
"jordan"
|
|
||||||
else
|
|
||||||
user;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit name;
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [
|
|
||||||
"audio"
|
|
||||||
"lxd"
|
|
||||||
"networkmanager"
|
|
||||||
"wheel"
|
|
||||||
];
|
|
||||||
description = "Jordan Holt";
|
|
||||||
useDefaultShell = true;
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
|
||||||
];
|
|
||||||
hashedPasswordFile = config.age.secrets."passwords/users/jordan".path;
|
|
||||||
home = "/home/${name}";
|
|
||||||
group = "users";
|
|
||||||
uid = 1000;
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
|
|
||||||
users.${config.user.name} = {
|
|
||||||
home = {
|
|
||||||
file = mkAliasDefinitions options.home.file;
|
|
||||||
stateVersion = config.system.stateVersion;
|
|
||||||
};
|
|
||||||
programs = mkAliasDefinitions options.home.programs;
|
|
||||||
services = mkAliasDefinitions options.home.services;
|
|
||||||
xdg = {
|
|
||||||
enable = true;
|
|
||||||
configFile = mkAliasDefinitions options.home.configFile;
|
|
||||||
dataFile = mkAliasDefinitions options.home.dataFile;
|
|
||||||
};
|
|
||||||
dconf.settings = mkAliasDefinitions options.dconf.settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
sharedModules = [
|
|
||||||
self.inputs.nixvim.homeManagerModules.nixvim
|
|
||||||
self.inputs.plasma-manager.homeManagerModules.plasma-manager
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
|
||||||
|
|
||||||
environment.extraInit = concatStringsSep "\n" (
|
|
||||||
mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.programs.dev.node;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.programs.dev.node = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
user.packages = with pkgs; [
|
|
||||||
nodejs_22
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.programs.libreoffice;
|
|
||||||
in
|
|
||||||
# libreoffice-gtk4 = pkgs.libreoffice.override {
|
|
||||||
# extraMakeWrapperArgs = [
|
|
||||||
# "--set SAL_USE_VCLPLUGIN gtk4"
|
|
||||||
# ];
|
|
||||||
# unwrapped = pkgs.libreoffice-unwrapped.overrideAttrs (oldAttrs: {
|
|
||||||
# buildInputs = oldAttrs.buildInputs ++ [
|
|
||||||
# pkgs.gtk4
|
|
||||||
# ];
|
|
||||||
# configureFlags = oldAttrs.configureFlags ++ [
|
|
||||||
# "--disable-werror"
|
|
||||||
# "--enable-gtk4"
|
|
||||||
# ];
|
|
||||||
# passthru = oldAttrs.passthru // {
|
|
||||||
# inherit (pkgs) gtk4;
|
|
||||||
# };
|
|
||||||
# });
|
|
||||||
# };
|
|
||||||
{
|
|
||||||
options.modules.programs.libreoffice = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
user.packages = with pkgs; [
|
|
||||||
(if config.modules.system.desktop.kde.enable == true then libreoffice-qt else libreoffice)
|
|
||||||
hunspell
|
|
||||||
hunspellDicts.en-gb-large
|
|
||||||
hunspellDicts.en-us-large
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.programs.recording;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.programs.recording = {
|
|
||||||
audio.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
video.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
user.packages =
|
|
||||||
with pkgs;
|
|
||||||
(
|
|
||||||
if cfg.audio.enable then
|
|
||||||
[
|
|
||||||
ardour
|
|
||||||
audacity
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[ ]
|
|
||||||
)
|
|
||||||
++ (
|
|
||||||
if cfg.video.enable then
|
|
||||||
[
|
|
||||||
handbrake
|
|
||||||
mkvtoolnix
|
|
||||||
obs-studio
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[ ]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,192 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.shell.zsh;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.shell.zsh = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
users.defaultUserShell = pkgs.zsh;
|
|
||||||
|
|
||||||
home.programs = {
|
|
||||||
zsh = {
|
|
||||||
enable = true;
|
|
||||||
autocd = true;
|
|
||||||
autosuggestion = {
|
|
||||||
enable = true;
|
|
||||||
strategy = [ "completion" ];
|
|
||||||
};
|
|
||||||
defaultKeymap = "viins";
|
|
||||||
dotDir = ".config/zsh";
|
|
||||||
enableCompletion = true;
|
|
||||||
enableVteIntegration = true;
|
|
||||||
|
|
||||||
history = {
|
|
||||||
append = true;
|
|
||||||
extended = true;
|
|
||||||
ignoreAllDups = true;
|
|
||||||
ignoreDups = true;
|
|
||||||
ignoreSpace = true;
|
|
||||||
save = 1000000;
|
|
||||||
size = 1000000;
|
|
||||||
};
|
|
||||||
|
|
||||||
initExtra = ''
|
|
||||||
## Colors
|
|
||||||
autoload -U colors && colors
|
|
||||||
|
|
||||||
## Directories
|
|
||||||
setopt AUTO_PUSHD
|
|
||||||
setopt CDABLE_VARS
|
|
||||||
setopt PUSHD_IGNORE_DUPS
|
|
||||||
setopt PUSHD_SILENT
|
|
||||||
setopt PUSHD_TO_HOME
|
|
||||||
|
|
||||||
## Expansion and globbing
|
|
||||||
setopt EXTENDED_GLOB
|
|
||||||
unsetopt GLOB_DOTS
|
|
||||||
unsetopt NOMATCH
|
|
||||||
|
|
||||||
## History
|
|
||||||
setopt BANG_HIST
|
|
||||||
setopt HIST_VERIFY
|
|
||||||
setopt INC_APPEND_HISTORY_TIME
|
|
||||||
|
|
||||||
## I/O
|
|
||||||
setopt INTERACTIVE_COMMENTS
|
|
||||||
setopt MULTIOS
|
|
||||||
unsetopt CLOBBER
|
|
||||||
|
|
||||||
## Jobs
|
|
||||||
setopt LONG_LIST_JOBS
|
|
||||||
setopt AUTO_RESUME
|
|
||||||
unsetopt BG_NICE
|
|
||||||
unsetopt NOTIFY
|
|
||||||
unsetopt HUP
|
|
||||||
unsetopt CHECK_JOBS
|
|
||||||
|
|
||||||
## Shell emulation
|
|
||||||
setopt APPEND_CREATE
|
|
||||||
|
|
||||||
## Prompt
|
|
||||||
PS1="%B%{$fg[magenta]%}%~%{$reset_color%} $%b "
|
|
||||||
|
|
||||||
## Vi mode
|
|
||||||
export KEYTIMEOUT=1
|
|
||||||
|
|
||||||
## Zsh line editor
|
|
||||||
unsetopt BEEP
|
|
||||||
'';
|
|
||||||
|
|
||||||
initExtraBeforeCompInit = ''
|
|
||||||
setopt HASH_LIST_ALL
|
|
||||||
'';
|
|
||||||
|
|
||||||
localVariables = {
|
|
||||||
# Prevent zsh-vi-mode overriding other keybinds
|
|
||||||
ZVM_INIT_MODE = "sourcing";
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins = with pkgs; [
|
|
||||||
{
|
|
||||||
name = "zsh-vi-mode";
|
|
||||||
src = zsh-vi-mode;
|
|
||||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "fast-syntax-highlighting";
|
|
||||||
src = zsh-fast-syntax-highlighting;
|
|
||||||
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "jq-zsh-plugin";
|
|
||||||
src = jq-zsh-plugin;
|
|
||||||
file = "share/jq-zsh-plugin/jq.plugin.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-autopair";
|
|
||||||
src = zsh-autopair;
|
|
||||||
file = "share/zsh/zsh-autopair/autopair.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-forgit";
|
|
||||||
src = zsh-forgit;
|
|
||||||
file = "share/zsh/zsh-forgit/forgit.plugin.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-fzf-tab";
|
|
||||||
src = zsh-fzf-tab;
|
|
||||||
file = "share/fzf-tab/fzf-tab.plugin.zsh";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
sessionVariables = {
|
|
||||||
MODE_INDICATOR = "";
|
|
||||||
MODE_CURSOR_VIINS = "#b77ee0 blinking bar";
|
|
||||||
MODE_CURSOR_REPLACE = "$MODE_CURSOR_VIINS #ff3334";
|
|
||||||
MODE_CURSOR_VICMD = "#b77ee0 block";
|
|
||||||
MODE_CURSOR_SEARCH = "#e7c547 steady underline";
|
|
||||||
MODE_CURSOR_VISUAL = "$MODE_CURSOR_VICMD steady bar";
|
|
||||||
MODE_CURSOR_VLINE = "$MODE_CURSOR_VISUAL #54ced6";
|
|
||||||
ZVM_LINE_INIT_MODE = "i";
|
|
||||||
};
|
|
||||||
|
|
||||||
shellAliases = {
|
|
||||||
# Verbose file operations
|
|
||||||
cp = "cp -iv";
|
|
||||||
mv = "mv -iv";
|
|
||||||
rm = "rm -v";
|
|
||||||
mkdir = "mkdir -v";
|
|
||||||
|
|
||||||
# Colorize commands
|
|
||||||
ls = "ls -h --color=auto --group-directories-first";
|
|
||||||
|
|
||||||
# Abbreviations
|
|
||||||
e = "$EDITOR";
|
|
||||||
f = "$FILE";
|
|
||||||
g = "git";
|
|
||||||
m = "neomutt";
|
|
||||||
n = "$FILE";
|
|
||||||
v = "$EDITOR";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
broot.enable = true;
|
|
||||||
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
fzf = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
package = pkgs.unstable.fzf;
|
|
||||||
};
|
|
||||||
|
|
||||||
mcfly.enable = true;
|
|
||||||
navi.enable = true;
|
|
||||||
nix-index.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
user.packages = with pkgs; [
|
|
||||||
bat
|
|
||||||
fd
|
|
||||||
jq
|
|
||||||
nix-zsh-completions
|
|
||||||
nnn
|
|
||||||
ripgrep
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,18 +1,11 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.tailscale;
|
cfg = config.modules.networking.tailscale;
|
||||||
headscale = "https://headscale.vimium.net";
|
headscale = "https://headscale.vimium.net";
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
in
|
in {
|
||||||
{
|
options.modules.networking.tailscale = {
|
||||||
options.modules.services.tailscale = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,24 +1,17 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let cfg = config.modules.networking.wireless;
|
||||||
cfg = config.modules.system.wireless;
|
in {
|
||||||
in
|
options.modules.networking.wireless = {
|
||||||
{
|
|
||||||
options.modules.system.wireless = {
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = mdDoc "Automatically connect to known networks";
|
description = mdDoc "Automatically connect to known networks";
|
||||||
};
|
};
|
||||||
interfaces = mkOption {
|
interfaces = mkOption {
|
||||||
default = [ ]; # All interfaces
|
default = [ ]; # All interfaces
|
||||||
example = [ "wlan0" ];
|
example = [ "wlan0" ];
|
||||||
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
||||||
};
|
};
|
||||||
@ -33,9 +26,9 @@ in
|
|||||||
wireless = {
|
wireless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = cfg.interfaces;
|
interfaces = cfg.interfaces;
|
||||||
secretsFile = config.age.secrets."passwords/networks".path;
|
environmentFile = config.age.secrets."passwords/networks".path;
|
||||||
networks = {
|
networks = {
|
||||||
"Apollo 600 Mbps".pskRaw = "ext:PSK_APOLLO";
|
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networkmanager.ensureProfiles.profiles = {
|
networkmanager.ensureProfiles.profiles = {
|
@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware/presonus-studio
|
|
||||||
./podman.nix
|
|
||||||
./services/borgmatic.nix
|
|
||||||
./services/chrony.nix
|
|
||||||
./services/coturn.nix
|
|
||||||
./services/gitea.nix
|
|
||||||
./services/gitea-runner.nix
|
|
||||||
./services/headscale.nix
|
|
||||||
./services/home-assistant
|
|
||||||
./services/mail.nix
|
|
||||||
./services/matrix.nix
|
|
||||||
./services/music-assistant.nix
|
|
||||||
./services/netbird.nix
|
|
||||||
./services/nginx.nix
|
|
||||||
./services/photoprism.nix
|
|
||||||
./services/postgresql.nix
|
|
||||||
./services/tailscale.nix
|
|
||||||
./system/desktop/gnome.nix
|
|
||||||
./system/desktop/hyprland.nix
|
|
||||||
./system/desktop/kde.nix
|
|
||||||
./system/desktop/mimeapps.nix
|
|
||||||
./system/wireless.nix
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,315 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.home-assistant;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./floorplan/default.nix
|
|
||||||
./mqtt.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options.modules.services.home-assistant.enable = lib.mkEnableOption "home-assistant";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
|
|
||||||
age.secrets."files/services/home-assistant/secrets.yaml" = {
|
|
||||||
file = "${self.inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
|
|
||||||
path = "${config.services.home-assistant.configDir}/secrets.yaml";
|
|
||||||
owner = "hass";
|
|
||||||
group = "hass";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.home-assistant = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
config = {
|
|
||||||
automation = "!include automations.yaml";
|
|
||||||
backup = { };
|
|
||||||
binary_sensor = [ ];
|
|
||||||
default_config = { };
|
|
||||||
http = {
|
|
||||||
server_host = "::1";
|
|
||||||
trusted_proxies = [ "::1" ];
|
|
||||||
use_x_forwarded_for = true;
|
|
||||||
};
|
|
||||||
ffmpeg = { };
|
|
||||||
homeassistant = {
|
|
||||||
name = "Home";
|
|
||||||
latitude = "!secret latitude";
|
|
||||||
longitude = "!secret longitude";
|
|
||||||
country = "GB";
|
|
||||||
temperature_unit = "C";
|
|
||||||
time_zone = config.time.timeZone;
|
|
||||||
unit_system = "metric";
|
|
||||||
auth_providers = [
|
|
||||||
{
|
|
||||||
type = "trusted_networks";
|
|
||||||
trusted_networks = [
|
|
||||||
"100.64.0.0/10"
|
|
||||||
"127.0.0.1"
|
|
||||||
];
|
|
||||||
allow_bypass_login = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "homeassistant";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
logger = {
|
|
||||||
default = "info";
|
|
||||||
logs = { };
|
|
||||||
};
|
|
||||||
lovelace = {
|
|
||||||
mode = "yaml";
|
|
||||||
};
|
|
||||||
media_player = [ ];
|
|
||||||
mobile_app = { };
|
|
||||||
onkyo = { };
|
|
||||||
open_meteo = { };
|
|
||||||
recorder = {
|
|
||||||
purge_keep_days = 365;
|
|
||||||
};
|
|
||||||
scene = "!include scenes.yaml";
|
|
||||||
script = "!include scripts.yaml";
|
|
||||||
sensor = [ ];
|
|
||||||
system_health = { };
|
|
||||||
zeroconf = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
extraComponents = [
|
|
||||||
"air_quality"
|
|
||||||
"airly"
|
|
||||||
"alert"
|
|
||||||
"api"
|
|
||||||
"application_credentials"
|
|
||||||
"asuswrt"
|
|
||||||
"auth"
|
|
||||||
"automation"
|
|
||||||
"bayesian"
|
|
||||||
"binary_sensor"
|
|
||||||
# "blackbird"
|
|
||||||
"blueprint"
|
|
||||||
"bluetooth_adapters"
|
|
||||||
"bluetooth_le_tracker"
|
|
||||||
"button"
|
|
||||||
"calendar"
|
|
||||||
"camera"
|
|
||||||
"cast"
|
|
||||||
"cert_expiry"
|
|
||||||
"climate"
|
|
||||||
"co2signal"
|
|
||||||
"color_extractor"
|
|
||||||
"command_line"
|
|
||||||
"compensation"
|
|
||||||
"configurator"
|
|
||||||
"counter"
|
|
||||||
"cover"
|
|
||||||
"cpuspeed"
|
|
||||||
"default_config"
|
|
||||||
"demo"
|
|
||||||
"derivative"
|
|
||||||
"device_automation"
|
|
||||||
"device_sun_light_trigger"
|
|
||||||
"device_tracker"
|
|
||||||
"dlna_dmr"
|
|
||||||
"dlna_dms"
|
|
||||||
"dnsip"
|
|
||||||
"esphome"
|
|
||||||
"fail2ban"
|
|
||||||
"fan"
|
|
||||||
"feedreader"
|
|
||||||
"ffmpeg"
|
|
||||||
"file"
|
|
||||||
"file_upload"
|
|
||||||
"filesize"
|
|
||||||
"folder"
|
|
||||||
"folder_watcher"
|
|
||||||
"forecast_solar"
|
|
||||||
"frontend"
|
|
||||||
"gdacs"
|
|
||||||
"generic"
|
|
||||||
"generic_hygrostat"
|
|
||||||
"generic_thermostat"
|
|
||||||
"geo_json_events"
|
|
||||||
"geo_location"
|
|
||||||
"geo_rss_events"
|
|
||||||
"github"
|
|
||||||
"group"
|
|
||||||
"hardware"
|
|
||||||
"hdmi_cec"
|
|
||||||
"history_stats"
|
|
||||||
"homeassistant"
|
|
||||||
"homekit"
|
|
||||||
"homekit_controller"
|
|
||||||
"html5"
|
|
||||||
"http"
|
|
||||||
"humidifier"
|
|
||||||
"icloud"
|
|
||||||
"image_processing"
|
|
||||||
"input_boolean"
|
|
||||||
"input_button"
|
|
||||||
"input_datetime"
|
|
||||||
"input_number"
|
|
||||||
"input_select"
|
|
||||||
"input_text"
|
|
||||||
"integration"
|
|
||||||
"ios"
|
|
||||||
"jellyfin"
|
|
||||||
"light"
|
|
||||||
"local_calendar"
|
|
||||||
"local_file"
|
|
||||||
"local_ip"
|
|
||||||
"local_todo"
|
|
||||||
"lock"
|
|
||||||
"logentries"
|
|
||||||
"logger"
|
|
||||||
"lovelace"
|
|
||||||
"manual"
|
|
||||||
"manual_mqtt"
|
|
||||||
"matter"
|
|
||||||
"media_player"
|
|
||||||
"min_max"
|
|
||||||
"mjpeg"
|
|
||||||
"modern_forms"
|
|
||||||
"mold_indicator"
|
|
||||||
"moon"
|
|
||||||
"mysensors"
|
|
||||||
"network"
|
|
||||||
"nmap_tracker"
|
|
||||||
"notify"
|
|
||||||
"number"
|
|
||||||
"onboarding"
|
|
||||||
"onkyo"
|
|
||||||
"panel_custom"
|
|
||||||
"persistent_notification"
|
|
||||||
"person"
|
|
||||||
"ping"
|
|
||||||
"plant"
|
|
||||||
"prometheus"
|
|
||||||
"proximity"
|
|
||||||
"push"
|
|
||||||
"proximity"
|
|
||||||
"python_script"
|
|
||||||
"radio_browser"
|
|
||||||
"random"
|
|
||||||
"recorder"
|
|
||||||
"remote"
|
|
||||||
"repairs"
|
|
||||||
"rest"
|
|
||||||
"rest_command"
|
|
||||||
"rss_feed_template"
|
|
||||||
"scene"
|
|
||||||
"schedule"
|
|
||||||
"scrape"
|
|
||||||
"script"
|
|
||||||
"search"
|
|
||||||
"season"
|
|
||||||
"select"
|
|
||||||
"sense"
|
|
||||||
"sensor"
|
|
||||||
"sensorpush"
|
|
||||||
"shell_command"
|
|
||||||
"shopping_list"
|
|
||||||
"siren"
|
|
||||||
"smtp"
|
|
||||||
"snmp"
|
|
||||||
"sql"
|
|
||||||
"statistics"
|
|
||||||
"sun"
|
|
||||||
"switch"
|
|
||||||
"switch_as_x"
|
|
||||||
"system_health"
|
|
||||||
"system_log"
|
|
||||||
"systemmonitor"
|
|
||||||
"tag"
|
|
||||||
"tailscale"
|
|
||||||
"tcp"
|
|
||||||
"template"
|
|
||||||
"text"
|
|
||||||
"thread"
|
|
||||||
"threshold"
|
|
||||||
"time_date"
|
|
||||||
"timer"
|
|
||||||
"tod"
|
|
||||||
"todo"
|
|
||||||
"tomorrowio"
|
|
||||||
"trend"
|
|
||||||
"universal"
|
|
||||||
"upb"
|
|
||||||
"update"
|
|
||||||
"upnp"
|
|
||||||
"uptime"
|
|
||||||
"utility_meter"
|
|
||||||
"vacuum"
|
|
||||||
"vlc"
|
|
||||||
"vlc_telnet"
|
|
||||||
"wake_on_lan"
|
|
||||||
"water_heater"
|
|
||||||
"weather"
|
|
||||||
"websocket_api"
|
|
||||||
"wled"
|
|
||||||
"workday"
|
|
||||||
"worldclock"
|
|
||||||
"zone"
|
|
||||||
];
|
|
||||||
|
|
||||||
extraPackages =
|
|
||||||
python3Packages: with python3Packages; [
|
|
||||||
onkyo-eiscp
|
|
||||||
zeroconf
|
|
||||||
];
|
|
||||||
|
|
||||||
customComponents = with pkgs; [
|
|
||||||
home-assistant-browser-mod
|
|
||||||
];
|
|
||||||
|
|
||||||
customLovelaceModules =
|
|
||||||
(with pkgs.home-assistant-custom-lovelace-modules; [
|
|
||||||
bubble-card
|
|
||||||
button-card
|
|
||||||
card-mod
|
|
||||||
light-entity-card
|
|
||||||
mini-graph-card
|
|
||||||
mini-media-player
|
|
||||||
mushroom
|
|
||||||
sankey-chart
|
|
||||||
universal-remote-card
|
|
||||||
])
|
|
||||||
++ (with pkgs; [
|
|
||||||
lovelace-auto-entities
|
|
||||||
lovelace-layout-card
|
|
||||||
lovelace-my-cards
|
|
||||||
lovelace-simple-weather-card
|
|
||||||
lovelace-state-switch
|
|
||||||
lovelace-weather-radar-card
|
|
||||||
]);
|
|
||||||
|
|
||||||
lovelaceConfigWritable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
config.services.home-assistant.configDir
|
|
||||||
];
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
virtualHosts."home.mesh.vimium.net" = {
|
|
||||||
forceSSL = false;
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffering off;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://[::1]:8123";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,94 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.home-assistant;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
services.home-assistant = {
|
|
||||||
customLovelaceModules = [
|
|
||||||
pkgs.lovelace-floorplan
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.etc."home-assistant/www/floorplan/style.css".source = ./style.css;
|
|
||||||
environment.etc."home-assistant/www/floorplan/config.yaml".text = builtins.toJSON {
|
|
||||||
image = {
|
|
||||||
location = "/local/floorplan/beetham.svg";
|
|
||||||
cache = false;
|
|
||||||
};
|
|
||||||
stylesheet = {
|
|
||||||
location = "/local/floorplan/style.css";
|
|
||||||
cache = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
defaults = {
|
|
||||||
hover_action = "hover-info";
|
|
||||||
hold_action = "toggle";
|
|
||||||
tap_action = "more-info";
|
|
||||||
};
|
|
||||||
|
|
||||||
rules = [
|
|
||||||
{
|
|
||||||
name = "Rooms";
|
|
||||||
entities = [
|
|
||||||
{
|
|
||||||
entity = "light.bedroom_lamps";
|
|
||||||
element = "area.bedroom";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.hallway_spots";
|
|
||||||
element = "area.hallway";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.living_room_lamps";
|
|
||||||
element = "area.livingroom";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.office_lamps";
|
|
||||||
element = "area.office";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
tap_action = "light.toggle";
|
|
||||||
state_action = {
|
|
||||||
service = "floorplan.class_set";
|
|
||||||
service_data = ''
|
|
||||||
if (entity.state === "on") {
|
|
||||||
return "light-on";
|
|
||||||
}
|
|
||||||
return "light-off";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "Temperature";
|
|
||||||
entities = [
|
|
||||||
"sensor.motion_sensor_temperature"
|
|
||||||
];
|
|
||||||
state_action = [
|
|
||||||
{
|
|
||||||
service = "floorplan.text_set";
|
|
||||||
service_data = ''
|
|
||||||
if (!isNaN(entity.state)) {
|
|
||||||
return Math.round(entity.state * 10) / 10 + "°";
|
|
||||||
}
|
|
||||||
return "Unknown";
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
service = "floorplan.class_set";
|
|
||||||
service_data = {
|
|
||||||
class = "static-temp";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
#floorplan {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg, svg * {
|
|
||||||
vector-effect: non-scaling-stroke !important;
|
|
||||||
pointer-events: all !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
path[id*="area."].light-on {
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
path[id*="area."] {
|
|
||||||
opacity: 0.5 !important;
|
|
||||||
transition: opacity .25s;
|
|
||||||
-moz-transition: opacity .25s;
|
|
||||||
-webkit-transition: opacity .25s;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg tspan {
|
|
||||||
fill: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.static-temp, .static-temp tspan {
|
|
||||||
fill: #ffffff;
|
|
||||||
}
|
|
@ -1,92 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.home-assistant;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
services.mosquitto = {
|
|
||||||
enable = true;
|
|
||||||
listeners = [
|
|
||||||
{
|
|
||||||
acl = [ "pattern readwrite #" ];
|
|
||||||
omitPasswordAuth = true;
|
|
||||||
port = 1883;
|
|
||||||
settings = {
|
|
||||||
allow_anonymous = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets."files/services/zigbee2mqtt/secret.yaml" = {
|
|
||||||
file = "${self.inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
|
|
||||||
path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml";
|
|
||||||
owner = "zigbee2mqtt";
|
|
||||||
group = "zigbee2mqtt";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.zigbee2mqtt = {
|
|
||||||
package = pkgs.unstable.zigbee2mqtt;
|
|
||||||
enable = true;
|
|
||||||
dataDir = "/var/lib/zigbee2mqtt";
|
|
||||||
settings = {
|
|
||||||
homeassistant = lib.optionalAttrs config.services.home-assistant.enable {
|
|
||||||
discovery_topic = "homeassistant";
|
|
||||||
status_topic = "hass/status";
|
|
||||||
};
|
|
||||||
availability = true;
|
|
||||||
frontend = true;
|
|
||||||
device_options = {
|
|
||||||
retain = true;
|
|
||||||
};
|
|
||||||
serial = {
|
|
||||||
port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0";
|
|
||||||
adapter = "zstack";
|
|
||||||
};
|
|
||||||
advanced = {
|
|
||||||
channel = 20;
|
|
||||||
network_key = "!secret.yaml network_key";
|
|
||||||
pan_id = 13001;
|
|
||||||
ext_pan_id = [
|
|
||||||
79
|
|
||||||
1
|
|
||||||
73
|
|
||||||
47
|
|
||||||
250
|
|
||||||
136
|
|
||||||
124
|
|
||||||
222
|
|
||||||
];
|
|
||||||
transmit_power = 20;
|
|
||||||
};
|
|
||||||
mqtt = {
|
|
||||||
version = 5;
|
|
||||||
server = "mqtt://localhost:1883";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
config.services.mosquitto.dataDir
|
|
||||||
config.services.zigbee2mqtt.dataDir
|
|
||||||
];
|
|
||||||
|
|
||||||
services.home-assistant = {
|
|
||||||
config.mqtt = { };
|
|
||||||
extraComponents = [
|
|
||||||
"mqtt"
|
|
||||||
"mqtt_eventstream"
|
|
||||||
"mqtt_json"
|
|
||||||
"mqtt_room"
|
|
||||||
"mqtt_statestream"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,248 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.matrix;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.matrix = {
|
|
||||||
enable = lib.mkEnableOption "matrix";
|
|
||||||
element = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bridges = {
|
|
||||||
signal = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable Signal bridge.";
|
|
||||||
};
|
|
||||||
whatsapp = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable WhatsApp bridge.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
serverName = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "vimium.com";
|
|
||||||
example = "vimium.com";
|
|
||||||
};
|
|
||||||
usePostgresql = lib.mkEnableOption "postgresql";
|
|
||||||
};
|
|
||||||
|
|
||||||
config =
|
|
||||||
let
|
|
||||||
matrixSubdomain = "matrix.${cfg.serverName}";
|
|
||||||
elementSubdomain = "chat.${cfg.serverName}";
|
|
||||||
matrixClientConfig = {
|
|
||||||
"m.homeserver" = {
|
|
||||||
base_url = "https://${matrixSubdomain}";
|
|
||||||
server_name = cfg.serverName;
|
|
||||||
};
|
|
||||||
"m.identity_server" = {
|
|
||||||
"base_url" = "https://vector.im";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
matrixServerConfig."m.server" = "${matrixSubdomain}:443";
|
|
||||||
commonBridgeSettings = bridge: {
|
|
||||||
appservice = {
|
|
||||||
database = lib.mkIf cfg.usePostgresql {
|
|
||||||
type = "postgres";
|
|
||||||
uri = "postgresql:///${bridge}?host=/run/postgresql";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bridge = {
|
|
||||||
encryption = {
|
|
||||||
allow = true;
|
|
||||||
default = true;
|
|
||||||
require = true;
|
|
||||||
};
|
|
||||||
permissions = {
|
|
||||||
"${cfg.serverName}" = "user";
|
|
||||||
"@jordan:${cfg.serverName}" = "admin";
|
|
||||||
};
|
|
||||||
provisioning = {
|
|
||||||
shared_secret = "disable";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
homeserver = {
|
|
||||||
address = "https://${matrixSubdomain}";
|
|
||||||
domain = cfg.serverName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.mkIf cfg.enable {
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
8448 # Matrix federation
|
|
||||||
];
|
|
||||||
|
|
||||||
security.acme.certs = {
|
|
||||||
"${matrixSubdomain}" = {
|
|
||||||
reloadServices = [ "matrix-synapse" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts =
|
|
||||||
{
|
|
||||||
"${matrixSubdomain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
listen = [
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 443;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 80;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 8448;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 443;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 80;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 8448;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
locations = {
|
|
||||||
"/" = {
|
|
||||||
proxyPass = "http://localhost:8008";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"/_matrix" = {
|
|
||||||
proxyPass = "http://localhost:8008";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
client_max_body_size 50M;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"/_synapse/client".proxyPass = "http://localhost:8008";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"${cfg.serverName}" =
|
|
||||||
let
|
|
||||||
mkWellKnown = data: ''
|
|
||||||
more_set_headers 'Content-Type: application/json';
|
|
||||||
return 200 '${builtins.toJSON data}';
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
locations."= /.well-known/matrix/server".extraConfig = (mkWellKnown matrixServerConfig);
|
|
||||||
locations."= /.well-known/matrix/client".extraConfig = (mkWellKnown matrixClientConfig);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
if cfg.element.enable then
|
|
||||||
{
|
|
||||||
"${elementSubdomain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
root = pkgs.unstable.element-web.override {
|
|
||||||
conf = {
|
|
||||||
default_server_config = matrixClientConfig;
|
|
||||||
brand = "Vimium Chat";
|
|
||||||
branding = {
|
|
||||||
auth_header_logo_url = "https://vimium.com/images/logo.svg";
|
|
||||||
auth_footer_links = [
|
|
||||||
{
|
|
||||||
"text" = "Vimium.com";
|
|
||||||
"url" = "https://vimium.com";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages = [
|
|
||||||
"jitsi-meet-1.0.8043"
|
|
||||||
"olm-3.2.16"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.matrix-synapse = {
|
|
||||||
enable = true;
|
|
||||||
enableRegistrationScript = true;
|
|
||||||
settings = {
|
|
||||||
database.name = (if cfg.usePostgresql then "psycopg2" else "sqlite3");
|
|
||||||
enable_metrics = false;
|
|
||||||
enable_registration = false;
|
|
||||||
max_upload_size = "100M";
|
|
||||||
report_stats = false;
|
|
||||||
server_name = cfg.serverName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.matrix-synapse.serviceConfig.SupplementaryGroups = (
|
|
||||||
lib.optional cfg.bridges.whatsapp config.systemd.services.mautrix-whatsapp.serviceConfig.Group
|
|
||||||
);
|
|
||||||
|
|
||||||
services.postgresql = lib.mkIf cfg.usePostgresql {
|
|
||||||
ensureUsers =
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name = "matrix-synapse";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ (lib.optional cfg.bridges.signal {
|
|
||||||
name = "mautrix-signal";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
})
|
|
||||||
++ (lib.optional cfg.bridges.whatsapp {
|
|
||||||
name = "mautrix-whatsapp";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
});
|
|
||||||
ensureDatabases =
|
|
||||||
[
|
|
||||||
"matrix-synapse"
|
|
||||||
]
|
|
||||||
++ (lib.optional cfg.bridges.signal "mautrix-signal")
|
|
||||||
++ (lib.optional cfg.bridges.whatsapp "mautrix-whatsapp");
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mautrix-signal = lib.mkIf cfg.bridges.signal {
|
|
||||||
enable = true;
|
|
||||||
settings = commonBridgeSettings "mautrix-signal";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mautrix-whatsapp = lib.mkIf cfg.bridges.whatsapp {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
bridge = {
|
|
||||||
history_sync = {
|
|
||||||
backfill = true;
|
|
||||||
max_initial_conversations = -1;
|
|
||||||
message_count = 50;
|
|
||||||
request_full_sync = true;
|
|
||||||
};
|
|
||||||
mute_bridging = true;
|
|
||||||
};
|
|
||||||
} // commonBridgeSettings "mautrix-whatsapp";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib)
|
|
||||||
mkEnableOption
|
|
||||||
mkIf
|
|
||||||
;
|
|
||||||
cfg = config.modules.services.music-assistant;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.music-assistant.enable = mkEnableOption "music-assistant";
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
services = {
|
|
||||||
nginx.virtualHosts."music-assistant.${config.networking.hostName}" = {
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffering off;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://[::1]:8095";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
music-assistant = {
|
|
||||||
enable = true;
|
|
||||||
providers = [
|
|
||||||
"hass"
|
|
||||||
"jellyfin"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.netbird;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.netbird = {
|
|
||||||
enable = lib.mkEnableOption "netbird";
|
|
||||||
coordinatorDomain = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "netbird.vimium.net";
|
|
||||||
};
|
|
||||||
meshDomain = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "mesh.vimium.net";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
age.secrets."passwords/services/netbird/data-store-encryption-key" = {
|
|
||||||
file = "${self.inputs.secrets}/passwords/services/netbird/data-store-encryption-key.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.netbird = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.netbird.server = {
|
|
||||||
domain = cfg.coordinatorDomain;
|
|
||||||
enable = true;
|
|
||||||
enableNginx = true;
|
|
||||||
dashboard.settings = {
|
|
||||||
AUTH_AUTHORITY = "https://auth.vimium.com/oauth2/openid/netbird";
|
|
||||||
};
|
|
||||||
management = rec {
|
|
||||||
disableAnonymousMetrics = true;
|
|
||||||
dnsDomain = cfg.meshDomain;
|
|
||||||
oidcConfigEndpoint = "https://auth.vimium.com/oauth2/openid/netbird/.well-known/openid-configuration";
|
|
||||||
settings = {
|
|
||||||
DataStoreEncryptionKey = {
|
|
||||||
_secret = config.age.secrets."passwords/services/netbird/data-store-encryption-key".path;
|
|
||||||
};
|
|
||||||
HttpConfig = {
|
|
||||||
AuthAudience = "netbird";
|
|
||||||
};
|
|
||||||
StoreConfig = {
|
|
||||||
Engine = "sqlite";
|
|
||||||
};
|
|
||||||
TURNConfig = {
|
|
||||||
Secret._secret = config.age.secrets."passwords/services/coturn/static-auth-secret".path;
|
|
||||||
TimeBasedCredentials = true;
|
|
||||||
};
|
|
||||||
PKCEAuthorizationFlow.ProviderConfig = {
|
|
||||||
AuthorizationEndpoint = "https://auth.vimium.com/ui/oauth2";
|
|
||||||
TokenEndpoint = "https://auth.vimium.com/oauth2/token";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
singleAccountModeDomain = dnsDomain;
|
|
||||||
turnDomain = config.services.coturn.realm;
|
|
||||||
turnPort = config.services.coturn.listening-port;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.netbird-signal.serviceConfig.RestartSec = "60";
|
|
||||||
systemd.services.netbird-management.serviceConfig.RestartSec = "60";
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."netbird.vimium.net" = {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,193 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.nginx;
|
|
||||||
nginxErrorPages = ''
|
|
||||||
location @error_pages {
|
|
||||||
rewrite ^.*$ /''${status}.html break;
|
|
||||||
|
|
||||||
root "/var/www/html/errors";
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
nginxEdgeHeaders = ''
|
|
||||||
more_set_headers 'Server: Vimium';
|
|
||||||
more_set_headers 'Access-Control-Allow-Origin: *';
|
|
||||||
add_header Expect-CT max-age=30 always;
|
|
||||||
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
|
||||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
|
||||||
add_header Vimium-Responding-Instance $hostname;
|
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
|
||||||
add_header X-Content-Type-Options nosniff always;
|
|
||||||
'';
|
|
||||||
nginxStrictHeaders = ''
|
|
||||||
add_header X-Frame-Options SAMEORIGIN always;
|
|
||||||
add_header Permissions-Policy "fullscreen=(self), sync-xhr=(self)" always;
|
|
||||||
'';
|
|
||||||
mkRedirect = from: to: {
|
|
||||||
"${from}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
serverAliases = [ "www.${from}" ];
|
|
||||||
locations."/".return = "301 https://${to}$request_uri";
|
|
||||||
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.nginx = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
80 # HTTP
|
|
||||||
443 # HTTPS
|
|
||||||
];
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.openresty;
|
|
||||||
recommendedGzipSettings = true;
|
|
||||||
recommendedOptimisation = true;
|
|
||||||
recommendedTlsSettings = true;
|
|
||||||
clientMaxBodySize = "2G";
|
|
||||||
sslProtocols = "TLSv1.2 TLSv1.3";
|
|
||||||
sslCiphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
|
|
||||||
appendHttpConfig = ''
|
|
||||||
error_page 400 @error_pages;
|
|
||||||
error_page 401 @error_pages;
|
|
||||||
error_page 403 @error_pages;
|
|
||||||
error_page 404 @error_pages;
|
|
||||||
error_page 405 @error_pages;
|
|
||||||
error_page 429 @error_pages;
|
|
||||||
error_page 500 @error_pages;
|
|
||||||
error_page 501 @error_pages;
|
|
||||||
error_page 502 @error_pages;
|
|
||||||
error_page 503 @error_pages;
|
|
||||||
error_page 504 @error_pages;
|
|
||||||
|
|
||||||
client_body_buffer_size 16k;
|
|
||||||
client_header_buffer_size 8k;
|
|
||||||
'';
|
|
||||||
appendConfig = ''
|
|
||||||
worker_processes auto;
|
|
||||||
worker_cpu_affinity auto;
|
|
||||||
worker_rlimit_nofile 50000;
|
|
||||||
'';
|
|
||||||
eventsConfig = ''
|
|
||||||
worker_connections 20000;
|
|
||||||
multi_accept off;
|
|
||||||
'';
|
|
||||||
proxyCachePath = {
|
|
||||||
"skycam" = {
|
|
||||||
enable = true;
|
|
||||||
keysZoneName = "skycam_cache";
|
|
||||||
maxSize = "100m";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
virtualHosts =
|
|
||||||
{
|
|
||||||
## Static sites
|
|
||||||
"jellyfin.vimium.com" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
extraConfig = nginxErrorPages + nginxEdgeHeaders;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:8000";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
proxy_set_header Range $http_range;
|
|
||||||
proxy_set_header If-Range $http_if_range;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"jdholt.com" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
serverAliases = [ "www.jdholt.com" ];
|
|
||||||
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
|
||||||
locations."/skycam/snapshot.jpg" = {
|
|
||||||
extraConfig = ''
|
|
||||||
set $backend "skycam.mesh.vimium.net:8080";
|
|
||||||
|
|
||||||
resolver 100.100.100.100;
|
|
||||||
|
|
||||||
proxy_pass http://$backend/snapshot;
|
|
||||||
proxy_cache skycam_cache;
|
|
||||||
proxy_cache_valid any 10s;
|
|
||||||
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."/".return = "301 https://vimium.com$request_uri";
|
|
||||||
};
|
|
||||||
"pki.vimium.com" = {
|
|
||||||
addSSL = true;
|
|
||||||
forceSSL = false;
|
|
||||||
enableACME = true;
|
|
||||||
extraConfig = ''
|
|
||||||
${nginxErrorPages}
|
|
||||||
more_set_headers 'Server: Vimium';
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
root = "/var/www/pki.vimium.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"suhailhussain.com" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
serverAliases = [ "www.suhailhussain.com" ];
|
|
||||||
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
|
||||||
locations."/" = {
|
|
||||||
root = "/var/www/suhailhussain.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"vimium.com" = {
|
|
||||||
default = true;
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
serverAliases = [ "www.vimium.com" ];
|
|
||||||
extraConfig =
|
|
||||||
nginxErrorPages
|
|
||||||
+ nginxEdgeHeaders
|
|
||||||
+ nginxStrictHeaders
|
|
||||||
+ ''
|
|
||||||
add_header Content-Security-Policy "default-src 'self' https://vimium.com https://www.vimium.com; style-src 'unsafe-inline'; object-src 'none'; upgrade-insecure-requests" always;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
root = "/var/www/vimium.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
## Redirects
|
|
||||||
// (mkRedirect "h0lt.com" "jdholt.com")
|
|
||||||
// (mkRedirect "jordanholt.xyz" "jdholt.com")
|
|
||||||
// (mkRedirect "omnimagic.com" "vimium.com")
|
|
||||||
// (mkRedirect "omnimagic.net" "vimium.com")
|
|
||||||
// (mkRedirect "thelostlegend.com" "suhailhussain.com")
|
|
||||||
// (mkRedirect "vimium.co" "vimium.com")
|
|
||||||
// (mkRedirect "vimium.co.uk" "vimium.com")
|
|
||||||
// (mkRedirect "vimium.info" "vimium.com")
|
|
||||||
// (mkRedirect "vimium.net" "vimium.com")
|
|
||||||
// (mkRedirect "vimium.org" "vimium.com")
|
|
||||||
// (mkRedirect "vimium.xyz" "vimium.com");
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
82
modules/options.nix
Normal file
82
modules/options.nix
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
{ config, options, lib, self, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options = with types; {
|
||||||
|
user = mkOption { type = attrs; default = { }; };
|
||||||
|
|
||||||
|
home = {
|
||||||
|
configFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_CONFIG_HOME"; };
|
||||||
|
dataFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_DATA_HOME"; };
|
||||||
|
file = mkOption { type = attrs; default = { }; description = "Files to place directly in $HOME"; };
|
||||||
|
packages = mkOption { type = attrs; default = { }; description = "User-level installed packages"; };
|
||||||
|
programs = mkOption { type = attrs; default = { }; description = "Programs managed directly from home-manager"; };
|
||||||
|
services = mkOption { type = attrs; default = { }; description = "Services managed directly from home-manager"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
dconf.settings = mkOption { type = attrs; default = { }; description = "dconf settings to enable"; };
|
||||||
|
|
||||||
|
env = mkOption {
|
||||||
|
type = attrsOf (oneOf [ str path (listOf (either str path)) ]);
|
||||||
|
apply = mapAttrs (n: v:
|
||||||
|
if isList v then
|
||||||
|
concatMapStringsSep ":" (x: toString x) v
|
||||||
|
else
|
||||||
|
(toString v));
|
||||||
|
default = { };
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age";
|
||||||
|
user =
|
||||||
|
let user = builtins.getEnv "USER";
|
||||||
|
name = if elem user [ "" "root" ] then "jordan" else user;
|
||||||
|
in {
|
||||||
|
inherit name;
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "networkmanager" "wheel" "lxd" ];
|
||||||
|
description = "Jordan Holt";
|
||||||
|
useDefaultShell = true;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
|
];
|
||||||
|
hashedPasswordFile = config.age.secrets."passwords/users/jordan".path;
|
||||||
|
home = "/home/${name}";
|
||||||
|
group = "users";
|
||||||
|
uid = 1000;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
|
||||||
|
users.${config.user.name} = {
|
||||||
|
home = {
|
||||||
|
file = mkAliasDefinitions options.home.file;
|
||||||
|
stateVersion = config.system.stateVersion;
|
||||||
|
};
|
||||||
|
programs = mkAliasDefinitions options.home.programs;
|
||||||
|
services = mkAliasDefinitions options.home.services;
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
configFile = mkAliasDefinitions options.home.configFile;
|
||||||
|
dataFile = mkAliasDefinitions options.home.dataFile;
|
||||||
|
};
|
||||||
|
dconf.settings = mkAliasDefinitions options.dconf.settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedModules = [
|
||||||
|
self.inputs.nixvim.homeManagerModules.nixvim
|
||||||
|
self.inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||||
|
|
||||||
|
environment.extraInit =
|
||||||
|
concatStringsSep "\n"
|
||||||
|
(mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env);
|
||||||
|
};
|
||||||
|
}
|
@ -1,16 +1,10 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.podman;
|
cfg = config.modules.podman;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.podman = {
|
options.modules.podman = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
@ -1,14 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.security.gpg;
|
||||||
cfg = config.modules.programs.gpg;
|
in {
|
||||||
in
|
options.modules.security.gpg = {
|
||||||
{
|
|
||||||
options.modules.programs.gpg = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.security.pass;
|
||||||
cfg = config.modules.programs.pass;
|
in {
|
||||||
in
|
options.modules.security.pass = {
|
||||||
{
|
|
||||||
options.modules.programs.pass = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
@ -1,15 +1,9 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.borgmatic;
|
cfg = config.modules.services.borgmatic;
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.borgmatic = {
|
options.modules.services.borgmatic = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -18,7 +12,7 @@ in
|
|||||||
};
|
};
|
||||||
directories = lib.mkOption {
|
directories = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [];
|
||||||
example = [
|
example = [
|
||||||
"/home/jordan/Documents"
|
"/home/jordan/Documents"
|
||||||
];
|
];
|
||||||
@ -41,14 +35,9 @@ in
|
|||||||
settings = {
|
settings = {
|
||||||
source_directories = cfg.directories;
|
source_directories = cfg.directories;
|
||||||
repositories = [
|
repositories = [
|
||||||
{
|
{ label = "borgbase"; path = cfg.repoPath; }
|
||||||
label = "borgbase";
|
|
||||||
path = cfg.repoPath;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
encryption_passcommand = "cat ${
|
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/${hostname}-passphrase".path}";
|
||||||
config.age.secrets."passwords/services/borg/${hostname}-passphrase".path
|
|
||||||
}";
|
|
||||||
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
||||||
keep_daily = 7;
|
keep_daily = 7;
|
||||||
keep_weekly = 4;
|
keep_weekly = 4;
|
@ -1,15 +1,10 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.chrony;
|
cfg = config.modules.services.chrony;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.chrony = {
|
options.modules.services.chrony = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
@ -1,14 +1,8 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.coturn;
|
cfg = config.modules.services.coturn;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.coturn = {
|
options.modules.services.coturn = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -27,28 +21,24 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
networking.firewall =
|
networking.firewall = let
|
||||||
let
|
range = with config.services.coturn; lib.singleton {
|
||||||
range =
|
from = min-port;
|
||||||
with config.services.coturn;
|
to = max-port;
|
||||||
lib.singleton {
|
|
||||||
from = min-port;
|
|
||||||
to = max-port;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
allowedTCPPorts = [
|
|
||||||
3478 # TURN listener
|
|
||||||
5349 # STUN TLS
|
|
||||||
5350 # STUN TLS alt
|
|
||||||
];
|
|
||||||
allowedUDPPorts = [
|
|
||||||
3478 # TURN listener
|
|
||||||
5349 # TLS
|
|
||||||
5350 # TLS alt
|
|
||||||
];
|
|
||||||
allowedUDPPortRanges = range; # TURN peer relays
|
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
3478 # TURN listener
|
||||||
|
5349 # STUN TLS
|
||||||
|
5350 # STUN TLS alt
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
3478 # TURN listener
|
||||||
|
5349 # TLS
|
||||||
|
5350 # TLS alt
|
||||||
|
];
|
||||||
|
allowedUDPPortRanges = range; # TURN peer relays
|
||||||
|
};
|
||||||
|
|
||||||
security.acme.certs = {
|
security.acme.certs = {
|
||||||
"${config.services.coturn.realm}" = {
|
"${config.services.coturn.realm}" = {
|
||||||
@ -57,26 +47,19 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets =
|
age.secrets = {
|
||||||
{
|
"passwords/services/coturn/static-auth-secret" = {
|
||||||
"passwords/services/coturn/static-auth-secret" = {
|
file = "${self.inputs.secrets}/passwords/services/coturn/static-auth-secret.age";
|
||||||
file = "${self.inputs.secrets}/passwords/services/coturn/static-auth-secret.age";
|
owner = "turnserver";
|
||||||
owner = "turnserver";
|
group = "turnserver";
|
||||||
group = "turnserver";
|
};
|
||||||
};
|
} // (if cfg.matrixIntegration then {
|
||||||
}
|
"passwords/services/coturn/matrix-turn-config.yml" = {
|
||||||
// (
|
file = "${self.inputs.secrets}/passwords/services/coturn/matrix-turn-config.yml.age";
|
||||||
if cfg.matrixIntegration then
|
owner = "matrix-synapse";
|
||||||
{
|
group = "matrix-synapse";
|
||||||
"passwords/services/coturn/matrix-turn-config.yml" = {
|
};
|
||||||
file = "${self.inputs.secrets}/passwords/services/coturn/matrix-turn-config.yml.age";
|
} else {});
|
||||||
owner = "matrix-synapse";
|
|
||||||
group = "matrix-synapse";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
|
||||||
|
|
||||||
services.coturn = rec {
|
services.coturn = rec {
|
||||||
enable = true;
|
enable = true;
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ pkgs, config, lib, self, ... }:
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Based on: https://git.clan.lol/clan/clan-infra/src/branch/main/modules/web01/gitea/actions-runner.nix
|
# Based on: https://git.clan.lol/clan/clan-infra/src/branch/main/modules/web01/gitea/actions-runner.nix
|
||||||
|
|
||||||
@ -58,12 +52,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "podman.service" ];
|
after = [ "podman.service" ];
|
||||||
requires = [ "podman.service" ];
|
requires = [ "podman.service" ];
|
||||||
path = [
|
path = [ config.virtualisation.podman.package pkgs.gnutar pkgs.shadow pkgs.getent ];
|
||||||
config.virtualisation.podman.package
|
|
||||||
pkgs.gnutar
|
|
||||||
pkgs.shadow
|
|
||||||
pkgs.getent
|
|
||||||
];
|
|
||||||
script = ''
|
script = ''
|
||||||
set -eux -o pipefail
|
set -eux -o pipefail
|
||||||
mkdir -p etc/nix
|
mkdir -p etc/nix
|
||||||
@ -153,12 +142,7 @@ in
|
|||||||
"~setdomainname"
|
"~setdomainname"
|
||||||
"~sethostname"
|
"~sethostname"
|
||||||
];
|
];
|
||||||
RestrictAddressFamilies = [
|
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" "AF_NETLINK" ];
|
||||||
"AF_INET"
|
|
||||||
"AF_INET6"
|
|
||||||
"AF_UNIX"
|
|
||||||
"AF_NETLINK"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Needs network access
|
# Needs network access
|
||||||
PrivateNetwork = false;
|
PrivateNetwork = false;
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.gitea;
|
cfg = config.modules.services.gitea;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.gitea = {
|
options.modules.services.gitea = {
|
||||||
enable = lib.mkEnableOption "gitea";
|
enable = lib.mkEnableOption "gitea";
|
||||||
domain = lib.mkOption {
|
domain = lib.mkOption {
|
||||||
@ -23,7 +16,7 @@ in
|
|||||||
users.git = {
|
users.git = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
useDefaultShell = true;
|
useDefaultShell = true;
|
||||||
group = "git";
|
group = "git";
|
||||||
extraGroups = [ "gitea" ];
|
extraGroups = [ "gitea" ];
|
||||||
home = config.services.gitea.stateDir;
|
home = config.services.gitea.stateDir;
|
||||||
};
|
};
|
@ -1,23 +1,19 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
with lib;
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.headscale;
|
cfg = config.modules.services.headscale;
|
||||||
fqdn = "headscale.vimium.net";
|
fqdn = "headscale.vimium.net";
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.headscale = {
|
options.modules.services.headscale = {
|
||||||
enable = lib.mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = [ pkgs.headscale ];
|
environment.systemPackages = [ pkgs.headscale ];
|
||||||
|
|
||||||
services.headscale = {
|
services.headscale = {
|
||||||
@ -26,17 +22,12 @@ in
|
|||||||
port = 8080;
|
port = 8080;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
policy.path = null;
|
|
||||||
ip_prefixes = [
|
ip_prefixes = [
|
||||||
"100.64.0.0/10"
|
"100.64.0.0/10"
|
||||||
];
|
];
|
||||||
server_url = "https://${fqdn}";
|
server_url = "https://${fqdn}";
|
||||||
derp = {
|
dns_config = {
|
||||||
auto_update_enable = false;
|
base_domain = "vimium.net";
|
||||||
update_frequency = "24h";
|
|
||||||
};
|
|
||||||
dns = {
|
|
||||||
base_domain = "mesh.vimium.net";
|
|
||||||
extra_records = [
|
extra_records = [
|
||||||
{
|
{
|
||||||
name = "grafana.mesh.vimium.net";
|
name = "grafana.mesh.vimium.net";
|
||||||
@ -49,10 +40,6 @@ in
|
|||||||
value = "100.64.0.7";
|
value = "100.64.0.7";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
magic_dns = true;
|
|
||||||
nameservers.global = [
|
|
||||||
"9.9.9.9"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
logtail.enabled = false;
|
logtail.enabled = false;
|
||||||
};
|
};
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.mail;
|
cfg = config.modules.services.mail;
|
||||||
@ -19,8 +14,7 @@ let
|
|||||||
"vimium.org"
|
"vimium.org"
|
||||||
"vimium.xyz"
|
"vimium.xyz"
|
||||||
];
|
];
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.mail = {
|
options.modules.services.mail = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -46,10 +40,7 @@ in
|
|||||||
|
|
||||||
services.nginx.enable = true;
|
services.nginx.enable = true;
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
80
|
|
||||||
443
|
|
||||||
];
|
|
||||||
|
|
||||||
mailserver = {
|
mailserver = {
|
||||||
enable = true;
|
enable = true;
|
248
modules/services/matrix/default.nix
Normal file
248
modules/services/matrix/default.nix
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
{ config, lib, pkgs, self, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.matrix;
|
||||||
|
in {
|
||||||
|
options.modules.services.matrix = {
|
||||||
|
enable = lib.mkEnableOption "matrix";
|
||||||
|
element = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bridges = {
|
||||||
|
signal = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable Signal bridge.";
|
||||||
|
};
|
||||||
|
whatsapp = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable WhatsApp bridge.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
serverName = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "vimium.com";
|
||||||
|
example = "vimium.com";
|
||||||
|
};
|
||||||
|
slidingSync = {
|
||||||
|
enable = lib.mkEnableOption "sliding-sync";
|
||||||
|
};
|
||||||
|
usePostgresql = lib.mkEnableOption "postgresql";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = let
|
||||||
|
matrixSubdomain = "matrix.${cfg.serverName}";
|
||||||
|
elementSubdomain = "chat.${cfg.serverName}";
|
||||||
|
matrixClientConfig = {
|
||||||
|
"m.homeserver" = {
|
||||||
|
base_url = "https://${matrixSubdomain}";
|
||||||
|
server_name = cfg.serverName;
|
||||||
|
};
|
||||||
|
"m.identity_server" = {};
|
||||||
|
"org.matrix.msc3575.proxy" = if cfg.slidingSync.enable then {
|
||||||
|
"url" = "https://${matrixSubdomain}";
|
||||||
|
} else { };
|
||||||
|
};
|
||||||
|
matrixServerConfig."m.server" = "${matrixSubdomain}:443";
|
||||||
|
commonBridgeSettings = bridge: {
|
||||||
|
appservice = {
|
||||||
|
database = lib.mkIf cfg.usePostgresql {
|
||||||
|
type = "postgres";
|
||||||
|
uri = "postgresql:///${bridge}?host=/run/postgresql";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bridge = {
|
||||||
|
encryption = {
|
||||||
|
allow = true;
|
||||||
|
default = true;
|
||||||
|
require = true;
|
||||||
|
};
|
||||||
|
permissions = {
|
||||||
|
"${cfg.serverName}" = "user";
|
||||||
|
"@jordan:${cfg.serverName}" = "admin";
|
||||||
|
};
|
||||||
|
provisioning = {
|
||||||
|
shared_secret = "disable";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
homeserver = {
|
||||||
|
address = "https://${matrixSubdomain}";
|
||||||
|
domain = cfg.serverName;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in lib.mkIf cfg.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
8448 # Matrix federation
|
||||||
|
];
|
||||||
|
|
||||||
|
security.acme.certs = {
|
||||||
|
"${matrixSubdomain}" = {
|
||||||
|
reloadServices = [ "matrix-synapse" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"${matrixSubdomain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 443;
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 80;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 8448;
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addr = "[::1]";
|
||||||
|
port = 443;
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addr = "[::1]";
|
||||||
|
port = 80;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addr = "[::1]";
|
||||||
|
port = 8448;
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
proxyPass = "http://localhost:8008";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"/_matrix" = {
|
||||||
|
proxyPass = "http://localhost:8008";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
client_max_body_size 50M;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"/_synapse/client".proxyPass = "http://localhost:8008";
|
||||||
|
"~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = lib.mkIf cfg.slidingSync.enable {
|
||||||
|
priority = 100;
|
||||||
|
proxyPass = "http://localhost:8009";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"${cfg.serverName}" = let
|
||||||
|
mkWellKnown = data: ''
|
||||||
|
more_set_headers 'Content-Type: application/json';
|
||||||
|
return 200 '${builtins.toJSON data}';
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
locations."= /.well-known/matrix/server".extraConfig = (mkWellKnown matrixServerConfig);
|
||||||
|
locations."= /.well-known/matrix/client".extraConfig = (mkWellKnown matrixClientConfig);
|
||||||
|
};
|
||||||
|
} // (if cfg.element.enable then {
|
||||||
|
"${elementSubdomain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
root = pkgs.unstable.element-web.override {
|
||||||
|
conf = {
|
||||||
|
default_server_config = matrixClientConfig;
|
||||||
|
brand = "Vimium Chat";
|
||||||
|
branding = {
|
||||||
|
auth_header_logo_url = "https://vimium.com/images/logo.svg";
|
||||||
|
auth_footer_links = [
|
||||||
|
{ "text" = "Vimium.com"; "url" = "https://vimium.com"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} else {});
|
||||||
|
|
||||||
|
services.matrix-synapse = {
|
||||||
|
enable = true;
|
||||||
|
enableRegistrationScript = true;
|
||||||
|
settings = {
|
||||||
|
database.name = (if cfg.usePostgresql then "psycopg2" else "sqlite3");
|
||||||
|
enable_metrics = false;
|
||||||
|
enable_registration = false;
|
||||||
|
max_upload_size = "100M";
|
||||||
|
report_stats = false;
|
||||||
|
server_name = cfg.serverName;
|
||||||
|
app_service_config_files = (lib.optional cfg.bridges.whatsapp
|
||||||
|
"/var/lib/mautrix-whatsapp/whatsapp-registration.yaml");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.services.matrix-synapse.serviceConfig.SupplementaryGroups =
|
||||||
|
(lib.optional cfg.bridges.whatsapp
|
||||||
|
config.systemd.services.mautrix-whatsapp.serviceConfig.Group);
|
||||||
|
|
||||||
|
age.secrets = if cfg.slidingSync.enable then {
|
||||||
|
"files/services/matrix/sliding-sync" = {
|
||||||
|
file = "${self.inputs.secrets}/files/services/matrix/sliding-sync.age";
|
||||||
|
};
|
||||||
|
} else {};
|
||||||
|
|
||||||
|
services.matrix-sliding-sync = lib.mkIf cfg.slidingSync.enable {
|
||||||
|
enable = true;
|
||||||
|
environmentFile = config.age.secrets."files/services/matrix/sliding-sync".path;
|
||||||
|
settings = { SYNCV3_SERVER = "https://${matrixSubdomain}"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
services.postgresql = lib.mkIf cfg.usePostgresql {
|
||||||
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "matrix-synapse";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}
|
||||||
|
] ++ (lib.optional cfg.bridges.signal
|
||||||
|
{
|
||||||
|
name = "mautrix-signal";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
})
|
||||||
|
++ (lib.optional cfg.bridges.whatsapp
|
||||||
|
{
|
||||||
|
name = "mautrix-whatsapp";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
});
|
||||||
|
ensureDatabases = [
|
||||||
|
"matrix-synapse"
|
||||||
|
] ++ (lib.optional cfg.bridges.signal
|
||||||
|
"mautrix-signal")
|
||||||
|
++ (lib.optional cfg.bridges.whatsapp
|
||||||
|
"mautrix-whatsapp");
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mautrix-signal = lib.mkIf cfg.bridges.signal {
|
||||||
|
enable = true;
|
||||||
|
settings = commonBridgeSettings "mautrix-signal";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mautrix-whatsapp = lib.mkIf cfg.bridges.whatsapp {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
bridge = {
|
||||||
|
history_sync = {
|
||||||
|
backfill = true;
|
||||||
|
max_initial_conversations = -1;
|
||||||
|
message_count = 50;
|
||||||
|
request_full_sync = true;
|
||||||
|
};
|
||||||
|
mute_bridging = true;
|
||||||
|
};
|
||||||
|
} // commonBridgeSettings "mautrix-whatsapp";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
178
modules/services/nginx/default.nix
Normal file
178
modules/services/nginx/default.nix
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.nginx;
|
||||||
|
nginxErrorPages = ''
|
||||||
|
location @error_pages {
|
||||||
|
rewrite ^.*$ /''${status}.html break;
|
||||||
|
|
||||||
|
root "/var/www/html/errors";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
nginxEdgeHeaders = ''
|
||||||
|
more_set_headers 'Server: Vimium';
|
||||||
|
more_set_headers 'Access-Control-Allow-Origin: *';
|
||||||
|
add_header Expect-CT max-age=30 always;
|
||||||
|
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
||||||
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||||
|
add_header Vimium-Responding-Instance $hostname;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
add_header X-Content-Type-Options nosniff always;
|
||||||
|
'';
|
||||||
|
nginxStrictHeaders = ''
|
||||||
|
add_header X-Frame-Options SAMEORIGIN always;
|
||||||
|
add_header Permissions-Policy "fullscreen=(self), sync-xhr=(self)" always;
|
||||||
|
'';
|
||||||
|
mkRedirect = from: to: {
|
||||||
|
"${from}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
serverAliases = [ "www.${from}" ];
|
||||||
|
locations."/".return = "301 https://${to}$request_uri";
|
||||||
|
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.modules.services.nginx = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80 # HTTP
|
||||||
|
443 # HTTPS
|
||||||
|
];
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.openresty;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
clientMaxBodySize = "2G";
|
||||||
|
sslProtocols = "TLSv1.2 TLSv1.3";
|
||||||
|
sslCiphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
|
||||||
|
appendHttpConfig = ''
|
||||||
|
error_page 400 @error_pages;
|
||||||
|
error_page 401 @error_pages;
|
||||||
|
error_page 403 @error_pages;
|
||||||
|
error_page 404 @error_pages;
|
||||||
|
error_page 405 @error_pages;
|
||||||
|
error_page 429 @error_pages;
|
||||||
|
error_page 500 @error_pages;
|
||||||
|
error_page 501 @error_pages;
|
||||||
|
error_page 502 @error_pages;
|
||||||
|
error_page 503 @error_pages;
|
||||||
|
error_page 504 @error_pages;
|
||||||
|
|
||||||
|
client_body_buffer_size 16k;
|
||||||
|
client_header_buffer_size 8k;
|
||||||
|
'';
|
||||||
|
appendConfig = ''
|
||||||
|
worker_processes auto;
|
||||||
|
worker_cpu_affinity auto;
|
||||||
|
worker_rlimit_nofile 50000;
|
||||||
|
'';
|
||||||
|
eventsConfig = ''
|
||||||
|
worker_connections 20000;
|
||||||
|
multi_accept off;
|
||||||
|
'';
|
||||||
|
proxyCachePath = {
|
||||||
|
"skycam" = {
|
||||||
|
enable = true;
|
||||||
|
keysZoneName = "skycam_cache";
|
||||||
|
maxSize = "100m";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
virtualHosts = {
|
||||||
|
## Static sites
|
||||||
|
"jellyfin.vimium.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
extraConfig = nginxErrorPages + nginxEdgeHeaders;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8000";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
proxy_set_header Range $http_range;
|
||||||
|
proxy_set_header If-Range $http_if_range;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"jdholt.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
serverAliases = [ "www.jdholt.com" ];
|
||||||
|
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
||||||
|
locations."/skycam/snapshot.jpg" = {
|
||||||
|
proxyPass = "http://skycam.mesh.vimium.net:8080/snapshot";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_cache skycam_cache;
|
||||||
|
proxy_cache_valid any 10s;
|
||||||
|
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
locations."/".return = "301 https://vimium.com$request_uri";
|
||||||
|
};
|
||||||
|
"pki.vimium.com" = {
|
||||||
|
addSSL = true;
|
||||||
|
forceSSL = false;
|
||||||
|
enableACME = true;
|
||||||
|
extraConfig = ''
|
||||||
|
${nginxErrorPages}
|
||||||
|
more_set_headers 'Server: Vimium';
|
||||||
|
'';
|
||||||
|
locations."/" = {
|
||||||
|
root = "/var/www/pki.vimium.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"suhailhussain.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
serverAliases = [ "www.suhailhussain.com" ];
|
||||||
|
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
||||||
|
locations."/" = {
|
||||||
|
root = "/var/www/suhailhussain.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"vimium.com" = {
|
||||||
|
default = true;
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
serverAliases = [ "www.vimium.com" ];
|
||||||
|
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders + ''
|
||||||
|
add_header Content-Security-Policy "default-src 'self' https://vimium.com https://www.vimium.com; style-src 'unsafe-inline'; object-src 'none'; upgrade-insecure-requests" always;
|
||||||
|
'';
|
||||||
|
locations."/" = {
|
||||||
|
root = "/var/www/vimium.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
## Redirects
|
||||||
|
// (mkRedirect "h0lt.com" "jdholt.com")
|
||||||
|
// (mkRedirect "jordanholt.xyz" "jdholt.com")
|
||||||
|
// (mkRedirect "omnimagic.com" "vimium.com")
|
||||||
|
// (mkRedirect "omnimagic.net" "vimium.com")
|
||||||
|
// (mkRedirect "thelostlegend.com" "suhailhussain.com")
|
||||||
|
// (mkRedirect "vimium.co" "vimium.com")
|
||||||
|
// (mkRedirect "vimium.co.uk" "vimium.com")
|
||||||
|
// (mkRedirect "vimium.info" "vimium.com")
|
||||||
|
// (mkRedirect "vimium.net" "vimium.com")
|
||||||
|
// (mkRedirect "vimium.org" "vimium.com")
|
||||||
|
// (mkRedirect "vimium.xyz" "vimium.com");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,16 +1,9 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let cfg = config.modules.services.photoprism;
|
||||||
cfg = config.modules.services.photoprism;
|
in {
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.photoprism = {
|
options.modules.services.photoprism = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
@ -1,14 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let cfg = config.modules.shell.git;
|
||||||
cfg = config.modules.programs.git;
|
in {
|
||||||
in
|
options.modules.shell.git = {
|
||||||
{
|
|
||||||
options.modules.programs.git = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
34
modules/shell/zsh/.zshrc
Normal file
34
modules/shell/zsh/.zshrc
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
source $ZDOTDIR/config.zsh
|
||||||
|
|
||||||
|
if [ ! -d "$ZGEN_DIR" ]; then
|
||||||
|
echo "Installing jandamm/zgenom"
|
||||||
|
git clone https://github.com/jandamm/zgenom "$ZGEN_DIR"
|
||||||
|
fi
|
||||||
|
source $ZGEN_DIR/zgenom.zsh
|
||||||
|
|
||||||
|
zgenom autoupdate
|
||||||
|
|
||||||
|
if ! zgenom saved; then
|
||||||
|
echo "Initializing zgenom"
|
||||||
|
rm -f $ZDOTDIR/*.zwc(N) \
|
||||||
|
$XDG_CACHE_HOME/zsh/*(N) \
|
||||||
|
$ZGEN_INIT.zwc
|
||||||
|
|
||||||
|
zgenom load junegunn/fzf shell
|
||||||
|
zgenom load zdharma-continuum/fast-syntax-highlighting
|
||||||
|
zgenom load zsh-users/zsh-completions src
|
||||||
|
zgenom load zsh-users/zsh-history-substring-search
|
||||||
|
zgenom load softmoth/zsh-vim-mode
|
||||||
|
|
||||||
|
zgenom save
|
||||||
|
zgenom compile $ZDOTDIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Bootstrap interactive sessions
|
||||||
|
if [[ $TERM != dumb ]]; then
|
||||||
|
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
|
||||||
|
|
||||||
|
source $ZDOTDIR/keybinds.zsh
|
||||||
|
source $ZDOTDIR/completion.zsh
|
||||||
|
source $ZDOTDIR/aliases.zsh
|
||||||
|
fi
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user