more vibed refactoring
This commit is contained in:
parent
c343c52ab7
commit
d9c42c2f3b
6 changed files with 69 additions and 19 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -4,5 +4,11 @@ result
|
||||||
# direnv
|
# direnv
|
||||||
.direnv
|
.direnv
|
||||||
|
|
||||||
|
# python
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
|
||||||
# clamav
|
# clamav
|
||||||
.clamav
|
.clamav
|
||||||
|
|
|
||||||
46
README.md
Normal file
46
README.md
Normal 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
18
flake.lock
generated
|
|
@ -273,11 +273,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772822230,
|
"lastModified": 1773068389,
|
||||||
"narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=",
|
"narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "71caefce12ba78d84fe618cf61644dce01cf3a96",
|
"rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -295,11 +295,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773134141,
|
"lastModified": 1773173351,
|
||||||
"narHash": "sha256-GM6mNluLIw/Fp6rXvc4MbDCdwL1TIbhC+cp2/1cYLPc=",
|
"narHash": "sha256-vbZTr0Tbu+c6WMAJTW/n3nYyJ8ngsixJ81v87j7UWAk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "ef5cd9310115cb270eb2c896433340cbb724b92d",
|
"rev": "08030da6f07460f8f4ff343cda712e9dd1d0a7ec",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -316,11 +316,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773134141,
|
"lastModified": 1773173351,
|
||||||
"narHash": "sha256-GM6mNluLIw/Fp6rXvc4MbDCdwL1TIbhC+cp2/1cYLPc=",
|
"narHash": "sha256-vbZTr0Tbu+c6WMAJTW/n3nYyJ8ngsixJ81v87j7UWAk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "ef5cd9310115cb270eb2c896433340cbb724b92d",
|
"rev": "08030da6f07460f8f4ff343cda712e9dd1d0a7ec",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
12
flake.nix
12
flake.nix
|
|
@ -36,7 +36,11 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
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 {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
@ -53,7 +57,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
sharedSpecialArgs = {
|
sharedSpecialArgs = {
|
||||||
inherit inputs pkgs-unstable repoLocalPath;
|
inherit pkgs-unstable repoLocalPath;
|
||||||
repoRoot = self;
|
repoRoot = self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -113,9 +117,7 @@
|
||||||
./nixos/modules/profiles/server.nix
|
./nixos/modules/profiles/server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
serverHomeModules = [
|
serverHomeModules = [ ];
|
||||||
./home/profiles/server.nix
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
stylix.enableReleaseChecks = false;
|
stylix.enableReleaseChecks = false;
|
||||||
|
|
||||||
xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ../conf/obsidian.json;
|
xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ../conf/obsidian.json;
|
||||||
xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix;
|
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue