more vibed refactoring

This commit is contained in:
alisceon 2026-03-10 21:58:35 +01:00
parent c343c52ab7
commit d9c42c2f3b
6 changed files with 69 additions and 19 deletions

8
.gitignore vendored
View file

@ -4,5 +4,11 @@ result
# direnv
.direnv
# python
__pycache__/
*.pyc
*.pyo
*.pyd
# clamav
.clamav
.clamav

46
README.md Normal file
View file

@ -0,0 +1,46 @@
# NixOS Configuration Layout
This repository is structured around explicit NixOS and Home Manager layers.
## Directory Overview
- `nixos/hosts/<host>/`
- Host-specific `configuration.nix` and `hardware-configuration.nix`.
- `nixos/modules/`
- Shared NixOS modules:
- `base.nix`
- `profiles/` (`workstation.nix`, `server.nix`)
- `wm/` (`sway.nix`, `gnome.nix`)
- `theme/` (`stylix.nix`)
- `home/users/`
- User base modules (`alisceon`, `root`).
- `home/profiles/`
- Shared Home Manager profile composition.
- `home/modules/`
- Home Manager feature modules grouped by `programs/`, `services/`, and `wm/`.
- `home/hosts/alisceon/`
- Host-specific Home Manager overrides for `alisceon`.
- `lib/`
- Shared helper libraries imported by modules.
- `util/`
- Local helper scripts.
## Composition Rules
- `flake.nix` is the single composition entrypoint for hosts.
- NixOS host modules should import only host-local hardware config and rely on shared modules from `nixos/modules`.
- Home Manager host overrides should stay small and contain only host deltas.
- Reusable behavior belongs in `nixos/modules` or `home/modules`, not in host files.
## Local Validation
Run these in your normal environment:
```bash
nix flake show
nix eval .#nixosConfigurations.electra.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.tower.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.tesla-nixos.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.nuc.config.system.build.toplevel.drvPath
nix flake check --no-build
```

18
flake.lock generated
View file

@ -273,11 +273,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1772822230,
"narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=",
"lastModified": 1773068389,
"narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "71caefce12ba78d84fe618cf61644dce01cf3a96",
"rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
"type": "github"
},
"original": {
@ -295,11 +295,11 @@
]
},
"locked": {
"lastModified": 1773134141,
"narHash": "sha256-GM6mNluLIw/Fp6rXvc4MbDCdwL1TIbhC+cp2/1cYLPc=",
"lastModified": 1773173351,
"narHash": "sha256-vbZTr0Tbu+c6WMAJTW/n3nYyJ8ngsixJ81v87j7UWAk=",
"owner": "nix-community",
"repo": "NUR",
"rev": "ef5cd9310115cb270eb2c896433340cbb724b92d",
"rev": "08030da6f07460f8f4ff343cda712e9dd1d0a7ec",
"type": "github"
},
"original": {
@ -316,11 +316,11 @@
]
},
"locked": {
"lastModified": 1773134141,
"narHash": "sha256-GM6mNluLIw/Fp6rXvc4MbDCdwL1TIbhC+cp2/1cYLPc=",
"lastModified": 1773173351,
"narHash": "sha256-vbZTr0Tbu+c6WMAJTW/n3nYyJ8ngsixJ81v87j7UWAk=",
"owner": "nix-community",
"repo": "NUR",
"rev": "ef5cd9310115cb270eb2c896433340cbb724b92d",
"rev": "08030da6f07460f8f4ff343cda712e9dd1d0a7ec",
"type": "github"
},
"original": {

View file

@ -36,7 +36,11 @@
}:
let
system = "x86_64-linux";
repoLocalPath = "/home/alisceon/.nixos_config";
repoLocalPath =
let
fromEnv = builtins.getEnv "NIXOS_CONFIG_ROOT";
in
if fromEnv != "" then fromEnv else "/home/alisceon/.nixos_config";
pkgs = import nixpkgs {
inherit system;
@ -53,7 +57,7 @@
};
sharedSpecialArgs = {
inherit inputs pkgs-unstable repoLocalPath;
inherit pkgs-unstable repoLocalPath;
repoRoot = self;
};
@ -113,9 +117,7 @@
./nixos/modules/profiles/server.nix
];
serverHomeModules = [
./home/profiles/server.nix
];
serverHomeModules = [ ];
in
{
nixosConfigurations = {

View file

@ -1,3 +0,0 @@
{ ... }:
{
}

View file

@ -10,7 +10,6 @@
stylix.enableReleaseChecks = false;
xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ../conf/obsidian.json;
xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix;
xdg = {
enable = true;