chore: refactor flake layout

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2025-09-17 00:16:25 +02:00
parent 892c0afc60
commit 105f613c6b
Signed by: lander
GPG key ID: 0142722B4B0C536F
6 changed files with 66 additions and 1 deletions

17
flake.lock generated
View file

@ -414,6 +414,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1757810152, "lastModified": 1757810152,
@ -587,6 +603,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-mailserver": "nixos-mailserver", "nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim", "nixvim": "nixvim",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"tidalcycles": "tidalcycles" "tidalcycles": "tidalcycles"

View file

@ -1,9 +1,10 @@
{ {
description = "Your new nix config"; description = "EscapeAngle's Nix config";
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Secrets # Secrets
sops-nix = { sops-nix = {
@ -54,8 +55,26 @@
}@inputs: }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
# I only care about linux builds
systems = [
"aarch64-linux"
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in in
{ {
# custom pkgs
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays { inherit inputs; };
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
nixosConfigurations = { nixosConfigurations = {
# Workstations # Workstations
wodan = nixpkgs.lib.nixosSystem { wodan = nixpkgs.lib.nixosSystem {

View file

@ -0,0 +1,3 @@
{
# my-module = import ./my-module.nix;
}

View file

@ -0,0 +1,3 @@
{
# my-module = import ./my-module.nix
}

20
overlays/default.nix Normal file
View file

@ -0,0 +1,20 @@
{ inputs, ... }:
{
# Import custom packages
additions = final: _prev: import ../pkgs final.pkgs;
# Add modifications here:
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# add nixpkgs unstable (accessible through pkgs.unstable)
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

3
pkgs/default.nix Normal file
View file

@ -0,0 +1,3 @@
pkgs: {
# example = pkgs.callPackage ./example { };
}