Compare commits
No commits in common. "prime" and "0.2.0" have entirely different histories.
132 changed files with 2179 additions and 3142 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
# gitignore
|
result
|
||||||
.pre-commit-config.*
|
*.qcow2
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
keys:
|
keys:
|
||||||
- &rafiq age12l33pas8eptwjc7ewux3d8snyzfzwz0tn9qg5kw8le79fswmjgjqdjgyy6
|
- &admin age12l33pas8eptwjc7ewux3d8snyzfzwz0tn9qg5kw8le79fswmjgjqdjgyy6
|
||||||
creation_rules:
|
creation_rules:
|
||||||
- path_regex: \.(yaml)$
|
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
|
||||||
key_groups:
|
key_groups:
|
||||||
- age:
|
- age:
|
||||||
- *rafiq
|
- *admin
|
||||||
|
|
55
README.md
Normal file
55
README.md
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# Planning
|
||||||
|
|
||||||
|
## To-do
|
||||||
|
|
||||||
|
- [ ] Implement an status bar for the desktop configuration
|
||||||
|
- [ ] Copy over ~/.ssh/id_ed25519 and zellij status bar plugin confirmation
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
|
||||||
|
- 1.0.0
|
||||||
|
- Replicate old zagreus wholly
|
||||||
|
- Automated backups for home and state directories
|
||||||
|
- Ability to build VMs of all systems and implement integration tests
|
||||||
|
- Staging VMs for ad-hoc testing
|
||||||
|
- All servers set up with following services:
|
||||||
|
- Git server
|
||||||
|
- Chat app
|
||||||
|
- Network shares
|
||||||
|
- Federation with ActivityPub
|
||||||
|
- Wakapi
|
||||||
|
- 0.2.0
|
||||||
|
- Provision Apollo
|
||||||
|
- Fix all NVF errors
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
|
||||||
|
The nixosModules and homeModules exposed by this flake are slightly out of the
|
||||||
|
norm.
|
||||||
|
|
||||||
|
Option declarations for user specific configuration are kept to:
|
||||||
|
|
||||||
|
- homeModules for CLI
|
||||||
|
- nixosModules for desktop
|
||||||
|
|
||||||
|
System configurations, to this end, should include the window manager,
|
||||||
|
lockscreen, terminal etc. for that system.
|
||||||
|
|
||||||
|
These desktop programs will be **configured** in home-manager for each user, but
|
||||||
|
those configurations consult the osConfig variable passed in by home-manager.
|
||||||
|
|
||||||
|
# System Setup
|
||||||
|
|
||||||
|
The following files are **required** for system activation:
|
||||||
|
|
||||||
|
- /persist/home/${mainUser}/.ssh/id_ed25519
|
||||||
|
|
||||||
|
This private key will be used by sops-nix to decrypt the secrets in
|
||||||
|
[[secrets/secrets.yaml]]. The secrets inside the yaml file should also be set,
|
||||||
|
or otherwise removed alongside their declarations (in
|
||||||
|
[[modules/nixos/system/secrets.nix]]) and references.
|
||||||
|
|
||||||
|
# Impermanence
|
||||||
|
|
||||||
|
System and user state is stored under /persist. Anything not declared under
|
||||||
|
`{environment,home}.persistence` is deleted on system boot.
|
|
@ -1,29 +0,0 @@
|
||||||
# Pantheon
|
|
||||||
This flake serves as a monorepo for my systems (using IaC), dotfiles, and scripts.
|
|
||||||
It's hosted at https://git.rrv.sh/rrvsh/pantheon, and mirrored to https://github.com/rrvsh/pantheon.
|
|
||||||
|
|
||||||
## Structure
|
|
||||||
The system configurations are defined in [`flake.manifest`](nix/manifest.nix).
|
|
||||||
`flake.manifest.owner` provides the attributes for the administrator user, including username and pubkey.
|
|
||||||
`flake.manifest.hosts` provides the specifications for the system configurations that should be exposed by the flake as nixosConfigurations.
|
|
||||||
`flake.modules.nixos.*` provide NixOS options and configurations.
|
|
||||||
The attribute `flake.modules.nixos.default` provides options that will be applied to every system of that class.
|
|
||||||
You can use it as seen [here](nix/modules/flake/home-manager.nix):
|
|
||||||
|
|
||||||
```nix
|
|
||||||
flake.modules.nixos.default.imports = [ inputs.home-manager.nixosModules.default ];
|
|
||||||
```
|
|
||||||
|
|
||||||
The other attributes under `flake.modules.nixos` should be opt-in, i.e. provide options that will be set in the profiles.
|
|
||||||
`flake.profiles.nixos` provides profiles which use the options defined in `flake.modules.nixos` to define different roles for each system, such as graphical, laptop, headless, etc.
|
|
||||||
Options should not be defined here.
|
|
||||||
`flake.contracts.nixos.*` will provide contracts, such as reverse proxies or databases, which will configure options on the provider and receiver host.
|
|
||||||
|
|
||||||
## Acknowledgements
|
|
||||||
Thanks to the following for inspiring this configuration. I highly recommend you look through their writings and configurations.
|
|
||||||
- [ornicar](https://github.com/ornicar/dotfiles) which is where I first heard of NixOS
|
|
||||||
- [No Boilerplate](https://www.youtube.com/watch?v=CwfKlX3rA6E&pp=0gcJCfwAo7VqN5tD) for making me finally try the OS
|
|
||||||
- [ryan4yin](https://nixos-and-flakes.thiscute.world/) for being an amazing introduction to NixOS, home-manager, and flakes
|
|
||||||
- [NotAShelf](https://github.com/NotAShelf/) for their blog and for the wonderful [NVF](https://github.com/notashelf/nvf)
|
|
||||||
- [mightyiam](https://github.com/mightyiam/infra) for their infrastructure repo using flake-parts
|
|
||||||
- [drupol](https://not-a-number.io/2025/refactoring-my-infrastructure-as-code-configurations/) for this blog post which convinced me to rebase my infra to use flake-parts
|
|
|
@ -1,2 +0,0 @@
|
||||||
# cheatsheet
|
|
||||||
`__curPos.file` will give the full evaluated path of the nix file it is called in. See [this issue](https://github.com/NixOS/nix/issues/5897#issuecomment-1012165198) for more information.
|
|
554
flake.lock
generated
554
flake.lock
generated
|
@ -67,73 +67,18 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dedupe_flake-compat": {
|
"crane": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747046372,
|
"lastModified": 1748047550,
|
||||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
"narHash": "sha256-t0qLLqb4C1rdtiY8IFRH5KIapTY/n3Lqt57AmxEv9mk=",
|
||||||
"owner": "edolstra",
|
"owner": "ipetkov",
|
||||||
"repo": "flake-compat",
|
"repo": "crane",
|
||||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
"rev": "b718a78696060df6280196a6f992d04c87a16aef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "edolstra",
|
"owner": "ipetkov",
|
||||||
"repo": "flake-compat",
|
"repo": "crane",
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dedupe_flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": [
|
|
||||||
"systems"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dedupe_gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dedupe_mnw": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1748710831,
|
|
||||||
"narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=",
|
|
||||||
"owner": "gerg-l",
|
|
||||||
"repo": "mnw",
|
|
||||||
"rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "gerg-l",
|
|
||||||
"repo": "mnw",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -144,11 +89,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751854533,
|
"lastModified": 1748832438,
|
||||||
"narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=",
|
"narHash": "sha256-/CtyLVfNaFP7PrOPrTEuGOJBIhcBKVQ91KiEbtXJi0A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "16b74a1e304197248a1bc663280f2548dbfcae3c",
|
"rev": "58d6e5a83fff9982d57e0a0a994d4e5c0af441e4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -157,21 +102,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1750263550,
|
|
||||||
"narHash": "sha256-EW/QJ8i/13GgiynBb6zOMxhLU1uEkRqmzbIDEP23yVA=",
|
|
||||||
"owner": "mightyiam",
|
|
||||||
"repo": "files",
|
|
||||||
"rev": "5f4ef1fd1f9012354a9748be093e277675d10f07",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "mightyiam",
|
|
||||||
"repo": "files",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"firefox-gnome-theme": {
|
"firefox-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -188,18 +118,31 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747046372,
|
||||||
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751413152,
|
"lastModified": 1748821116,
|
||||||
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
|
"narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
|
"rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -208,6 +151,46 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": [
|
||||||
|
"systems"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils-plus": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1738591040,
|
||||||
|
"narHash": "sha256-4WNeriUToshQ/L5J+dTSWC5OJIwT39SEP7V7oylndi8=",
|
||||||
|
"owner": "gytis-ivaskevicius",
|
||||||
|
"repo": "flake-utils-plus",
|
||||||
|
"rev": "afcb15b845e74ac5e998358709b2b5fe42a948d1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "gytis-ivaskevicius",
|
||||||
|
"repo": "flake-utils-plus",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fromYaml": {
|
"fromYaml": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -227,21 +210,21 @@
|
||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"dedupe_flake-compat"
|
"stylix",
|
||||||
],
|
"flake-compat"
|
||||||
"gitignore": [
|
|
||||||
"dedupe_gitignore"
|
|
||||||
],
|
],
|
||||||
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
"stylix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750779888,
|
"lastModified": 1747372754,
|
||||||
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
|
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -250,19 +233,41 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"stylix",
|
||||||
|
"git-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"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gnome-shell": {
|
"gnome-shell": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748186689,
|
"lastModified": 1744584021,
|
||||||
"narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=",
|
"narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=",
|
||||||
"owner": "GNOME",
|
"owner": "GNOME",
|
||||||
"repo": "gnome-shell",
|
"repo": "gnome-shell",
|
||||||
"rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0",
|
"rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "GNOME",
|
"owner": "GNOME",
|
||||||
"ref": "48.2",
|
"ref": "48.1",
|
||||||
"repo": "gnome-shell",
|
"repo": "gnome-shell",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -274,11 +279,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751990210,
|
"lastModified": 1748830238,
|
||||||
"narHash": "sha256-krWErNDl9ggMLSfK00Q2BcoSk3+IRTSON/DiDgUzzMw=",
|
"narHash": "sha256-EB+LzYHK0D5aqxZiYoPeoZoOzSAs8eqBDxm3R+6wMKU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "218da00bfa73f2a61682417efe74549416c16ba6",
|
"rev": "c7fdb7e90bff1a51b79c1eed458fb39e6649a82a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -302,74 +307,44 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"import-tree": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751399845,
|
"lastModified": 1748710831,
|
||||||
"narHash": "sha256-iun7//YHeEFgEOcG4KKKoy3d2GWOYqokLFVU/zIs79Y=",
|
"narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=",
|
||||||
"owner": "vic",
|
"owner": "Gerg-L",
|
||||||
"repo": "import-tree",
|
"repo": "mnw",
|
||||||
"rev": "e24a50ff9b5871d4bdd8900679784812eeb120ea",
|
"rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "vic",
|
"owner": "Gerg-L",
|
||||||
"repo": "import-tree",
|
"repo": "mnw",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"make-shell": {
|
"nil": {
|
||||||
"inputs": {
|
|
||||||
"flake-compat": [
|
|
||||||
"dedupe_flake-compat"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733933815,
|
|
||||||
"narHash": "sha256-9JjM7eT66W4NJAXpGUsdyAFXhBxFWR2Z9LZwUa7Hli0=",
|
|
||||||
"owner": "nicknovitski",
|
|
||||||
"repo": "make-shell",
|
|
||||||
"rev": "ffeceae9956df03571ea8e96ef77c2924f13a63c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nicknovitski",
|
|
||||||
"repo": "make-shell",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"manifest": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1752588656,
|
|
||||||
"narHash": "sha256-clKPzQ43eDpukeiGHzXmd1hGb2s4N+MWXAzQ5u5+pHQ=",
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "manifest",
|
|
||||||
"rev": "365902fba994f30469298dee0c98a5fc0f41ec38",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "manifest",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-darwin": {
|
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": [
|
||||||
|
"rust-overlay"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751313918,
|
"lastModified": 1741118843,
|
||||||
"narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
|
"narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=",
|
||||||
"owner": "nix-darwin",
|
"owner": "oxalica",
|
||||||
"repo": "nix-darwin",
|
"repo": "nil",
|
||||||
"rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
|
"rev": "577d160da311cc7f5042038456a0713e9863d09e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-darwin",
|
"owner": "oxalica",
|
||||||
"ref": "master",
|
"repo": "nil",
|
||||||
"repo": "nix-darwin",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -380,11 +355,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751774635,
|
"lastModified": 1748751003,
|
||||||
"narHash": "sha256-DuOznGdgMxeSlPpUu6Wkq0ZD5e2Cfv9XRZeZlHWMd1s=",
|
"narHash": "sha256-i4GZdKAK97S0ZMU3w4fqgEJr0cVywzqjugt2qZPrScs=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "85686025ba6d18df31cc651a91d5adef63378978",
|
"rev": "2860bee699248d828c2ed9097a1cd82c2f991b43",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -395,11 +370,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751792365,
|
"lastModified": 1748693115,
|
||||||
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -409,6 +384,41 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1748740939,
|
||||||
|
"narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "656a64127e9d791a334452c6b6606d17539476e2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixspect": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747725629,
|
||||||
|
"narHash": "sha256-jEdIW5+SMfX6jVvx/MkMbpXLX9S2b+zsayIC1YJNAaY=",
|
||||||
|
"owner": "rrvsh",
|
||||||
|
"repo": "nixspect",
|
||||||
|
"rev": "28deacc6adeaef69f45af5c8139961a774e1600b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rrvsh",
|
||||||
|
"repo": "nixspect",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": [
|
"flake-parts": [
|
||||||
|
@ -416,14 +426,15 @@
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
],
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752005241,
|
"lastModified": 1748864791,
|
||||||
"narHash": "sha256-+7DH6wh2BYnLRJzYXEbVlA1ZuAR4MxZI/paknbAuzk4=",
|
"narHash": "sha256-YRRRbOEc8aXpzSvN3qdIkqtVQ9xjx9rgichtaSQ0qwY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "a2570fb4d0699fd34ebbbd52e2a763722601f6c6",
|
"rev": "4ee0c2599266fb26e6ac3cb71836e96f25df446e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -438,10 +449,13 @@
|
||||||
"flake-parts"
|
"flake-parts"
|
||||||
],
|
],
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"dedupe_flake-utils"
|
"flake-utils"
|
||||||
],
|
],
|
||||||
"mnw": [
|
"mnw": [
|
||||||
"dedupe_mnw"
|
"mnw"
|
||||||
|
],
|
||||||
|
"nil": [
|
||||||
|
"nil"
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -451,11 +465,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752001027,
|
"lastModified": 1748651104,
|
||||||
"narHash": "sha256-JgP8lW4QBr9v/U4ETaIOMvGCd/DAA1AjZ1lqjIwfWno=",
|
"narHash": "sha256-GZLiCQlNV8QfAWwGinXeSdiKZS346ZGPv6EKzeY0tAA=",
|
||||||
"owner": "notashelf",
|
"owner": "notashelf",
|
||||||
"repo": "nvf",
|
"repo": "nvf",
|
||||||
"rev": "c4d80273aaefeadaad96db97d077c647942b0e96",
|
"rev": "c4cf91d4b531245a02f5b6c196f6279bc87a546f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -467,20 +481,18 @@
|
||||||
"python-flexseal": {
|
"python-flexseal": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"stable-diffusion-webui-nix",
|
|
||||||
"flake-utils"
|
"flake-utils"
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"stable-diffusion-webui-nix",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751898758,
|
"lastModified": 1734836319,
|
||||||
"narHash": "sha256-8EmTPdfOymvvHhmHYWiyO3cwZ4gtLo5uBFm3CU5vySo=",
|
"narHash": "sha256-h/Jiq852WJyyAL037sIxjPDScjeH8sUoZVZBWlciXaw=",
|
||||||
"owner": "Janrupf",
|
"owner": "Janrupf",
|
||||||
"repo": "python-flexseal",
|
"repo": "python-flexseal",
|
||||||
"rev": "af318e1fd047abbefcc68d0292a4d902179c95fe",
|
"rev": "fdd313f7b9a5c9545c015acaf0729b01f708118a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -491,60 +503,39 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dedupe_flake-compat": "dedupe_flake-compat",
|
"crane": "crane",
|
||||||
"dedupe_flake-utils": "dedupe_flake-utils",
|
|
||||||
"dedupe_gitignore": "dedupe_gitignore",
|
|
||||||
"dedupe_mnw": "dedupe_mnw",
|
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"files": "files",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"git-hooks": "git-hooks",
|
"flake-utils": "flake-utils",
|
||||||
|
"flake-utils-plus": "flake-utils-plus",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"import-tree": "import-tree",
|
"mnw": "mnw",
|
||||||
"make-shell": "make-shell",
|
"nil": "nil",
|
||||||
"manifest": "manifest",
|
|
||||||
"nix-darwin": "nix-darwin",
|
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixspect": "nixspect",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"nvf": "nvf",
|
"nvf": "nvf",
|
||||||
"rrv-sh": "rrv-sh",
|
"python-flexseal": "python-flexseal",
|
||||||
"rrvsh-nixpkgs": "rrvsh-nixpkgs",
|
"rrvsh-nixpkgs": "rrvsh-nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay",
|
||||||
|
"snowfall-lib": "snowfall-lib",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"stable-diffusion-webui-nix": "stable-diffusion-webui-nix",
|
"stable-diffusion-webui-nix": "stable-diffusion-webui-nix",
|
||||||
"stylix": "stylix",
|
"stylix": "stylix",
|
||||||
"systems": "systems",
|
"systems": "systems",
|
||||||
"text": "text"
|
"zjstatus": "zjstatus"
|
||||||
}
|
|
||||||
},
|
|
||||||
"rrv-sh": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1751721838,
|
|
||||||
"narHash": "sha256-702c0fbgpUuEuQsduGJ9I5bSrCLYEG88SPuZXcSQqTs=",
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "rrv.sh",
|
|
||||||
"rev": "e00c1c2607b55f43ef74b5f555f62838f4fe5963",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "rrv.sh",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rrvsh-nixpkgs": {
|
"rrvsh-nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750146550,
|
"lastModified": 1748869769,
|
||||||
"narHash": "sha256-vFNbONVWIdYBqlKZoJScDRjnQ/euDmVqgCL2ebnsu7U=",
|
"narHash": "sha256-2L9Bcj3kIt3n9NkCms6u66j8GsN7j22YnjaX+er3AtY=",
|
||||||
"owner": "rrvsh",
|
"owner": "rrvsh",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d7fa95990fd890bbd17ca8361f5d4e4935512c75",
|
"rev": "32aae0a2767f3b18b115a0f1f2edfe524305b864",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -554,6 +545,52 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1748832016,
|
||||||
|
"narHash": "sha256-TQSaFa1wWJr6GOs+K8lecK4AKKr8k6mwxHIPCOmVkgs=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "7ec2ea005b600dac9436a7c5c6b66d960cbfcea2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"snowfall-lib": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": [
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"flake-utils-plus": [
|
||||||
|
"flake-utils-plus"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1736130495,
|
||||||
|
"narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=",
|
||||||
|
"owner": "snowfallorg",
|
||||||
|
"repo": "lib",
|
||||||
|
"rev": "02d941739f98a09e81f3d2d9b3ab08918958beac",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "snowfallorg",
|
||||||
|
"repo": "lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -561,11 +598,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751606940,
|
"lastModified": 1747603214,
|
||||||
"narHash": "sha256-KrDPXobG7DFKTOteqdSVeL1bMVitDcy7otpVZWDE6MA=",
|
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "3633fc4acf03f43b260244d94c71e9e14a2f6e0d",
|
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -577,23 +614,26 @@
|
||||||
"stable-diffusion-webui-nix": {
|
"stable-diffusion-webui-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"dedupe_flake-utils"
|
"flake-utils"
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"python-flexseal": "python-flexseal"
|
"python-flexseal": [
|
||||||
|
"python-flexseal"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751899247,
|
"lastModified": 1748219198,
|
||||||
"narHash": "sha256-bh6xwc24Rv0YE4grKXvj+kmXmydns+OrlWn4WLnJSY4=",
|
"narHash": "sha256-RRDI12SLfm9lP7tq4vUr/c/TRj0+mgRjAThdnwTJgIE=",
|
||||||
"owner": "janrupf",
|
"owner": "Janrupf",
|
||||||
"repo": "stable-diffusion-webui-nix",
|
"repo": "stable-diffusion-webui-nix",
|
||||||
"rev": "d5ba5dccd190b0ded17f9c4a23dc7665c6dc2eae",
|
"rev": "381e5de206d4962d94a8ebc97d6dc04395928e0c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "janrupf",
|
"owner": "Janrupf",
|
||||||
|
"ref": "main",
|
||||||
"repo": "stable-diffusion-webui-nix",
|
"repo": "stable-diffusion-webui-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -605,10 +645,17 @@
|
||||||
"base16-helix": "base16-helix",
|
"base16-helix": "base16-helix",
|
||||||
"base16-vim": "base16-vim",
|
"base16-vim": "base16-vim",
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
|
"flake-compat": [
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
"flake-parts": [
|
"flake-parts": [
|
||||||
"flake-parts"
|
"flake-parts"
|
||||||
],
|
],
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
"gnome-shell": "gnome-shell",
|
"gnome-shell": "gnome-shell",
|
||||||
|
"home-manager": [
|
||||||
|
"home-manager"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
|
@ -625,11 +672,11 @@
|
||||||
"tinted-zed": "tinted-zed"
|
"tinted-zed": "tinted-zed"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751995939,
|
"lastModified": 1748803004,
|
||||||
"narHash": "sha256-C5CSTv+b8XSbqJwqTP8SGkZEK3YCCJnmvRbg209ql5w=",
|
"narHash": "sha256-dLGywKYxge3rzD6AqtVP0UmMHONdQNCWXj6i0lfm/UM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "stylix",
|
"repo": "stylix",
|
||||||
"rev": "8f3259dbc57c8ee871492fde80f77468826bbd63",
|
"rev": "5f841056ca60bea7312aeade957da084cd95b26e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -653,21 +700,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"text": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1751819711,
|
|
||||||
"narHash": "sha256-Emci++Hknzr2FEZRUbRDD7prI5JwwGsACO/GaU9Pmxg=",
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "text.nix",
|
|
||||||
"rev": "00ba1e616ef3b761a52d5f7ac32892715cc4bcd1",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "text.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tinted-foot": {
|
"tinted-foot": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -748,6 +780,56 @@
|
||||||
"repo": "base16-zed",
|
"repo": "base16-zed",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nur",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733222881,
|
||||||
|
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zjstatus": {
|
||||||
|
"inputs": {
|
||||||
|
"crane": [
|
||||||
|
"crane"
|
||||||
|
],
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": [
|
||||||
|
"rust-overlay"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1745230073,
|
||||||
|
"narHash": "sha256-OER99U7MiqQ47myvbsiljsax7OsK19NMds4NBM9XXLs=",
|
||||||
|
"owner": "dj95",
|
||||||
|
"repo": "zjstatus",
|
||||||
|
"rev": "a819e3bfe6bfef0438d811cdbb1bcfdc29912c62",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "dj95",
|
||||||
|
"repo": "zjstatus",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
217
flake.nix
217
flake.nix
|
@ -1,134 +1,95 @@
|
||||||
{
|
{
|
||||||
outputs =
|
|
||||||
{ self, ... }@inputs:
|
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
|
|
||||||
(inputs.import-tree ./nix)
|
|
||||||
// {
|
|
||||||
systems = import inputs.systems;
|
|
||||||
flake = {
|
|
||||||
inherit self;
|
|
||||||
paths.root = ./.;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
inputs = {
|
inputs = {
|
||||||
### SYSTEM ###
|
|
||||||
|
|
||||||
# systems provides a list of supported nix systems.
|
|
||||||
systems.url = "github:nix-systems/default";
|
|
||||||
# nixos-unstable provides a binary cache for all packages.
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
# My fork for random shit
|
|
||||||
rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module";
|
rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module";
|
||||||
# home-manager manages our user packages and dotfiles
|
crane.url = "github:ipetkov/crane";
|
||||||
home-manager = {
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:nix-community/home-manager";
|
disko.url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
flake-compat.url = "github:edolstra/flake-compat";
|
||||||
};
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
# nix darwin provides declarative mac configuration
|
flake-utils-plus.inputs.flake-utils.follows = "flake-utils";
|
||||||
nix-darwin = {
|
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||||
url = "github:nix-darwin/nix-darwin/master";
|
flake-utils.inputs.systems.follows = "systems";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# the nix user repository for mainly firefox extensions
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
nur = {
|
|
||||||
url = "github:nix-community/NUR";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.flake-parts.follows = "flake-parts";
|
|
||||||
};
|
|
||||||
# impermanence provides a nice abstraction over linking files from /persist
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
# flake-parts lets us define flake modules.
|
mnw.url = "github:Gerg-L/mnw";
|
||||||
flake-parts = {
|
nil.inputs.flake-utils.follows = "flake-utils";
|
||||||
url = "github:hercules-ci/flake-parts";
|
nil.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
nil.inputs.rust-overlay.follows = "rust-overlay";
|
||||||
};
|
nil.url = "github:oxalica/nil";
|
||||||
# disko provides declarative drive partitioning
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
disko = {
|
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||||
url = "github:nix-community/disko";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
nixspect.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
nixspect.url = "github:rrvsh/nixspect";
|
||||||
# sops-nix lets us version control secrets like passwords and api keys
|
nur.inputs.flake-parts.follows = "flake-parts";
|
||||||
sops-nix = {
|
nur.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:Mic92/sops-nix";
|
nur.url = "github:nix-community/NUR";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
nvf.inputs.flake-parts.follows = "flake-parts";
|
||||||
};
|
nvf.inputs.flake-utils.follows = "flake-utils";
|
||||||
stylix = {
|
nvf.inputs.mnw.follows = "mnw";
|
||||||
url = "github:nix-community/stylix";
|
nvf.inputs.nil.follows = "nil";
|
||||||
inputs = {
|
nvf.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nixpkgs.follows = "nixpkgs";
|
nvf.inputs.systems.follows = "systems";
|
||||||
flake-parts.follows = "flake-parts";
|
nvf.url = "github:notashelf/nvf";
|
||||||
systems.follows = "systems";
|
python-flexseal.inputs.flake-utils.follows = "flake-utils";
|
||||||
nur.follows = "nur";
|
python-flexseal.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
python-flexseal.url = "github:Janrupf/python-flexseal";
|
||||||
};
|
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
### FLAKE PARTS MODULES ###
|
snowfall-lib.inputs.flake-compat.follows = "flake-compat";
|
||||||
|
snowfall-lib.inputs.flake-utils-plus.follows = "flake-utils-plus";
|
||||||
# import-tree imports all nix files in a given directory.
|
snowfall-lib.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
import-tree.url = "github:vic/import-tree";
|
snowfall-lib.url = "github:snowfallorg/lib";
|
||||||
# files lets us write text files and automatically add checks for them
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
files.url = "github:mightyiam/files";
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
# text.nix lets us easily define markdown text to pass to files
|
stable-diffusion-webui-nix.inputs.flake-utils.follows = "flake-utils";
|
||||||
text.url = "github:rrvsh/text.nix";
|
stable-diffusion-webui-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# manifest lets us define all hosts in one file
|
stable-diffusion-webui-nix.inputs.python-flexseal.follows = "python-flexseal";
|
||||||
manifest.url = "github:rrvsh/manifest";
|
stable-diffusion-webui-nix.url = "github:Janrupf/stable-diffusion-webui-nix/main";
|
||||||
# make-shells.<name> creates devShells and checks
|
stylix.inputs.flake-compat.follows = "flake-compat";
|
||||||
make-shell = {
|
stylix.inputs.flake-parts.follows = "flake-parts";
|
||||||
url = "github:nicknovitski/make-shell";
|
stylix.inputs.nur.follows = "nur";
|
||||||
inputs.flake-compat.follows = "dedupe_flake-compat";
|
stylix.inputs.home-manager.follows = "home-manager";
|
||||||
};
|
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# git-hooks ensures nix flake check is ran before commits
|
stylix.inputs.systems.follows = "systems";
|
||||||
git-hooks = {
|
stylix.url = "github:nix-community/stylix";
|
||||||
url = "github:cachix/git-hooks.nix";
|
systems.url = "github:nix-systems/default";
|
||||||
inputs = {
|
zjstatus.inputs.crane.follows = "crane";
|
||||||
flake-compat.follows = "dedupe_flake-compat";
|
zjstatus.inputs.flake-utils.follows = "flake-utils";
|
||||||
nixpkgs.follows = "nixpkgs";
|
zjstatus.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
gitignore.follows = "dedupe_gitignore";
|
zjstatus.inputs.rust-overlay.follows = "rust-overlay";
|
||||||
};
|
zjstatus.url = "github:dj95/zjstatus";
|
||||||
};
|
|
||||||
|
|
||||||
### FLAKES ###
|
|
||||||
|
|
||||||
# nix-index-database indexes the nixpkgs binaries for use with comma
|
|
||||||
nix-index-database = {
|
|
||||||
url = "github:nix-community/nix-index-database";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
# nvf provides modules to wrap neovim
|
|
||||||
nvf = {
|
|
||||||
url = "github:notashelf/nvf";
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.follows = "nixpkgs";
|
|
||||||
flake-parts.follows = "flake-parts";
|
|
||||||
systems.follows = "systems";
|
|
||||||
flake-utils.follows = "dedupe_flake-utils";
|
|
||||||
mnw.follows = "dedupe_mnw";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# provides comfy ui and sdwebui services
|
|
||||||
stable-diffusion-webui-nix = {
|
|
||||||
url = "github:janrupf/stable-diffusion-webui-nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.flake-utils.follows = "dedupe_flake-utils";
|
|
||||||
};
|
|
||||||
# my website :)
|
|
||||||
rrv-sh = {
|
|
||||||
url = "github:rrvsh/rrv.sh";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
### DEDUPE ###
|
|
||||||
|
|
||||||
dedupe_flake-compat.url = "github:edolstra/flake-compat";
|
|
||||||
dedupe_flake-utils = {
|
|
||||||
url = "github:numtide/flake-utils";
|
|
||||||
inputs.systems.follows = "systems";
|
|
||||||
};
|
|
||||||
dedupe_mnw.url = "github:gerg-l/mnw";
|
|
||||||
dedupe_gitignore = {
|
|
||||||
url = "github:hercules-ci/gitignore.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
inputs:
|
||||||
|
inputs.snowfall-lib.mkFlake {
|
||||||
|
inherit inputs;
|
||||||
|
src = ./.;
|
||||||
|
snowfall.namespace = "pantheon";
|
||||||
|
overlays = with inputs; [
|
||||||
|
stable-diffusion-webui-nix.overlays.default
|
||||||
|
(_final: prev: {
|
||||||
|
zjstatus = zjstatus.packages.${prev.system}.default;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
systems.modules.nixos = with inputs; [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
impermanence.nixosModules.impermanence
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
stylix.nixosModules.stylix
|
||||||
|
];
|
||||||
|
homes.modules = with inputs; [
|
||||||
|
impermanence.homeManagerModules.impermanence
|
||||||
|
nix-index-database.hmModules.nix-index
|
||||||
|
nvf.homeManagerModules.default
|
||||||
|
];
|
||||||
|
outputs-builder = channels: {
|
||||||
|
formatter = channels.nixpkgs.nixfmt-rfc-style;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
47
homes/x86_64-linux/rafiq/default.nix
Normal file
47
homes/x86_64-linux/rafiq/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
{
|
||||||
|
cli = {
|
||||||
|
shell = "zsh";
|
||||||
|
finder = "fzf";
|
||||||
|
screensaver.enable = true;
|
||||||
|
screensaver.timeout = "100";
|
||||||
|
screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2";
|
||||||
|
editor = "nvf";
|
||||||
|
file-browser = "yazi";
|
||||||
|
multiplexer = "zellij";
|
||||||
|
fetch = "hyfetch";
|
||||||
|
git.name = "Mohammad Rafiq";
|
||||||
|
git.email = "rafiq@rrv.sh";
|
||||||
|
git.defaultBranch = "prime";
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
shellAliases = {
|
||||||
|
v = "nvim";
|
||||||
|
e = "edit";
|
||||||
|
};
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
cbonsai
|
||||||
|
ripgrep
|
||||||
|
devenv
|
||||||
|
stremio
|
||||||
|
pantheon.rebuild
|
||||||
|
pantheon.edit
|
||||||
|
inputs.nixspect.packages."x86_64-linux".nixspect
|
||||||
|
];
|
||||||
|
|
||||||
|
persistence."/persist/home/rafiq".directories = [ "repos" ];
|
||||||
|
};
|
||||||
|
programs = {
|
||||||
|
nh.enable = true;
|
||||||
|
tealdeer.enable = true;
|
||||||
|
pay-respects = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
tealdeer.settings.updates.auto_update = true;
|
||||||
|
direnv = {
|
||||||
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
19
lib/default.nix
Normal file
19
lib/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
mkStrOption = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
mkPortOption =
|
||||||
|
port:
|
||||||
|
lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = port;
|
||||||
|
};
|
||||||
|
mkPathOption =
|
||||||
|
path:
|
||||||
|
lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
default = path;
|
||||||
|
};
|
||||||
|
}
|
79
modules/home/cli/default.nix
Normal file
79
modules/home/cli/default.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.cli = {
|
||||||
|
shell = lib.pantheon.mkStrOption;
|
||||||
|
finder = lib.pantheon.mkStrOption;
|
||||||
|
screensaver.enable = lib.mkEnableOption "";
|
||||||
|
screensaver.timeout = lib.pantheon.mkStrOption;
|
||||||
|
screensaver.command = lib.pantheon.mkStrOption;
|
||||||
|
editor = lib.pantheon.mkStrOption;
|
||||||
|
nvf.snippets = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.attrs;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
file-browser = lib.pantheon.mkStrOption;
|
||||||
|
multiplexer = lib.pantheon.mkStrOption;
|
||||||
|
fetch = lib.pantheon.mkStrOption;
|
||||||
|
git = {
|
||||||
|
name = lib.pantheon.mkStrOption;
|
||||||
|
email = lib.pantheon.mkStrOption;
|
||||||
|
defaultBranch = lib.pantheon.mkStrOption;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
home.shell.enableShellIntegration = true;
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
Host *
|
||||||
|
SetEnv TERM=xterm-256color
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
programs.zoxide.enable = true;
|
||||||
|
home.shellAliases.cd = "z";
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
||||||
|
".local/share/zoxide"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
programs.nix-index.enable = true;
|
||||||
|
programs.nix-index-database.comma.enable = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
home.shellAliases.ai = "aichat -r %shell% -e";
|
||||||
|
|
||||||
|
home.packages = with pkgs; [ aichat ];
|
||||||
|
|
||||||
|
xdg.configFile."aichat/config.yaml".text = ''
|
||||||
|
model: gemini:gemini-2.0-flash
|
||||||
|
clients:
|
||||||
|
- type: gemini
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
add_newline = false;
|
||||||
|
format = ''
|
||||||
|
$directory$character
|
||||||
|
'';
|
||||||
|
right_format = ''
|
||||||
|
$all
|
||||||
|
'';
|
||||||
|
git_branch.format = "[$symbol$branch(:$remote_branch)]($style) ";
|
||||||
|
shlvl.disabled = false;
|
||||||
|
hostname.disabled = true;
|
||||||
|
username.disabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -3,23 +3,29 @@
|
||||||
blink-cmp = {
|
blink-cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
friendly-snippets.enable = true;
|
friendly-snippets.enable = true;
|
||||||
sourcePlugins.ripgrep.enable = true;
|
sourcePlugins = {
|
||||||
|
ripgrep.enable = true;
|
||||||
|
spell.enable = true;
|
||||||
|
};
|
||||||
setupOpts = {
|
setupOpts = {
|
||||||
# Disable completion in markdown files
|
completion.documentation.auto_show_delay_ms = 0;
|
||||||
# TODO: Disable completion when in comments
|
signature.enabled = true;
|
||||||
enabled =
|
enabled =
|
||||||
lib.generators.mkLuaInline
|
lib.generators.mkLuaInline
|
||||||
# lua
|
# lua
|
||||||
''
|
''
|
||||||
|
--- Disable completion for markdown
|
||||||
function()
|
function()
|
||||||
return not vim.tbl_contains({"markdown"}, vim.bo.filetype)
|
return not vim.tbl_contains({"markdown"}, vim.bo.filetype)
|
||||||
and vim.bo.buftype ~= "prompt"
|
and vim.bo.buftype ~= "prompt"
|
||||||
and vim.b.completion ~= false
|
and vim.b.completion ~= false
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
completion.documentation.auto_show_delay_ms = 0;
|
cmdline = {
|
||||||
# Show e.g. function parameters
|
enabled = true;
|
||||||
signature.enabled = true;
|
sources = null;
|
||||||
|
completion.menu.auto_show = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
15
modules/home/cli/editor/nvf/binds.nix
Normal file
15
modules/home/cli/editor/nvf/binds.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
hardtime-nvim = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts = {
|
||||||
|
max_count = 1;
|
||||||
|
disabled_keys = {
|
||||||
|
"<Up>" = [ ];
|
||||||
|
"<Down>" = [ ];
|
||||||
|
"<Right>" = [ ];
|
||||||
|
"<Left>" = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
whichKey.enable = true;
|
||||||
|
}
|
2
modules/home/cli/editor/nvf/clipboard.nix
Normal file
2
modules/home/cli/editor/nvf/clipboard.nix
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{
|
||||||
|
}
|
40
modules/home/cli/editor/nvf/default.nix
Normal file
40
modules/home/cli/editor/nvf/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.cli.editor == "nvf") {
|
||||||
|
home.sessionVariables.EDITOR = "nvim";
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
||||||
|
".local/share/nvf"
|
||||||
|
];
|
||||||
|
programs.nvf = {
|
||||||
|
enable = true;
|
||||||
|
settings.vim = {
|
||||||
|
hideSearchHighlight = true;
|
||||||
|
syntaxHighlighting = true;
|
||||||
|
telescope.enable = true;
|
||||||
|
searchCase = "ignore";
|
||||||
|
undoFile.enable = true;
|
||||||
|
fzf-lua.enable = true;
|
||||||
|
git.enable = true;
|
||||||
|
git.gitsigns.enable = false;
|
||||||
|
autocomplete = import ./autocomplete.nix { inherit lib; };
|
||||||
|
autopairs.nvim-autopairs.enable = true;
|
||||||
|
binds = import ./binds.nix;
|
||||||
|
clipboard = import ./clipboard.nix;
|
||||||
|
diagnostics = import ./diagnostics.nix;
|
||||||
|
keymaps = import ./keymaps.nix;
|
||||||
|
languages = import ./languages.nix;
|
||||||
|
lsp = import ./lsp.nix;
|
||||||
|
navigation = import ./navigation.nix;
|
||||||
|
notes = import ./notes.nix;
|
||||||
|
options = import ./options.nix;
|
||||||
|
notify = import ./notify.nix;
|
||||||
|
snippets = import ./snippets.nix;
|
||||||
|
statusline = import ./statusline.nix;
|
||||||
|
treesitter = import ./treesitter.nix;
|
||||||
|
ui = import ./ui.nix;
|
||||||
|
utility = import ./utility.nix;
|
||||||
|
visuals = import ./visuals.nix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
2
modules/home/cli/editor/nvf/diagnostics.nix
Normal file
2
modules/home/cli/editor/nvf/diagnostics.nix
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{
|
||||||
|
}
|
23
modules/home/cli/editor/nvf/keymaps.nix
Normal file
23
modules/home/cli/editor/nvf/keymaps.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
desc = "Open the file path under the cursor, making the file if it doesn't exist.";
|
||||||
|
key = "gf";
|
||||||
|
mode = "n";
|
||||||
|
action = ":cd %:p:h<CR>:e <cfile><CR>";
|
||||||
|
silent = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
desc = "";
|
||||||
|
key = "<C-u>";
|
||||||
|
mode = "n";
|
||||||
|
action = "<C-u>zz";
|
||||||
|
silent = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
desc = "";
|
||||||
|
key = "<C-d>";
|
||||||
|
mode = "n";
|
||||||
|
action = "<C-d>zz";
|
||||||
|
silent = true;
|
||||||
|
}
|
||||||
|
]
|
|
@ -4,30 +4,22 @@
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
bash.enable = true;
|
bash.enable = true;
|
||||||
clang.enable = true;
|
clang.enable = true;
|
||||||
# broken on macos
|
csharp.enable = true;
|
||||||
# csharp.enable = true;
|
|
||||||
css.enable = true;
|
css.enable = true;
|
||||||
go.enable = true;
|
go.enable = true;
|
||||||
html.enable = true;
|
html.enable = true;
|
||||||
lua.enable = true;
|
lua.enable = true;
|
||||||
markdown = {
|
markdown.enable = true;
|
||||||
enable = true;
|
markdown.extensions.markview-nvim.enable = true;
|
||||||
extensions.markview-nvim.enable = true;
|
|
||||||
format.type = "prettierd";
|
|
||||||
};
|
|
||||||
nix = {
|
nix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
format.type = "nixfmt";
|
format.type = "nixfmt";
|
||||||
lsp.server = "nil";
|
lsp.server = "nil";
|
||||||
};
|
};
|
||||||
python = {
|
python.enable = true;
|
||||||
enable = true;
|
python.lsp.server = "python-lsp-server";
|
||||||
format.type = "ruff";
|
|
||||||
lsp.server = "pyright";
|
|
||||||
};
|
|
||||||
rust.enable = true;
|
rust.enable = true;
|
||||||
rust.crates.enable = true;
|
rust.crates.enable = true;
|
||||||
tailwind.enable = true;
|
|
||||||
ts.enable = true;
|
ts.enable = true;
|
||||||
ts.extensions.ts-error-translator.enable = true;
|
ts.extensions.ts-error-translator.enable = true;
|
||||||
typst.enable = true;
|
typst.enable = true;
|
9
modules/home/cli/editor/nvf/lsp.nix
Normal file
9
modules/home/cli/editor/nvf/lsp.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
formatOnSave = true;
|
||||||
|
inlayHints.enable = true;
|
||||||
|
lightbulb.enable = true;
|
||||||
|
lspkind.enable = true;
|
||||||
|
null-ls.enable = true;
|
||||||
|
otter-nvim.enable = true;
|
||||||
|
}
|
5
modules/home/cli/editor/nvf/navigation.nix
Normal file
5
modules/home/cli/editor/nvf/navigation.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
harpoon = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
3
modules/home/cli/editor/nvf/notes.nix
Normal file
3
modules/home/cli/editor/nvf/notes.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
todo-comments.enable = true;
|
||||||
|
}
|
2
modules/home/cli/editor/nvf/notify.nix
Normal file
2
modules/home/cli/editor/nvf/notify.nix
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{
|
||||||
|
}
|
11
modules/home/cli/editor/nvf/options.nix
Normal file
11
modules/home/cli/editor/nvf/options.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
scroll = 1;
|
||||||
|
autoindent = true;
|
||||||
|
backspace = "indent,eol,start";
|
||||||
|
cursorline = true;
|
||||||
|
expandtab = true;
|
||||||
|
shiftwidth = 2;
|
||||||
|
smartindent = true;
|
||||||
|
tabstop = 2;
|
||||||
|
updatetime = 0;
|
||||||
|
}
|
6
modules/home/cli/editor/nvf/snippets.nix
Normal file
6
modules/home/cli/editor/nvf/snippets.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
luasnip = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts.enable_autosnippets = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,6 +5,8 @@
|
||||||
statusline = 10;
|
statusline = 10;
|
||||||
winbar = 10;
|
winbar = 10;
|
||||||
};
|
};
|
||||||
#TODO: rice lualine
|
activeSection = {
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
6
modules/home/cli/editor/nvf/treesitter.nix
Normal file
6
modules/home/cli/editor/nvf/treesitter.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
autotagHtml = true;
|
||||||
|
fold = true;
|
||||||
|
indent.disable = [ "markdown" ];
|
||||||
|
textobjects.enable = true;
|
||||||
|
}
|
|
@ -4,13 +4,10 @@
|
||||||
globalStyle = "rounded";
|
globalStyle = "rounded";
|
||||||
};
|
};
|
||||||
breadcrumbs.enable = true;
|
breadcrumbs.enable = true;
|
||||||
# Show color values e.g. #ffffff
|
|
||||||
colorizer.enable = true;
|
colorizer.enable = true;
|
||||||
# Highlight matching symbols
|
|
||||||
illuminate.enable = true;
|
illuminate.enable = true;
|
||||||
noice.enable = true;
|
noice.enable = true;
|
||||||
noice.setupOpts.notify.enabled = false;
|
noice.setupOpts.notify.enabled = false;
|
||||||
# Make folds look nicer
|
|
||||||
nvim-ufo.enable = true;
|
nvim-ufo.enable = true;
|
||||||
smartcolumn.enable = true;
|
smartcolumn.enable = true;
|
||||||
}
|
}
|
|
@ -1,4 +1,7 @@
|
||||||
{
|
{
|
||||||
|
ccc.enable = true;
|
||||||
|
leetcode-nvim.enable = true;
|
||||||
|
mkdir.enable = true;
|
||||||
motion.hop.enable = true;
|
motion.hop.enable = true;
|
||||||
yazi-nvim = {
|
yazi-nvim = {
|
||||||
enable = true;
|
enable = true;
|
|
@ -2,6 +2,7 @@
|
||||||
indent-blankline.enable = true;
|
indent-blankline.enable = true;
|
||||||
fidget-nvim.enable = true;
|
fidget-nvim.enable = true;
|
||||||
fidget-nvim.setupOpts.notification.override_vim_notify = true;
|
fidget-nvim.setupOpts.notification.override_vim_notify = true;
|
||||||
|
nvim-cursorline.enable = true;
|
||||||
nvim-web-devicons.enable = true;
|
nvim-web-devicons.enable = true;
|
||||||
rainbow-delimiters.enable = true;
|
rainbow-delimiters.enable = true;
|
||||||
}
|
}
|
31
modules/home/cli/fetch/default.nix
Normal file
31
modules/home/cli/fetch/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.cli.fetch == "hyfetch") {
|
||||||
|
home.packages = [ pkgs.fastfetch ];
|
||||||
|
home.sessionVariables.FETCH = "hyfetch";
|
||||||
|
home.shellAliases.fetch = "hyfetch";
|
||||||
|
programs.hyfetch = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
preset = "bisexual";
|
||||||
|
mode = "rgb";
|
||||||
|
light_dark = "dark";
|
||||||
|
lightness = 0.5;
|
||||||
|
color_align = {
|
||||||
|
mode = "horizontal";
|
||||||
|
custom_colors = [ ];
|
||||||
|
fore_back = null;
|
||||||
|
};
|
||||||
|
backend = "fastfetch";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
22
modules/home/cli/file-browser/default.nix
Normal file
22
modules/home/cli/file-browser/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.cli.file-browser == "yazi") {
|
||||||
|
home.sessionVariables.FILE_BROWSER = "yazi";
|
||||||
|
programs.yazi = {
|
||||||
|
enable = true;
|
||||||
|
shellWrapperName = "t";
|
||||||
|
settings = {
|
||||||
|
mgr = {
|
||||||
|
sort_by = "natural";
|
||||||
|
prepend_keymap = [
|
||||||
|
{
|
||||||
|
on = "l";
|
||||||
|
run = "plugin smart-enter";
|
||||||
|
desc = "";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
11
modules/home/cli/finder/default.nix
Normal file
11
modules/home/cli/finder/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.cli.finder == "fzf") {
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = lib.mkIf (config.cli.shell == "zsh") true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
14
modules/home/cli/multiplexer/default.nix
Normal file
14
modules/home/cli/multiplexer/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
osConfig,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.cli.multiplexer == "zellij") (
|
||||||
|
import ./zellij.nix { inherit config pkgs osConfig; }
|
||||||
|
))
|
||||||
|
];
|
||||||
|
}
|
60
modules/home/cli/multiplexer/zellij.nix
Normal file
60
modules/home/cli/multiplexer/zellij.nix
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
osConfig,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
home.sessionVariables.MULTIPLEXER = "zellij";
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [ "/.cache/zellij" ];
|
||||||
|
programs.zellij = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
attachExistingSession = true;
|
||||||
|
exitShellOnExit = true;
|
||||||
|
settings = {
|
||||||
|
pane_frames = false;
|
||||||
|
show_startup_tips = false;
|
||||||
|
show_release_notes = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
xdg.configFile."zellij/layouts/default.kdl".text = # kdl
|
||||||
|
''
|
||||||
|
layout {
|
||||||
|
default_tab_template {
|
||||||
|
pane size=1 borderless=true {
|
||||||
|
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
|
||||||
|
format_left "{mode} ${osConfig.system.hostname}"
|
||||||
|
format_center "{tabs}"
|
||||||
|
format_right "{datetime}"
|
||||||
|
format_space ""
|
||||||
|
format_hide_on_overlength "true"
|
||||||
|
format_precedence "lrc"
|
||||||
|
|
||||||
|
border_enabled "false"
|
||||||
|
border_char "─"
|
||||||
|
border_format "#[fg=#6C7086]{char}"
|
||||||
|
border_position "top"
|
||||||
|
|
||||||
|
hide_frame_for_single_pane "false"
|
||||||
|
|
||||||
|
mode_default_to_mode "normal"
|
||||||
|
mode_normal "#[bg=#89B4FA] {name} "
|
||||||
|
mode_locked "#[bg=#f55e18] {name} "
|
||||||
|
mode_session "#[bg=#00ff00] {name} "
|
||||||
|
|
||||||
|
tab_normal "#[fg=#6C7086] {index} "
|
||||||
|
tab_active "#[fg=#9399B2,bold,italic] {index} "
|
||||||
|
tab_display_count "3" // limit to showing 3 tabs
|
||||||
|
tab_truncate_start_format "..."
|
||||||
|
tab_truncate_end_format "..."
|
||||||
|
|
||||||
|
datetime "#[fg=#6C7086,bold] {format}"
|
||||||
|
datetime_format "%H:%M:%S"
|
||||||
|
datetime_timezone "Asia/Singapore"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
children
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
38
modules/home/cli/shell/default.nix
Normal file
38
modules/home/cli/shell/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.cli.shell == "zsh") {
|
||||||
|
home.sessionVariables.SHELL = "zsh";
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableVteIntegration = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
historySubstringSearch.enable = true;
|
||||||
|
history = {
|
||||||
|
append = true;
|
||||||
|
extended = true;
|
||||||
|
ignoreDups = true;
|
||||||
|
ignoreSpace = true;
|
||||||
|
save = 10000;
|
||||||
|
share = true;
|
||||||
|
size = 10000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.zsh.initContent = lib.mkIf config.cli.screensaver.enable (
|
||||||
|
lib.mkOrder 1200
|
||||||
|
# zsh
|
||||||
|
''
|
||||||
|
precmd() {
|
||||||
|
TMOUT=${config.cli.screensaver.timeout}
|
||||||
|
}
|
||||||
|
|
||||||
|
TRAPALRM() {
|
||||||
|
TMOUT=1
|
||||||
|
${config.cli.screensaver.command}
|
||||||
|
# If we exit, assume the previous command was exited out of
|
||||||
|
TMOUT=${config.cli.screensaver.timeout}
|
||||||
|
zle reset-prompt
|
||||||
|
}
|
||||||
|
''
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
3
modules/home/cli/utilities/default.nix
Normal file
3
modules/home/cli/utilities/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [ ./git.nix ];
|
||||||
|
}
|
|
@ -1,18 +1,22 @@
|
||||||
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
flake.modules.homeManager.rafiq = {
|
config = {
|
||||||
|
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
|
||||||
home.shellAliases = {
|
home.shellAliases = {
|
||||||
gs = "git status";
|
gs = "git status";
|
||||||
gc = "git commit";
|
gc = "git commit";
|
||||||
gcam = "git commit -am";
|
gcam = "git commit -am";
|
||||||
gu = "git push";
|
gu = "git push";
|
||||||
gy = "git pull";
|
gy = "git pull";
|
||||||
gdh = "git diff HEAD";
|
|
||||||
};
|
};
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
userName = config.cli.git.name;
|
||||||
|
userEmail = config.cli.git.email;
|
||||||
|
signing.key = "~/.ssh/id_ed25519.pub";
|
||||||
signing.signByDefault = true;
|
signing.signByDefault = true;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
init.defaultBranch = "prime";
|
init.defaultBranch = config.cli.git.defaultBranch;
|
||||||
push.autoSetupRemote = true;
|
push.autoSetupRemote = true;
|
||||||
pull.rebase = false;
|
pull.rebase = false;
|
||||||
core.editor = "$EDITOR";
|
core.editor = "$EDITOR";
|
12
modules/home/desktop/browser/firefox/default.nix
Normal file
12
modules/home/desktop/browser/firefox/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ osConfig, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf (osConfig.desktop.browser == "firefox") {
|
||||||
|
home.persistence."/persist/home/rafiq".directories = [ ".mozilla/firefox" ];
|
||||||
|
home.sessionVariables.BROWSER = "firefox";
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
profiles.rafiq.id = 0;
|
||||||
|
profiles.test.id = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
30
modules/home/desktop/default.nix
Normal file
30
modules/home/desktop/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.hardware.gpu == "nvidia") {
|
||||||
|
home.packages = [ pkgs.stable-diffusion-webui.forge.cuda ];
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
||||||
|
".local/share/stable-diffusion-webui"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(lib.mkIf osConfig.desktop.enableSpotifyd {
|
||||||
|
services.spotifyd.enable = true;
|
||||||
|
services.spotifyd.settings.global = {
|
||||||
|
device_name = "${osConfig.system.hostname}";
|
||||||
|
device_type = "computer";
|
||||||
|
zeroconf_port = 5353;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf osConfig.desktop.enableSteam {
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
||||||
|
".local/share/Steam"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
24
modules/home/desktop/launcher/default.nix
Normal file
24
modules/home/desktop/launcher/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.desktop.launcher == "fuzzel") {
|
||||||
|
home.sessionVariables.LAUNCHER = "fuzzel";
|
||||||
|
programs.fuzzel = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf (osConfig.desktop.launcher == "wofi") {
|
||||||
|
home.sessionVariables.LAUNCHER = "wofi";
|
||||||
|
programs.wofi = {
|
||||||
|
enable = true;
|
||||||
|
style = null;
|
||||||
|
settings = { };
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
47
modules/home/desktop/lockscreen/default.nix
Normal file
47
modules/home/desktop/lockscreen/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
osConfig,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.desktop.lockscreen == "hyprlock") {
|
||||||
|
home.sessionVariables.LOCKSCREEN = "hyprlock";
|
||||||
|
programs.hyprlock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
general.hide_cursor = true;
|
||||||
|
general.ignore_empty_input = true;
|
||||||
|
|
||||||
|
background = {
|
||||||
|
blur_passes = 5;
|
||||||
|
blur_size = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
label = {
|
||||||
|
text = ''hi, $USER.'';
|
||||||
|
font_size = 32;
|
||||||
|
halign = "center";
|
||||||
|
valign = "center";
|
||||||
|
position = "0, 0";
|
||||||
|
zindex = 1;
|
||||||
|
shadow_passes = 5;
|
||||||
|
shadow_size = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
input-field = {
|
||||||
|
fade_on_empty = true;
|
||||||
|
size = "200, 45";
|
||||||
|
halign = "center";
|
||||||
|
valign = "center";
|
||||||
|
position = "0, -5%";
|
||||||
|
placeholder_text = "";
|
||||||
|
zindex = 1;
|
||||||
|
shadow_passes = 5;
|
||||||
|
shadow_size = 5;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
12
modules/home/desktop/notification-daemon/default.nix
Normal file
12
modules/home/desktop/notification-daemon/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ osConfig, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.desktop.notification-daemon == "mako") {
|
||||||
|
home.sessionVariables.NOTIFICATION_DAEMON = "mako";
|
||||||
|
services.mako = {
|
||||||
|
enable = true;
|
||||||
|
settings = { };
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
61
modules/home/desktop/status-bar/default.nix
Normal file
61
modules/home/desktop/status-bar/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.desktop.status-bar == "waybar") {
|
||||||
|
home.sessionVariables.STATUS_BAR = "waybar";
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
layer = "top";
|
||||||
|
modules-left = [
|
||||||
|
"pulseaudio"
|
||||||
|
];
|
||||||
|
modules-right = [
|
||||||
|
"battery"
|
||||||
|
"clock"
|
||||||
|
];
|
||||||
|
"pulseaudio" = {
|
||||||
|
format = "{icon} {volume}%";
|
||||||
|
format-muted = "";
|
||||||
|
format-icons.default = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
];
|
||||||
|
on-click = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
};
|
||||||
|
"clock" = {
|
||||||
|
interval = 1;
|
||||||
|
format = "{:%F %T}";
|
||||||
|
};
|
||||||
|
"battery" = {
|
||||||
|
interval = 1;
|
||||||
|
bat-compatibility = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
style = # css
|
||||||
|
''
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio,
|
||||||
|
#battery,
|
||||||
|
#clock {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
23
modules/home/desktop/terminal/default.nix
Normal file
23
modules/home/desktop/terminal/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
osConfig,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (osConfig.desktop.terminal == "kitty") {
|
||||||
|
home.packages = with pkgs; [ kitty ];
|
||||||
|
home.sessionVariables.TERMINAL = "kitty";
|
||||||
|
})
|
||||||
|
(lib.mkIf (osConfig.desktop.terminal == "ghostty") {
|
||||||
|
home.sessionVariables.TERMINAL = "ghostty -e";
|
||||||
|
programs.ghostty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
confirm-close-surface = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
animation = [ "workspaces, 1, 1, default" ];
|
animation = [ "workspaces, 0" ];
|
||||||
general = {
|
general = {
|
||||||
border_size = 2;
|
border_size = 2;
|
||||||
gaps_in = 0;
|
gaps_in = 0;
|
47
modules/home/desktop/windowManager/hyprland/default.nix
Normal file
47
modules/home/desktop/windowManager/hyprland/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (osConfig.desktop) mainMonitor;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf (osConfig.desktop.windowManager == "hyprland") {
|
||||||
|
wayland.windowManager.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
systemd.enable = false;
|
||||||
|
settings = lib.mkMerge [
|
||||||
|
{
|
||||||
|
ecosystem.no_update_news = true;
|
||||||
|
|
||||||
|
monitor = [
|
||||||
|
"${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}"
|
||||||
|
", preferred, auto, 1"
|
||||||
|
];
|
||||||
|
|
||||||
|
exec-once = [
|
||||||
|
"uwsm app -- $LOCKSCREEN"
|
||||||
|
"uwsm app -- $NOTIFICATION_DAEMON"
|
||||||
|
"uwsm app -- $STATUS_BAR"
|
||||||
|
];
|
||||||
|
|
||||||
|
xwayland.force_zero_scaling = true;
|
||||||
|
}
|
||||||
|
(import ./decoration.nix)
|
||||||
|
(import ./keybinds.nix { inherit pkgs; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
xdg.configFile."uwsm/env".text = # sh
|
||||||
|
''
|
||||||
|
export GDK_SCALE=${mainMonitor.scale}
|
||||||
|
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||||
|
'';
|
||||||
|
xdg.configFile."uwsm/env-hyprland".text = # sh
|
||||||
|
''
|
||||||
|
export GDK_SCALE=${mainMonitor.scale}
|
||||||
|
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,12 +6,11 @@
|
||||||
"$hypr, Q, exec, uwsm stop"
|
"$hypr, Q, exec, uwsm stop"
|
||||||
"SUPER, W, killactive"
|
"SUPER, W, killactive"
|
||||||
|
|
||||||
"SUPER, return, exec, uwsm app -- $TERMINAL"
|
"SUPER, return, exec, uwsm app -- $TERMINAL $MULTIPLEXER"
|
||||||
"SUPER, O, exec, uwsm app -- $BROWSER"
|
"SUPER, O, exec, uwsm app -- $BROWSER"
|
||||||
"SUPER, Escape, exec, uwsm app -- $LOCKSCREEN"
|
"SUPER, Escape, exec, uwsm app -- $LOCKSCREEN"
|
||||||
#TODO:add file browser
|
"SUPER, space, exec, uwsm app -- $($LAUNCHER --launch-prefix=\"uwsm app -- \")"
|
||||||
|
|
||||||
#TODO: make it directional
|
|
||||||
"SUPER, H, cyclenext, visible"
|
"SUPER, H, cyclenext, visible"
|
||||||
"SUPER, L, cyclenext, visible prev"
|
"SUPER, L, cyclenext, visible prev"
|
||||||
"SUPER_ALT, H, movewindow, l"
|
"SUPER_ALT, H, movewindow, l"
|
||||||
|
@ -26,31 +25,15 @@
|
||||||
"SUPER_CTRL, L, workspace, r+1"
|
"SUPER_CTRL, L, workspace, r+1"
|
||||||
"$hypr, H, movetoworkspace, r-1"
|
"$hypr, H, movetoworkspace, r-1"
|
||||||
"$hypr, L, movetoworkspace, r+1"
|
"$hypr, L, movetoworkspace, r+1"
|
||||||
|
|
||||||
"$hypr, V, togglefloating"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindr = [
|
|
||||||
# Activates on SUPER without any other modifier
|
|
||||||
"SUPER, Super_L, exec, uwsm app -- $($LAUNCHER --launch-prefix=\"uwsm app -- \")"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
bindle = [
|
bindle = [
|
||||||
"SUPER, 6, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"
|
"SUPER, 6, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"
|
||||||
"SUPER, 7, exec, ${pkgs.playerctl}/bin/playerctl previous"
|
"SUPER, 7, exec, ${pkgs.playerctl}/bin/playerctl previous"
|
||||||
"SUPER, 8, exec, ${pkgs.playerctl}/bin/playerctl -a play-pause"
|
"SUPER, 8, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
|
||||||
"SUPER, 9, exec, ${pkgs.playerctl}/bin/playerctl next"
|
"SUPER, 9, exec, ${pkgs.playerctl}/bin/playerctl next"
|
||||||
"SUPER, 0, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
"SUPER, 0, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||||
|
"$meh, mouse_up, resizeactive, 10% 10%"
|
||||||
"ALT, mouse_up, resizeactive, 10% 10%"
|
"$meh, mouse_down, resizeactive, -10% -10%"
|
||||||
"ALT, mouse_down, resizeactive, -10% -10%"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindm = [
|
|
||||||
"ALT, mouse:272, movewindow"
|
|
||||||
"ALT, mouse:273, resizeactive"
|
|
||||||
];
|
|
||||||
bindc = [
|
|
||||||
"ALT, mouse:272, togglefloating"
|
|
||||||
];
|
];
|
||||||
}
|
}
|
12
modules/home/system/default.nix
Normal file
12
modules/home/system/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
home.persistence."/persist/home/${config.snowfallorg.user.name}" = {
|
||||||
|
directories = [
|
||||||
|
".ssh"
|
||||||
|
".config/sops/age"
|
||||||
|
];
|
||||||
|
allowOther = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.stateVersion = "24.11";
|
||||||
|
}
|
19
modules/nixos/cli/default.nix
Normal file
19
modules/nixos/cli/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.cli = { };
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
environment.pathsToLink = [ "/share/zsh" ]; # enables completion
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
78
modules/nixos/desktop/default.nix
Normal file
78
modules/nixos/desktop/default.nix
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./windowManager.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.desktop = {
|
||||||
|
mainMonitor = {
|
||||||
|
id = lib.pantheon.mkStrOption;
|
||||||
|
scale = lib.pantheon.mkStrOption;
|
||||||
|
resolution = lib.pantheon.mkStrOption;
|
||||||
|
refresh-rate = lib.pantheon.mkStrOption;
|
||||||
|
};
|
||||||
|
windowManager = lib.pantheon.mkStrOption;
|
||||||
|
lockscreen = lib.pantheon.mkStrOption;
|
||||||
|
browser = lib.pantheon.mkStrOption;
|
||||||
|
terminal = lib.pantheon.mkStrOption;
|
||||||
|
notification-daemon = lib.pantheon.mkStrOption;
|
||||||
|
launcher = lib.pantheon.mkStrOption;
|
||||||
|
status-bar = lib.pantheon.mkStrOption;
|
||||||
|
enableSpotifyd = lib.mkEnableOption "";
|
||||||
|
enableSteam = lib.mkEnableOption "";
|
||||||
|
enableVR = lib.mkEnableOption "";
|
||||||
|
enableSunshine = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
font-awesome
|
||||||
|
];
|
||||||
|
}
|
||||||
|
(lib.mkIf config.desktop.enableSteam {
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf config.desktop.enableVR {
|
||||||
|
programs.alvr = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
environment.systemPackages = [ pkgs.android-tools ];
|
||||||
|
})
|
||||||
|
(lib.mkIf config.desktop.enableSunshine {
|
||||||
|
networking.firewall.allowedTCPPortRanges = [
|
||||||
|
{
|
||||||
|
from = 47984;
|
||||||
|
to = 47990;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
networking.firewall.allowedUDPPortRanges = [
|
||||||
|
{
|
||||||
|
from = 47998;
|
||||||
|
to = 48000;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
networking.firewall.allowedTCPPorts = [ 48010 ];
|
||||||
|
services.sunshine = {
|
||||||
|
enable = true;
|
||||||
|
capSysAdmin = true;
|
||||||
|
openFirewall = true;
|
||||||
|
settings = {
|
||||||
|
sunshine_name = config.system.hostname;
|
||||||
|
port = 48989; # default
|
||||||
|
origin_web_ui_allowed = "wan";
|
||||||
|
};
|
||||||
|
applications = { };
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
8
modules/nixos/desktop/lockscreen/default.nix
Normal file
8
modules/nixos/desktop/lockscreen/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.desktop.lockscreen == "hyprlock") {
|
||||||
|
security.pam.services.hyprlock = { };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
23
modules/nixos/desktop/windowManager.nix
Normal file
23
modules/nixos/desktop/windowManager.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.desktop.windowManager == "hyprland") {
|
||||||
|
environment.loginShellInit = # sh
|
||||||
|
''
|
||||||
|
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
|
||||||
|
if uwsm check may-start; then
|
||||||
|
exec uwsm start hyprland-uwsm.desktop
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
environment.variables = {
|
||||||
|
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||||
|
NIXOS_OZONE_WL = "1";
|
||||||
|
};
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
9
modules/nixos/hardware/audio.nix
Normal file
9
modules/nixos/hardware/audio.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
104
modules/nixos/hardware/btrfs.nix
Normal file
104
modules/nixos/hardware/btrfs.nix
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.hardware.drives.btrfs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
|
disko.devices.disk.main = {
|
||||||
|
device = cfg.drive;
|
||||||
|
type = "disk";
|
||||||
|
content.type = "gpt";
|
||||||
|
content.partitions = {
|
||||||
|
boot.name = "boot";
|
||||||
|
boot.size = "1M";
|
||||||
|
boot.type = "EF02";
|
||||||
|
esp.name = "ESP";
|
||||||
|
esp.size = "500M";
|
||||||
|
esp.type = "EF00";
|
||||||
|
esp.content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
swap.size = "4G";
|
||||||
|
swap.content = {
|
||||||
|
type = "swap";
|
||||||
|
resumeDevice = true;
|
||||||
|
};
|
||||||
|
root.name = "root";
|
||||||
|
root.size = "100%";
|
||||||
|
root.content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "root_vg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
disko.devices.lvm_vg.root_vg = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs.root.size = "100%FREE";
|
||||||
|
lvs.root.content.type = "btrfs";
|
||||||
|
lvs.root.content.extraArgs = [ "-f" ];
|
||||||
|
lvs.root.content.subvolumes = {
|
||||||
|
"/root".mountpoint = "/";
|
||||||
|
"/persist".mountpoint = "/persist";
|
||||||
|
"/persist".mountOptions = [
|
||||||
|
"subvol=persist"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
"/nix".mountpoint = "/nix";
|
||||||
|
"/nix".mountOptions = [
|
||||||
|
"subvol=nix"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.ephemeralRoot {
|
||||||
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
|
mkdir /btrfs_tmp
|
||||||
|
mount /dev/root_vg/root /btrfs_tmp
|
||||||
|
if [[ -e /btrfs_tmp/root ]]; then
|
||||||
|
mkdir -p /btrfs_tmp/old_roots
|
||||||
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
|
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
delete_subvolume_recursively() {
|
||||||
|
IFS=$'\n'
|
||||||
|
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||||
|
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||||
|
done
|
||||||
|
btrfs subvolume delete "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
||||||
|
delete_subvolume_recursively "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
|
umount /btrfs_tmp
|
||||||
|
'';
|
||||||
|
programs.fuse.userAllowOther = true;
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
environment.persistence."/persist" = {
|
||||||
|
hideMounts = true;
|
||||||
|
directories = [
|
||||||
|
"/var/lib/systemd"
|
||||||
|
"/var/lib/nixos"
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||||
|
"/etc/machine-id"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
13
modules/nixos/hardware/cpu.nix
Normal file
13
modules/nixos/hardware/cpu.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.hardware.platform == "amd") {
|
||||||
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.hardware.platform == "intel") {
|
||||||
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
29
modules/nixos/hardware/default.nix
Normal file
29
modules/nixos/hardware/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./btrfs.nix
|
||||||
|
./nvidia.nix
|
||||||
|
./audio.nix
|
||||||
|
./cpu.nix
|
||||||
|
./networking.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.hardware = {
|
||||||
|
drives.btrfs = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
drive = lib.pantheon.mkStrOption;
|
||||||
|
ephemeralRoot = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
gpu = lib.pantheon.mkStrOption;
|
||||||
|
platform = lib.pantheon.mkStrOption;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
settings.General.Experimental = true;
|
||||||
|
};
|
||||||
|
hardware.xone.enable = true;
|
||||||
|
};
|
||||||
|
}
|
27
modules/nixos/hardware/networking.nix
Normal file
27
modules/nixos/hardware/networking.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
networking.hostName = config.system.hostname;
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PrintMotd = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
authKeyFile = config.sops.secrets."keys/tailscale".path;
|
||||||
|
};
|
||||||
|
environment.persistence."/persist".directories = [ "/var/lib/tailscale" ];
|
||||||
|
}
|
||||||
|
(lib.mkIf config.desktop.enableSpotifyd {
|
||||||
|
networking.firewall.allowedTCPPorts = [ 5353 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 5353 ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
30
modules/nixos/hardware/nvidia.nix
Normal file
30
modules/nixos/hardware/nvidia.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.hardware.gpu == "nvidia") {
|
||||||
|
hardware = {
|
||||||
|
graphics.enable = true;
|
||||||
|
graphics.extraPackages = with pkgs; [
|
||||||
|
nvidia-vaapi-driver
|
||||||
|
];
|
||||||
|
nvidia.open = true;
|
||||||
|
nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
|
};
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
environment.variables = {
|
||||||
|
LIBVA_DRIVER_NAME = "nvidia";
|
||||||
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||||
|
NVD_BACKEND = "direct";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.substituters = [ "https://cuda-maintainers.cachix.org" ];
|
||||||
|
nix.settings.trusted-public-keys = [
|
||||||
|
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
58
modules/nixos/server/databases/default.nix
Normal file
58
modules/nixos/server/databases/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.server.databases;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.server.databases = {
|
||||||
|
mongodb = {
|
||||||
|
enable = lib.mkEnableOption "the MongoDB server";
|
||||||
|
port = lib.pantheon.mkPortOption 27017;
|
||||||
|
};
|
||||||
|
mysql = {
|
||||||
|
enable = lib.mkEnableOption "the MySQL server";
|
||||||
|
port = lib.pantheon.mkPortOption 3306;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.mongodb.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [ cfg.mongodb.port ];
|
||||||
|
environment.persistence."/persist".directories = [
|
||||||
|
{
|
||||||
|
directory = builtins.toString config.services.mongodb.dbpath;
|
||||||
|
user = "mongodb";
|
||||||
|
group = "mongodb";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
services.mongodb = {
|
||||||
|
enable = true;
|
||||||
|
bind_ip = "0.0.0.0";
|
||||||
|
extraConfig = ''
|
||||||
|
net.port: ${builtins.toString cfg.mongodb.port}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf cfg.mysql.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [ cfg.mysql.port ];
|
||||||
|
environment.persistence."/persist".directories = [
|
||||||
|
{
|
||||||
|
directory = builtins.toString config.services.mysql.dataDir;
|
||||||
|
user = "mysql";
|
||||||
|
group = "mysql";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
services.mysql = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.mariadb;
|
||||||
|
settings.mysqld = {
|
||||||
|
inherit (cfg.mysql) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
73
modules/nixos/server/default.nix
Normal file
73
modules/nixos/server/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.server = {
|
||||||
|
mountHelios = lib.mkEnableOption "";
|
||||||
|
enableDDNS = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf config.server.enableDDNS {
|
||||||
|
services.godns = {
|
||||||
|
enable = true;
|
||||||
|
loadCredential = [
|
||||||
|
"cf_token:${config.sops.secrets."keys/cloudflare".path}"
|
||||||
|
"telegram_bot_token:${config.sops.secrets."keys/telegram_bot".path}"
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
provider = "Cloudflare";
|
||||||
|
login_token_file = "$CREDENTIALS_DIRECTORY/cf_token";
|
||||||
|
domains = [
|
||||||
|
{
|
||||||
|
domain_name = "rrv.sh";
|
||||||
|
sub_domains = [ "@" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
domain_name = "aenyrathia.wiki";
|
||||||
|
sub_domains = [ "@" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
domain_name = "bwfiq.com";
|
||||||
|
sub_domains = [ "*" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
domain_name = "slayment.com";
|
||||||
|
sub_domains = [ "*" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
resolver = "1.1.1.1";
|
||||||
|
ip_urls = [
|
||||||
|
"https://wtfismyip.com/text"
|
||||||
|
"https://api.ipify.org"
|
||||||
|
"https://myip.biturl.top"
|
||||||
|
"https://api-ipv4.ip.sb/ip"
|
||||||
|
];
|
||||||
|
ip_type = "IPv4";
|
||||||
|
interval = 300;
|
||||||
|
notify = {
|
||||||
|
telegram = {
|
||||||
|
enabled = true;
|
||||||
|
bot_api_key_file = "$CREDENTIALS_DIRECTORY/telegram_bot_token";
|
||||||
|
chat_id = "384288005";
|
||||||
|
message_template = "Domain *{{ .Domain }} has been updated to %0A{{ .CurrentIP }}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf config.server.mountHelios {
|
||||||
|
fileSystems."/media/helios/data" = {
|
||||||
|
device = "//helios/data";
|
||||||
|
fsType = "cifs";
|
||||||
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"x-systemd.requires=tailscaled.service"
|
||||||
|
"x-systemd.mount-timeout=0"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
65
modules/nixos/server/web-apps/default.nix
Normal file
65
modules/nixos/server/web-apps/default.nix
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.server.web-apps;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
"${inputs.rrvsh-nixpkgs}/nixos/modules/services/web-apps/librechat.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
options.server.web-apps = {
|
||||||
|
librechat.enable = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.librechat.enable {
|
||||||
|
services.librechat = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
port = 3080;
|
||||||
|
env = {
|
||||||
|
HOST = "0.0.0.0";
|
||||||
|
ALLOW_REGISTRATION = "true";
|
||||||
|
MONGO_URI = "mongodb://apollo:27017";
|
||||||
|
};
|
||||||
|
credentials = {
|
||||||
|
CREDS_KEY = config.sops.secrets."librechat/creds_key".path;
|
||||||
|
CREDS_IV = config.sops.secrets."librechat/creds_iv".path;
|
||||||
|
JWT_SECRET = config.sops.secrets."librechat/jwt_secret".path;
|
||||||
|
JWT_REFRESH_SECRET = config.sops.secrets."librechat/jwt_refresh_secret".path;
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
version = "1.0.8";
|
||||||
|
cache = true;
|
||||||
|
interface = {
|
||||||
|
privacyPolicy = {
|
||||||
|
externalUrl = "https://librechat.ai/privacy-policy";
|
||||||
|
openNewTab = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
endpoints = {
|
||||||
|
custom = [
|
||||||
|
{
|
||||||
|
name = "OpenRouter";
|
||||||
|
apiKey = "\${OPENROUTER_KEY}";
|
||||||
|
baseURL = "https://openrouter.ai/api/v1";
|
||||||
|
models = {
|
||||||
|
default = [ "meta-llama/llama-3-70b-instruct" ];
|
||||||
|
fetch = true;
|
||||||
|
};
|
||||||
|
titleConvo = true;
|
||||||
|
titleModule = "meta-llama/llama-3-70b-instruct";
|
||||||
|
dropParams = [ "stop" ];
|
||||||
|
modelDisplayLabel = "OpenRouter";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
52
modules/nixos/server/web-servers/default.nix
Normal file
52
modules/nixos/server/web-servers/default.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.server.web-servers;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.server.web-servers = {
|
||||||
|
nginx = {
|
||||||
|
enable = lib.mkEnableOption "the Nginx server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "rafiq@rrv.sh";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.nginx.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
443
|
||||||
|
80
|
||||||
|
];
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"chat.bwfiq.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://helios:3080";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"il.bwfiq.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://helios:2283";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
${config.system.hostname} = {
|
||||||
|
locations."/" = {
|
||||||
|
return = "200 '<html><body>It works!</body></html'";
|
||||||
|
extraConfig = ''
|
||||||
|
default_type text/html;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
27
modules/nixos/system/boot.nix
Normal file
27
modules/nixos/system/boot.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
}
|
||||||
|
(lib.mkIf (config.system.bootloader == "systemd-boot") {
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
30
modules/nixos/system/default.nix
Normal file
30
modules/nixos/system/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./boot.nix
|
||||||
|
./users.nix
|
||||||
|
./localisation.nix
|
||||||
|
./nix-config.nix
|
||||||
|
./secrets.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.system = {
|
||||||
|
hostname = lib.pantheon.mkStrOption;
|
||||||
|
mainUser.name = lib.pantheon.mkStrOption;
|
||||||
|
mainUser.publicKey = lib.pantheon.mkStrOption;
|
||||||
|
bootloader = lib.pantheon.mkStrOption;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
stylix = {
|
||||||
|
enable = true;
|
||||||
|
base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-cave.yaml";
|
||||||
|
};
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
};
|
||||||
|
}
|
9
modules/nixos/system/localisation.nix
Normal file
9
modules/nixos/system/localisation.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
time.timeZone = "Asia/Singapore";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
17
modules/nixos/system/nix-config.nix
Normal file
17
modules/nixos/system/nix-config.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, inputs, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
|
|
||||||
|
nix.settings = {
|
||||||
|
experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
"pipe-operators"
|
||||||
|
];
|
||||||
|
|
||||||
|
trusted-users = [ "@wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
27
modules/nixos/system/secrets.nix
Normal file
27
modules/nixos/system/secrets.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
sops = {
|
||||||
|
defaultSopsFile = lib.snowfall.fs.get-file "secrets/secrets.yaml";
|
||||||
|
age.sshKeyPaths = [ "/persist/home/rafiq/.ssh/id_ed25519" ];
|
||||||
|
secrets = {
|
||||||
|
"keys/tailscale" = { };
|
||||||
|
"keys/gemini" = { };
|
||||||
|
"keys/cvt-jira" = { };
|
||||||
|
"keys/cloudflare" = { };
|
||||||
|
"keys/telegram_bot" = { };
|
||||||
|
"misc/cvt-jira-link" = { };
|
||||||
|
"rafiq/hashedPassword".neededForUsers = true;
|
||||||
|
"librechat/creds_key" = { };
|
||||||
|
"librechat/creds_iv" = { };
|
||||||
|
"librechat/jwt_secret" = { };
|
||||||
|
"librechat/jwt_refresh_secret" = { };
|
||||||
|
"librechat/meili_master_key" = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.shellInit = # sh
|
||||||
|
''
|
||||||
|
export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path})
|
||||||
|
export CVT_JIRA_KEY=$(sudo cat ${config.sops.secrets."keys/cvt-jira".path})
|
||||||
|
export CVT_JIRA_LINK=$(sudo cat ${config.sops.secrets."misc/cvt-jira-link".path})
|
||||||
|
'';
|
||||||
|
}
|
26
modules/nixos/system/users.nix
Normal file
26
modules/nixos/system/users.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
users.mutableUsers = false;
|
||||||
|
users.groups.users = {
|
||||||
|
gid = 100;
|
||||||
|
members = [ "${config.system.mainUser.name}" ];
|
||||||
|
};
|
||||||
|
users.users."${config.system.mainUser.name}" = {
|
||||||
|
linger = true;
|
||||||
|
uid = 1000;
|
||||||
|
isNormalUser = true;
|
||||||
|
hashedPasswordFile = config.sops.secrets."${config.system.mainUser.name}/hashedPassword".path;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
openssh.authorizedKeys.keys = [ config.system.mainUser.publicKey ];
|
||||||
|
};
|
||||||
|
services.getty.autologinUser = config.system.mainUser.name;
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,62 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib) nixosSystem;
|
|
||||||
inherit (inputs.nix-darwin.lib) darwinSystem;
|
|
||||||
inherit (lib.lists) optional;
|
|
||||||
inherit (lib.attrsets) mapAttrs;
|
|
||||||
inherit (cfg.lib.modules) forAllUsers';
|
|
||||||
inherit (config.manifest) hosts;
|
|
||||||
cfg = config.flake;
|
|
||||||
globalCfg = hostName: hostConfig: {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
extraSpecialArgs = { inherit hostName hostConfig; };
|
|
||||||
sharedModules = [ cfg.modules.homeManager.default ];
|
|
||||||
users = forAllUsers' (name: _: cfg.modules.homeManager.${name});
|
|
||||||
};
|
|
||||||
mkConfigurations =
|
|
||||||
class: hosts:
|
|
||||||
mapAttrs (
|
|
||||||
name: value:
|
|
||||||
if class == "nixos" then
|
|
||||||
nixosSystem {
|
|
||||||
specialArgs = {
|
|
||||||
inherit (config.flake) self;
|
|
||||||
hostName = name;
|
|
||||||
hostConfig = value;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
cfg.modules.nixos.default
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{ home-manager = globalCfg name value; }
|
|
||||||
(value.extraCfg or { })
|
|
||||||
] ++ optional value.graphical cfg.modules.nixos.graphical;
|
|
||||||
}
|
|
||||||
else if class == "darwin" then
|
|
||||||
darwinSystem {
|
|
||||||
specialArgs = {
|
|
||||||
inherit (config.flake) self;
|
|
||||||
hostName = name;
|
|
||||||
hostConfig = value;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
cfg.modules.darwin.default
|
|
||||||
inputs.home-manager.darwinModules.home-manager
|
|
||||||
{ home-manager = globalCfg name value; }
|
|
||||||
(value.extraCfg or { })
|
|
||||||
] ++ optional value.graphical cfg.modules.darwin.graphical;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
) hosts;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [ inputs.home-manager.flakeModules.home-manager ];
|
|
||||||
flake.nixosConfigurations = mkConfigurations "nixos" hosts.nixos;
|
|
||||||
flake.darwinConfigurations = mkConfigurations "darwin" hosts.darwin;
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
let
|
|
||||||
inherit (builtins) concatStringsSep;
|
|
||||||
inherit (lib.lists) singleton;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
text.cheatsheet = concatStringsSep "\n" [
|
|
||||||
"`__curPos.file` will give the full evaluated path of the nix file it is called in. See [this issue](https://github.com/NixOS/nix/issues/5897#issuecomment-1012165198) for more information."
|
|
||||||
];
|
|
||||||
perSystem =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
files.files = singleton {
|
|
||||||
path_ = "docs/cheatsheet.md";
|
|
||||||
drv = pkgs.writeText "cheatsheet.md" config.text.cheatsheet;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
perSystem =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
files.files = [
|
|
||||||
{
|
|
||||||
path_ = ".gitignore";
|
|
||||||
drv = pkgs.writeText ".gitignore" config.text.gitignore;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
text.readme = {
|
|
||||||
heading = "Pantheon";
|
|
||||||
description = # markdown
|
|
||||||
''
|
|
||||||
This flake serves as a monorepo for my systems (using IaC), dotfiles, and scripts.
|
|
||||||
It's hosted at https://git.rrv.sh/rrvsh/pantheon, and mirrored to https://github.com/rrvsh/pantheon.
|
|
||||||
'';
|
|
||||||
order = [
|
|
||||||
"Structure"
|
|
||||||
"Acknowledgements"
|
|
||||||
];
|
|
||||||
parts."Acknowledgements" = # markdown
|
|
||||||
''
|
|
||||||
Thanks to the following for inspiring this configuration. I highly recommend you look through their writings and configurations.
|
|
||||||
- [ornicar](https://github.com/ornicar/dotfiles) which is where I first heard of NixOS
|
|
||||||
- [No Boilerplate](https://www.youtube.com/watch?v=CwfKlX3rA6E&pp=0gcJCfwAo7VqN5tD) for making me finally try the OS
|
|
||||||
- [ryan4yin](https://nixos-and-flakes.thiscute.world/) for being an amazing introduction to NixOS, home-manager, and flakes
|
|
||||||
- [NotAShelf](https://github.com/NotAShelf/) for their blog and for the wonderful [NVF](https://github.com/notashelf/nvf)
|
|
||||||
- [mightyiam](https://github.com/mightyiam/infra) for their infrastructure repo using flake-parts
|
|
||||||
- [drupol](https://not-a-number.io/2025/refactoring-my-infrastructure-as-code-configurations/) for this blog post which convinced me to rebase my infra to use flake-parts
|
|
||||||
'';
|
|
||||||
parts."Structure" = # markdown
|
|
||||||
''
|
|
||||||
The system configurations are defined in [`flake.manifest`](nix/manifest.nix).
|
|
||||||
`manifest.owner` provides the attributes for the administrator user, including username and pubkey.
|
|
||||||
`manifest.hosts` provides the specifications for the system configurations that should be exposed by the flake as nixosConfigurations.
|
|
||||||
`flake.modules.nixos.*` provide NixOS options and configurations.
|
|
||||||
The attribute `flake.modules.nixos.default` provides options that will be applied to every system of that class.
|
|
||||||
You can use it as seen [here](nix/modules/flake/home-manager.nix):
|
|
||||||
|
|
||||||
```nix
|
|
||||||
flake.modules.nixos.default.imports = [ inputs.home-manager.nixosModules.default ];
|
|
||||||
```
|
|
||||||
|
|
||||||
The other attributes under `flake.modules.nixos` should be opt-in, i.e. provide options that will be set in the profiles.
|
|
||||||
`flake.profiles.nixos` provides profiles which use the options defined in `flake.modules.nixos` to define different roles for each system, such as graphical, laptop, headless, etc.
|
|
||||||
Options should not be defined here.
|
|
||||||
`flake.contracts.nixos.*` will provide contracts, such as reverse proxies or databases, which will configure options on the provider and receiver host.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
perSystem =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
files.files = [
|
|
||||||
{
|
|
||||||
path_ = "docs/README.md";
|
|
||||||
drv = pkgs.writeText "README.md" config.text.readme;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
withSystem,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (builtins) map head;
|
|
||||||
inherit (lib.lists) concatStringsSep;
|
|
||||||
mkListEntry = x: "- [" + x.path_ + "](" + x.path_ + ")";
|
|
||||||
listOfGeneratedFiles = withSystem (head config.systems) (psArgs: psArgs.config.files.files);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [ inputs.files.flakeModules.default ];
|
|
||||||
perSystem = psArgs: {
|
|
||||||
make-shells.default.packages = [ psArgs.config.files.writer.drv ];
|
|
||||||
};
|
|
||||||
text.readme.parts."Generated Files" = concatStringsSep "\n" (
|
|
||||||
[
|
|
||||||
"This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation."
|
|
||||||
|
|
||||||
"The list of generated files are:"
|
|
||||||
|
|
||||||
]
|
|
||||||
++ (map mkListEntry listOfGeneratedFiles)
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
debug = true;
|
|
||||||
imports = [
|
|
||||||
inputs.make-shell.flakeModules.default
|
|
||||||
inputs.manifest.flakeModules.default
|
|
||||||
inputs.flake-parts.flakeModules.modules
|
|
||||||
inputs.text.flakeModules.default
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
imports = [ inputs.git-hooks.flakeModule ];
|
|
||||||
text.gitignore = ".pre-commit-config.*";
|
|
||||||
perSystem = psArgs: {
|
|
||||||
pre-commit.settings.hooks = {
|
|
||||||
# Nix Linters
|
|
||||||
deadnix.enable = true;
|
|
||||||
statix.enable = true;
|
|
||||||
nil.enable = true;
|
|
||||||
nixfmt-rfc-style.enable = true;
|
|
||||||
# Flake Health Checks
|
|
||||||
flake-checker.enable = true;
|
|
||||||
# Misc
|
|
||||||
mixed-line-endings.enable = true;
|
|
||||||
trim-trailing-whitespace.enable = true;
|
|
||||||
#TODO: figure out vale
|
|
||||||
#TODO: make nix develop work
|
|
||||||
#TODO: add nix flake check
|
|
||||||
#TODO: add write-files
|
|
||||||
};
|
|
||||||
make-shells.default.shellHook = psArgs.config.pre-commit.installationScript;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
whichKey.enable = true;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
# Show virtual text hints
|
|
||||||
inlayHints.enable = true;
|
|
||||||
lightbulb.enable = true;
|
|
||||||
# Show icons for lsp actions
|
|
||||||
lspkind.enable = true;
|
|
||||||
null-ls.enable = true;
|
|
||||||
otter-nvim = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts = {
|
|
||||||
buffers.set_filetype = true;
|
|
||||||
buffers.write_to_disk = true;
|
|
||||||
handle_leading_whitespace = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
harpoon = {
|
|
||||||
enable = true;
|
|
||||||
mappings.listMarks = "<leader>ml";
|
|
||||||
mappings.markFile = "<leader>mm";
|
|
||||||
setupOpts.defaults.save_on_toggle = true;
|
|
||||||
setupOpts.defaults.sync_on_ui_close = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
{ pkgs }:
|
|
||||||
{
|
|
||||||
luasnip = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.enable_autosnippets = true;
|
|
||||||
providers = with pkgs.vimPlugins; [ vim-snippets ];
|
|
||||||
loaders = "require('luasnip.loaders.from_vscode').lazy_load()";
|
|
||||||
customSnippets.snipmate = {
|
|
||||||
nix = [
|
|
||||||
{
|
|
||||||
trigger = "mod";
|
|
||||||
description = "empty module";
|
|
||||||
body = # nix
|
|
||||||
''
|
|
||||||
{config, lib, ...}:
|
|
||||||
let
|
|
||||||
cfg = config.$1;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.$1 = { $2 };
|
|
||||||
config = $3;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,71 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
pkgs.writeShellScriptBin "commit" # bash
|
|
||||||
''
|
|
||||||
if git diff-index --quiet HEAD --; then exit 0; fi
|
|
||||||
|
|
||||||
PROMPT="Please generate a commit message for this diff."
|
|
||||||
GUIDELINES="1. Use conventional commit syntax, following the context. 2. Cap the commit message at 80 characters, preferably less. You must not go beyond this limit. 3. Do not include backticks. Only generate the raw text. 4. Be as succint as possible. Each commit should be atomic. You may throw a warning if it is not."
|
|
||||||
NUM_ANCESTORS=0
|
|
||||||
PUSH=false
|
|
||||||
|
|
||||||
# Parse arguments
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
case "$1" in
|
|
||||||
--num-ancestors | -n)
|
|
||||||
NUM_ANCESTORS="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
--push | -u)
|
|
||||||
PUSH=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unrecognised argument: $1. Exiting..."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get context and diff
|
|
||||||
CONTEXT=$(git --no-pager log -n 10)
|
|
||||||
DIFF=$(git --no-pager diff HEAD~$NUM_ANCESTORS)
|
|
||||||
|
|
||||||
# Generate initial response
|
|
||||||
RESPONSE=$(aichat "$PROMPT\nGuidelines: $GUIDELINES\nContext from git log:\n$CONTEXT\nDiff from git diff HEAD:\n$DIFF")
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
echo "$RESPONSE"
|
|
||||||
echo
|
|
||||||
echo "Choose an action:"
|
|
||||||
read -p "Options: [y]es, [r]eroll, [e]dit, [q]uit? " -n 1 -r choice
|
|
||||||
echo
|
|
||||||
|
|
||||||
case "$choice" in
|
|
||||||
y | yes)
|
|
||||||
git commit -am "$RESPONSE"
|
|
||||||
echo "Committed successfully."
|
|
||||||
if $PUSH; then
|
|
||||||
git push
|
|
||||||
echo "Pushed successfully."
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
r | reroll)
|
|
||||||
RESPONSE=$(aichat "$PROMPT\nGuidelines: $GUIDELINES\nContext from git log:\n$CONTEXT\nDiff from git diff HEAD:\n$DIFF")
|
|
||||||
;;
|
|
||||||
e | edit)
|
|
||||||
echo "$RESPONSE" > /tmp/commit_msg.txt
|
|
||||||
"$EDITOR" /tmp/commit_msg.txt
|
|
||||||
RESPONSE=$(cat /tmp/commit_msg.txt)
|
|
||||||
rm /tmp/commit_msg.txt
|
|
||||||
;;
|
|
||||||
q | quit | "")
|
|
||||||
echo "Aborted."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid choice. Please choose again."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
''
|
|
|
@ -1,9 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
pkgs.writeShellScriptBin "note" # bash
|
|
||||||
''
|
|
||||||
zk edit -i
|
|
||||||
pushd ~/notebook > /dev/null
|
|
||||||
git add .
|
|
||||||
commit -u
|
|
||||||
popd > /dev/null
|
|
||||||
''
|
|
|
@ -1,148 +0,0 @@
|
||||||
{ pkgs }:
|
|
||||||
let
|
|
||||||
inherit (pkgs.lib) getExe;
|
|
||||||
in
|
|
||||||
pkgs.writeShellScriptBin "rebuild" # sh
|
|
||||||
''
|
|
||||||
QUICK=false
|
|
||||||
NO_GENERATION_CHECK=false
|
|
||||||
TEST_SHELL=false
|
|
||||||
REMOTE_HOSTS=()
|
|
||||||
REBUILDING_ALL=false
|
|
||||||
# ANSI color codes
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
ORANGE='\033[0;33m'
|
|
||||||
RED='\033[0;31m'
|
|
||||||
NC='\033[0m'
|
|
||||||
|
|
||||||
info() {
|
|
||||||
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
|
|
||||||
echo -e "''${GREEN}''${timestamp} INFO: $1''${NC}"
|
|
||||||
}
|
|
||||||
|
|
||||||
warn() {
|
|
||||||
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
|
|
||||||
echo -e "''${ORANGE}''${timestamp} WARN: $1''${NC}"
|
|
||||||
}
|
|
||||||
|
|
||||||
err() {
|
|
||||||
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
|
|
||||||
echo -e "''${RED}''${timestamp} ERROR: $1''${NC}"
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt() {
|
|
||||||
local PROMPT="$1"
|
|
||||||
shift
|
|
||||||
read -p "$PROMPT? (y/n) [n]: " -n 1 -r REPLY
|
|
||||||
echo
|
|
||||||
if [[ "$REPLY" =~ ^[Yy]$ ]]; then
|
|
||||||
"$*"
|
|
||||||
else
|
|
||||||
info "$PROMPT aborted."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
spawn_test_shell() {
|
|
||||||
info "Spawning test shell on $1..."
|
|
||||||
(export PS1="Test shell> "
|
|
||||||
exec ${pkgs.bash}/bin/bash ssh "$1") || {
|
|
||||||
${pkgs.cowsay}/bin/cowsay "You aborted."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rebuild_remote() {
|
|
||||||
local args=(".#nixosConfigurations.$1" "--target-host" "$1")
|
|
||||||
local CURRENT_GENERATION=$(ssh "$1" readlink /nix/var/nix/profiles/system | cut -d- -f2)
|
|
||||||
|
|
||||||
if "$TEST_SHELL"; then
|
|
||||||
info "Testing $1..."
|
|
||||||
${getExe pkgs.nh} os test "''${args[@]}" || exit 1
|
|
||||||
git diff HEAD --color=always --stat --patch
|
|
||||||
spawn_test_shell "$1"
|
|
||||||
info "Rebuilding $1..."
|
|
||||||
${getExe pkgs.nh} os boot "''${args[@]}" || exit 1
|
|
||||||
else
|
|
||||||
info "Rebuilding $1 on $HOSTNAME..."
|
|
||||||
${getExe pkgs.nh} os switch "''${args[@]}" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! "$NO_GENERATION_CHECK"; then
|
|
||||||
local NEW_GENERATION=$(ssh "$1" readlink /nix/var/nix/profiles/system | cut -d- -f2)
|
|
||||||
info "$1 - New generation is $NEW_GENERATION. Current is $CURRENT_GENERATION."
|
|
||||||
if [ ! $NEW_GENERATION -gt $CURRENT_GENERATION ]; then
|
|
||||||
warn "New config was not added to bootloader."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
info "Starting rebuild script."
|
|
||||||
|
|
||||||
if [ ! -f "flake.nix" ]; then
|
|
||||||
err "flake.nix not found in the current directory. Exiting."
|
|
||||||
exit 1 # Indicate an error
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
case "$1" in
|
|
||||||
--quick | -q)
|
|
||||||
QUICK=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--no-generation-check | -n)
|
|
||||||
NO_GENERATION_CHECK=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--test-shell | -t)
|
|
||||||
TEST_SHELL=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--all | -a)
|
|
||||||
reachable_hosts=()
|
|
||||||
hostnames=$(nix flake show --all-systems --json | , jq -r '.nixosConfigurations | keys | .[]')
|
|
||||||
for host in ''${hostnames[@]}; do
|
|
||||||
info "Checking if $host is reachable..."
|
|
||||||
if ping -c 1 -W 1 "$host" > /dev/null 2>&1 ; then
|
|
||||||
info "$host is reachable."
|
|
||||||
reachable_hosts+=("$host")
|
|
||||||
else
|
|
||||||
warn "$host is unreachable."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
REMOTE_HOSTS=(''${reachable_hosts[@]})
|
|
||||||
REBUILDING_ALL=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
if [ !REBUILDING_ALL ]; then
|
|
||||||
if ping -c 1 -W 1 "$1" > /dev/null 2>&1 ; then
|
|
||||||
REMOTE_HOSTS+=("$1")
|
|
||||||
else
|
|
||||||
err "$1 is unreachable. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ''${#REMOTE_HOSTS[@]} == 0 ]; then
|
|
||||||
info "No hostnames provided."
|
|
||||||
REMOTE_HOSTS=("$HOSTNAME")
|
|
||||||
fi
|
|
||||||
|
|
||||||
git add .
|
|
||||||
|
|
||||||
for host in "''${REMOTE_HOSTS[@]}"; do
|
|
||||||
rebuild_remote $host
|
|
||||||
done
|
|
||||||
|
|
||||||
if ! "$QUICK"; then
|
|
||||||
prompt "Commit changes" commit
|
|
||||||
prompt "Reboot system" sudo systemctl reboot
|
|
||||||
fi
|
|
||||||
|
|
||||||
info "Rebuild script completed successfully."
|
|
||||||
exit 0
|
|
||||||
''
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.homeManager.rafiq =
|
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
hostName,
|
|
||||||
hostConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
mkIf (pkgs.system == "aarch64-darwin" || pkgs.system == "x86_64-darwin") {
|
|
||||||
home.file."Library/Application Support/aichat/config.yaml".text = ''
|
|
||||||
model: gemini:gemini-2.0-flash
|
|
||||||
clients:
|
|
||||||
- type: gemini
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,146 +0,0 @@
|
||||||
{ lib, inputs, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib.strings) concatStrings;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.homeManager.rafiq =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.nvf.homeManagerModules.default
|
|
||||||
inputs.nix-index-database.hmModules.nix-index
|
|
||||||
];
|
|
||||||
persistDirs = [
|
|
||||||
".local/share/zoxide"
|
|
||||||
"notebook"
|
|
||||||
];
|
|
||||||
xdg.configFile."aichat/config.yaml".text = ''
|
|
||||||
model: gemini:gemini-2.0-flash
|
|
||||||
clients:
|
|
||||||
- type: gemini
|
|
||||||
'';
|
|
||||||
home = {
|
|
||||||
sessionVariables = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
FETCH = "hyfetch";
|
|
||||||
FILE_BROWSER = "yazi";
|
|
||||||
SHELL = "fish";
|
|
||||||
};
|
|
||||||
shellAliases = {
|
|
||||||
fetch = "hyfetch";
|
|
||||||
windows = "sudo systemctl reboot --boot-loader-entry=auto-windows";
|
|
||||||
v = "$EDITOR";
|
|
||||||
e = "edit";
|
|
||||||
cd = "z"; # zoxide
|
|
||||||
ai = "aichat -r %shell% -e";
|
|
||||||
};
|
|
||||||
packages = with pkgs; [
|
|
||||||
fastfetch
|
|
||||||
ripgrep
|
|
||||||
aichat
|
|
||||||
(import ./_scripts/edit.nix { inherit pkgs; })
|
|
||||||
(import ./_scripts/commit.nix { inherit pkgs; })
|
|
||||||
(import ./_scripts/note.nix { inherit pkgs; })
|
|
||||||
(import ./_scripts/rebuild.nix { inherit pkgs; })
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
mise.enable = true;
|
|
||||||
nvf.enable = true;
|
|
||||||
nvf.settings.vim = {
|
|
||||||
syntaxHighlighting = true;
|
|
||||||
hideSearchHighlight = true;
|
|
||||||
searchCase = "ignore";
|
|
||||||
undoFile.enable = true;
|
|
||||||
telescope.enable = true;
|
|
||||||
fzf-lua.enable = true;
|
|
||||||
git.enable = true;
|
|
||||||
autopairs.nvim-autopairs.enable = true;
|
|
||||||
autocomplete = import ./_nvf/autocomplete.nix { inherit lib; };
|
|
||||||
binds = import ./_nvf/binds.nix;
|
|
||||||
languages = import ./_nvf/languages.nix;
|
|
||||||
lsp = import ./_nvf/lsp.nix;
|
|
||||||
navigation = import ./_nvf/navigation.nix;
|
|
||||||
notes.todo-comments.enable = true;
|
|
||||||
options = {
|
|
||||||
autoindent = true;
|
|
||||||
backspace = "indent,eol,start";
|
|
||||||
cursorline = true;
|
|
||||||
expandtab = true;
|
|
||||||
shiftwidth = 2;
|
|
||||||
smartindent = true;
|
|
||||||
tabstop = 2;
|
|
||||||
};
|
|
||||||
snippets = import ./_nvf/snippets.nix { inherit pkgs; };
|
|
||||||
statusline = import ./_nvf/statusline.nix;
|
|
||||||
treesitter = {
|
|
||||||
autotagHtml = true;
|
|
||||||
fold = true;
|
|
||||||
indent.disable = [ "markdown" ];
|
|
||||||
textobjects.enable = true;
|
|
||||||
};
|
|
||||||
ui = import ./_nvf/ui.nix;
|
|
||||||
utility = import ./_nvf/utility.nix;
|
|
||||||
visuals = import ./_nvf/visuals.nix;
|
|
||||||
};
|
|
||||||
zk = {
|
|
||||||
enable = true;
|
|
||||||
settings.notebook.dir = "~/notebook";
|
|
||||||
};
|
|
||||||
hyfetch = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
preset = "bisexual";
|
|
||||||
mode = "rgb";
|
|
||||||
light_dark = "dark";
|
|
||||||
lightness = 0.5;
|
|
||||||
color_align = {
|
|
||||||
# Flag color alignment
|
|
||||||
mode = "horizontal";
|
|
||||||
fore_back = null;
|
|
||||||
};
|
|
||||||
backend = "fastfetch";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
tealdeer.enable = true;
|
|
||||||
tealdeer.enableAutoUpdates = true;
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
zoxide.enable = true;
|
|
||||||
nix-index.enable = true;
|
|
||||||
nix-index-database.comma.enable = true;
|
|
||||||
fzf.enable = true;
|
|
||||||
fzf.enableZshIntegration = true;
|
|
||||||
yazi = {
|
|
||||||
enable = true;
|
|
||||||
shellWrapperName = "t";
|
|
||||||
settings.mgr.sort_by = "natural";
|
|
||||||
};
|
|
||||||
fish.enable = true;
|
|
||||||
starship = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
add_newline = false;
|
|
||||||
format = concatStrings [
|
|
||||||
# First Line
|
|
||||||
## Left Prompt
|
|
||||||
"$hostname$directory"
|
|
||||||
"$fill"
|
|
||||||
## Right Prompt
|
|
||||||
"$all"
|
|
||||||
# Second Line
|
|
||||||
## Left Prompt
|
|
||||||
"$character"
|
|
||||||
];
|
|
||||||
git_branch.format = "[$symbol$branch(:$remote_branch)]($style) ";
|
|
||||||
shlvl.disabled = false;
|
|
||||||
username.disabled = true;
|
|
||||||
fill.symbol = " ";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
let
|
|
||||||
inherit (config.manifest) admin;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.darwin.graphical.homebrew = {
|
|
||||||
enable = true;
|
|
||||||
user = admin.username;
|
|
||||||
onActivation.cleanup = "uninstall";
|
|
||||||
brews = [
|
|
||||||
"mise"
|
|
||||||
"docker"
|
|
||||||
];
|
|
||||||
casks = [
|
|
||||||
"ghostty"
|
|
||||||
"slack"
|
|
||||||
"gitify"
|
|
||||||
"telegram"
|
|
||||||
"vial"
|
|
||||||
"linear-linear"
|
|
||||||
"chatgpt"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
flake.modules.homeManager.rafiq = {
|
|
||||||
# make sure brew is on the path for M1
|
|
||||||
programs.zsh.initContent = ''
|
|
||||||
if [[ $(uname -m) == 'arm64' ]]; then
|
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
programs.fish.shellInit = ''
|
|
||||||
if test (uname -m) = "arm64"
|
|
||||||
eval (/opt/homebrew/bin/brew shellenv)
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
{ lib, inputs, ... }:
|
|
||||||
{
|
|
||||||
flake.modules.homeManager.rafiq =
|
|
||||||
{ pkgs, config, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (builtins) map listToAttrs;
|
|
||||||
inherit (lib.lists) findFirstIndex;
|
|
||||||
inherit (inputs.nur.legacyPackages.${pkgs.stdenv.hostPlatform.system}.repos.rycee) firefox-addons;
|
|
||||||
profiles = listToAttrs (
|
|
||||||
map (name: {
|
|
||||||
inherit name;
|
|
||||||
# If there are duplicate profile names, findFirstIndex will cause issues.
|
|
||||||
value = profileCfg (findFirstIndex (x: x == name) null syncedProfiles);
|
|
||||||
}) syncedProfiles
|
|
||||||
);
|
|
||||||
syncedProfiles = [
|
|
||||||
"rafiq"
|
|
||||||
"test"
|
|
||||||
];
|
|
||||||
profileCfg = id: {
|
|
||||||
inherit id;
|
|
||||||
settings."extensions.autoDisableScopes" = 0; # Auto enable extensions
|
|
||||||
extensions = {
|
|
||||||
force = true;
|
|
||||||
packages = with firefox-addons; [
|
|
||||||
darkreader
|
|
||||||
gesturefy
|
|
||||||
sponsorblock
|
|
||||||
ublock-origin
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
mkIf config.graphical {
|
|
||||||
stylix = {
|
|
||||||
image = ./wallpaper.png;
|
|
||||||
targets = {
|
|
||||||
firefox.colorTheme.enable = true;
|
|
||||||
firefox.profileNames = syncedProfiles;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home = {
|
|
||||||
sessionVariables = {
|
|
||||||
BROWSER = "firefox";
|
|
||||||
TERMINAL = "ghostty";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
vesktop.enable = true;
|
|
||||||
thunderbird.enable = true;
|
|
||||||
thunderbird.profiles.rafiq.isDefault = true;
|
|
||||||
# ghostty is broken on nix-darwin
|
|
||||||
ghostty.settings.confirm-close-surface = false;
|
|
||||||
firefox = {
|
|
||||||
enable = true;
|
|
||||||
inherit profiles;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,232 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
let
|
|
||||||
inherit (config.manifest) admin;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
allowedUnfreePackages = [
|
|
||||||
"stremio-shell"
|
|
||||||
"stremio-server"
|
|
||||||
"steam"
|
|
||||||
"steam-unwrapped"
|
|
||||||
];
|
|
||||||
flake.modules.nixos.graphical =
|
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
fonts.packages = [ pkgs.font-awesome ];
|
|
||||||
services.getty.autologinUser = admin.username;
|
|
||||||
# Start Hyprland at boot only if not connecting through SSH
|
|
||||||
environment.loginShellInit = # sh
|
|
||||||
''
|
|
||||||
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
|
|
||||||
if uwsm check may-start; then
|
|
||||||
exec uwsm start hyprland-uwsm.desktop
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
environment.variables = {
|
|
||||||
# Get Electron apps to use Wayland
|
|
||||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
|
||||||
NIXOS_OZONE_WL = "1";
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
hyprland = {
|
|
||||||
enable = true;
|
|
||||||
# Use UWSM to have each process controlled by systemd init
|
|
||||||
withUWSM = true;
|
|
||||||
};
|
|
||||||
steam = {
|
|
||||||
enable = true;
|
|
||||||
gamescopeSession.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
security.pam.services.hyprlock = { };
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
capSysAdmin = true;
|
|
||||||
openFirewall = true;
|
|
||||||
settings = {
|
|
||||||
sunshine_name = config.networking.hostName;
|
|
||||||
origin_pin_allowed = "wan";
|
|
||||||
origin_web_ui_allowed = "wan";
|
|
||||||
};
|
|
||||||
applications = { };
|
|
||||||
};
|
|
||||||
# spotifyd
|
|
||||||
networking.firewall.allowedTCPPorts = [ 5353 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 5353 ];
|
|
||||||
};
|
|
||||||
flake.modules.homeManager.rafiq =
|
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
hostName,
|
|
||||||
hostConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib.modules) mkMerge mkIf;
|
|
||||||
in
|
|
||||||
mkIf (config.graphical && pkgs.system == "x86_64-linux") {
|
|
||||||
stylix.targets.waybar.addCss = false;
|
|
||||||
persistDirs = [
|
|
||||||
"docs"
|
|
||||||
"repos"
|
|
||||||
"vids"
|
|
||||||
"tmp"
|
|
||||||
".cache/Smart Code ltd/Stremio"
|
|
||||||
".local/share/Smart Code ltd/Stremio"
|
|
||||||
".mozilla/firefox"
|
|
||||||
".tor project"
|
|
||||||
".local/share/Steam"
|
|
||||||
".local/share/PrismLauncher"
|
|
||||||
".config/sunshine"
|
|
||||||
];
|
|
||||||
home = {
|
|
||||||
packages = with pkgs; [
|
|
||||||
wl-clipboard-rs
|
|
||||||
stremio
|
|
||||||
tor-browser
|
|
||||||
vlc
|
|
||||||
prismlauncher
|
|
||||||
];
|
|
||||||
sessionVariables = {
|
|
||||||
LAUNCHER = "fuzzel";
|
|
||||||
LOCKSCREEN = "hyprlock";
|
|
||||||
NOTIFICATION_DAEMON = "mako";
|
|
||||||
STATUS_BAR = "waybar";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# xdg.configFile."uwsm/env".text = # sh
|
|
||||||
# ''
|
|
||||||
# # Force apps to scale right with Wayland
|
|
||||||
# export GDK_SCALE=${mainMonitor.scale}
|
|
||||||
# export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
|
||||||
# '';
|
|
||||||
# xdg.configFile."uwsm/env-hyprland".text = # sh
|
|
||||||
# ''
|
|
||||||
# export GDK_SCALE=${mainMonitor.scale}
|
|
||||||
# export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
|
||||||
# '';
|
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
# This is needed for UWSM
|
|
||||||
systemd.enable = false;
|
|
||||||
# Null the packages since we use them system wide
|
|
||||||
package = null;
|
|
||||||
portalPackage = null;
|
|
||||||
settings = mkMerge [
|
|
||||||
(import ./_hyprland/decoration.nix)
|
|
||||||
(import ./_hyprland/keybinds.nix { inherit pkgs; })
|
|
||||||
{
|
|
||||||
ecosystem.no_update_news = true;
|
|
||||||
xwayland.force_zero_scaling = true;
|
|
||||||
monitor =
|
|
||||||
let
|
|
||||||
mainMonitor = hostConfig.machine.monitors.main;
|
|
||||||
in
|
|
||||||
[
|
|
||||||
"${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}"
|
|
||||||
", preferred, auto, 1"
|
|
||||||
];
|
|
||||||
exec-once = [
|
|
||||||
"uwsm app -- $LOCKSCREEN"
|
|
||||||
"uwsm app -- $NOTIFICATION_DAEMON"
|
|
||||||
"uwsm app -- $STATUS_BAR"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
services = {
|
|
||||||
spotifyd.enable = true;
|
|
||||||
spotifyd.settings.global = {
|
|
||||||
device_name = "${hostName}";
|
|
||||||
device_type = "computer";
|
|
||||||
zeroconf_port = 5353;
|
|
||||||
};
|
|
||||||
mako.enable = true;
|
|
||||||
mako.settings.default-timeout = 10000;
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
obs-studio.enable = true;
|
|
||||||
fuzzel.enable = true;
|
|
||||||
ghostty.enable = true;
|
|
||||||
waybar = {
|
|
||||||
enable = true;
|
|
||||||
settings = [
|
|
||||||
{
|
|
||||||
layer = "top";
|
|
||||||
modules-left = [
|
|
||||||
"pulseaudio"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"battery"
|
|
||||||
"clock"
|
|
||||||
];
|
|
||||||
"pulseaudio" = {
|
|
||||||
format = "{icon} {volume}%";
|
|
||||||
format-muted = "";
|
|
||||||
format-icons.default = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
on-click = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
|
||||||
};
|
|
||||||
"clock" = {
|
|
||||||
interval = 1;
|
|
||||||
format = "{:%F %T}";
|
|
||||||
};
|
|
||||||
"battery" = {
|
|
||||||
interval = 1;
|
|
||||||
bat-compatibility = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
style = # css
|
|
||||||
''
|
|
||||||
window#waybar {
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#pulseaudio,
|
|
||||||
#battery,
|
|
||||||
#clock {
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
hyprlock = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
general.hide_cursor = true;
|
|
||||||
general.ignore_empty_input = true;
|
|
||||||
background.blur_passes = 5;
|
|
||||||
background.blur_size = 5;
|
|
||||||
label = {
|
|
||||||
text = ''hi, $USER.'';
|
|
||||||
font_size = 32;
|
|
||||||
position = "0, 0";
|
|
||||||
halign = "center";
|
|
||||||
valign = "center";
|
|
||||||
zindex = 1;
|
|
||||||
shadow_passes = 5;
|
|
||||||
shadow_size = 5;
|
|
||||||
};
|
|
||||||
input-field = {
|
|
||||||
placeholder_text = "";
|
|
||||||
fade_on_empty = true;
|
|
||||||
size = "200, 45";
|
|
||||||
position = "0, -5%";
|
|
||||||
halign = "center";
|
|
||||||
valign = "center";
|
|
||||||
zindex = 1;
|
|
||||||
shadow_passes = 5;
|
|
||||||
shadow_size = 5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB |
|
@ -1,54 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (builtins) attrNames head;
|
|
||||||
inherit (lib.trivial) pipe;
|
|
||||||
inherit (lib.attrsets) filterAttrs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.lib.attrsets = {
|
|
||||||
/**
|
|
||||||
`firstAttrNameMatching pred set` filters an attribute set `set` based on a predicate `pred`
|
|
||||||
and returns the *first* attribute name that satisfies the predicate.
|
|
||||||
|
|
||||||
# Example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
let
|
|
||||||
mySet = {
|
|
||||||
a = { value = 1; };
|
|
||||||
b = { value = 2; };
|
|
||||||
c = { value = 3; };
|
|
||||||
};
|
|
||||||
|
|
||||||
isGreaterThanOne = name: value: value.value > 1;
|
|
||||||
|
|
||||||
result = firstAttrNameMatching isGreaterThanOne mySet;
|
|
||||||
|
|
||||||
in
|
|
||||||
result
|
|
||||||
# Output: "b"
|
|
||||||
```
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
firstAttrNameMatching :: (String -> Any -> Bool) -> AttrSet -> String
|
|
||||||
```
|
|
||||||
|
|
||||||
# Arguments
|
|
||||||
|
|
||||||
pred
|
|
||||||
: A function that takes an attribute name and its value and returns a boolean.
|
|
||||||
|
|
||||||
set
|
|
||||||
: The attribute set to filter.
|
|
||||||
*/
|
|
||||||
firstAttrNameMatching =
|
|
||||||
pred: set:
|
|
||||||
pipe set [
|
|
||||||
(filterAttrs pred)
|
|
||||||
attrNames
|
|
||||||
head
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
let
|
|
||||||
inherit (builtins) length tail;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.lib.lists = rec {
|
|
||||||
shortenList =
|
|
||||||
count: list:
|
|
||||||
let
|
|
||||||
len = length list;
|
|
||||||
in
|
|
||||||
if len <= count then list else (shortenList count (tail list));
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,100 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
let
|
|
||||||
inherit (builtins) foldl' attrNames;
|
|
||||||
inherit (lib.attrsets) mapAttrs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.lib.modules = {
|
|
||||||
/**
|
|
||||||
Fold over the users list and create an attribute set.
|
|
||||||
|
|
||||||
# Inputs
|
|
||||||
|
|
||||||
`f`
|
|
||||||
|
|
||||||
: A function that takes the name of a user and returns an attribute set.
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
userListToAttrs :: (String -> AttrSet) -> AttrSet
|
|
||||||
```
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
:::{.example}
|
|
||||||
## `userListToAttrs` usage example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
flake.manifest.users.rafiq = { ... };
|
|
||||||
flake.modules.homeManager.users = userListToAttrs (name: {
|
|
||||||
${name}.home.username = name;
|
|
||||||
});
|
|
||||||
=> flake.modules.homeManager.default.users.rafiq.home.username = "rafiq";
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
*/
|
|
||||||
userListToAttrs = f: foldl' (acc: elem: acc // (f elem)) { } (attrNames config.manifest.users);
|
|
||||||
/**
|
|
||||||
Return an attribute set for use with a option that needs to be used for all users.
|
|
||||||
|
|
||||||
# Inputs
|
|
||||||
|
|
||||||
`attrset`
|
|
||||||
|
|
||||||
: An attribute set to apply to all the users.
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
forAllUsers :: AttrSet -> AttrSet
|
|
||||||
```
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
:::{.example}
|
|
||||||
## `forAllUsers` usage example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
flake.manifest.users.rafiq = { ... };
|
|
||||||
flake.modules.nixos.default.users = forAllUsers {
|
|
||||||
isNormalUser = true;
|
|
||||||
};
|
|
||||||
=> flake.modules.nixos.default.users.rafiq.isNormalUser = true;
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
*/
|
|
||||||
forAllUsers = attrset: mapAttrs (_: _: attrset) config.manifest.users;
|
|
||||||
|
|
||||||
/**
|
|
||||||
Like forAllUsers, but passes in the name and value from the manifest.
|
|
||||||
|
|
||||||
# Inputs
|
|
||||||
|
|
||||||
`f`
|
|
||||||
|
|
||||||
: A function that takes an attribute name and its value, and returns the new value for the attribute.
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
forAllUsers' :: (String -> Any -> Any) -> AttrSet
|
|
||||||
```
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
:::{.example}
|
|
||||||
## `forAllUsers'` usage example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
flake.manifest.users.rafiq = { ... };
|
|
||||||
flake.modules.homeManager.users = forAllUsers' (name: value: {
|
|
||||||
home.username = name;
|
|
||||||
});
|
|
||||||
=> flake.modules.homeManager.default.users.rafiq.home.username = "rafiq";
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
*/
|
|
||||||
forAllUsers' = f: mapAttrs f config.manifest.users;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.types)
|
|
||||||
str
|
|
||||||
path
|
|
||||||
int
|
|
||||||
port
|
|
||||||
attrs
|
|
||||||
;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.lib.options = {
|
|
||||||
mkStrOption =
|
|
||||||
default:
|
|
||||||
mkOption {
|
|
||||||
inherit default;
|
|
||||||
type = str;
|
|
||||||
};
|
|
||||||
mkAttrOption =
|
|
||||||
default:
|
|
||||||
mkOption {
|
|
||||||
inherit default;
|
|
||||||
type = attrs;
|
|
||||||
};
|
|
||||||
mkIntOption =
|
|
||||||
default:
|
|
||||||
mkOption {
|
|
||||||
inherit default;
|
|
||||||
type = int;
|
|
||||||
};
|
|
||||||
mkPortOption =
|
|
||||||
default:
|
|
||||||
mkOption {
|
|
||||||
type = port;
|
|
||||||
inherit default;
|
|
||||||
};
|
|
||||||
mkPathOption =
|
|
||||||
default:
|
|
||||||
mkOption {
|
|
||||||
type = path;
|
|
||||||
inherit default;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (builtins) length concatStringsSep;
|
|
||||||
inherit (lib.options) mkEnableOption;
|
|
||||||
inherit (lib.strings) splitString;
|
|
||||||
inherit (lib.lists) singleton;
|
|
||||||
inherit (lib.modules) mkMerge mkIf;
|
|
||||||
inherit (cfg.lib.options) mkStrOption mkPortOption mkAttrOption;
|
|
||||||
inherit (cfg.lib.lists) shortenList;
|
|
||||||
cfg = config.flake;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.lib.services = rec {
|
|
||||||
splitDomain = domain: splitString "." domain;
|
|
||||||
isRootDomain = domain: length (splitDomain domain) <= 2;
|
|
||||||
mkRootDomain = domain: concatStringsSep "." (shortenList 2 (splitDomain domain));
|
|
||||||
mkWildcardDomain = rootDomain: concatStringsSep "." ((singleton "*") ++ (splitDomain rootDomain));
|
|
||||||
mkHost = domain: if isRootDomain domain then domain else mkWildcardDomain (mkRootDomain domain);
|
|
||||||
mkWebApp =
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
name,
|
|
||||||
defaultPort,
|
|
||||||
persistDirs ? [ ],
|
|
||||||
extraOptions ? { },
|
|
||||||
extraConfig ? { },
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = config.server.web-apps.${name};
|
|
||||||
networkingConfig =
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
cfg,
|
|
||||||
name,
|
|
||||||
}:
|
|
||||||
mkIf (cfg.domain != "") {
|
|
||||||
assertions = singleton {
|
|
||||||
assertion = config.server.web-servers.nginx.enable;
|
|
||||||
message = "You must enable a web server if you want to set server.web-apps.${name}.domain.";
|
|
||||||
};
|
|
||||||
server.ddns.domains = singleton (mkRootDomain cfg.domain);
|
|
||||||
server.web-servers.nginx.proxies = singleton {
|
|
||||||
source = cfg.domain;
|
|
||||||
target = "http://${config.networking.hostName}:${toString cfg.port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.server.web-apps.${name} = {
|
|
||||||
enable = mkEnableOption "";
|
|
||||||
port = mkPortOption defaultPort;
|
|
||||||
domain = mkStrOption "";
|
|
||||||
openFirewall = mkEnableOption "";
|
|
||||||
extraCfg = mkAttrOption { };
|
|
||||||
} // extraOptions;
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
{
|
|
||||||
inherit persistDirs;
|
|
||||||
networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = singleton cfg.port; };
|
|
||||||
}
|
|
||||||
(networkingConfig { inherit config cfg name; })
|
|
||||||
extraConfig
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
104
nix/manifest.nix
104
nix/manifest.nix
|
@ -1,104 +0,0 @@
|
||||||
{
|
|
||||||
manifest = {
|
|
||||||
users.rafiq = {
|
|
||||||
primary = true;
|
|
||||||
name = "Mohammad Rafiq";
|
|
||||||
email = "rafiq@rrv.sh";
|
|
||||||
shell = "fish";
|
|
||||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq";
|
|
||||||
};
|
|
||||||
hosts = {
|
|
||||||
darwin = {
|
|
||||||
venus = {
|
|
||||||
graphical = true;
|
|
||||||
machine.platform = "intel";
|
|
||||||
};
|
|
||||||
hephaestus = {
|
|
||||||
graphical = true;
|
|
||||||
machine.platform = "apple-silicon";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nixos = {
|
|
||||||
nemesis = {
|
|
||||||
graphical = true;
|
|
||||||
machine = {
|
|
||||||
platform = "amd";
|
|
||||||
gpu = "nvidia";
|
|
||||||
root.drive = "/dev/disk/by-id/nvme-CT2000P3SSD8_2325E6E77434";
|
|
||||||
monitors.main = {
|
|
||||||
id = "desc:OOO AN-270W04K";
|
|
||||||
resolution = "3840x2160";
|
|
||||||
refresh-rate = "60";
|
|
||||||
scale = "2";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraCfg = {
|
|
||||||
machine = {
|
|
||||||
bluetooth.enable = true;
|
|
||||||
usb.automount = true;
|
|
||||||
usb.qmk.enable = true;
|
|
||||||
virtualisation = {
|
|
||||||
podman.enable = true;
|
|
||||||
podman.distrobox.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
server.web-apps = {
|
|
||||||
comfy-ui.enable = true;
|
|
||||||
sd-webui-forge.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
apollo = {
|
|
||||||
graphical = false;
|
|
||||||
machine = {
|
|
||||||
platform = "intel";
|
|
||||||
root.drive = "/dev/disk/by-id/nvme-eui.002538d221b47b01";
|
|
||||||
};
|
|
||||||
extraCfg.server = {
|
|
||||||
ddns = {
|
|
||||||
enable = true;
|
|
||||||
domains = [
|
|
||||||
"aenyrathia.wiki"
|
|
||||||
"slayment.com"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
web-servers = {
|
|
||||||
enableSSL = true;
|
|
||||||
nginx = {
|
|
||||||
enable = true;
|
|
||||||
proxies = [
|
|
||||||
{
|
|
||||||
source = "aenyrathia.wiki";
|
|
||||||
target = "http://helios:5896";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "il.bwfiq.com";
|
|
||||||
target = "http://helios:2283";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
databases = {
|
|
||||||
mongodb.enable = true;
|
|
||||||
mysql.enable = true;
|
|
||||||
postgresql.enable = true;
|
|
||||||
};
|
|
||||||
web-apps = {
|
|
||||||
librechat = {
|
|
||||||
enable = true;
|
|
||||||
domain = "chat.bwfiq.com";
|
|
||||||
};
|
|
||||||
forgejo = {
|
|
||||||
enable = true;
|
|
||||||
domain = "git.rrv.sh";
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
rrv-sh.enable = true;
|
|
||||||
rrv-sh.domain = "rrv.sh";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
31
nix/meta.nix
31
nix/meta.nix
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.types) path lazyAttrsOf raw;
|
|
||||||
inherit (inputs.flake-parts.lib) mkSubmoduleOptions;
|
|
||||||
cfg = config.flake;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.flake = mkSubmoduleOptions {
|
|
||||||
self = mkOption { type = raw; };
|
|
||||||
lib = mkOption {
|
|
||||||
type = lazyAttrsOf raw;
|
|
||||||
default = { };
|
|
||||||
};
|
|
||||||
paths = {
|
|
||||||
root = mkOption { type = path; };
|
|
||||||
secrets = mkOption {
|
|
||||||
type = path;
|
|
||||||
readOnly = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config.flake = {
|
|
||||||
paths.secrets = cfg.paths.root + "/secrets";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
let
|
|
||||||
inherit (config.manifest) users;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.homeManager.default =
|
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
userName = users.${config.home.username}.name;
|
|
||||||
userEmail = users.${config.home.username}.email;
|
|
||||||
signing.key = "~/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixos.default.nix.settings.experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
flake.modules.darwin.default = {
|
|
||||||
nix.enable = false;
|
|
||||||
nix.settings.experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.flake;
|
|
||||||
inherit (config.manifest) users;
|
|
||||||
inherit (cfg.lib.modules) forAllUsers';
|
|
||||||
inherit (lib.attrsets) mapAttrs';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules = {
|
|
||||||
nixos.default =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
programs = mapAttrs' (name: value: {
|
|
||||||
name = value.shell;
|
|
||||||
value.enable = true;
|
|
||||||
}) users;
|
|
||||||
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
|
|
||||||
};
|
|
||||||
darwin.default =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
programs = mapAttrs' (name: value: {
|
|
||||||
name = value.shell;
|
|
||||||
value.enable = true;
|
|
||||||
}) users;
|
|
||||||
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
|
|
||||||
environment.shells = [ pkgs.fish ];
|
|
||||||
};
|
|
||||||
homeManager.default =
|
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
programs.${users.${config.home.username}.shell}.enable = true;
|
|
||||||
home.shell.enableShellIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib.options) mkEnableOption;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules = {
|
|
||||||
nixos.graphical = {
|
|
||||||
home-manager.sharedModules = [ { graphical = true; } ];
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
homeManager.default.options.graphical = mkEnableOption "";
|
|
||||||
darwin.graphical.home-manager.sharedModules = [ { graphical = true; } ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
# needs to be default because the options get
|
|
||||||
# evaluated even if graphical is set to false
|
|
||||||
flake.modules.nixos.default =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [ inputs.stylix.nixosModules.stylix ];
|
|
||||||
stylix.enable = true;
|
|
||||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
|
||||||
};
|
|
||||||
flake.modules.darwin.default =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [ inputs.stylix.darwinModules.stylix ];
|
|
||||||
stylix.enable = true;
|
|
||||||
#TODO: move into manifest
|
|
||||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixos.default.boot = {
|
|
||||||
initrd.availableKernelModules = [
|
|
||||||
"nvme"
|
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
loader.efi.canTouchEfiVariables = true;
|
|
||||||
#TODO: disable for mbp?
|
|
||||||
loader.systemd-boot = {
|
|
||||||
enable = true;
|
|
||||||
configurationLimit = 5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue